/* ==========================================================================
   ENDLESS — "The Alchemist's Desk"
   Drenched ink fields, cork as the constant material, Bodoni for the nib's
   thick-thin stroke, Familjen Grotesk for everything you operate.
   ========================================================================== */

:root {
  --paper: #eceee9;          /* Regalia paper, cool */
  --paper-2: #e2e5df;
  --raven: #1a2150;          /* Raven Blue field */
  --raven-deep: #10153a;
  --raven-ink: #151a3d;      /* text on paper */
  --copper: #d48b57;         /* Raven's copper sheen */
  --gold: #d6b25a;           /* Phantom trims */
  --cork: #bf946a;
  --cork-deep: #8c6442;
  --mars: #dd7460;
  --forest: #0d4d31;
  --obsidian: #131217;
  --ice: #dce6f2;

  --ink-on-paper: #151a3d;
  --ink-on-paper-2: #3f4466;
  --ink-on-dark: #f1f0ea;
  --ink-on-dark-2: #c4c7dc;

  --display: 'Bodoni Moda', 'Bodoni 72', 'Didot', serif;
  --ui: 'Familjen Grotesk', system-ui, sans-serif;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.18vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.1vw, 2.25rem);
  --step-3: clamp(2.2rem, 1.6rem + 2.6vw, 3.6rem);
  --step-4: clamp(2.8rem, 1.8rem + 4.4vw, 6rem);

  --gutter: clamp(16px, 4vw, 56px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ink: cubic-bezier(0.22, 0.9, 0.24, 1);
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--cork-deep) var(--paper); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-on-paper);
  font-family: var(--ui);
  font-size: var(--step-0);
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  /* Bodoni Moda: cap the optical size so hairlines survive at display sizes and over the ink field */
  font-variation-settings: 'opsz' 20;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
