/* ————————————————————————————————————————————————————————————————————————
   Doppl coming-soon — letterpress on warm paper.
   Palette + type lifted from the first-round pitch deck:
   paper #FAF7F1 · ink #211B15 · taupe #6E645A · sienna #B4512E
   Serif display (Fraunces) · mono labels (Courier Prime)
   ———————————————————————————————————————————————————————————————————————— */

:root {
  --paper: #faf7f1;
  --paper-2: #f4eee5;
  --paper-3: #ede6da;
  --edge: #e4dcd0;
  --ink: #211b15;
  --ink-2: #3d362e;
  --taupe: #6e645a;
  --stone: #a99e90;
  --sienna: #b4512e;
  --sienna-deep: #a8412c;
  --apricot: #d98e63;
  --white: #fffdf9;

  --serif: "Fraunces", Georgia, serif;
  --mono: "Courier Prime", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100svh; }

::selection { background: var(--sienna); color: var(--paper); }

/* ————— atmosphere ————— */

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.5 0 0 0 0 0.44 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.watermark {
  position: fixed;
  right: 0.02em;
  bottom: -0.12em;
  z-index: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22rem, 46vw, 44rem);
  line-height: 1;
  color: var(--edge);
  pointer-events: none;
  user-select: none;
}

/* ————— shell ————— */

.shell {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 5vw, 2rem) 4rem;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--edge);
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

.badge,
.fine,
.flow-step,
.field-label,
.linkish,
.foot,
.fatal-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.badge { color: var(--taupe); }

/* ————— reveal choreography ————— */

.reveal {
  opacity: 0;
  transform: translateY(0.6rem);
  animation: rise 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  animation-delay: calc(var(--d) * 130ms);
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
}

/* ————— hero ————— */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 9vh, 6rem) 0 2rem;
}

.tagline {
  font-family: var(--serif);
  font-weight: 340;
  font-style: italic;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2.7rem, 8.4vw, 5.4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 11em;
}

.tagline span { display: inline-block; }

.tagline .ellipsis {
  color: var(--sienna);
  margin-right: 0.06em;
}

.tagline em {
  font-style: italic;
  color: var(--sienna);
}

.whisper {
  margin-top: 1.6rem;
  font-style: italic;
  font-weight: 350;
  font-size: 1.08rem;
  color: var(--taupe);
  letter-spacing: 0.005em;
}

.hero-cta { margin-top: 2.6rem; }

.fine {
  margin-top: 0.85rem;
  color: var(--stone);
  letter-spacing: 0.12em;
  line-height: 1.7;
  max-width: 34rem;
}

/* ————— buttons ————— */

.btn {
  appearance: none;
  display: inline-block;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 1.6rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease,
    box-shadow 0.18s ease;
}

.btn-ink:hover,
.btn-ink:focus-visible {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -14px rgba(33, 27, 21, 0.55);
}

.btn-sienna {
  border-color: var(--sienna);
  background: var(--sienna);
  color: var(--paper);
}

.btn-sienna:hover,
.btn-sienna:focus-visible {
  background: var(--sienna-deep);
  border-color: var(--sienna-deep);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -14px rgba(180, 81, 46, 0.65);
}

.btn:disabled { opacity: 0.5; cursor: wait; transform: none; }

.linkish {
  appearance: none;
  border: none;
  background: none;
  color: var(--taupe);
  cursor: pointer;
  margin-top: 2rem;
  padding: 0.25rem 0;
  align-self: flex-start;
  text-align: left;
}

.linkish:hover { color: var(--sienna); }

/* ————— question flow ————— */

.flow {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 8vh, 5rem) 0 2rem;
  animation: rise 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.flow-head {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 2.2rem;
}

.flow-step { color: var(--sienna); }

.flow-rule {
  display: block;
  height: 1px;
  background: var(--edge);
  position: relative;
  overflow: hidden;
}

.flow-fill {
  position: absolute;
  inset: 0;
  background: var(--sienna);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.question {
  font-family: var(--serif);
  font-weight: 420;
  font-variation-settings: "opsz" 90;
  font-size: clamp(1.7rem, 4.6vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 18em;
}

.options {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option {
  appearance: none;
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--edge);
  background: var(--white);
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 380;
  color: var(--ink-2);
  transition: border-color 0.15s ease, background 0.15s ease,
    color 0.15s ease, transform 0.15s ease;
}

.option .key {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--stone);
  transition: color 0.15s ease;
}

.option:hover,
.option:focus-visible {
  border-color: var(--sienna);
  transform: translateX(3px);
}

.option:hover .key,
.option:focus-visible .key { color: var(--sienna); }

.option.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.option.selected .key { color: var(--apricot); }

/* ————— identity form ————— */

.signup {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  max-width: 26rem;
}

.field { display: flex; flex-direction: column; gap: 0.45rem; }

.field-label { color: var(--taupe); }

.field input {
  border: none;
  border-bottom: 1px solid var(--stone);
  background: transparent;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 380;
  color: var(--ink);
  padding: 0.35rem 0;
  border-radius: 0;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus { border-bottom-color: var(--sienna); }

.field input::placeholder { color: var(--stone); font-style: italic; }

.signup .btn { align-self: flex-start; margin-top: 0.4rem; }

.form-error {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--sienna-deep);
}

/* ————— the receipt ————— */

.receipt-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2.5rem, 7vh, 4.5rem) 0 2rem;
}

