/* PistachioPerfume.com design tokens. Rules and usage: DESIGN.md. Use a token, never a raw value.
   Sticker style: pale kernel-mint ground, chunky ink outlines with offset shadows, colors from the nut
   (green kernel, rose-violet skin, tan shell). Logo colors are fixed and live in .wordmark only. */
:root {
  --bg: #f3f7ea;           /* pale kernel mint */
  --surface: #ffffff;      /* cards, table */
  --surface-2: #fbfdf6;
  --text: #26341c;         /* ink: text and outlines */
  --text-2: #56634b;       /* secondary text, 6.1:1 on bg */
  --text-3: #8a957f;       /* decoration only */
  --line: #26341c;         /* sticker outline */
  --line-soft: #d5dfc5;    /* hairlines inside cards */
  --line-strong: #26341c;
  --accent: #3f6b1f;       /* links, 6.0:1 on bg */
  --accent-hover: #2d4f14;
  --accent-soft: #dcefc6;  /* kernel tint */
  --kernel: #9ccb6e;       /* button fill, bars */
  --skin: #c98aa6;
  --skin-soft: #f4dde8;
  --shell: #e9d6b4;
  --shell-soft: #f8efdf;
  --shell-text: #7a6040;   /* eyebrow labels */
  --on-kernel: #1d2a14;
  --shadow-color: #26341c;
  --focus-ring: 0 0 0 3px var(--skin);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;

  --radius-sm: 12px;
  --radius: 18px;
  --radius-pill: 999px;
  --outline: 2.5px;
  --control-md: 40px;
  --control-lg: 48px;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-logo: "Grandstander", "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --max: 1120px;
  --reading: 740px;
  --gutter: 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171d12; --surface: #212a19; --surface-2: #1c2415; --text: #eef5e2; --text-2: #b4c0a6; --text-3: #7d8a70;
    --line: #cfe0b8; --line-soft: #34412a; --line-strong: #cfe0b8; --accent: #b6dc8a; --accent-hover: #d2ecb2;
    --accent-soft: #2f4321; --kernel: #a6d47a; --skin: #e0a6c0; --skin-soft: #43283a; --shell: #d9c39b; --shell-soft: #3a3122;
    --shell-text: #e3cfa8; --shadow-color: #050803; color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
}
main { flex: 1 0 auto; padding-bottom: var(--space-8); }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
a:focus-visible, summary:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.015em; line-height: 1.08; margin: 0 0 var(--space-3); text-wrap: balance; }
h1 { font-size: clamp(34px, 5.4vw, 56px); }
h2 { font-size: clamp(26px, 3.4vw, 34px); margin-top: var(--space-7); }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 1em; }
mark { background: var(--accent-soft); color: var(--text); padding: 0 4px; border-radius: 6px; }
.num, td.num { font-variant-numeric: tabular-nums; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--reading); }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--space-4); top: var(--space-4); background: var(--surface); padding: var(--space-2) var(--space-3); z-index: 10; }
.sticker { background: var(--surface); border: var(--outline) solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--shadow-color); }

