/* 12 Butterflies test site. Warm white ground, the twelve hues of the mark, a warm cursive serif served from our own files.
   Mobile first; light and dark. */
@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
:root {
  --paper: #FDFBF7; --ink: #111111; --muted: #6B655C; --line: #E7E0D4; --soft: #F4EFE6; --card: #FFFFFF;
  --h01: #F08944; --h02: #EAC820; --h03: #8CC63F; --h04: #87CA45; --h05: #83CABB; --h06: #68A3D4;
  --h07: #6F9ED6; --h08: #58387C; --h09: #AC47B9; --h10: #C756C1; --h11: #ED6A78; --h12: #F0523D;
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Gill Sans", Seravek, "Segoe UI", Candara, system-ui, sans-serif;
  --soft-serif: normal;
  --k08: #58387C;   /* the indigo as a text colour; lifted in the dark so it still reads */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #15120F; --ink: #F4EFE6; --muted: #A69D90; --line: #2E2823; --soft: #1E1A16; --card: #1B1713; --k08: #B08BD6; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
[hidden] { display: none !important; }
button { font: inherit; }
.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; }
em.k { font-style: italic; color: var(--k, var(--ink)); }

/* the top bar */
.top { position: fixed; inset: 0 0 auto 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: calc(0.9rem + env(safe-area-inset-top, 0px)) 1.25rem 0.9rem; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .top { mix-blend-mode: normal; } .top .mark img { filter: invert(1) hue-rotate(180deg); } }
.top .mark img { display: block; width: 150px; height: auto; }
.top .enter { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
.top .enter:hover { color: var(--ink); }

/* 1. the living butterfly */
.hero { height: 200vh; position: relative; }
.hero-stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#wing { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-copy { position: absolute; left: 1.25rem; right: 1.25rem; bottom: calc(2rem + env(safe-area-inset-bottom, 0px)); max-width: 30rem; }
.hero-copy .catch { font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: 1.02; margin: 0 0 0.8rem; letter-spacing: -0.015em; }
.hero-copy .welcome { margin: 0; font-size: 1rem; color: var(--muted); }
.hero-copy .cue { margin: 1.4rem 0 0; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hero.still #wing { display: none; }
.hero.still .fallback { display: block; position: absolute; inset: 0; display: grid; place-items: center; padding: 2rem; }
.hero.still .fallback img { width: min(80vw, 34rem); }
.fallback { display: none; }
@media (min-width: 760px) { .hero-copy { left: 4rem; bottom: 4rem; } .top { padding-inline: 4rem; } .top .mark img { width: 170px; } }

/* 2. the story, one line per screen, read in word by word as you scroll */
.story { position: relative; z-index: 1; background: var(--paper); }
.line { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 3rem 1.25rem; }
.line p { font-family: var(--serif); font-weight: 400; font-size: clamp(2.1rem, 5.4vw, 4.2rem); line-height: 1.12; max-width: 20ch; margin: 0; text-align: center; text-wrap: balance; letter-spacing: -0.01em; }
.line p span { opacity: 0.13; transition: opacity 0.6s ease; }
.line p span.lit { opacity: 1; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.1s ease, transform 1.1s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .line p span { opacity: 1; transition: none; } }

/* the Treasury of Truth, moving */
.treasury { min-height: 100vh; min-height: 100svh; display: grid; align-content: center; gap: 1.5rem; padding: 4rem 1.25rem; }
.treasury .frame { position: relative; max-width: 34rem; margin-inline: auto; width: 100%; }
.treasury svg { width: 100%; height: auto; display: block; }
.treasury .q { position: absolute; left: 50%; top: 0; width: 18ch; transform: translate(-50%, 0); font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 3.4vw, 1.7rem); line-height: 1.25; text-align: center; margin: 0; transition: transform 1.3s cubic-bezier(.6,0,.3,1), opacity 1.3s ease; }
.treasury.play .q { transform: translate(-50%, 1000%) scale(0.06); opacity: 0; }
.treasury .core, .treasury .ripple { transform-box: fill-box; transform-origin: center; transform: scale(0); }
.treasury.play .core { transform: scale(1); transition: transform 0.6s cubic-bezier(.2,1.4,.4,1) 1.25s; }
.treasury.play .ripple { animation: ripple 2.8s ease-out 1.3s forwards; }
@keyframes ripple { 0% { transform: scale(0); opacity: 0.9; } 100% { transform: scale(1); opacity: 0; } }
.treasury .layer { opacity: 0; transition: opacity 0.9s ease; }
.treasury.play .layer { opacity: 1; }
.treasury .layer.l0 { transition-delay: 1.5s; } .treasury .layer.l1 { transition-delay: 2.05s; } .treasury .layer.l2 { transition-delay: 2.6s; }
.treasury .layer.l3 { transition-delay: 3.15s; } .treasury .layer.l4 { transition-delay: 3.7s; }
.treasury ol.layers { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.4rem; max-width: 40rem; }
.treasury ol.layers li { font-size: 0.95rem; color: var(--muted); opacity: 0.25; transition: opacity 0.6s ease, color 0.6s ease; }
.treasury.play ol.layers li { opacity: 1; color: var(--ink); }
.treasury.play ol.layers li:nth-child(1) { transition-delay: 1.5s; } .treasury.play ol.layers li:nth-child(2) { transition-delay: 2.05s; }
.treasury.play ol.layers li:nth-child(3) { transition-delay: 2.6s; } .treasury.play ol.layers li:nth-child(4) { transition-delay: 3.15s; } .treasury.play ol.layers li:nth-child(5) { transition-delay: 3.7s; }
.treasury .after { text-align: center; max-width: 36rem; margin: 0 auto; opacity: 0; transition: opacity 1s ease 4.4s; }
.treasury.play .after { opacity: 1; }
.treasury .after p { margin: 0.4rem 0; }
.treasury .after .big { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 3vw, 1.75rem); }
.treasury .after .fine { color: var(--muted); font-size: 0.95rem; }
.treasury .replay { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.9rem; color: var(--muted); cursor: pointer; font-size: 0.8rem; margin-top: 0.6rem; }
@media (prefers-reduced-motion: reduce) {
  .treasury .q { display: none; } .treasury .core, .treasury .layer { transform: none; opacity: 1; transition: none; } .treasury .ripple { display: none; }
  .treasury ol.layers li, .treasury .after { opacity: 1; color: var(--ink); transition: none; } .treasury .replay { display: none; }
}

