/* Tell Me — the screen darkens as the questions deepen. Cream, then sage,
   then night. That is the only progress bar it has. */

:root {
  --ui: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: "Bodoni Moda", ui-serif, Didot, Georgia, serif;
  --r: 26px;
}

body[data-depth="1"] { --field: #F3E6D0; --ink: #33291A; --soft: #33291a99; --line: #33291a26; --chip: #33291a12; }
body[data-depth="2"] { --field: #CBDDD4; --ink: #1C3A31; --soft: #1c3a3199; --line: #1c3a3126; --chip: #1c3a3112; }
body[data-depth="3"] { --field: #241E38; --ink: #EFE9F6; --soft: #efe9f6a6; --line: #efe9f629; --chip: #efe9f614; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--ui);
  overscroll-behavior: none;
  transition: background-color .5s ease, color .5s ease;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
}

/* ── intro ────────────────────────────────────────────────────────────── */

.intro { justify-content: center; }
.introinner { width: 100%; max-width: 26rem; margin: 0 auto; }
.intro h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 17vw, 4.6rem);
  line-height: .95;
  letter-spacing: -.02em;
  margin: 0;
}
.intro .line { margin: 20px 0 0; color: var(--soft); font-size: 1rem; line-height: 1.55; }
.intro .ask { margin: 40px 0 12px; font-size: .95rem; font-weight: 600; }

.whos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.who {
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: .95rem; font-weight: 500;
  transition: background .16s ease, border-color .16s ease;
}
.who:hover { background: var(--chip); }
.who.on { background: var(--ink); color: var(--field); border-color: var(--ink); }
.whos.small .who { padding: 11px 10px; font-size: .88rem; }

.go {
  width: 100%;
  margin-top: 22px;
  padding: 17px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--field);
  font-weight: 600; font-size: 1.02rem;
}
.go:disabled { opacity: .25; cursor: default; }
.fine { margin: 18px 0 0; color: var(--soft); font-size: .76rem; line-height: 1.5; opacity: .8; }

/* ── deck ─────────────────────────────────────────────────────────────── */

.deck { max-width: 30rem; margin: 0 auto; width: 100%; }

.top { display: flex; align-items: center; gap: 8px; }
.pill {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .8rem; font-weight: 500;
}
.pill.flat { border-color: transparent; background: var(--chip); }
.icon {
  margin-left: auto;
  width: 38px; height: 38px;
  border-radius: 999px;
  font-size: 1.15rem; line-height: 1;
}
.icon:hover { background: var(--chip); }

/* The card slides right off the edge when it is dealt. Without clipping here
   that transform widens the document and a phone zooms the whole layout out. */
.stage { flex: 1; position: relative; display: flex; padding: 16px 0 10px; overflow: hidden; }

.card {
  position: relative;
  flex: 1;
  display: flex; align-items: center;
  padding: 30px 26px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--chip);
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  will-change: transform;
}
.card:active { cursor: grabbing; }
.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.card.behind {
  position: absolute; inset: 16px 0 10px;
  transform: rotate(-1.6deg) scale(.985);
  opacity: .45;
  z-index: -1;
  background: none;
}

.q {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 6.8vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.foot { display: flex; align-items: center; gap: 10px; }
.icon.big {
  margin: 0;
  width: 54px; height: 54px; flex: none;
  border: 1px solid var(--line);
  font-size: 1.1rem;
}
.icon.big:disabled { opacity: .3; cursor: default; }
.keep {
  flex: 1;
  padding: 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 600; font-size: .96rem;
  color: var(--soft);
  transition: background .16s ease, color .16s ease;
}
.keep:hover { background: var(--chip); color: var(--ink); }
.keep.on { background: var(--ink); color: var(--field); border-color: var(--ink); }

.hint { margin: 12px 0 0; text-align: center; color: var(--soft); font-size: .76rem; opacity: .75; }

/* ── the sheet ────────────────────────────────────────────────────────── */

.sheetwrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; }
.scrim { position: absolute; inset: 0; z-index: 0; background: #0006; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }

.sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--field);
  color: var(--ink);
  animation: up .26s cubic-bezier(.2,.85,.3,1) both;
}
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
.grab { width: 38px; height: 4px; border-radius: 999px; background: var(--line); margin: 0 auto 16px; }

.sheet h2 { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--soft); margin: 22px 0 9px; }
.sheet h2:first-of-type { margin-top: 4px; }

.depths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.depth {
  padding: 11px 8px;
  border-radius: 13px;
  border: 1px solid var(--line);
  text-align: center;
}
.depth b { display: block; font-size: .9rem; font-weight: 600; }
.depth i { display: block; margin-top: 2px; font-style: normal; font-size: .7rem; color: var(--soft); }
.depth.on { background: var(--ink); color: var(--field); border-color: var(--ink); }
.depth.on i { color: var(--field); opacity: .7; }
.depth:disabled { opacity: .35; cursor: default; }

.switch { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .92rem; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--ink); }
.note { margin: 10px 0 0; color: var(--soft); font-size: .8rem; }

.keptlist { list-style: none; padding: 0; margin: 0; }
.keptlist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem; line-height: 1.4;
}
.keptlist li:last-child { border-bottom: 0; }
.keptlist .empty { color: var(--soft); border-bottom: 0; }
.keptlist .x { flex: none; color: var(--soft); font-size: 1.1rem; line-height: 1; padding: 0 2px; }
.keptlist .x:hover { color: var(--ink); }

.sheetrow { display: flex; gap: 8px; margin-top: 14px; }
.ghost {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: .86rem; font-weight: 500;
}
.ghost:hover { background: var(--chip); }
.close {
  width: 100%;
  margin-top: 10px;
  padding: 15px;
  border-radius: 14px;
  background: var(--ink); color: var(--field);
  font-weight: 600;
}
.sheet .fine { text-align: center; }
.sheet .fine a { text-decoration: underline; text-underline-offset: 3px; }

/* ── toast ────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; left: 50%; top: calc(62px + env(safe-area-inset-top));
  transform: translateX(-50%);
  padding: 10px 17px;
  border-radius: 999px;
  background: var(--ink); color: var(--field);
  font-size: .85rem; font-weight: 600;
  z-index: 30;
  animation: drop .22s ease both;
  box-shadow: 0 12px 34px -14px #0008;
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (min-width: 640px) {
  .stage { padding-top: 24px; }
  .card { padding: 44px 40px; }
}
