/* AUTOGRAPH quiz v3.2 — a consultation card, not an app.
   Type: Switzer (questions, large and tight), Courier Prime (the typed label, like a made-to-order bottle label),
   Noto Nastaliq Urdu (room names). Grid: 20px gutters, 4px baseline steps.
   The person's room arrives through --accent, --paper, --tempo, --lead (set in app.js). */
:root {
  --paper: #F7F4EF;
  --card: #FFFDF9;
  --ink: #141210;
  --ink2: #6A635B;
  --ink3: #A39B91;
  --line: rgba(20, 18, 16, .12);
  --line2: rgba(20, 18, 16, .22);
  --accent: #6B2430;
  --tempo: 520ms;
  --lead: 0px;
  --sans: 'Switzer', 'Helvetica Neue', Arial, sans-serif;
  --type: 'Courier Prime', 'Courier New', monospace;
  --nastaliq: 'Noto Nastaliq Urdu', serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
}
* { box-sizing: border-box; }
html { background: #2e1316 url('img/texture-shawl.jpg') center / cover fixed; }
body { margin: 0; color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: 'ss01', 'tnum' 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--paper); }

/* the sheet */
.sheet { position: relative; display: flex; flex-direction: column; margin: 8px; min-height: calc(100svh - 50px);
  background: var(--paper); border-radius: 6px; overflow: clip; transition: background-color calc(var(--tempo) * 3) ease;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
@media (min-width: 720px) { .sheet { max-width: 600px; margin: 40px auto 10px; min-height: calc(100svh - 100px); } }

/* header: back · wordmark · folio, on one line */
.head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 56px; padding: 0 12px; }
.back { width: 40px; height: 40px; border: 0; background: none; font: 400 20px var(--sans); color: var(--ink); border-radius: 50%; }
.back:hover { background: var(--line); }
.back[hidden] { visibility: hidden; display: block; }
.wordmark { justify-self: center; display: flex; align-items: baseline; gap: 6px; text-decoration: none; font: 500 19px/1 var(--sans); letter-spacing: -.035em; }
.wordmark span { font: italic 400 12px var(--type); letter-spacing: 0; color: var(--ink2); }
.folio { justify-self: end; font: 400 12px var(--type); color: var(--ink2); font-variant-numeric: tabular-nums; }

/* named sections, each with its own fill: You / Smell / Wear */
.sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 20px; }
.sections[hidden] { display: none; }
.sec { font: 500 10.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink3); padding-bottom: 8px; position: relative; }
.sec.on, .sec.done { color: var(--ink); }
.sec::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--line); }
.sec i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); z-index: 1; transition: width var(--tempo) var(--ease), background-color var(--tempo); }

