/* Home and /brands (TER-23). Full-width colour chapters with bento tiles inside
   them. The previous version was one black section with one grey card grid,
   nine times over: clean, and monotonous. Colour here comes from the same places
   as the app's budtender poster and the marketing reels, so it reads as one brand.

   Each chapter sets its own palette through the variables below, so a tile, a
   chart or a heading is written once and works on every colour. The legal pages
   keep their own, plainer sheet.

   SF Pro is Apple's and is not ours to self-host, so it comes from the system
   font stack. Inter and Instrument Serif are self-hosted in /fonts, so no
   visitor's IP goes to a font CDN. */

:root {
  --black: #000;
  --sage: #81c784;       /* the app's colorScheme.primary */
  --sage-ink: #0b1a0c;   /* 9.8:1 on sage */
  --sage-ink-2: #1e3a20; /* 6.2:1 on sage */
  --paper: #f3f2ed;
  --paper-ink: #141414;
  --paper-ink-2: #55554f; /* 6.7:1 on paper */
  --paper-accent: #2f6b3a; /* 5.6:1 on paper */
  --deep: #10302a;

  --sf: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --gap: clamp(8px, 1vw, 12px);
  --r: clamp(20px, 2.2vw, 28px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--black); scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--black);
  color: #f5f5f7;
  font-family: var(--sf);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
/* height:auto, or an img carrying width/height attributes keeps its attribute
   height when CSS narrows it, and squashes. */
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: rgba(129, 199, 132, 0.35); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 6px; }
section[id] { scroll-margin-top: 64px; }