.receipt {
  width: min(24rem, 100%);
  background: var(--white);
  padding: 2rem 1.8rem 2.2rem;
  font-family: var(--mono);
  color: var(--ink-2);
  box-shadow: 0 24px 48px -24px rgba(33, 27, 21, 0.35);
  position: relative;
  animation: print 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  /* perforated top + bottom edge */
  --notch: 0.55rem;
  clip-path: polygon(
    0 var(--notch), 4% 0, 8% var(--notch), 12% 0, 16% var(--notch), 20% 0,
    24% var(--notch), 28% 0, 32% var(--notch), 36% 0, 40% var(--notch), 44% 0,
    48% var(--notch), 52% 0, 56% var(--notch), 60% 0, 64% var(--notch), 68% 0,
    72% var(--notch), 76% 0, 80% var(--notch), 84% 0, 88% var(--notch), 92% 0,
    96% var(--notch), 100% 0,
    100% calc(100% - var(--notch)), 96% 100%, 92% calc(100% - var(--notch)),
    88% 100%, 84% calc(100% - var(--notch)), 80% 100%,
    76% calc(100% - var(--notch)), 72% 100%, 68% calc(100% - var(--notch)),
    64% 100%, 60% calc(100% - var(--notch)), 56% 100%,
    52% calc(100% - var(--notch)), 48% 100%, 44% calc(100% - var(--notch)),
    40% 100%, 36% calc(100% - var(--notch)), 32% 100%,
    28% calc(100% - var(--notch)), 24% 100%, 20% calc(100% - var(--notch)),
    16% 100%, 12% calc(100% - var(--notch)), 8% 100%,
    4% calc(100% - var(--notch)), 0 100%
  );
}

@keyframes print {
  from { opacity: 0; transform: translateY(-1.6rem); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .receipt { animation: none; }
}

.r-head {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 0.6rem;
}

.r-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--taupe);
  margin-top: 0.5rem;
}

.r-rule {
  border-top: 1px dashed var(--stone);
  margin: 1.1rem 0;
}

.r-lines { display: flex; flex-direction: column; gap: 0.55rem; }

.r-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.r-line dt { text-transform: uppercase; color: var(--taupe); flex-shrink: 0; }

.r-line dd { text-align: right; text-transform: uppercase; color: var(--ink); overflow-wrap: anywhere; }

.r-status {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.r-status span { text-transform: uppercase; color: var(--taupe); }

.r-status strong {
  text-transform: uppercase;
  color: var(--sienna);
  letter-spacing: 0.14em;
}

.r-sign {
  font-size: 0.75rem;
  line-height: 1.75;
  letter-spacing: 0.05em;
  color: var(--taupe);
  text-align: center;
  margin-bottom: 0.6rem;
}

/* ————— fatal ————— */

.fatal {
  margin-top: 3rem;
  border: 1px solid var(--sienna-deep);
  background: var(--white);
  padding: 1.6rem 1.8rem;
}

.fatal-label { color: var(--sienna-deep); margin-bottom: 0.6rem; }

.fatal p:not(.fatal-label) {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ————— footer ————— */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--edge);
  color: var(--stone);
}

.foot-mark { font-style: normal; }

/* ————— admin (shares the sheet) ————— */

.admin-shell { max-width: 62rem; }

.admin-gate {
  margin: 18vh auto 0;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.8rem;
  margin: 2.2rem 0;
}

.stat {
  border: 1px solid var(--edge);
  background: var(--white);
  padding: 1.2rem 1.3rem;
}

.stat .n {
  font-family: var(--serif);
  font-weight: 420;
  font-size: 2.4rem;
  line-height: 1.1;
  color: var(--ink);
}

.stat .l {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--taupe);
  margin-top: 0.4rem;
  display: block;
}

.breakdowns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.8rem;
  margin-bottom: 2.2rem;
}

.breakdown {
  border: 1px solid var(--edge);
  background: var(--white);
  padding: 1.2rem 1.3rem;
}

.breakdown h3 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sienna);
  margin-bottom: 1rem;
  font-weight: 700;
}

.bar-line { margin-bottom: 0.75rem; }

.bar-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  margin-bottom: 0.3rem;
}

.bar-track { height: 4px; background: var(--paper-3); }

.bar-fill { height: 100%; background: var(--sienna); }

.signup-table { width: 100%; border-collapse: collapse; margin-bottom: 3rem; }

.signup-table th {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--taupe);
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--ink);
}

.signup-table td {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 380;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--edge);
  vertical-align: baseline;
}

.signup-table td.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--taupe);
  text-transform: uppercase;
}

/* ————— small screens ————— */

@media (max-width: 30rem) {
  .watermark { font-size: 20rem; }
  .r-line { flex-direction: column; gap: 0.1rem; }
  .r-line dd { text-align: left; }
}