main { flex: 1; padding: 0 20px 28px; }
main > section { animation: rise var(--tempo) var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* question */
.meta { display: flex; justify-content: space-between; align-items: baseline; margin: 30px 0 14px; font: 400 12px var(--type); color: var(--ink2); }
.meta b { font-weight: 400; color: var(--accent); }
.ask { font: 400 calc(clamp(30px, 8.6vw, 44px) * var(--qscale, 1))/1.04 var(--sans); letter-spacing: -.038em; margin: 0; text-wrap: balance; transition: font-size var(--tempo) var(--ease); }
.ask em { font-style: normal; color: var(--accent); }
.aside { font: 400 15px/1.45 var(--sans); color: var(--ink2); margin: 12px 0 0; max-width: 34ch; text-wrap: pretty; }
.small { font: 400 13px/1.5 var(--sans); color: var(--ink2); }
p { margin: 0 0 12px; }

/* answers: lettered rows; the chosen one inverts */
.answers { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 8px; }
.ans { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left; min-height: 58px;
  padding: 13px 16px 13px 14px; border: 1px solid var(--line2); border-radius: 4px; background: var(--card);
  font: 400 17px/1.3 var(--sans); letter-spacing: -.01em; transition: background-color 180ms, color 180ms, border-color 180ms, transform 120ms; }
.ans:active { transform: scale(.985); }
.ans .key { font: 400 12px var(--type); color: var(--ink3); text-transform: uppercase; }
.ans small { display: block; font: 400 13px/1.4 var(--sans); color: var(--ink2); margin-top: 3px; letter-spacing: 0; }
.ans .hint { font: italic 400 12px var(--type); color: var(--accent); white-space: nowrap; }
.ans .mark { width: 16px; height: 16px; border: 1px solid var(--line2); border-radius: 50%; }
.multi .ans .mark { border-radius: 3px; }
.ans.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ans.on .key, .ans.on small { color: rgba(247,244,239,.6); }
.ans.on .hint { color: var(--paper); }
.ans.on .mark { background: var(--accent); border-color: var(--paper); box-shadow: inset 0 0 0 3px var(--ink); }
@media (hover: hover) { .ans:hover:not(.on) { border-color: var(--ink); } }

/* smell families: a card per family, two choices inside */
.fams { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 8px; }
.fams li { background: var(--card); border: 1px solid var(--line2); border-radius: 4px; padding: 14px 14px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.fams li.love { border-color: var(--ink); }
.fams li.no { background: transparent; }
.fams li.no b, .fams li.no i { color: var(--ink3); text-decoration: line-through; text-decoration-thickness: 1px; }
.fams b { font: 500 17px/1.2 var(--sans); letter-spacing: -.015em; }
.fams i { grid-column: 1; font: italic 400 12.5px/1.4 var(--type); color: var(--ink2); }
.two { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.pick { border: 1px solid var(--line2); background: none; border-radius: 999px; padding: 8px 12px; font: 500 12.5px var(--sans); color: var(--ink2); }
.pick.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pick.no.on { background: var(--ink2); border-color: var(--ink2); }
.fam-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; transform: translateY(-1px); }

/* memories */
.tabs { display: flex; gap: 6px; margin: 22px 0 0; overflow-x: auto; scrollbar-width: none; }
.tab { border: 1px solid var(--line2); background: none; border-radius: 999px; padding: 8px 14px; font: 500 13px var(--sans); color: var(--ink2); white-space: nowrap; }
.tab.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.more { background: none; border: 0; padding: 14px 0 0; font: 400 13px var(--type); color: var(--ink2); text-decoration: underline; text-underline-offset: 4px; }

/* writing */
.write-label { display: block; font: 400 12px var(--type); color: var(--ink2); margin: 24px 0 6px; }
.write { width: 100%; border: 1px solid var(--line2); background: var(--card); border-radius: 4px; font: 400 17px var(--sans); padding: 14px; color: var(--ink); outline: none; transition: border-color 160ms; }
.write:focus { border-color: var(--ink); }
.write::placeholder { color: var(--ink3); }
.write.big { font-size: 26px; letter-spacing: -.03em; padding: 16px; }
select.write { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.write { resize: vertical; }

/* dials */
.dial { margin: 22px 0 0; background: var(--card); border: 1px solid var(--line2); border-radius: 4px; padding: 16px 16px 12px; }
.dial label { display: block; font: 500 17px/1.25 var(--sans); letter-spacing: -.015em; margin-bottom: 10px; }
.dial input { width: 100%; -webkit-appearance: none; appearance: none; background: transparent; height: 30px; }
.dial input::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--ink) 0 2px, transparent 2px) 0 0 / 25% 2px, var(--line2); }
.dial input::-moz-range-track { height: 2px; background: var(--line2); }
.dial input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); margin-top: -11px; border: 4px solid var(--card); box-shadow: 0 0 0 1px var(--ink); }
.dial input::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 3px solid var(--card); }
.ends { display: flex; justify-content: space-between; font: 400 12px var(--type); color: var(--ink2); }

