/* Companion — shared shell: tokens, announcement, nav, footer */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@600;700&display=swap');

@font-face {
  font-family: 'Neue Haak Grotesk';
  src: url('fonts/NeueHaakGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple: #8F4FEF;
  --purple-dark: #6B35C7;
  --purple-light: #B07AF7;
  --deep: #1E0D38;
  --deep2: #2B134F;
  --lavender: #F5EFFE;
  --lavender-mid: #EAD9FA;
  --lavender-dark: #D9C2F5;
  --white: #FFFFFF;
  --muted: rgba(30,13,56,0.62);
  --muted-light: rgba(30,13,56,0.42);
  --border: rgba(143,79,239,0.13);
  --border-strong: rgba(143,79,239,0.28);

  /* Typography: Lora (editorial display) + Source Sans 3 (clinical UI/body) */
  --font-display: 'Lora', Georgia, 'Times New Roman', serif;
  --font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-brand: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-nav: 'Neue Haak Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Type scale */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 34px;
  --text-4xl: 44px;
  --text-5xl: 56px;

  /* Spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 80px;
  --space-10: 96px;
  --space-11: 120px;

  --grad: linear-gradient(135deg, #8F4FEF 0%, #6B35C7 100%);
  --grad2: linear-gradient(135deg, #A570F5 0%, #8F4FEF 100%);
  --shadow-sm: 0 1px 2px rgba(30,13,56,0.06), 0 2px 8px rgba(30,13,56,0.05);
  --shadow-md: 0 4px 16px rgba(30,13,56,0.08);
  --shadow-lg: 0 16px 48px rgba(30,13,56,0.12);
  --shadow-purple: 0 6px 20px rgba(143,79,239,0.22);
  --shadow-purple-lg: 0 14px 40px rgba(143,79,239,0.26);

  /* Radius scale */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --radius: 16px;

  /* Motion */
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

  /* Semantic */
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --text-primary: #1E0D38;
  --text-secondary: rgba(30,13,56,0.62);
  --accent: #8F4FEF;
  --accent-clinical: #2E7D5A;
  --green: #2E7D5A;
  --amber: #B47A1E;
  --red: #C0392B;

  --nav-height: 80px;
  --nav-bg: var(--white);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: #ffffff;
  /* clip avoids hidden scrollport that breaks position:sticky on descendants */
  overflow-x: clip;
  max-width: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background-color: #ffffff;
  color: var(--deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  max-width: 100%;
}

img { max-width: 100%; height: auto; }

/* SKIP LINK */
.skip-link {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -150%);
  z-index: 1000;
  background: var(--deep);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-fast) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); outline: none; }

/* FOCUS STATES */
:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 3px;
}
.nav-cta:focus-visible,
.nav-link:focus-visible,
.nav-burger:focus-visible { outline-offset: 3px; }

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.brand-name { font-family: var(--font-brand); }

/* ANNOUNCEMENT */
.announcement {
  background: var(--lavender);
  color: var(--muted);
  text-align: center; padding: 11px 24px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
  border-bottom: 1px solid var(--border);
}
.announcement strong { color: var(--purple); font-weight: 600; }

