/* rosacea.help — one family (Literata), one ground per side of the split,
   one accent (the flush). Tokens first, everything else references them. */

:root {
  --night: #0e1a1e;
  --night-2: #15262b;
  --skin: #2a444d;
  --skin-2: #1f353c;
  --skin-hi: #35535d;
  --paper: #edefe9;
  --paper-2: #e0e6de;
  --sage: #c7d4cc;
  --ink: #10181b;
  --ink-2: #2f3d41;
  --bone: #e9ede8;
  --bone-2: #a8b8b5;
  --heat: #e4573c;
  --flush: #b03520;
  --flush-hi: #8f2a18;
  --calm: #6e9ea0;

  --step-small: 0.9375rem;
  --step-ui: 1rem;
  --step-body: clamp(1.125rem, 1.06rem + 0.25vw, 1.25rem);
  --step-lead: clamp(1.3rem, 1.15rem + 0.6vw, 1.65rem);
  --step-h2: clamp(1.9rem, 1.35rem + 2vw, 2.9rem);
  --step-h1: clamp(2.2rem, 1.4rem + 2.6vw, 3.6rem);

  --gutter: clamp(1.25rem, 4.4vw, 4rem);
  --bar-h: 4.5rem;
  --measure: 36rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cool: 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 2rem; scrollbar-color: var(--ink-2) var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Literata', Georgia, 'Times New Roman', serif;
  font-size: var(--step-body);
  line-height: 1.62;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  accent-color: var(--flush);
  caret-color: var(--flush);
}
::selection { background: var(--flush); color: var(--bone); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3 { font-weight: 560; margin: 0; text-wrap: balance; font-variation-settings: 'opsz' 60; }
h1 { font-size: var(--step-h1); line-height: 1.04; letter-spacing: -0.026em; font-weight: 540; margin-bottom: 0.5em; }
h2 { font-size: var(--step-h2); line-height: 1.06; letter-spacing: -0.022em; }
h3 { font-size: var(--step-body); line-height: 1.35; letter-spacing: -0.005em; font-weight: 640; }
p { margin: 0 0 1.1em; text-wrap: pretty; hyphens: manual; }
.lead { font-size: var(--step-lead); line-height: 1.42; letter-spacing: -0.008em; max-width: 28em; }
.small { font-size: var(--step-small); line-height: 1.5; }
.dim { color: var(--ink-2); }
strong { font-weight: 650; }
em, i { font-style: italic; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.25em; }
li { margin-bottom: 0.55em; padding-left: 0.2em; }
li::marker { color: var(--flush); }

a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); transition: text-decoration-color 0.2s; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--flush); outline-offset: 3px; }
.stage :focus-visible, .band--night :focus-visible, .foot :focus-visible, .menu-panel :focus-visible { outline-color: var(--bone); }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--bone); color: var(--ink); padding: 0.7rem 1rem; }
.skip:focus { top: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- header (overlays the split: wordmark over the stage, actions over the paper) ---------- */
.bar { position: absolute; inset: 0 0 auto 0; z-index: 20; height: var(--bar-h); display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); align-items: center; pointer-events: none; }
.bar > * { pointer-events: auto; }
.bar .mark { justify-self: start; margin-left: var(--gutter); color: var(--bone); text-decoration: none; font-size: var(--step-ui); font-weight: 620; letter-spacing: -0.015em; }
.bar .mark span { color: var(--heat); }
.bar-right { display: flex; justify-content: flex-end; align-items: center; gap: 1.5rem; margin-right: var(--gutter); color: var(--ink); }
.menu-btn { cursor: pointer; font-size: var(--step-ui); font-weight: 560; padding: 0.55rem 0.2rem; position: relative; z-index: 40; color: inherit; text-decoration: none; }
.bar.menu-open .menu-btn { color: var(--bone); }
.bar.menu-open .btn { visibility: hidden; }
.menu-panel[hidden] { display: none; }
.menu-panel { position: fixed; inset: 0; z-index: 30; background: var(--night); color: var(--bone); padding: calc(var(--bar-h) + 2rem) var(--gutter) 3rem; overflow-y: auto; display: grid; align-content: start; }
.menu-panel ul { list-style: none; padding: 0; margin: 0; max-width: 56rem; }
.menu-panel li { padding: 0; margin: 0 0 clamp(0.7rem, 1.6vh, 1.2rem); }
.menu-panel a { display: block; text-decoration: none; font-size: var(--step-h2); line-height: 1.1; letter-spacing: -0.02em; font-weight: 540; transition: transform 0.4s var(--ease), color 0.3s; }
.menu-panel a small { display: block; font-size: var(--step-small); font-weight: 400; line-height: 1.4; letter-spacing: 0; color: var(--bone-2); margin-top: 0.25rem; }
.menu-panel ul:hover a { color: var(--bone-2); }
.menu-panel ul a:hover, .menu-panel ul a:focus-visible, .menu-panel a[aria-current='page'] { color: var(--bone); transform: translateX(0.6rem); }
.menu-panel a[aria-current='page'] { position: relative; }
.menu-panel a[aria-current='page']::before { content: ''; position: absolute; left: -1.3rem; top: 0.5em; width: 0.6rem; height: 0.6rem; background: var(--heat); }
.menu-panel .menu-foot { margin-top: 2rem; max-width: 36rem; color: var(--bone-2); }