/* moving on */
.navrow { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 22px; }
.go { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 24px; border: 0; border-radius: 4px; background: var(--ink); color: var(--paper);
  font: 500 16px var(--sans); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; transition: background-color 160ms, opacity 160ms; }
.go::after { content: '→'; font-weight: 400; transition: transform var(--tempo) var(--ease); }
.go:hover::after { transform: translateX(3px); }
.go:disabled { opacity: .25; cursor: default; }
.go.wide { width: 100%; }
.go.solid { background: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.link { background: none; border: 0; padding: 10px 0; font: 400 13px var(--type); color: var(--ink2); text-decoration: underline; text-underline-offset: 4px; }

/* welcome */
.welcome { padding-top: 10px; }
.hero { font: 400 clamp(54px, 15.5vw, 92px)/.9 var(--sans); letter-spacing: -.058em; margin: 18px 0 0; }
.hero span { display: block; text-align: right; }
.photo { position: relative; margin: 22px -20px 0; }
.photo img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; filter: saturate(.9) contrast(1.03); }
.photo figcaption { position: absolute; left: 20px; bottom: 14px; font: italic 400 12px var(--type); color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.cols p { font: 400 14px/1.45 var(--sans); color: var(--ink2); margin: 0; }
.cols p b { display: block; font: 400 12px var(--type); color: var(--ink); margin-bottom: 4px; }
.lede { font: 400 20px/1.3 var(--sans); letter-spacing: -.02em; margin: 20px 0 0; }

/* part openers */
.opener .num { font: 400 13px var(--type); color: var(--accent); margin: 34px 0 10px; }
.opener h2 { font: 400 clamp(48px, 14vw, 80px)/.92 var(--sans); letter-spacing: -.055em; margin: 0; }
.opener ul { list-style: none; padding: 0; margin: 26px 0 0; border-top: 1px solid var(--line2); }
.opener li { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font: 400 15px var(--sans); }
.opener li span { font: 400 12px var(--type); color: var(--ink2); }

/* the label: a typed, made-to-order bottle label that fills in as you answer */
.label { position: sticky; bottom: 0; z-index: 3; margin: 0 12px 12px; background: var(--card); border: 1px solid var(--line2); border-radius: 4px;
  box-shadow: 0 -10px 30px -18px rgba(20,18,16,.35); font: 400 12px/1.5 var(--type); color: var(--ink); cursor: pointer; }
.label[hidden] { display: none; }
.label .strip { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; }
.label .no { color: var(--accent); }
.label .sum { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink2); }
.label .tog { color: var(--ink3); }
.label dl { display: none; margin: 0; padding: 4px 12px 12px; border-top: 1px dashed var(--line2); }
.label.open dl { display: block; }
.label dl div { display: grid; grid-template-columns: 84px 1fr; gap: 8px; padding: 3px 0; }
.label dt { color: var(--ink3); }
.label dd { margin: 0; }
.typed { animation: type 700ms steps(24) both; }
@keyframes type { from { clip-path: inset(0 100% 0 0); } }