.skip-link {
  position: absolute; left: 50%; top: 8px; z-index: 200;
  transform: translate(-50%, -160%);
  padding: 10px 18px; border-radius: 10px;
  background: var(--sage); color: var(--sage-ink); font-weight: 600;
  transition: transform 0.2s;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ── Palettes ──────────────────────────────────────────────────────────── */
.c-black, .c-deep {
  --fg: #f5f5f7; --fg2: #a1a1a6; --accent: var(--sage); --on-accent: var(--sage-ink);
  --tile: #1c1c1e; --tile2: #2c2c2e; --line: rgba(255, 255, 255, 0.14);
}
.c-black { background: var(--black); }
.c-deep  { background: var(--deep); --fg2: #b4c6bf; --tile: #18423a; --tile2: #215349; --line: rgba(255, 255, 255, 0.18); }
.c-sage {
  background: var(--sage);
  --fg: var(--sage-ink); --fg2: var(--sage-ink-2); --accent: var(--sage-ink); --on-accent: var(--sage);
  --tile: var(--sage-ink); --tile2: #16301a; --line: rgba(11, 26, 12, 0.25);
}
.c-paper {
  background: var(--paper);
  --fg: var(--paper-ink); --fg2: var(--paper-ink-2); --accent: var(--paper-accent); --on-accent: #fff;
  --tile: #fff; --tile2: #e7e5dc; --line: rgba(20, 20, 20, 0.16);
}
/* A dark tile on sage carries its own text colours. */
.c-sage .t { --fg: #f5f5f7; --fg2: #b7c7b8; --accent: var(--sage); --on-accent: var(--sage-ink); --line: rgba(255, 255, 255, 0.16); }
/* Any tile can flip to a loud colour. */
.t.on-sage { background: var(--sage); --fg: var(--sage-ink); --fg2: var(--sage-ink-2); --accent: var(--sage-ink); --on-accent: var(--sage); --line: rgba(11, 26, 12, 0.25); }
.t.on-paper { background: var(--paper); --fg: var(--paper-ink); --fg2: var(--paper-ink-2); --accent: var(--paper-accent); --on-accent: #fff; --line: rgba(20, 20, 20, 0.16); }

/* ── Type ──────────────────────────────────────────────────────────────── */
.chapter, .t, .more { color: var(--fg); }
.display, .title {
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
  color: var(--fg);
}
.display { font-size: clamp(50px, 10.2vw, 128px); }
.title { font-size: clamp(42px, 7.4vw, 96px); max-width: 15ch; }
/* One word in each headline gets the serif. It is regular weight at a larger
   size, because this face runs small and has no bold. */
.display em, .title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.09em;
  letter-spacing: -0.025em;
}
.eyebrow { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--accent); margin-bottom: 14px; }
.lede {
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--fg2);
  max-width: 34ch;
  margin-top: clamp(16px, 2vw, 24px);
}
.lede strong { color: var(--fg); font-weight: 600; }
.fine { font-size: 13px; color: var(--fg2); margin-top: 16px; }

/* ── Nav ───────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 56px; padding: 0 var(--gutter);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: #f5f5f7;
}
.nav a { text-decoration: none; }
.nav-logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.nav-logo img { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; font-size: 14px; }
.nav-links a { color: #c7c7cc; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: #fff; }
.nav-links .nav-cta { display: block; padding: 6px 14px; border-radius: 999px; background: var(--sage); color: var(--sage-ink); font-weight: 600; white-space: nowrap; }
.nav-links .nav-cta:hover { color: var(--sage-ink); }
@media (max-width: 820px) { .nav-links li:not(.keep) { display: none; } .nav-links { gap: 14px; } }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(22px, 3vw, 34px); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px;
  padding: 0 26px; border-radius: 999px;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { box-shadow: inset 0 0 0 1.5px var(--line); color: var(--fg); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--fg); }

/* ── Layout ────────────────────────────────────────────────────────────── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.chapter { padding: clamp(72px, 10vw, 136px) 0; }
.head { margin-bottom: clamp(32px, 5vw, 64px); }
.head.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: end; }
.head.split .lede { margin-top: 0; }
@media (max-width: 860px) { .head.split { grid-template-columns: 1fr; } }

/* ── Bento ─────────────────────────────────────────────────────────────── */
.bento { display: grid; gap: var(--gap); grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; }
.t {
  grid-column: span 4;
  background: var(--tile);
  border-radius: var(--r);
  padding: clamp(20px, 2.2vw, 28px);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.r2 { grid-row: span 2; }
@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t, .s3, .s4, .s5, .s6, .s7, .s8, .s12 { grid-column: span 2; }
  .t.half { grid-column: span 1; }
  .r2 { grid-row: auto; }
}
/* Two tiles side by side leave too little line length on the narrowest phones. */
@media (max-width: 480px) { .t.half { grid-column: span 2; } }
.t h3 { font-size: clamp(19px, 1.8vw, 22px); font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 8px; }
.t p { font-size: 15.5px; line-height: 1.42; color: var(--fg2); }
.t p + p { margin-top: 10px; }
.t p a, .more a { color: var(--fg); text-underline-offset: 2px; }
.huge { font-size: clamp(60px, 8vw, 104px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.95; color: var(--accent); }
.huge small { font-size: 0.42em; font-weight: 700; letter-spacing: -0.03em; }
.loud { font-size: clamp(40px, 5.6vw, 72px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.98; color: var(--fg); }
.plus { display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 2px 8px; border-radius: 999px; background: var(--tile2); color: var(--fg2); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; }

/* A phone rising out of the bottom of a tile. A screenshot already carries the
   status bar and island, so the frame is only the band and the bezel. */
.phone {
  aspect-ratio: 1206 / 2622;
  padding: 2.4%;
  border-radius: 15.5% / 7.2%;
  background: linear-gradient(145deg, #5b5b5f, #232325 22%, #161618 55%, #2b2b2e 82%, #4c4c50);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 13.6% / 6.3%; background: #000; }
/* Capped, so a whole phone does not set the height of the row beside it and
   leave those tiles half empty. It reads as rising out of the tile. */
.t.has-phone { padding-bottom: 0; display: flex; flex-direction: column; max-height: 600px; }
.t.has-phone .phone { flex: none; width: min(84%, 320px); margin: clamp(18px, 2vw, 26px) auto 0; }
/* Words at the top and a figure or chart at the bottom, whatever the row height. */
.t.spread { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }

/* ── Charts: plain elements, so they need no library and no request ──── */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 16px; }
.bars.tall { height: 170px; }
.bars i {
  flex: 1; display: block; min-height: 3px;
  height: calc(var(--v) * 1%);
  border-radius: 4px;
  background: var(--accent);
  transform-origin: bottom;
  transition: transform 1.1s var(--ease);
}
.bars i.dim { opacity: 0.45; }
.js .reveal:not(.visible) .bars i { transform: scaleY(0.03); }
.axis { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--fg2); margin-top: 6px; }
.axis.even span { flex: 1; text-align: center; }
.t p.say { font-size: clamp(17px, 1.7vw, 20px); line-height: 1.25; letter-spacing: -0.015em; color: var(--fg); margin-top: 10px; }
.tag { font-size: 13px; color: var(--fg2); }

/* The lab report, in the face a lab report would use. */
.coa { font-family: var(--mono); font-size: clamp(13px, 1.25vw, 15px); margin-top: 14px; }
.coa div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.coa b { font-weight: 600; color: var(--fg); }

.stars { display: flex; gap: 6px; margin-top: 14px; color: var(--accent); font-size: 30px; line-height: 1; }

/* ── The rest of it, one tap away ──────────────────────────────────────── */
.more { border-top: 1px solid var(--line); }
.more:last-of-type { border-bottom: 1px solid var(--line); }
.more summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: clamp(18px, 2.2vw, 26px) 0;
  font-size: clamp(22px, 2.8vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
  cursor: pointer; list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary small { display: block; margin-top: 4px; font-size: 15px; font-weight: 400; letter-spacing: -0.01em; color: var(--fg2); }
.more summary::after { content: '+'; flex: none; font-size: 1.2em; font-weight: 400; color: var(--accent); transition: transform 0.25s var(--ease); }
.more[open] summary::after { transform: rotate(45deg); }
.more .bento { padding-bottom: clamp(22px, 3vw, 34px); }
.more .intro { max-width: 62ch; color: var(--fg2); padding-bottom: 18px; }
.more ul { list-style: none; }
.more li { padding: 10px 0; border-top: 1px solid var(--line); color: var(--fg2); }
.more li strong { color: var(--fg); font-weight: 600; }

.price { font-size: clamp(38px, 4.4vw, 56px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 2px 0 10px; color: var(--fg); }
.price span { font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--fg2); }

/* The budtender card, drawn for /brands with a sample batch, so no real brand
   appears on a page brands read. Same layout as CounterCard in the app. */
.card-poster { width: min(100%, 320px); margin: 0 auto; border-radius: 32px; overflow: hidden; background: #000; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45); }
.card-poster .top { background: var(--sage); color: var(--sage-ink); padding: 26px 22px 28px; }
.card-poster .top small { font-size: 14px; font-weight: 600; }
.card-poster .top b { display: block; font-size: 46px; font-weight: 800; letter-spacing: -0.045em; line-height: 1; margin-top: 6px; }
.card-poster .top span { display: block; font-size: 13px; font-weight: 600; margin-top: 10px; }
.card-poster .bot { background: #000; color: #f5f5f7; border-radius: 22px 22px 0 0; margin-top: -18px; position: relative; padding: 18px 22px 22px; }
.card-poster h4 { font-size: 13px; font-weight: 600; color: var(--sage); margin: 14px 0 2px; }
.card-poster h4:first-child { margin-top: 0; }
.card-poster .bot p { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; color: #f5f5f7; line-height: 1.3; }
.card-poster .bot p small { font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: #a1a1a6; margin-left: 5px; }
.card-poster .bot p.q { font-size: 13.5px; font-weight: 400; letter-spacing: 0; color: #a1a1a6; }

/* ── Footer ────────────────────────────────────────────────────────────── */
footer { background: var(--black); padding: 44px var(--gutter) 60px; font-size: 13px; color: #86868b; }
footer .wrap { padding: 0; display: grid; gap: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer nav a { color: #c7c7cc; text-decoration: none; }
footer nav a:hover { color: #fff; }
footer .legal { max-width: 72ch; line-height: 1.55; }

/* ── Reveal ────────────────────────────────────────────────────────────── */
/* Armed only once the inline script sets .js, so the page reads normally
   without it. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: 0.07s; }
.js .reveal.d2 { transition-delay: 0.14s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .reveal:not(.visible) .bars i { transform: none; }
  .bars i, .btn, .more summary::after { transition: none; }
}
