/* ==========================================================================
   TomiGuide - Design system & base layer
   Learn How. Do More.

   Load order matters:  style.css -> components.css -> responsive.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Brand ---------------------------------------------------------------- */
  --primary: #2f3ea8;          /* deep indigo - navigation, links, primary UI */
  --primary-dark: #232f85;
  --primary-darker: #1a2364;
  --primary-light: #5b68c9;
  --primary-soft: #eef0fb;     /* tinted surface for primary contexts */
  --primary-softer: #f6f7fd;

  --secondary: #0f9d8f;        /* teal - success paths, creator surfaces */
  --secondary-dark: #0b7f74;
  --secondary-soft: #e6f6f4;

  --accent: #ff9f1c;           /* warm amber - the one colour that means BUY */
  --accent-dark: #ef8c00;
  --accent-soft: #fff4e2;

  /* Neutrals -------------------------------------------------------------- */
  --background: #fafbfd;
  --surface: #ffffff;
  --surface-alt: #f4f6fa;
  --surface-sunken: #eef1f6;

  --text: #12172b;
  --text-soft: #3d4560;
  --muted: #6b7490;
  --muted-light: #9aa2b8;

  --border: #e3e7ef;
  --border-strong: #cfd5e2;

  /* Status ---------------------------------------------------------------- */
  --success: #0f9d5f;
  --success-soft: #e5f6ee;
  --warning: #d98a00;
  --warning-soft: #fff5e0;
  --danger: #d93438;
  --danger-soft: #fdecec;
  --info: #2f6ea8;
  --info-soft: #e9f2fa;

  --star: #f5a623;

  /* Typography ------------------------------------------------------------ */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Manrope", var(--font-sans);

  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.8125rem;   /* 13 */
  --fs-base: 0.9375rem; /* 15 */
  --fs-md: 1rem;        /* 16 */
  --fs-lg: 1.125rem;    /* 18 */
  --fs-xl: 1.375rem;    /* 22 */
  --fs-2xl: 1.75rem;    /* 28 */
  --fs-3xl: 2.25rem;    /* 36 */
  --fs-4xl: 3rem;       /* 48 */

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-normal: 1.55;
  --lh-loose: 1.7;

  /* Space ----------------------------------------------------------------- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 2.5rem;
  --sp-8: 3rem;
  --sp-9: 4rem;
  --sp-10: 5.5rem;

  /* Shape ----------------------------------------------------------------- */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  /* Elevation - deliberately soft and low-contrast ------------------------ */
  --shadow-xs: 0 1px 2px rgba(18, 23, 43, 0.05);
  --shadow-sm: 0 1px 3px rgba(18, 23, 43, 0.06), 0 1px 2px rgba(18, 23, 43, 0.04);
  --shadow: 0 4px 14px rgba(18, 23, 43, 0.07);
  --shadow-md: 0 10px 26px rgba(18, 23, 43, 0.09);
  --shadow-lg: 0 20px 45px rgba(18, 23, 43, 0.12);
  --shadow-focus: 0 0 0 3px rgba(47, 62, 168, 0.28);

  /* Motion ---------------------------------------------------------------- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 120ms var(--ease);
  --t: 180ms var(--ease);
  --t-slow: 320ms var(--ease);

  /* Layout ---------------------------------------------------------------- */
  --container: 1200px;
  --container-wide: 1400px;
  --container-narrow: 760px;
  --header-h: 68px;
  --z-header: 100;
  --z-dropdown: 200;
  --z-drawer: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.no-scroll { overflow: hidden; }

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  margin: 0 0 var(--sp-3);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  font-weight: 700;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--primary-dark); text-decoration: underline; }

img, video { max-width: 100%; height: auto; display: block; }
/* Icons sit inside sentences and buttons far more often than they stand alone,
   so they stay inline and centre on the text baseline. */
svg { max-width: 100%; display: inline-block; vertical-align: middle; flex: none; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.25rem; }
li { margin-bottom: var(--sp-2); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--sp-6) 0;
}

small { font-size: var(--fs-sm); }

code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  background: var(--surface-sunken);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
}

pre {
  background: var(--text);
  color: #e8ebf5;
  padding: var(--sp-4);
  border-radius: var(--radius);
  overflow-x: auto;
}
pre code { background: none; padding: 0; color: inherit; }

table { border-collapse: collapse; width: 100%; }