/* ---------- buttons: one shape, square, one fill ---------- */
.btn { display: inline-flex; align-items: center; gap: 0.7rem; background: var(--flush); color: var(--bone); text-decoration: none; font: inherit; font-size: var(--step-ui); font-weight: 600; letter-spacing: -0.004em; min-height: 3.25rem; padding: 0.7rem 1.4rem; border: 0; border-radius: 0; cursor: pointer; transition: background-color 0.25s, transform 0.25s var(--ease); }
.btn:hover { background: var(--flush-hi); }
.btn:active { transform: translateY(1px); }
.btn .arr { transition: transform 0.35s var(--ease); }
.btn:hover .arr { transform: translateX(0.3rem); }
.btn--small { min-height: 2.6rem; padding: 0.45rem 1rem; }
.btn--bone { background: var(--bone); color: var(--ink); }
.btn--bone:hover { background: #fff; }
.btn--quiet { background: var(--paper-2); color: var(--ink); }
.btn--quiet:hover { background: var(--sage); }
.link-arrow { display: inline-flex; gap: 0.5rem; font-weight: 600; text-decoration-color: var(--flush); }

/* ---------- the split ---------- */
.split { display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); }
.stage { position: sticky; top: 0; height: 100svh; background: var(--night); color: var(--bone); display: flex; flex-direction: column; padding: calc(var(--bar-h) + 0.5rem) var(--gutter) 1.5rem; overflow: hidden; }
.stage-map { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
.stage-map svg { height: 100%; width: auto; max-width: 100%; }
.stage-legend { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; font-size: var(--step-small); color: var(--bone-2); }
.stage-legend li { margin: 0; padding: 0; display: inline-flex; align-items: center; gap: 0.5rem; transition: color 0.4s; }
.stage-legend li::before { content: ''; width: 0.7rem; height: 0.7rem; background: var(--zone); opacity: 0.25; transition: opacity 0.4s; }
.stage-legend li.on { color: var(--bone); }
.stage-legend li.on::before { opacity: 1; }
.stage-note { margin: 0.9rem 0 0; font-size: var(--step-small); color: var(--bone-2); max-width: 30rem; line-height: 1.45; }
.stage-title { order: 3; margin: 0.4rem 0 0; font-weight: 500; letter-spacing: -0.05em; line-height: 0.86; font-size: clamp(3.4rem, 6.1vw, 7.4rem); color: var(--bone); white-space: nowrap; transform-origin: left bottom; }
.stage-title span { color: var(--heat); }

.column { background: var(--paper); padding: 0 var(--gutter); min-width: 0; }
.column > section { padding-block: clamp(4rem, 8vw, 7.5rem); }
.column > section > :is(p, ul, ol, h1, h2, h3, .actions, .pager) { max-width: var(--measure); }
.column > section > .tbl, .column > section > .note, .column > section > .warn, .column > section > .facts, .column > section > .fig, .column > section > .tool, .column > section > .note-out, .column > section > .tool-actions { max-width: none; }
.column > section:first-of-type { padding-top: calc(var(--bar-h) + clamp(3rem, 9vh, 6.5rem)); }
.column > section + section { padding-top: clamp(2.5rem, 5vw, 5rem); }
.column h2 { margin-bottom: 0.7em; }
.column .lead + .lead { margin-top: 0; }
.column .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: 2rem; }