/* Wordmark: fixed logo colors in both themes */
.wordmark { display: inline-flex; flex-direction: column; align-items: center; font-family: var(--font-logo); font-weight: 900; line-height: .92; white-space: nowrap; font-size: 36px; }
.wordmark .row { display: inline-flex; align-items: baseline; }
.wordmark .r2 { font-size: .62em; letter-spacing: .03em; }
.wordmark .l { display: inline-block; -webkit-text-stroke: .075em #26341c; paint-order: stroke fill; text-shadow: .045em .055em 0 #26341c; }
.wordmark .l:nth-child(odd) { transform: translateY(-.03em) rotate(-3deg); }
.wordmark .l:nth-child(even) { transform: translateY(.02em) rotate(3deg); }
.wordmark .idot { position: relative; display: inline-block; }
.wordmark .idot svg { position: absolute; left: 50%; top: -.11em; height: .39em; width: auto; max-width: none; overflow: visible; transform: translateX(-50%) rotate(var(--r, -20deg)); filter: drop-shadow(.03em .04em 0 #26341c); }
.wordmark.inline { flex-direction: row; gap: .18em; }
.wordmark.inline .r2 { font-size: 1em; letter-spacing: 0; }

/* Header and footer */
.site-header { background: var(--bg); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 84px; flex-wrap: wrap; padding-top: var(--space-3); padding-bottom: var(--space-3); }
.brand { display: inline-flex; align-items: center; text-decoration: none; padding-top: 6px; }
.brand:hover { text-decoration: none; }
.header-nav { display: flex; gap: var(--space-1); font-size: 15px; flex-wrap: wrap; }
.header-nav a { color: var(--text); font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: var(--radius-pill); border: 2px solid transparent; }
.header-nav a:hover { border-color: var(--line); background: var(--surface); }
.site-footer { border-top: var(--outline) solid var(--line); padding: var(--space-7) 0 var(--space-6); font-size: 15px; color: var(--text-2); background: var(--surface-2); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; align-items: flex-start; }
.footer-inner p { max-width: 420px; margin-top: var(--space-4); }
.footer-inner .brand { padding-top: 8px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; gap: var(--space-5); flex-wrap: wrap; }
.footer-links a { color: var(--text); font-weight: 600; }
.footer-legal { margin-top: var(--space-6); font-size: 14px; }
.footer-legal p { margin: 0 0 var(--space-1); }
.breadcrumbs { font-size: 14px; color: var(--text-2); padding-top: var(--space-4); }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs .sep { margin: 0 var(--space-1); color: var(--text-3); }

/* Hero and page heads */
.hero { padding-top: var(--space-6); padding-bottom: var(--space-5); display: grid; grid-template-columns: 1.3fr .8fr; gap: var(--space-6); align-items: center; }
.hero > * { min-width: 0; }
.eyebrow { font-family: var(--font); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--shell-text); margin: 0 0 var(--space-3); }
.hero-title { font-size: clamp(38px, 6vw, 64px); margin-top: 0; }
.hero-title .nut { background: var(--kernel); color: var(--on-kernel); padding: 0 .16em; border-radius: .22em; border: var(--outline) solid var(--line); box-shadow: 3px 3px 0 var(--shadow-color); display: inline-block; transform: rotate(-1.5deg); }
.lede { font-size: 19px; color: var(--text-2); max-width: var(--reading); }
.page-head { padding-top: var(--space-5); padding-bottom: var(--space-3); }
.mascot { position: relative; padding: var(--space-5); background: var(--accent-soft); }
.mascot svg { width: 100%; max-width: 280px; margin: 0 auto; }
.bubble { position: absolute; top: 14px; right: 14px; background: var(--surface); border: var(--outline) solid var(--line); border-radius: 16px 16px 4px 16px; padding: 8px 12px; font-weight: 700; font-size: 14px; max-width: 13em; line-height: 1.3; }
@media (prefers-reduced-motion: no-preference) {
  .bob { animation: bob 4s ease-in-out infinite; transform-origin: 50% 80%; }
  @keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-2deg); } }
}