/* Accessibility: a genuinely visible focus ring, never removed ------------- */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: 999;
  background: var(--primary);
  color: #fff;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--t);
}
.skip-link:focus { top: var(--sp-3); text-decoration: none; color: #fff; }

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

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--sp-9); }
.section--tight { padding-block: var(--sp-7); }
.section--alt { background: var(--surface-alt); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.section-head h2 { margin-bottom: var(--sp-1); }
.section-head p { color: var(--muted); margin: 0; max-width: 60ch; }
.section-head .link-more {
  font-weight: 600;
  font-size: var(--fs-base);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}
.section-head .link-more::after { content: "\2192"; transition: transform var(--t); }
.section-head .link-more:hover::after { transform: translateX(3px); }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--sp-2);
}

.grid { display: grid; gap: var(--sp-5); }
.grid--products { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.grid--categories { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.stack > * + * { margin-top: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.text-muted { color: var(--muted); }
.text-sm { font-size: var(--fs-sm); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--primary);
  --btn-fg: #fff;
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.6875rem 1.125rem;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.2;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t), background var(--t),
    border-color var(--t), color var(--t), opacity var(--t);
  -webkit-user-select: none;
  user-select: none;
}
.btn:hover { text-decoration: none; color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn--primary { --btn-bg: var(--primary); box-shadow: var(--shadow-sm); }
.btn--primary:hover:not(:disabled) { --btn-bg: var(--primary-dark); box-shadow: var(--shadow); }

.btn--accent {
  --btn-bg: var(--accent);
  --btn-fg: #3a2500;
  box-shadow: 0 2px 10px rgba(255, 159, 28, 0.35);
}
.btn--accent:hover:not(:disabled) { --btn-bg: var(--accent-dark); }

.btn--secondary { --btn-bg: var(--secondary); }
.btn--secondary:hover:not(:disabled) { --btn-bg: var(--secondary-dark); }

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--primary);
  --btn-bd: var(--border-strong);
}
.btn--outline:hover:not(:disabled) {
  --btn-bg: var(--primary-soft);
  --btn-bd: var(--primary-light);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text-soft);
  --btn-bd: transparent;
}
.btn--ghost:hover:not(:disabled) { --btn-bg: var(--surface-sunken); --btn-fg: var(--text); }

.btn--danger { --btn-bg: var(--danger); }
.btn--danger:hover:not(:disabled) { --btn-bg: #b82b2f; }

.btn--quiet-danger {
  --btn-bg: var(--danger-soft);
  --btn-fg: var(--danger);
  --btn-bd: transparent;
}

.btn--lg { padding: 0.875rem 1.5rem; font-size: var(--fs-md); border-radius: var(--radius); }
.btn--sm { padding: 0.4375rem 0.75rem; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn--pill { border-radius: var(--radius-pill); }

.btn--icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
}

/* Inline spinner shown while an async action runs */
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1rem; height: 1rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--btn-fg);
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   5. Forms
   -------------------------------------------------------------------------- */

.field { margin-bottom: var(--sp-4); }

.label,
.field > label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: var(--sp-2);
}

.label .req { color: var(--danger); margin-left: 2px; }

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--muted-light); }

.input:hover, .select:hover, .textarea:hover { border-color: var(--muted-light); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.select[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(217, 52, 56, 0.22); }

.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-normal); }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7490' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.field-hint { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-2); }
.field-error {
  font-size: var(--fs-sm);
  color: var(--danger);
  margin-top: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.field-error:empty { display: none; }

.checkbox,
.radio {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text-soft);
  margin-bottom: var(--sp-3);
  line-height: 1.45;
}
.checkbox input,
.radio input {
  width: 1.0625rem;
  height: 1.0625rem;
  margin: 0.125rem 0 0;
  accent-color: var(--primary);
  flex: none;
  cursor: pointer;
}

.input-group { display: flex; gap: var(--sp-2); }
.input-group .input { flex: 1; }

fieldset { border: 0; padding: 0; margin: 0 0 var(--sp-5); }
legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  padding: 0;
  margin-bottom: var(--sp-3);
}

/* --------------------------------------------------------------------------
   6. Header / navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

/* Logo -------------------------------------------------------------------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--text);
  flex: none;
}
.logo:hover { text-decoration: none; color: var(--text); }
.logo__mark { width: 30px; height: 30px; flex: none; border-radius: 9px; }
.logo__text { white-space: nowrap; }
.logo__text b { color: var(--primary); font-weight: 800; }

.nav { display: flex; align-items: center; gap: var(--sp-1); }

.nav__link {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 550;
  font-size: var(--fs-base);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav__link:hover { background: var(--surface-sunken); color: var(--text); text-decoration: none; }
.nav__link[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }

.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.header-actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--text); }

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #3a2500;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cart-count[hidden] { display: none; }

.nav-toggle { display: none; }

/* Account dropdown -------------------------------------------------------- */
.account { position: relative; }