/* the zones of the face map */
.map { --zone: color-mix(in srgb, var(--heat) calc((1 - var(--cool)) * 100%), var(--calm)); }
.map .skin { fill: var(--skin); }
.map .skin-2 { fill: var(--skin-2); }
.map .skin-hi { fill: var(--skin-hi); }
.map .dark { fill: var(--night); }
.map .z { fill: var(--zone); opacity: 0.07; transition: opacity 0.7s var(--ease), fill 0.4s linear; }
.map .z.on { opacity: 0.96; }
.stage-legend { --zone: color-mix(in srgb, var(--heat) calc((1 - var(--cool)) * 100%), var(--calm)); }

/* ---------- pictures ---------- */
.fig { margin: 2.2rem 0 2.4rem; }
.fig img { width: 100%; }
.fig figcaption { margin-top: 0.7rem; font-size: var(--step-small); line-height: 1.5; color: var(--ink-2); max-width: 34rem; }

/* ---------- reading components ---------- */
.note { background: var(--paper-2); padding: clamp(1.1rem, 2.4vw, 1.7rem); margin: 1.8rem 0; }
.note > :last-child { margin-bottom: 0; }
.note h3 { margin-bottom: 0.4em; }
.src { font-size: var(--step-small); white-space: nowrap; font-style: italic; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.src::before { content: '('; }
.src::after { content: ')'; }
.facts { list-style: none; padding: 0; margin: 1.6rem 0; display: grid; gap: 1px; background: var(--paper); }
.facts li { margin: 0; padding: 1rem 1.1rem 1.05rem; background: var(--paper-2); }
.facts li strong { display: block; margin-bottom: 0.15rem; }
.tbl { width: 100%; border-collapse: collapse; margin: 1.6rem 0 0.7rem; font-size: var(--step-ui); font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 0.7rem 0.9rem; vertical-align: baseline; }
.tbl thead th { font-weight: 650; background: var(--paper-2); }
.tbl tbody tr:nth-child(even) { background: color-mix(in srgb, var(--paper-2) 55%, var(--paper)); }
.tbl td:last-child, .tbl th:last-child { text-align: right; }
.steps { list-style: none; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; margin-bottom: 1.1rem; padding-left: 0; }
.steps li strong { display: block; }
.pager { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin-top: 1rem; }
.pager a { font-weight: 600; }
.warn { background: var(--flush); color: var(--bone); padding: clamp(1.1rem, 2.4vw, 1.7rem); margin: 1.8rem 0; }
.warn h3 { margin-bottom: 0.4em; }
.warn p:last-child { margin-bottom: 0; }
.warn a { text-decoration-color: currentColor; }

/* ---------- full-bleed bands ---------- */
.band { padding: clamp(4.5rem, 9vw, 9rem) var(--gutter); }
.band--sage { background: var(--sage); color: var(--ink); }
.band--night { background: var(--night); color: var(--bone); }
.band--paper { background: var(--paper); }
.band h2 { max-width: 16em; }

.sheet { background: var(--paper); max-width: 44rem; width: 100%; margin: 0; padding: clamp(1.6rem, 4vw, 3.6rem); }
.sheet h2 { margin-bottom: 0.4em; }
.sheet ul { list-style: none; padding: 0; margin: 2rem 0 0; }
.sheet li { margin: 0; padding: 0; }
.sheet li a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1.2rem; align-items: baseline; text-decoration: none; padding: 1rem 0.9rem; margin-inline: -0.9rem; transition: background-color 0.25s; }
.sheet li a:hover { background: var(--paper-2); }
.sheet li a strong { font-size: var(--step-body); font-weight: 620; letter-spacing: -0.01em; }
.sheet li a span { grid-column: 1; color: var(--ink-2); font-size: var(--step-small); }
.sheet li a .arr { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--flush); transition: transform 0.35s var(--ease); }
.sheet li a:hover .arr { transform: translateX(0.4rem); }

.home-find { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 6rem); align-items: start; }
.home-find .intro { position: sticky; top: 2rem; }
.home-find .intro p { max-width: 24rem; }