/* 3. the twelve verticals, a kaleidoscope you can turn, each one a room you can enter */
.verticals { padding: 5rem 1.25rem; background: var(--soft); }
.verticals h2, .door h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.12; margin: 0 0 0.5rem; }
.verticals .sub, .door .sub { color: var(--muted); margin: 0 0 2rem; max-width: 42rem; }
.kal { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .kal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; } }
.wheel { position: relative; width: min(100%, 26rem); margin-inline: auto; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.wheel svg { width: 100%; height: auto; display: block; cursor: grab; }
.wheel.dragging svg { cursor: grabbing; }
.wheel g.disc { transform-origin: 200px 200px; transform-box: view-box; }
.wheel.snap g.disc { transition: transform 0.55s cubic-bezier(.3,.7,.2,1); }
.wheel path.wedge { opacity: 0.5; transition: opacity 0.4s ease; cursor: pointer; }
.wheel path.wedge.on { opacity: 1; }
.wheel .pointer { position: absolute; top: -0.2rem; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 12px solid var(--ink); }
.wheel .nav { display: flex; justify-content: center; gap: 0.6rem; margin-top: 1rem; }
.wheel .nav button { background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; width: 2.6rem; height: 2.6rem; cursor: pointer; font-size: 1.1rem; }
.wheel .hint { text-align: center; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0.8rem 0 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--hue, var(--h01)); border-radius: 18px; padding: 1.6rem 1.5rem 1.8rem; min-height: 22rem; }
.badge { display: inline-block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem; margin-bottom: 0.9rem; }
.panel h3 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.18; margin: 0 0 0.6rem; }
.panel .num { margin: -0.2rem 0 0.6rem; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hue, var(--muted)); }
.panel .line-p { margin: 0 0 1rem; color: var(--muted); }
.panel dt { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 1rem; }
.panel dd { margin: 0.25rem 0 0; }
.panel dd.problem { font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.3; }
.panel .areas { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.panel .chip { border: 1.5px solid var(--line); border-radius: 999px; padding: 0.3rem 0.75rem; font-size: 0.9rem; }
.panel .open-room { margin-top: 1.4rem; }

/* a vertical's room */
.room { position: fixed; inset: 0; z-index: 20; background: var(--paper); overflow-y: auto; padding: calc(4.5rem + env(safe-area-inset-top, 0px)) 1.25rem calc(3rem + env(safe-area-inset-bottom, 0px)); }
.room .close { position: fixed; top: calc(0.8rem + env(safe-area-inset-top, 0px)); right: 1.25rem; z-index: 21; width: 2.8rem; height: 2.8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 1.4rem; cursor: pointer; }
.room .inner { width: min(100%, 44rem); margin-inline: auto; border-top: 6px solid var(--hue, var(--h01)); padding-top: 1.4rem; }
.room h2 { font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.08; margin: 0 0 0.6rem; }
.room .line-p { color: var(--muted); font-size: 1.1rem; margin: 0 0 1.5rem; }
.room section { margin-top: 2.2rem; }
.room h3 { font-family: var(--sans); font-variation-settings: normal; font-weight: 600; font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.room .q { font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 3.6vw, 2.3rem); line-height: 1.22; margin: 0; }
.room p { margin: 0.5rem 0; }
.room .who { display: grid; gap: 1.2rem; align-items: center; }
@media (min-width: 700px) { .room .who { grid-template-columns: 14rem 1fr; } }
.room .who svg { width: 100%; max-width: 14rem; height: auto; display: block; margin-inline: auto; }
.room .ring-q { display: grid; gap: 1rem; }
.room .ring-q svg { width: min(100%, 24rem); height: auto; display: block; margin-inline: auto; }
.room .ring-q circle.node { cursor: pointer; transition: r 0.2s ease; }
.room .ring-q circle.node.on { stroke: var(--ink); stroke-width: 3; }
.room .ring-q .picked { font-family: var(--serif); font-style: italic; font-size: 1.25rem; line-height: 1.3; text-align: center; min-height: 3.5em; margin: 0; }
.room .row { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }

/* 4. the door */
.door { padding: 5rem 1.25rem 4rem; }
.door .count { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 8vw, 5.4rem); line-height: 1; margin: 0; letter-spacing: -0.02em; }
.door .count-line { margin: 0.4rem 0 2.2rem; color: var(--muted); }
.door .two { display: grid; gap: 1.2rem; }
@media (min-width: 760px) { .door .two { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem 1.5rem; }
.card h3 { font-size: 1.6rem; margin: 0 0 0.4rem; }
.card p { margin: 0 0 1rem; color: var(--muted); }
.card .asking { color: var(--ink); background: var(--soft); border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.95rem; }
.card .asking button { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; margin-left: 0.4rem; }
.card label { display: block; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0.9rem 0 0.3rem; }
.card input, .card textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.85rem; }
.card input:focus, .card textarea:focus { outline: 2px solid var(--h06); outline-offset: 1px; }
.card .code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.18em; text-transform: uppercase; font-size: 1.15rem; }
.btn { display: inline-block; margin-top: 1.1rem; background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 0.8rem 1.4rem; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: wait; }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.msg { margin-top: 0.8rem; font-size: 0.95rem; min-height: 1.4em; }
.msg.bad { color: var(--h12); }
.msg.good { color: var(--h04); }
.truths { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; gap: 0.8rem; max-width: 42rem; }
.truths li { padding-left: 1.3rem; position: relative; }
.truths li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--h05); }
.truths li:nth-child(2)::before { background: var(--h01); } .truths li:nth-child(3)::before { background: var(--h08); }
.truths li:nth-child(4)::before { background: var(--h11); } .truths li:nth-child(5)::before { background: var(--h03); }