.account__trigger {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.account__trigger:hover { background: var(--surface-alt); border-color: var(--border-strong); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  flex: none;
  overflow: hidden;
  object-fit: cover;
  text-transform: uppercase;
}
.avatar--lg { width: 64px; height: 64px; font-size: var(--fs-xl); }
.avatar--xl { width: 96px; height: 96px; font-size: var(--fs-2xl); }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 232px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.menu.is-open { opacity: 1; transform: none; pointer-events: auto; }

.menu__header {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-2);
}
.menu__name { font-weight: 700; font-size: var(--fs-base); }
.menu__email {
  font-size: var(--fs-sm);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 0.5625rem var(--sp-3);
  border: 0;
  background: transparent;
  border-radius: var(--radius-xs);
  color: var(--text-soft);
  font-size: var(--fs-base);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.menu__item:hover { background: var(--surface-sunken); color: var(--text); text-decoration: none; }
.menu__item svg { flex: none; opacity: 0.7; }
.menu__sep { height: 1px; background: var(--border); margin: var(--sp-2) 0; }

/* Mobile drawer ----------------------------------------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 23, 43, 0.45);
  z-index: var(--z-drawer);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 86vw);
  background: var(--surface);
  z-index: calc(var(--z-drawer) + 1);
  transform: translateX(100%);
  transition: transform var(--t-slow);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.drawer.is-open { transform: none; }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
}
.drawer__body { padding: var(--sp-4) var(--sp-5) var(--sp-8); }
.drawer__section + .drawer__section {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}
.drawer__title {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-3);
}
.drawer__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.6875rem 0;
  color: var(--text);
  font-weight: 550;
  font-size: var(--fs-md);
  border-bottom: 1px solid var(--border);
}
.drawer__link:hover { text-decoration: none; color: var(--primary); }
.drawer__link:last-child { border-bottom: 0; }

/* --------------------------------------------------------------------------
   7. Hero & search
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: var(--sp-10) var(--sp-9);
  background:
    radial-gradient(70% 120% at 8% -10%, rgba(47, 62, 168, 0.13) 0%, transparent 62%),
    radial-gradient(60% 100% at 95% 0%, rgba(15, 157, 143, 0.12) 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--background) 100%);
  overflow: hidden;
}

.hero__inner { max-width: 800px; margin-inline: auto; text-align: center; }

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  letter-spacing: -0.035em;
  margin-bottom: var(--sp-4);
}
/* Painted as a background gradient rather than a pseudo-element: a negative
   z-index would sit behind the hero's own background layers. */
.hero h1 .accent-underline {
  white-space: nowrap;
  background-image: linear-gradient(
    to top,
    rgba(255, 159, 28, 0.42) 0.06em,
    rgba(255, 159, 28, 0.42) 0.32em,
    transparent 0.32em
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding-inline: 0.06em;
}

.hero__sub {
  font-size: clamp(1rem, 2.2vw, 1.1875rem);
  color: var(--text-soft);
  max-width: 62ch;
  margin: 0 auto var(--sp-6);
  line-height: var(--lh-loose);
}

/* Search box (also used on explore) --------------------------------------- */
.searchbox { position: relative; width: 100%; }

.searchbox__form {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-5);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--t), border-color var(--t);
}
.searchbox__form:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), var(--shadow-focus);
}

.searchbox__icon { color: var(--muted); flex: none; margin-right: var(--sp-1); }

.searchbox__input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: var(--fs-md);
  color: var(--text);
  padding: var(--sp-3) 0;
  min-width: 0;
}
.searchbox__input:focus { outline: none; }
.searchbox__input::placeholder { color: var(--muted-light); }
.searchbox__input::-webkit-search-cancel-button { -webkit-appearance: none; }

.searchbox--hero .searchbox__form { padding-left: var(--sp-5); }
.searchbox--compact .searchbox__form {
  padding: 0 var(--sp-2) 0 var(--sp-4);
  box-shadow: none;
  background: var(--surface-alt);
  border-color: transparent;
}
.searchbox--compact .searchbox__form:focus-within { background: var(--surface); }
.searchbox--compact .searchbox__input { padding: 0.5rem 0; font-size: var(--fs-base); }

/* Autocomplete ------------------------------------------------------------ */
.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: var(--z-dropdown);
  max-height: 380px;
  overflow-y: auto;
  text-align: left;
  display: none;
}
.suggestions.is-open { display: block; }

.suggestions__group-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
}