/* the reveal: the label, set large */
.reveal .meta { margin-top: 22px; }
.room-name { font: 400 clamp(64px, 19vw, 120px)/.86 var(--sans); letter-spacing: -.06em; margin: 0 0 0 -3px; overflow-wrap: anywhere; }
.nastaliq { font: 400 clamp(32px, 9.5vw, 48px)/2.1 var(--nastaliq); text-align: right; direction: rtl; color: var(--accent); margin: -2px 0 -14px; }
.pron { font: 400 12px var(--type); color: var(--ink2); }
.line { font: 400 22px/1.25 var(--sans); letter-spacing: -.02em; margin: 14px 0 8px; }
.ticket { margin: 22px 0 0; background: var(--card); border: 1px solid var(--line2); border-radius: 4px; font: 400 12.5px/1.6 var(--type); }
.ticket > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 14px; border-bottom: 1px dashed var(--line2); }
.ticket > div:last-child { border-bottom: 0; }
.ticket dt { color: var(--ink3); }
.ticket dd { margin: 0; }
.card { margin: 26px 0 0; }
.card svg { width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 22px 40px -26px rgba(0,0,0,.65); }
.chapter { margin-top: 44px; }
.chapter > h3 { font: 500 10.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink2); margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; }
.chapter > h3 span { font: 400 12px var(--type); letter-spacing: 0; text-transform: none; color: var(--ink3); }
.rows { margin: 0; }
.rows > div { display: grid; grid-template-columns: 30% 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rows dt { font: 400 12px/1.5 var(--type); color: var(--ink2); padding-top: 2px; }
.rows dd { margin: 0; font: 400 16px/1.45 var(--sans); letter-spacing: -.01em; }
.note { margin-bottom: 12px; }
.note:last-child { margin-bottom: 0; }
.note b { font-weight: 500; }
.note .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; transform: translateY(-1px); }
.note .because { display: block; font: 400 12px/1.5 var(--type); color: var(--ink2); margin-top: 3px; }
.temper { font: 400 clamp(46px, 13.5vw, 80px)/.92 var(--sans); letter-spacing: -.055em; margin: 6px 0 12px; }
.bridge { font: 400 21px/1.3 var(--sans); letter-spacing: -.02em; border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; margin: 22px 0; }
.price { font: 400 48px/1 var(--sans); letter-spacing: -.05em; margin: 4px 0 10px; }
pre.msg { white-space: pre-wrap; word-break: break-all; font: 400 12px/1.5 var(--type); color: var(--ink2); background: var(--card); border: 1px solid var(--line2); border-radius: 4px; padding: 12px; margin-top: 18px; }

.outside { text-align: center; font: 400 12px var(--type); color: rgba(255,245,235,.72); margin: 0 0 16px; }
.outside a { color: inherit; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--paper); font: 400 13px var(--sans); padding: 10px 14px; border-radius: 4px; z-index: 9; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.kicker { font: 400 12px/1.4 var(--type); color: var(--ink2); margin: 0 0 10px; }

/* ---------- home: one screen, the whole pitch (v4.2) ----------
   Rule: text sits on a photograph only over a dark gradient that guarantees contrast. */
.hhome { position: relative; margin: 0 -20px; height: calc(100svh - 128px); min-height: 520px; max-height: 860px; overflow: hidden; border-radius: 0 0 4px 4px; color: #fff; }
.hhome img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; filter: saturate(.9) contrast(1.03); }
.hhome::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(12, 10, 8, .9) 0%, rgba(12, 10, 8, .72) 34%, rgba(12, 10, 8, .18) 62%, rgba(12, 10, 8, 0) 78%); }
.hhome .in { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 20px 22px; }
.hhome h1 { font: 400 clamp(46px, 13.2vw, 76px)/.92 var(--sans); letter-spacing: -.055em; margin: 0; color: #fff; text-wrap: balance; }
.hhome .sub { font: 400 16px/1.4 var(--sans); color: rgba(255, 255, 255, .88); margin: 14px 0 0; max-width: 34ch; }
.hhome .cta { display: flex; width: 100%; justify-content: center; align-items: center; gap: 10px; min-height: 56px; margin-top: 20px; border: 0; border-radius: 4px; background: #F7F4EF; color: #141210; font: 500 17px var(--sans); }
.hhome .cta::after { content: '→'; }
.hhome .facts { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font: 400 12px/1.4 var(--type); color: rgba(255, 255, 255, .78); }
.hhome .again { background: none; border: 0; padding: 0; font: 400 12px var(--type); color: rgba(255, 255, 255, .78); text-decoration: underline; text-underline-offset: 3px; }
body.home-on .imprint, body.home-on #label { display: none; }
@media (min-width: 720px) { .hhome { margin: 0 -20px; } }