.faq { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(2rem, 5vw, 6rem); }
.faq-text { columns: 2; column-gap: clamp(2rem, 4vw, 4rem); }
.faq-text p { break-inside: avoid; margin-bottom: 1.2rem; }
.faq-text p b { font-weight: 650; }

.colm .prints { order: -1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(0.75rem, 2vw, 1.5rem); align-items: end; }
.colm .prints figure { margin: 0; overflow: hidden; }
.colm .prints figure:first-child { aspect-ratio: 4 / 5; }
.colm .prints figure:last-child { aspect-ratio: 1 / 1; margin-bottom: clamp(2rem, 6vw, 5rem); }
.colm .prints img { width: 100%; height: 100%; object-fit: cover; max-height: none; }
.colm { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 7rem); align-items: center; }
.colm h2 {  max-width: 14em; margin-bottom: 0.6em; }
.colm p { max-width: 32rem; }
.colm .disclose { color: var(--ink-2); font-size: var(--step-small); max-width: 30rem; }
.colm .actions { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: center; margin-top: 1.8rem; }

/* ---------- footer: the map returns large, cropped; the menu set large ---------- */
.foot { background: var(--night); color: var(--bone); display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); min-height: min(100svh, 52rem); overflow: hidden; }
.foot-map { background: var(--night-2); position: relative; min-height: 22rem; overflow: hidden; }
.foot-map svg { position: absolute; left: 50%; top: 4%; width: 118%; height: auto; transform: translateX(-50%); }
.foot-body { padding: clamp(3rem, 6vw, 5.5rem) var(--gutter) 2rem; display: flex; flex-direction: column; }
.foot-body .mark { color: var(--bone); text-decoration: none; font-weight: 620; font-size: var(--step-ui); letter-spacing: -0.015em; }
.foot-body .mark span { color: var(--heat); }
.foot-menu { list-style: none; padding: 0; margin: clamp(2rem, 6vh, 4rem) 0 0; }
.foot-menu li { margin: 0 0 0.5rem; padding: 0; }
.foot-menu a { text-decoration: none; font-size: var(--step-h2); line-height: 1.12; letter-spacing: -0.02em; font-weight: 540; display: inline-block; transition: transform 0.4s var(--ease); }
.foot-menu:hover a { color: var(--bone-2); }
.foot-menu a:hover, .foot-menu a:focus-visible { color: var(--bone); transform: translateX(0.7rem); }
.foot-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-top: auto; padding-top: 3rem; font-size: var(--step-small); color: var(--bone-2); line-height: 1.55; }
.foot-cols b { color: var(--bone); font-weight: 620; display: block; margin-bottom: 0.2rem; }
.foot-cols a { color: var(--bone); }
.foot-legal { margin-top: 2rem; font-size: var(--step-small); color: var(--bone-2); line-height: 1.55; max-width: 38rem; }
.foot-legal a { color: var(--bone-2); }

/* ---------- the doctor-note tool ---------- */
.tool { background: var(--paper-2); padding: clamp(1.2rem, 3vw, 2.2rem); margin: 2rem calc(var(--gutter) * -0.4) 0; }
.tool fieldset { border: 0; margin: 0 0 2.4rem; padding: 0; min-width: 0; }
.tool legend { padding: 0; font-weight: 650; font-size: var(--step-lead); letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 0.9rem; }
.tool .hint { margin: -0.4rem 0 0.9rem; font-size: var(--step-small); color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: block; padding: 0.7rem 1rem; min-height: 2.9rem; background: var(--paper); color: var(--ink); font-size: var(--step-ui); line-height: 1.3; transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease); }
.chip:hover span { background: var(--sage); }
.chip input:checked + span { background: var(--ink); color: var(--bone); }
.chip input:focus-visible + span { outline: 3px solid var(--flush); outline-offset: 3px; }
.chip input:active + span { transform: scale(0.98); }
.tool select, .tool textarea, .tool input[type='text'] { width: 100%; font: inherit; font-size: var(--step-ui); color: var(--ink); background: var(--paper); border: 0; border-radius: 0; padding: 0.8rem 1rem; min-height: 3rem; }
.tool textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
.tool select:focus-visible, .tool textarea:focus-visible, .tool input[type='text']:focus-visible { outline: 3px solid var(--flush); outline-offset: 2px; }
.tool label.field { display: block; margin-bottom: 1rem; font-weight: 560; }
.tool label.field > span { display: block; margin-bottom: 0.35rem; }
.map-pick { display: grid; place-items: center; background: var(--night); padding: 1rem; margin-bottom: 1rem; }
.map-pick svg { height: min(52svh, 22rem); width: auto; }
.map-pick .z { cursor: pointer; opacity: 0.16; }
.map-pick .z:hover { opacity: 0.5; }
.map-pick .z.on { opacity: 0.96; }
.map-pick .z:focus-visible { outline: 0; outline-offset: 0; opacity: 0.7; stroke: var(--bone); stroke-width: 3; }
.note-out { background: var(--paper); padding: clamp(1.1rem, 2.4vw, 1.8rem); white-space: pre-wrap; font-size: var(--step-ui); line-height: 1.55; min-height: 8rem; margin: 0 0 1rem; font-family: inherit; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; }
.copied { font-size: var(--step-small); color: var(--ink-2); align-self: center; }
.noscript-list { margin-top: 1.5rem; }