.suggestion {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  background: transparent;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--text);
  transition: background var(--t-fast);
}
.suggestion:hover,
.suggestion.is-active { background: var(--primary-soft); text-decoration: none; }
.suggestion__thumb {
  width: 40px; height: 30px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex: none;
  background: var(--surface-sunken);
}
.suggestion__body { min-width: 0; flex: 1; }
.suggestion__title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggestion__meta { font-size: var(--fs-sm); color: var(--muted); }
.suggestion mark { background: var(--accent-soft); color: inherit; font-weight: 700; border-radius: 2px; }

/* Popular searches -------------------------------------------------------- */
.popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}
.popular__label { font-size: var(--fs-sm); color: var(--muted); margin-right: var(--sp-1); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.375rem 0.8125rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--text-soft);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
}
.chip:hover {
  background: var(--primary-soft);
  border-color: var(--primary-light);
  color: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
}
.chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--text);
  color: #b9c0d4;
  padding-block: var(--sp-9) var(--sp-6);
  margin-top: var(--sp-9);
  flex: none;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: var(--sp-7) var(--sp-5);
}

.footer__brand .logo { color: #fff; margin-bottom: var(--sp-3); }
.footer__brand .logo__text b { color: #fff; }
.footer__tagline {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: #fff;
  font-weight: 600;
  margin-bottom: var(--sp-3);
}
.footer__blurb { font-size: var(--fs-base); max-width: 34ch; color: #98a1b8; }

.footer__title {
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}

.footer__list { list-style: none; padding: 0; margin: 0; }
.footer__list li { margin-bottom: var(--sp-3); }
.footer__list a { color: #b9c0d4; font-size: var(--fs-base); }
.footer__list a:hover { color: #fff; text-decoration: none; }

.footer__social { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.footer__social a {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #d5daea;
  transition: background var(--t-fast), color var(--t-fast);
}
.footer__social a:hover { background: var(--primary); color: #fff; }

.footer__bottom {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: #8b93aa;
}
.footer__bottom a { color: #b9c0d4; }

/* --------------------------------------------------------------------------
   9. Page furniture
   -------------------------------------------------------------------------- */

.page-head {
  padding-block: var(--sp-7) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.page-head h1 { margin-bottom: var(--sp-2); }
.page-head p { color: var(--muted); margin: 0; max-width: 70ch; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.breadcrumbs li { margin: 0; display: flex; align-items: center; gap: var(--sp-2); }
.breadcrumbs li + li::before { content: "/"; color: var(--border-strong); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs [aria-current="page"] { color: var(--text-soft); font-weight: 550; }

/* Auth pages -------------------------------------------------------------- */
.auth {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  min-height: calc(100vh - var(--header-h));
}
.auth__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-5);
}
.auth__card { width: 100%; max-width: 420px; }
.auth__card h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-2); }
.auth__card > p { color: var(--muted); margin-bottom: var(--sp-6); }

.auth__aside {
  background:
    radial-gradient(80% 80% at 20% 10%, rgba(255, 255, 255, 0.14) 0%, transparent 60%),
    linear-gradient(160deg, var(--primary) 0%, var(--primary-darker) 70%);
  color: #fff;
  padding: var(--sp-9) var(--sp-8);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth__aside h2 { color: #fff; font-size: var(--fs-2xl); max-width: 18ch; }
.auth__aside p { color: rgba(255, 255, 255, 0.82); max-width: 40ch; }
.auth__points { list-style: none; padding: 0; margin: var(--sp-6) 0 0; }
.auth__points li {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  margin-bottom: var(--sp-4);
  color: rgba(255, 255, 255, 0.92);
}
.auth__points svg { flex: none; margin-top: 2px; color: var(--accent); }

.divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn--google {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  font-weight: 600;
}
.btn--google:hover:not(:disabled) { --btn-bg: var(--surface-alt); }

/* Dashboard shell --------------------------------------------------------- */
.dash {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: var(--sp-6);
  align-items: start;
  padding-block: var(--sp-6) var(--sp-9);
}

.dash__side {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  /* A grid item's automatic minimum size is its content width. On mobile this
     holds a nowrap scrolling nav, so without this the track is forced wider
     than the viewport and the whole page scrolls sideways. */
  min-width: 0;
}

.dash__nav { display: flex; flex-direction: column; gap: 2px; }
.dash__nav a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.625rem var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 550;
  font-size: var(--fs-base);
  transition: background var(--t-fast), color var(--t-fast);
}
.dash__nav a:hover { background: var(--surface-sunken); color: var(--text); text-decoration: none; }
.dash__nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 650;
}
.dash__nav a svg { flex: none; opacity: 0.8; }

.dash__nav-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-light);
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}

.dash__main { min-width: 0; }

.dash__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.dash__head h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-1); }
.dash__head p { color: var(--muted); margin: 0; }

/* Print ------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .btn, .dash__side { display: none !important; }
  body { background: #fff; }
}