/* NAV */
#nav-root {
  position: sticky;
  top: 0;
  z-index: 200;
}
#nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(30,13,56,0.08);
  box-shadow: 0 1px 3px rgba(30,13,56,0.05);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 28px;
  transition: box-shadow 0.3s;
}
#nav.scrolled { box-shadow: 0 4px 20px rgba(30,13,56,0.08); }
.nav-inner {
  width: 100%; max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  min-width: 0;
}
.nav-logo {
  font-family: var(--font-nav);
  font-size: 28px; letter-spacing: -0.03em;
  color: var(--deep); text-decoration: none;
  font-weight: 700;
}
.nav-logo .brand-name { font-family: inherit; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  font-size: 15px; font-weight: 500; color: var(--muted);
  text-decoration: none; padding: 10px 16px; border-radius: var(--radius-sm);
  transition: background var(--t), color var(--t);
}
.nav-link:hover { color: var(--deep); background: rgba(143,79,239,0.08); }
.nav-link.active { color: var(--purple); font-weight: 600; background: rgba(143,79,239,0.08); }
.nav-cta {
  background: var(--grad); color: white; border: none;
  border-radius: var(--radius-sm); padding: 13px 22px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: var(--font); text-decoration: none;
  letter-spacing: 0; box-shadow: var(--shadow-sm);
  transition: all var(--t);
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-purple); }
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  color: var(--deep);
  text-decoration: none;
  transition: background var(--t), color var(--t);
  flex-shrink: 0;
}
.nav-cart:hover { background: rgba(143,79,239,0.08); color: var(--purple); }
.nav-cart-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--purple);
  color: white;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
}
.nav-cart-mobile { display: none; }
.nav-mobile-cta { display: none; }
.nav-mobile-actions {
  display: none;
  align-items: center;
  gap: 4px;
}
.nav-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--deep);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t);
}
.nav-burger:hover { background: rgba(143,79,239,0.08); }
.nav-burger-line {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform var(--t), opacity var(--t);
}
#nav.nav-open .nav-burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#nav.nav-open .nav-burger-line:nth-child(2) { opacity: 0; }
#nav.nav-open .nav-burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* FOOTER */
footer { background: var(--deep); border-top: 1px solid rgba(255,255,255,0.07); padding: 60px 24px 40px; }
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 36px; margin-bottom: 48px;
}
.footer-brand .f-logo {
  font-family: var(--font-nav);
  font-size: 28px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.footer-brand .f-logo .brand-name { font-family: inherit; }
.footer-brand p { font-size: 13px; color: rgba(255,255,255,0.38); line-height: 1.65; max-width: 220px; }
.footer-links h4 { font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.35); margin-bottom: 16px; }
.footer-links a { display: block; font-size: 14px; color: rgba(255,255,255,0.58); text-decoration: none; margin-bottom: 10px; transition: color var(--t); }
.footer-links a:hover { color: white; }
.footer-bottom {
  max-width: 1100px; margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.07); padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px;
}
.footer-bottom p { font-size: 12px; color: rgba(255,255,255,0.28); line-height: 1.65; }
.footer-legal { display: flex; gap: 22px; }
.footer-legal a { font-size: 12px; color: rgba(255,255,255,0.32); text-decoration: none; transition: color var(--t); }
.footer-legal a:hover { color: rgba(255,255,255,0.7); }

@media (max-width: 900px) {
  .announcement { font-size: 12px; padding: 10px 16px; line-height: 1.45; }
  #nav { padding: 0 20px; }
  .nav-mobile-actions { display: flex; align-items: center; gap: 10px; }
  .nav-cart-mobile { display: inline-flex; }
  .nav-mobile-cta { display: inline-flex; }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 12px 18px 20px;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(30,13,56,0.12);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity var(--t), visibility var(--t), transform var(--t);
  }
  #nav.nav-open .nav-links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .nav-links .nav-link {
    text-align: left;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 16px;
  }
  .nav-cta-desktop { display: none; }
  .nav-links .nav-cart { display: none; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (max-width: 600px) {
  .announcement { font-size: 11px; padding: 10px 12px; letter-spacing: 0.01em; }
  :root { --nav-height: 72px; }
  #nav { padding: 0 16px; }
  .nav-logo { font-size: 24px; }
  .footer-brand .f-logo { font-size: 24px; }
  .nav-cta { padding: 11px 18px; font-size: 14px; }
  .footer-inner { flex-direction: column; }
  .footer-bottom { padding-top: 22px; }
  .footer-legal { flex-direction: column; gap: 10px; align-items: flex-start; }
  footer { padding: 48px 14px 32px; }
}

@media (max-width: 380px) {
  .nav-mobile-cta { padding: 9px 12px; font-size: 12px; }
}