/* Buttons and chips */
.cta-row { display: flex; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-4) 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--control-lg); padding: 0 var(--space-5); border-radius: 14px; font-weight: 700; font-size: 16px; border: var(--outline) solid var(--line); box-shadow: 3px 3px 0 var(--shadow-color); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.btn:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-color); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-color); }
.btn-primary, .btn-primary:hover { background: var(--kernel); color: var(--on-kernel); }
.btn-secondary, .btn-secondary:hover { background: var(--surface); color: var(--text); }
.pills { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); }
.pill { display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: var(--radius-pill); border: 2px solid var(--line); background: var(--surface); }
.finder { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); margin: var(--space-4) 0 var(--space-5); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.chips .label { font-size: 13px; font-weight: 700; color: var(--text-2); margin-right: 2px; }
.chip { font: inherit; font-size: 15px; font-weight: 600; padding: 5px 13px; border-radius: var(--radius-pill); border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* Quick picks */
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-top: var(--space-5); }
.pick { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.pick .tag { align-self: flex-start; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-pill); border: 2px solid var(--line); color: var(--on-kernel); }
.pick:nth-child(1) .tag { background: var(--kernel); }
.pick:nth-child(2) .tag { background: var(--skin); }
.pick:nth-child(3) .tag { background: var(--shell); }
.pick h3 { margin: 0; }
.pick h3 a { color: var(--text); text-decoration: none; }
.pick h3 a:hover { text-decoration: underline; }
.pick p { margin: 0; color: var(--text-2); font-size: 15px; }
.pick-facts { display: flex; gap: var(--space-4); font-size: 14px; color: var(--text-2); margin: 0; }
.pick-facts dd { margin: 0; order: -1; font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--text); line-height: 1.2; }
.pick-facts div { display: flex; flex-direction: column; }
.pick .btn { margin-top: auto; align-self: flex-start; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); margin: 0; }
.stats div { background: var(--surface); border: var(--outline) solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--shadow-color); padding: var(--space-4) var(--space-5); display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font-family: var(--font-display); font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats dt { color: var(--text-2); font-size: 15px; }

/* Ranking table */
.table-wrap { overflow-x: auto; background: var(--surface); border: var(--outline) solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--shadow-color); padding: 4px; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 780px; }
.rank-table th { text-align: left; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--text-2); padding: var(--space-3) var(--space-4) var(--space-2); white-space: nowrap; }
.rank-table td { padding: var(--space-3) var(--space-4); border-top: 2px dashed var(--line-soft); vertical-align: middle; }
.rank-table .num { text-align: right; white-space: nowrap; }
.rank-table .rank { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.rank-table tr[hidden] { display: none; }
.pos { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); border: 1.5px solid var(--line); white-space: nowrap; background: var(--accent-soft); }
.score { display: inline-flex; align-items: center; gap: var(--space-2); }
.bar { width: 64px; height: 10px; border-radius: var(--radius-pill); border: 1.5px solid var(--line); background: var(--surface); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--kernel); }
.score strong { font-family: var(--font-display); font-size: 18px; min-width: 2.4em; text-align: right; }
.perfume-cell { display: flex; align-items: center; gap: var(--space-3); color: var(--text); text-decoration: none; }
.perfume-cell:hover strong { text-decoration: underline; }
.perfume-cell strong { display: block; }
.perfume-cell .muted { font-size: 13px; }
.empty-row td { color: var(--text-2); padding: var(--space-5) var(--space-4); }

/* Logo tile */
.logo-tile { flex: none; width: 42px; height: 42px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--shell); display: grid; place-items: center; overflow: hidden; font-family: var(--font-display); font-weight: 800; color: var(--on-kernel); }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; background: #ffffff; }
.logo-tile-lg { width: 68px; height: 68px; font-size: 26px; border-width: var(--outline); box-shadow: 3px 3px 0 var(--shadow-color); }

/* Method */
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-top: var(--space-4); }
.method-grid > div { padding: var(--space-5); }
.method-grid > div:nth-child(1) { background: var(--accent-soft); }
.method-grid > div:nth-child(2) { background: var(--skin-soft); }
.method-grid > div:nth-child(3) { background: var(--shell-soft); }
.method-grid .pts { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; margin-bottom: var(--space-2); }
.method-grid .pts span { font-size: 16px; color: var(--text-2); }
.method-grid p { margin: var(--space-2) 0 0; color: var(--text-2); font-size: 15px; }
.method { margin-top: var(--space-7); }
.method ul { padding-left: 1.1em; }

/* Calculator */
.calc { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; margin-top: var(--space-4); }
.calc > div { padding: var(--space-5); min-width: 0; }
.calc form { display: grid; gap: var(--space-3); }
.calc label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.calc select, .calc input { font: inherit; padding: 9px 12px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface); color: var(--text); width: 100%; }
.calc .two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.calc-out { background: var(--skin-soft); border-left: var(--outline) solid var(--line); display: grid; align-content: center; gap: var(--space-4); }
.calc-out .big { font-family: var(--font-display); font-weight: 800; font-size: clamp(42px, 6vw, 58px); line-height: 1; font-variant-numeric: tabular-nums; }
.calc-out .row { display: flex; gap: var(--space-6); flex-wrap: wrap; font-size: 15px; color: var(--text-2); }
.calc-out .row b { display: block; font-family: var(--font-display); font-size: 24px; color: var(--text); font-variant-numeric: tabular-nums; }