/* the butterfly flies across the screen at the end */
.flight { position: relative; height: 72vh; min-height: 24rem; overflow: hidden; background: var(--paper); }
#wing2 { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fly-line { position: absolute; left: 50%; bottom: 2.5rem; transform: translateX(-50%); margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 3.2vw, 2.2rem); color: var(--muted); white-space: nowrap; }
footer { padding: 2rem 1.25rem calc(2.5rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }
footer p { margin: 0; }

/* 5. the metamorphosis (apply.html) */
.apply { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr; }
.stages { display: flex; justify-content: center; gap: 1.2rem; padding: calc(4.2rem + env(safe-area-inset-top, 0px)) 1rem 0.5rem; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stages span { opacity: 0.4; } .stages span.on { opacity: 1; color: var(--ink); }
.stages span.done { opacity: 0.75; }
.meta { display: grid; gap: 1rem; padding: 0.5rem 1.25rem 2rem; align-content: start; }
@media (min-width: 860px) { .meta { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; align-items: center; width: min(100% - 2.5rem, 68rem); margin-inline: auto; } }
#creature { width: 100%; height: 200px; display: block; }
@media (min-width: 860px) { #creature { height: 460px; } }
.screen { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem 1.5rem 1.8rem; }
.screen .stage { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.screen h2 { font-size: clamp(1.45rem, 3.2vw, 2rem); line-height: 1.22; margin: 0 0 0.6rem; }
.screen .help { color: var(--muted); margin: 0 0 1rem; }
.screen input[type=text], .screen input[type=email], .screen textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.9rem; }
.screen textarea { min-height: 7rem; resize: vertical; }
.screen input:focus, .screen textarea:focus { outline: 2px solid var(--h06); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips label { border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer; background: var(--paper); }
.chips label:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips input { position: absolute; opacity: 0; width: 0; height: 0; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; margin-top: 0.4rem; }
.scale label { text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 0; cursor: pointer; background: var(--paper); font-family: var(--serif); font-size: 1.2rem; }
.scale label:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.scale input { position: absolute; opacity: 0; width: 0; height: 0; }
.scale-ends { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }
.screen .row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.2rem; }
.screen .row .skip, .screen .row .back { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0.6rem; }
.screen .count-q { color: var(--muted); font-size: 0.8rem; margin-left: auto; }
.final h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.final p { margin: 0.5rem 0; }
.final .big { font-family: var(--serif); font-style: italic; font-size: 1.3rem; }

/* reading the answers back before sending */
.review { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.review summary { cursor: pointer; color: var(--muted); }
.review dl { margin: 0.8rem 0 0; display: grid; gap: 0.2rem 1rem; font-size: 0.92rem; }
.review dt { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; margin-top: 0.6rem; }
.review dd { margin: 0; }
.screen .kept { background: var(--soft); border-radius: 10px; padding: 0.6rem 0.8rem; color: var(--ink); }