::selection { background: var(--copper); color: var(--raven-deep); }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; border-radius: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--cork-deep); border-radius: 10px; border: 2px solid var(--paper); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--paper); padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---------- type ---------- */
.display {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.06;
  text-wrap: balance;
  margin: 0;
}
.display em { font-style: italic; font-weight: 400; }
.h-xl { font-size: var(--step-4); }
.h-l { font-size: var(--step-3); }
.h-m { font-size: var(--step-2); line-height: 1.05; }
.lede { font-size: var(--step-1); line-height: 1.45; max-width: 34ch; text-wrap: pretty; }
.body { max-width: 62ch; text-wrap: pretty; }
.meta { font-size: var(--step--1); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.price { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: 'tnum'; }

/* ---------- the brand mark: bar + three dots (from Endless packaging) ---------- */
.mark { display: inline-flex; align-items: center; gap: 5px; }
.mark i { display: block; height: 3px; border-radius: 3px; background: currentColor; }
.mark i:first-child { width: 22px; }
.mark i:not(:first-child) { width: 3px; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink-on-paper); --fg: var(--paper);
  display: inline-flex; align-items: center; gap: 0.7em;
  min-height: 48px; padding: 0 1.35em;
  border-radius: 999px; border: 0;
  background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: var(--step-0); letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer;
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 8px 24px -12px rgba(0,0,0,.45);
}
.btn::before { /* ink fill on hover */
  content: ''; position: absolute; inset: -2px; z-index: -1;
  background: var(--fill, var(--copper));
  clip-path: circle(0% at var(--mx, 50%) var(--my, 50%));
  transition: clip-path 0.6s var(--ease-ink);
}
.btn:hover::before { clip-path: circle(140% at var(--mx, 50%) var(--my, 50%)); }
.btn:hover { color: var(--fg-hover, var(--raven-deep)); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn .price { opacity: 0.75; font-weight: 500; }
.btn--light { --bg: var(--paper); --fg: var(--raven-deep); }
.btn--ghost { --bg: transparent; --fg: currentColor; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--ghost:hover { --fg-hover: var(--raven-deep); }
.btn[aria-disabled='true'] { opacity: .55; pointer-events: none; }

.link-arrow { display: inline-flex; align-items: center; gap: .45em; font-weight: 600; text-decoration: none; }
.link-arrow span { background: linear-gradient(currentColor,currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .5s var(--ease-out); padding-bottom: 2px; }
.link-arrow:hover span { background-size: 100% 1.5px; }
.link-arrow svg { width: 1em; height: 1em; transition: transform .5s var(--ease-out); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  color: var(--nav-fg, var(--ink-on-dark));
  transition: color .5s var(--ease-out), background-color .5s var(--ease-out), transform .6s var(--ease-out);
}
.nav.is-solid { background: color-mix(in srgb, var(--nav-bg, var(--raven-deep)) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__links { display: flex; gap: clamp(14px, 2vw, 30px); list-style: none; margin: 0; padding: 0; font-weight: 500; }
.nav__links a { text-decoration: none; position: relative; padding: 6px 0; }
.nav__links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-out); }
.nav__links a:hover::after, .nav__links a[aria-current='page']::after { transform: scaleX(1); transform-origin: left; }
.wordmark { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; font-family: var(--ui); font-weight: 700; letter-spacing: 0.32em; font-size: 1.05rem; padding-left: .32em; }
.wordmark .mark { transform: scale(.85); }
.nav__end { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.nav__shop { min-height: 40px; padding: 0 1.1em; font-size: var(--step--1); }
.nav__menu { display: none; background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer; }
.nav__menu svg { width: 26px; height: 26px; }

.drawer { position: fixed; inset: 0; z-index: 60; background: var(--raven-deep); color: var(--ink-on-dark); padding: calc(var(--nav-h) + 24px) var(--gutter) 40px; display: flex; flex-direction: column; gap: 6px; clip-path: circle(0% at calc(100% - 36px) 36px); transition: clip-path .8s var(--ease-ink); }
.drawer.is-open { clip-path: circle(150% at calc(100% - 36px) 36px); }
.drawer a { font-family: var(--display); font-size: clamp(2.4rem, 11vw, 3.4rem); text-decoration: none; line-height: 1.15; }
.drawer__close { position: absolute; top: 14px; right: calc(var(--gutter) - 10px); background: none; border: 0; padding: 10px; cursor: pointer; }
.drawer__close svg { width: 26px; height: 26px; }
.drawer .meta { margin-top: auto; color: var(--ink-on-dark-2); }

@media (max-width: 860px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav__links { display: none; }
  .nav .wordmark { justify-self: start; align-items: flex-start; padding-left: 0; }
  .nav__shop { display: none; }
  .nav__menu { display: block; }
}

/* ---------- section scaffolding ---------- */
.section { position: relative; padding: clamp(96px, 14vw, 200px) var(--gutter); }
.wrap { max-width: 1440px; margin: 0 auto; }
.field-raven { background: var(--raven); color: var(--ink-on-dark); }
.field-paper { background: var(--paper); color: var(--ink-on-paper); }
.field-obsidian { background: var(--obsidian); color: var(--ink-on-dark); }
.field-forest { background: var(--forest); color: var(--ink-on-dark); }
.field-mars { background: var(--mars); color: #2a0b0c; }
.field-cork { background-color: var(--cork); color: #2b1a0c; }
.field-ice { background: var(--ice); color: var(--raven-ink); }

/* cork, generated: two noise octaves + fleck dots */
.cork-tex {
  background-color: var(--cork);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.42' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .22 0 0 0 0 .11 0 0 0 6 -3.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='h'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='2' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .74 0 0 0 6 -3.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23h)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.03' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .36 0 0 0 0 .2 0 0 0 .7 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
}
.grain::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  background: var(--raven); color: var(--ink-on-dark);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  padding: calc(var(--nav-h) + 24px) var(--gutter) clamp(28px, 4vw, 48px);
  isolation: isolate;
}
.ink-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.hero__copy { position: relative; z-index: 2; align-self: center; padding-bottom: 6vh; }
.hero__title { font-size: clamp(3rem, 1.6rem + 5.4vw, 6rem); line-height: 1.04; letter-spacing: -0.02em; font-weight: 600; text-shadow: 0 2px 24px rgba(8, 10, 34, .45); }
.hero__title em { font-weight: 500; }
.hero__title .line { display: block; overflow: hidden; padding: 0.06em 0 0.24em; margin: -0.06em 0 -0.24em; }
.hero__title .line > span { display: inline-block; }
.hero__sub { margin: clamp(20px, 3vw, 32px) 0 clamp(26px, 4vw, 40px); color: #dfe1ee; text-shadow: 0 1px 14px rgba(8, 10, 34, .6); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero__foot { position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: clamp(20px, 3vw, 32px); display: flex; justify-content: space-between; align-items: end; gap: 20px; color: var(--ink-on-dark-2); }
.hero__foot .meta { max-width: 32ch; }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; }
.scroll-cue i { width: 1.5px; height: 38px; background: currentColor; transform-origin: top; animation: cue 2.4s var(--ease-out) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Phantom (clickable pen) ---------- */
.phantom {
  --ang: 20.7deg; --cut: 7.2%; --nib: 1;
  position: relative; z-index: 2; justify-self: center;
  width: min(23vw, 300px); aspect-ratio: 517 / 1253;
  border: 0; padding: 0; background: none; cursor: pointer;
  transform: translate3d(var(--px, 0), var(--py, 0), 0) rotate(var(--tilt, 0deg));
  -webkit-tap-highlight-color: transparent;
}
.phantom__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  /* the nib retracts by masking along the pen axis */
  -webkit-mask-image: linear-gradient(var(--ang), transparent calc(var(--cut) * (1 - var(--nib))), #000 calc(var(--cut) * (1 - var(--nib)) + 0.4%));
          mask-image: linear-gradient(var(--ang), transparent calc(var(--cut) * (1 - var(--nib))), #000 calc(var(--cut) * (1 - var(--nib)) + 0.4%));
  filter: drop-shadow(-26px 38px 28px rgba(5, 8, 30, 0.55));
  transition: transform .18s var(--ease-out);
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.phantom.is-pressed .phantom__img { transform: translate(-1.2%, 0.9%); }
.phantom__hint {
  position: absolute; right: 78%; top: 4%; white-space: nowrap;
  display: flex; flex-direction: row-reverse; align-items: center; gap: 10px; color: var(--ink-on-dark-2); font-size: var(--step--1);
  pointer-events: none;
}
.phantom__hint::before { content: ''; width: 46px; height: 1px; background: currentColor; }
.phantom__count { font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: 1fr auto; align-items: end; padding-bottom: 96px; }
  .hero__copy { order: 2; padding-bottom: 0; }
  .phantom { order: 1; width: min(38vw, 190px); margin-top: 4px; justify-self: end; margin-right: 6vw; align-self: center; }
  .phantom__hint { right: 85%; top: 18%; }
  .hero__foot .meta:first-child { display: none; }
}

/* ==========================================================================
   STATEMENT (inline objects in text)
   ========================================================================== */
.statement { background: var(--paper); }
.statement__text { font-family: var(--display); font-size: clamp(2rem, 1.1rem + 3.6vw, 4.6rem); line-height: 1.08; letter-spacing: -0.02em; font-weight: 400; margin: 0; max-width: 18ch; text-wrap: balance; }
.statement__text .obj { display: inline-block; vertical-align: middle; height: 0.82em; aspect-ratio: 1.45; border-radius: 999px; overflow: hidden; margin: -0.1em 0.06em 0; background: var(--paper-2); box-shadow: inset 0 0 0 1px rgba(21,26,61,.08); }
.statement__text .obj img { width: 100%; height: 100%; object-fit: cover; }
.statement__text .word-dim { color: color-mix(in srgb, var(--ink-on-paper) 48%, var(--paper)); transition: color .4s linear; }
.statement__foot { display: flex; flex-wrap: wrap; gap: 24px 56px; margin-top: clamp(48px, 7vw, 96px); align-items: start; }
.statement__foot p { margin: 0; max-width: 36ch; color: var(--ink-on-paper-2); }
.statement__foot strong { display: block; color: var(--ink-on-paper); font-family: var(--display); font-weight: 500; font-size: var(--step-2); line-height: 1.08; margin-bottom: 8px; letter-spacing: -0.02em; }

/* ==========================================================================
   PHANTOM FEATURE (home)
   ========================================================================== */
.pf { background: var(--raven-deep); color: var(--ink-on-dark); overflow: hidden; }
.pf__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.pf__visual { position: relative; aspect-ratio: 4/5; border-radius: 28px; overflow: hidden; background: #0c1033; }
.pf__visual img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); }
.pf__list { list-style: none; padding: 0; margin: clamp(28px, 4vw, 48px) 0; display: grid; gap: 0; }
.pf__list li { padding: 18px 0; border-top: 1px solid rgba(241,240,234,.16); display: grid; grid-template-columns: 9.5rem 1fr; gap: 16px; }
.pf__list li:last-child { border-bottom: 1px solid rgba(241,240,234,.16); }
.pf__list b { font-weight: 600; }
.pf__list span { color: var(--ink-on-dark-2); }
.pf .note { color: var(--copper); }
@media (max-width: 860px) { .pf__grid { grid-template-columns: 1fr; } .pf__list li { grid-template-columns: 1fr; gap: 2px; } }

/* colourway rail */
.ways { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.way { --c: #000; --t: var(--gold); width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; position: relative; background: conic-gradient(from 210deg, var(--c) 0 70%, var(--t) 70% 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); transition: transform .4s var(--ease-out); }
.way::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; box-shadow: 0 0 0 1.5px currentColor; opacity: 0; transform: scale(.85); transition: .4s var(--ease-out); }
.way[aria-pressed='true']::after { opacity: 1; transform: scale(1); }
.way:hover { transform: translateY(-2px); }

/* ==========================================================================
   INK SHELF (pinned horizontal)
   ========================================================================== */
.shelf { position: relative; background: var(--shelf-bg, var(--ink-0, #5b689b)); color: var(--shelf-fg, #fff); transition: background-color .9s var(--ease-out), color .6s; overflow: hidden; }
.shelf__intro { padding: clamp(96px, 12vw, 160px) var(--gutter) 0; display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.shelf__intro .lede { opacity: .85; }
.shelf__viewport { position: relative; height: 100svh; display: flex; align-items: center; }
.shelf__track { display: flex; gap: clamp(20px, 3vw, 48px); padding: 0 var(--gutter); will-change: transform; }
.bottle {
  flex: none; width: clamp(280px, 34vw, 520px);
  display: grid; grid-template-rows: auto auto; gap: 18px; text-decoration: none; color: inherit;
}
.bottle__photo { position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: var(--g); box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); }
.bottle__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.bottle:hover .bottle__photo img { transform: scale(1.05); }
.bottle__photo .tag { position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,.88); color: #1a1a1a; font-size: var(--step--1); font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.bottle__name { font-family: var(--display); font-size: var(--step-3); line-height: 1.08; letter-spacing: -0.025em; margin: 0; }
.bottle__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bottle__story { margin: 6px 0 0; max-width: 40ch; opacity: .82; font-size: var(--step--1); line-height: 1.5; }
.bottle__drop { width: 14px; height: 18px; flex: none; }
.shelf__progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px; height: 2px; background: color-mix(in srgb, currentColor 22%, transparent); }
.shelf__progress i { position: absolute; inset: 0; background: currentColor; transform-origin: left; transform: scaleX(var(--p, 0)); }
.shelf__end { flex: none; width: clamp(260px, 26vw, 400px); display: flex; flex-direction: column; justify-content: center; gap: 22px; }
@media (max-width: 860px) {
  .shelf__viewport { height: auto; padding: 48px 0 96px; }
  .shelf__track { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: none; }
  .shelf__track::-webkit-scrollbar { display: none; }
  .bottle, .shelf__end { scroll-snap-align: center; width: 78vw; }
  .shelf__progress { display: none; }
}

/* ==========================================================================
   POTIONCRAFT LAB
   ========================================================================== */
.lab { position: relative; overflow: hidden; color: #26180b; }
.lab__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.lab__bench > div:first-child { min-width: 0; width: 100%; }
.lab__copy .body { color: #4a3420; }
.lab__bench { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(18px, 3vw, 40px); align-items: end; padding: clamp(22px, 3vw, 40px); border-radius: 30px; background: rgba(255,248,236,.32); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -18px 40px -24px rgba(70,40,10,.4), 0 40px 80px -50px rgba(40,20,0,.55); }
.flask-wrap { position: relative; display: grid; place-items: center; min-height: 380px; width: 100%; }
.flask { width: min(100%, 300px); min-width: 200px; height: auto; overflow: visible; filter: drop-shadow(0 26px 22px rgba(60,30,0,.28)); }
.flask .liquid { transition: fill .9s var(--ease-out); }
.flask-sparkle { position: absolute; pointer-events: none; }
.potion-name { text-align: center; margin-top: 10px; }
.potion-name output { display: block; font-family: var(--display); font-size: var(--step-2); line-height: 1.08; letter-spacing: -0.02em; min-height: 1.05em; }
.potion-name .meta { color: #5a4029; }
.droppers { display: grid; gap: 10px; }
.dropper {
  --c: #000; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  min-width: 190px; min-height: 48px; padding: 6px 14px 6px 8px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255,250,240,.72); color: #26180b; text-align: left;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 14px -8px rgba(60,30,0,.5);
  transition: transform .35s var(--ease-out), background-color .3s;
}
.dropper:hover { background: #fffaf0; transform: translateX(-3px); }
.dropper:active { transform: scale(.97); }
.dropper__bulb { width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: inset -4px -6px 10px rgba(0,0,0,.25), inset 3px 4px 8px rgba(255,255,255,.35); }
.dropper--clear .dropper__bulb { background: linear-gradient(135deg, #fff, #dfe6ea); box-shadow: inset 0 0 0 1.5px #b9c3c9; }
.dropper--metal .dropper__bulb { background: var(--c); background-size: 200% 200%; }
.dropper b { font-weight: 600; display: block; line-height: 1.1; }
.dropper small { color: #6a4e34; font-size: .78rem; }
.dropper .n { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 2ch; text-align: right; color: #6a4e34; }
.lab__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; justify-content: center; }
.lab__actions .btn { min-height: 42px; font-size: var(--step--1); }
.drop-fx { position: absolute; width: 12px; height: 16px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; pointer-events: none; z-index: 5; }
@media (max-width: 960px) { .lab__grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .lab__bench { grid-template-columns: 1fr; }
  .droppers { grid-template-columns: 1fr 1fr; }
  .dropper { min-width: 0; grid-template-columns: 28px 1fr auto; padding-right: 10px; }
  .dropper__bulb { width: 28px; height: 28px; }
  .dropper small { display: none; }
  .flask-wrap { min-height: 300px; }
  .lab__bench { padding: 18px; }
}

/* ==========================================================================
   PAPER (write test)
   ========================================================================== */
.paper { background: var(--paper); }
.paper__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.sheet { position: relative; aspect-ratio: 1.414 / 1; border-radius: 6px; background-color: #f7f7f3; background-image: radial-gradient(circle, rgba(21,26,61,.22) 1px, transparent 1.4px); background-size: 22px 22px; background-position: 11px 11px; box-shadow: 0 1px 1px rgba(0,0,0,.05), 0 30px 60px -36px rgba(21,26,61,.45); touch-action: none; cursor: crosshair; overflow: hidden; }
.sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet__hint { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-style: italic; font-size: var(--step-2); color: rgba(21,26,61,.32); pointer-events: none; transition: opacity .5s; }
.sheet.is-used .sheet__hint { opacity: 0; }
.sheet__tools { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; margin-top: 18px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); position: relative; padding: 0; }
.swatch::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--ink-on-paper); opacity: 0; transition: opacity .3s; }
.swatch[aria-pressed='true']::after { opacity: 1; }
.nibs { display: inline-flex; border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgba(21,26,61,.25); padding: 3px; }
.nibs button { border: 0; background: none; min-height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: var(--step--1); }
.nibs button[aria-pressed='true'] { background: var(--ink-on-paper); color: var(--paper); }
.textbtn { background: none; border: 0; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: .25em; padding: 10px 4px; }

.books { margin-top: clamp(64px, 9vw, 120px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.book { text-decoration: none; display: grid; gap: 14px; }
.book__img { aspect-ratio: 4/5; border-radius: 18px; overflow: hidden; background: var(--paper-2); }
.book__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease-out); }
.book:hover .book__img img { transform: scale(1.05); }
.book h3 { font-family: var(--display); font-weight: 500; font-size: var(--step-2); margin: 0; letter-spacing: -0.02em; line-height: 1.08; }
.book p { margin: 4px 0 0; color: var(--ink-on-paper-2); font-size: var(--step--1); }
@media (max-width: 960px) { .paper__grid { grid-template-columns: 1fr; } .books { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ==========================================================================
   MAZE
   ========================================================================== */
.maze { background: var(--ice); color: var(--raven-ink); overflow: hidden; }
.maze__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.maze__art { position: relative; aspect-ratio: 1; }
.maze__art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.maze__photo { position: absolute; right: -4%; bottom: -6%; width: 54%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(21,26,61,.55); border: 6px solid var(--ice); }
.maze__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 40%; }
.badge { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: var(--raven); color: var(--ink-on-dark); font-weight: 600; font-size: var(--step--1); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: #6ad1ff; box-shadow: 0 0 0 0 rgba(106,209,255,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(106,209,255,0); } 100% { box-shadow: 0 0 0 0 rgba(106,209,255,0); } }
@media (max-width: 860px) { .maze__grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   CARRY (leather)
   ========================================================================== */
.carry { background: #2a1b12; color: #f3e6d6; }
.carry__grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(16px, 2vw, 28px); margin-top: clamp(40px, 6vw, 72px); }
.tile { position: relative; border-radius: 26px; overflow: hidden; min-height: 520px; display: flex; align-items: flex-end; text-decoration: none; color: #fff; isolation: isolate; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.4s var(--ease-out); }
.tile::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(20,10,4,.82), rgba(20,10,4,0) 55%); }
.tile:hover img { transform: scale(1.04); }
.tile__body { padding: clamp(22px, 3vw, 36px); display: flex; justify-content: space-between; align-items: end; gap: 20px; width: 100%; flex-wrap: wrap; }
.tile h3 { font-family: var(--display); font-weight: 500; font-size: var(--step-3); line-height: 1.08; margin: 0; letter-spacing: -0.025em; }
.tile p { margin: 8px 0 0; color: #e6d6c3; max-width: 34ch; }
@media (max-width: 860px) { .carry__grid { grid-template-columns: 1fr; } .tile { min-height: 420px; } }

/* ==========================================================================
   LABS + JOURNAL
   ========================================================================== */
.labs { background: var(--paper); }
.labs__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.journal { list-style: none; margin: 0; padding: 0; }
.journal li a { display: grid; grid-template-columns: 132px 1fr auto; gap: 22px; align-items: center; padding: 18px 0; border-top: 1px solid rgba(21,26,61,.14); text-decoration: none; }
.journal li:last-child a { border-bottom: 1px solid rgba(21,26,61,.14); }
.journal img { width: 132px; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; }
.journal h3 { font-family: var(--display); font-weight: 500; font-size: var(--step-1); margin: 0; line-height: 1.15; }
.journal svg { width: 20px; height: 20px; transition: transform .5s var(--ease-out); }
.journal a:hover svg { transform: translateX(5px); }
.labs__card { position: relative; border-radius: 26px; overflow: hidden; aspect-ratio: 4/5; display: block; }
.labs__card img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .labs__grid { grid-template-columns: 1fr; } .journal li a { grid-template-columns: 96px 1fr auto; gap: 14px; } .journal img { width: 96px; } }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { position: relative; color: #26180b; padding: clamp(80px, 10vw, 140px) var(--gutter) 28px; overflow: hidden; }
.footer__big { font-family: var(--display); font-size: clamp(2.6rem, 1rem + 6vw, 6rem); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 clamp(40px, 6vw, 72px); max-width: 14ch; font-weight: 500; }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer h2 { font-size: var(--step--1); font-weight: 700; margin: 0 0 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.news { display: flex; gap: 8px; margin-top: 14px; max-width: 420px; }
.news input { flex: 1; min-width: 0; min-height: 48px; border-radius: 999px; border: 0; padding: 0 18px; background: rgba(255,250,240,.75); color: #26180b; font: inherit; box-shadow: inset 0 0 0 1.5px rgba(38,24,11,.18); }
.news input::placeholder { color: #6e5238; }
.news input:focus-visible { outline: 2px solid #26180b; outline-offset: 2px; }
.news__msg { min-height: 1.5em; margin: 8px 0 0; font-size: var(--step--1); }
.footer__base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: clamp(48px, 6vw, 80px); padding-top: 20px; border-top: 1px solid rgba(38,24,11,.22); font-size: var(--step--1); }
.footer .btn { --bg: #26180b; --fg: #f6ead8; --fill: var(--raven); --fg-hover: #fff; }
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__grid > :first-child { grid-column: 1 / -1; } }

/* ==========================================================================
   PHANTOM PAGE
   ========================================================================== */
.pp-hero { position: relative; min-height: 100svh; background: var(--raven-deep); color: var(--ink-on-dark); overflow: hidden; isolation: isolate; display: grid; place-items: center; padding: calc(var(--nav-h) + 20px) var(--gutter) 40px; text-align: center; }
.pp-hero__word { font-family: var(--display); font-weight: 500; font-size: clamp(4.5rem, 19vw, 18rem); letter-spacing: -0.045em; line-height: .8; margin: 0; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; color: color-mix(in srgb, var(--ink-on-dark) 92%, transparent); z-index: 0; }
.pp-hero .phantom { width: min(20vw, 240px); z-index: 2; }
@media (max-width: 860px) {
  .pp-hero .phantom { width: min(36vw, 200px); justify-self: center; margin: -8vh 0 0; }
  .pp-hero__word { top: 42%; }
}
.pp-hero__sub { position: absolute; bottom: clamp(24px, 4vw, 44px); left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; z-index: 3; text-align: left; }
.pp-hero__sub p { margin: 0; max-width: 34ch; color: var(--ink-on-dark-2); }

.chapters { background: var(--raven-deep); color: var(--ink-on-dark); position: relative; }
.chapters__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
.chapters__stage { position: sticky; top: calc(var(--nav-h) + 4vh); height: calc(100svh - var(--nav-h) - 8vh); border-radius: 28px; overflow: hidden; background: #0c1033; }
.chapters__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .9s var(--ease-out), transform 1.4s var(--ease-out); }
.chapters__stage img.is-on { opacity: 1; transform: scale(1); }
.chapter { min-height: 90svh; display: flex; flex-direction: column; justify-content: center; padding: 6vh 0; }
.chapter .body { color: var(--ink-on-dark-2); margin-top: 22px; }
.chapter__k { color: var(--copper); font-weight: 600; margin-bottom: 18px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .chapters__grid { grid-template-columns: 1fr; }
  .chapters__stage { position: relative; top: 0; height: auto; aspect-ratio: 4/5; display: none; }
  .chapter { min-height: 0; padding: 0 0 72px; }
  .chapter__img { display: block !important; border-radius: 20px; overflow: hidden; margin-bottom: 26px; aspect-ratio: 4/3; }
  .chapter__img img { width: 100%; height: 100%; object-fit: cover; }
}
.chapter__img { display: none; }

.choose { background: var(--paper); }
.choose__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.choose__stage { position: relative; aspect-ratio: 1; border-radius: 30px; background: var(--stage, var(--raven)); transition: background-color .8s var(--ease-out); display: grid; place-items: center; overflow: hidden; }
.choose__stage img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(-20px 30px 24px rgba(0,0,0,.35)); transition: opacity .35s, transform .8s var(--ease-out); }
.choose__stage img.is-flip { transform: rotate(180deg); }
.choose__name { font-family: var(--display); font-size: var(--step-3); margin: 18px 0 6px; line-height: 1.08; letter-spacing: -0.025em; }
.choose .ways { margin: 24px 0 28px; color: var(--ink-on-paper); }
@media (max-width: 860px) { .choose__grid { grid-template-columns: 1fr; } }

.parts { background: var(--paper-2); }
.parts__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); margin-top: clamp(32px, 5vw, 56px); }
.part { display: grid; grid-template-columns: 160px 1fr; gap: 22px; align-items: center; padding: 18px; border-radius: 22px; background: var(--paper); text-decoration: none; transition: transform .5s var(--ease-out); }
.part:hover { transform: translateY(-3px); }
.part img { width: 160px; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
.part h3 { font-family: var(--display); font-weight: 500; font-size: var(--step-2); margin: 0 0 6px; line-height: 1.08; }
.part p { margin: 0 0 10px; color: var(--ink-on-paper-2); font-size: var(--step--1); }
@media (max-width: 760px) { .parts__grid { grid-template-columns: 1fr; } .part { grid-template-columns: 96px 1fr; } .part img { width: 96px; } }

/* ==========================================================================
   ALCHEMY PAGE
   ========================================================================== */
.al-hero { position: relative; min-height: 100svh; background: var(--forest); color: var(--ink-on-dark); overflow: hidden; isolation: isolate; display: flex; align-items: flex-end; padding: calc(var(--nav-h) + 40px) var(--gutter) clamp(40px, 6vw, 72px); }
.al-hero__title { font-size: clamp(3.2rem, 1.4rem + 7vw, 6rem); max-width: 11ch; }
.al-hero .lede { margin-top: 24px; color: color-mix(in srgb, var(--ink-on-dark) 82%, var(--forest)); }

.library { background: var(--paper); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: clamp(28px, 4vw, 44px) 0; }
.filters button { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer; background: var(--paper-2); font-weight: 600; font-size: var(--step--1); transition: background-color .3s, color .3s; }
.filters button[aria-pressed='true'] { background: var(--ink-on-paper); color: var(--paper); }
.filters .n { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }
.inkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(14px, 2vw, 24px); }
.inkcard { position: relative; border-radius: 24px; overflow: hidden; background: var(--g); color: var(--fg, #fff); text-decoration: none; display: grid; grid-template-rows: auto 1fr; transition: transform .6s var(--ease-out), opacity .4s; }
.inkcard:hover, .js-motion .inkcard.is-in:hover { transform: translateY(-4px); transition-duration: .6s; transition-delay: 0s; }
.inkcard img { aspect-ratio: 1; width: 100%; object-fit: cover; }
.inkcard__body { padding: 18px 20px 22px; display: grid; gap: 6px; }
.inkcard h3 { font-family: var(--display); font-weight: 500; font-size: var(--step-2); margin: 0; line-height: 1.08; letter-spacing: -0.02em; }
.inkcard p { margin: 0; font-size: var(--step--1); opacity: .85; }
.inkcard__row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-weight: 600; }
.inkcard .tag { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.88); color: #1a1a1a; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.inkcard[hidden] { display: none; }

.kit { background: var(--paper-2); }
.kit__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: clamp(32px, 5vw, 56px); border-top: 1px solid rgba(21,26,61,.15); }
.kit__grid > div { padding: 26px 26px 26px 0; border-bottom: 1px solid rgba(21,26,61,.15); }
.kit__grid h3 { font-family: var(--display); font-weight: 500; font-size: var(--step-2); margin: 0 0 12px; line-height: 1.08; }
.kit__grid ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--ink-on-paper-2); }
.kit__grid li b { color: var(--ink-on-paper); font-weight: 600; }
.kit__photos { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(14px, 2vw, 24px); margin-top: clamp(32px, 5vw, 56px); }
.kit__photos img { border-radius: 22px; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .kit__grid { grid-template-columns: 1fr; } .kit__photos { grid-template-columns: 1fr; } }

/* ---------- reveal helpers (only applied when JS + motion allowed) ---------- */
.js-motion [data-reveal] { opacity: 0; transform: translateY(28px); filter: blur(6px); }
.js-motion [data-reveal].is-in { opacity: 1; transform: none; filter: none; transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out), filter 1.1s var(--ease-out); transition-delay: var(--d, 0s); }

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