/* Perfume page */
.perfume-head { display: flex; gap: var(--space-5); align-items: flex-start; padding-top: var(--space-5); }
.perfume-head h1 { margin-bottom: var(--space-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; background: var(--surface); border: var(--outline) solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--shadow-color); overflow: hidden; margin: var(--space-5) 0 0; }
.facts div { padding: var(--space-3) var(--space-4); border-bottom: 2px dashed var(--line-soft); }
.facts dt { font-size: 13px; color: var(--text-2); }
.facts dd { margin: 0; font-weight: 700; }
.pyramid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.tier { background: var(--surface); border: var(--outline) solid var(--line); border-radius: var(--radius); padding: var(--space-4) var(--space-5); }
.tier:nth-child(1) { background: var(--accent-soft); }
.tier:nth-child(2) { background: var(--skin-soft); }
.tier:nth-child(3) { background: var(--shell-soft); }
.tier ul { margin: 0; padding-left: 1.1em; }
.score-card { background: var(--accent-soft); border: var(--outline) solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--shadow-color); padding: var(--space-5); margin-top: var(--space-7); }
.score-card h2 { margin-top: 0; font-size: 24px; }
.score-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); margin: 0 0 var(--space-3); }
.score-parts dt { font-size: 14px; color: var(--text-2); }
.score-parts dd { margin: 0; font-weight: 800; font-size: 22px; font-family: var(--font-display); }
.card-list, .hub-links, .hub-grid { list-style: none; padding: 0; margin: 0; }
.card-list { display: grid; gap: var(--space-3); }
.mini-card { display: flex; gap: var(--space-3); align-items: center; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-4); color: var(--text); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.mini-card:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow-color); }
.mini-card strong { display: block; }
.mini-card .muted { font-size: 14px; }
.vs-table { min-width: 560px; }
.vs-table td:first-child { font-weight: 600; white-space: nowrap; }
.faq details { border-bottom: 2px dashed var(--line-soft); padding: var(--space-3) 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: var(--space-2) 0 0; color: var(--text-2); }
.source { margin-top: var(--space-6); font-size: 14px; color: var(--text-2); }

/* Hubs */
.hub-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hub-links a { display: inline-flex; align-items: center; min-height: var(--control-md); padding: 0 var(--space-4); border: 2px solid var(--line); border-radius: var(--radius-pill); color: var(--text); background: var(--surface); text-decoration: none; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.hub-card { display: flex; flex-direction: column; gap: var(--space-1); background: var(--surface); border: var(--outline) solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--shadow-color); padding: var(--space-5); color: var(--text); text-decoration: none; transition: transform .12s; }
.hub-card:hover { transform: rotate(-1deg) translateY(-2px); }
.hub-card strong { font-family: var(--font-display); font-size: 19px; }
.hub-grid li:nth-child(4n+1) .hub-card { background: var(--accent-soft); }
.hub-grid li:nth-child(4n+2) .hub-card { background: var(--skin-soft); }
.hub-grid li:nth-child(4n+3) .hub-card { background: var(--shell-soft); }
.prose h2 { font-size: 28px; }
.prose ul, .prose ol { padding-left: 1.2em; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .mascot { max-width: 380px; }
  .picks, .method-grid { grid-template-columns: 1fr; }
  .calc { grid-template-columns: 1fr; }
  .calc-out { border-left: 0; border-top: var(--outline) solid var(--line); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .header-inner { min-height: 0; }
  .wordmark { font-size: 26px; }
  .perfume-head { gap: var(--space-4); }
  .logo-tile-lg { width: 52px; height: 52px; font-size: 20px; }
  .calc .two { grid-template-columns: 1fr; }
}