/* ---------- motion ---------- */
.js .reveal { opacity: 0; transform: translateY(1.6rem); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .stage-map svg { animation: map-in 1.4s var(--ease) both; }
@keyframes map-in { from { opacity: 0; transform: translateY(1.2rem) scale(0.985); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: scroll()) {
  .stage-title { animation: title-settle linear both; animation-timeline: scroll(root); animation-range: 0 60svh; }
  @keyframes title-settle { to { transform: translateY(1.2rem) scale(0.94); opacity: 0; } }
}
.fig img, .colm img { transition: transform 1.2s var(--ease); }
.fig:hover img, .colm figure:hover img { transform: scale(1.012); }
.fig { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- narrower screens ---------- */
@media (max-width: 62rem) {
  :root { --bar-h: 4rem; }
  .colm .prints { order: 0; }
  .bar { grid-template-columns: 1fr auto; }
  .bar .mark { margin-left: var(--gutter); }
  .bar-right { color: var(--bone); margin-right: var(--gutter); gap: 1rem; }
  .bar-right .btn { display: none; }
  .split { grid-template-columns: 1fr; }
  .stage { position: relative; height: auto; padding: calc(var(--bar-h) + 0.25rem) var(--gutter) 1.4rem; }
  .stage-map { flex: none; }
  .stage-map svg { height: 40svh; width: auto; }
  .stage--sub .stage-map svg { height: 24svh; }
  .stage--sub .stage-legend, .stage--sub .stage-note { display: none; }
  .stage-title { order: 0; font-size: clamp(2.6rem, 12.4vw, 5.5rem); margin-top: 0.8rem; }
  .stage-legend { margin-top: 1rem; }
  .stage--sub .stage-title { display: none; }
  .column > section:first-of-type { padding-top: clamp(2.5rem, 8vw, 4rem); }
  .column > section { padding-block: clamp(3.2rem, 11vw, 5rem); }
  .column > section + section { padding-top: clamp(1.5rem, 6vw, 3rem); }
  .tool { margin-inline: 0; }
  .colm .prints { max-width: 32rem; }
  .sheet { max-width: none; }
  .foot { grid-template-columns: 1fr; }
  .foot-map { min-height: 0; height: 52svh; }
  .foot-map svg { top: 2%; width: 130%; }
  .sheet { padding: 1.4rem 1.2rem; }
  .menu-panel { padding-top: calc(var(--bar-h) + 1rem); }
}
@media (max-width: 47.9375rem) {
  .home-find, .faq, .colm { grid-template-columns: 1fr; }
  .home-find .intro { position: static; }
  .faq-text { columns: 1; }
}
@media (max-width: 40rem) {
  :root { --step-body: 1.0625rem; --step-lead: 1.2rem; }
  body { line-height: 1.6; }
  .foot-cols { grid-template-columns: 1fr; }
  .tbl { font-size: 0.97rem; }
  .tbl th, .tbl td { padding: 0.6rem 0.6rem; }
}

@media print {
  .bar, .stage, .menu-panel, .foot, .tool-actions, .tool, .skip, .band, .btn { display: none !important; }
  .split { display: block; }
  .column { padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .note-out { background: none; padding: 0; }
}
