/* Sofia & Adam — "The Love Letter" (version A). Shared tokens and type. */
:root {
  --wine-950: #2a0810;
  --wine-900: #3a0c17;
  --wine-800: #4b111f;
  --wine-700: #5c1626;
  --wine-600: #7d2635;
  --wine-500: #9a3a48;
  --wine-300: #c98b93;
  --paper: #f6efe3;
  --paper-2: #efe5d4;
  --ivory: #f3ebdd;
  --cream: #ecdcbd;
  --champagne: #e3cfae;
  --gold: #b08d57;
  --ink: #2c1a1e;
  --ink-2: #5d4247;
  --ink-3: #8a7074;
  --line: rgba(92, 22, 38, 0.18);
  --line-strong: rgba(92, 22, 38, 0.32);
  --on-wine: #f3e6d3;
  --on-wine-2: rgba(243, 230, 211, 0.72);
  --line-on-wine: rgba(243, 230, 211, 0.22);
  --ok: #4f6b3a;
  --danger: #8f1d2c;

  --f-script: "Pinyon Script", "Snell Roundhand", cursive;
  --f-display: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --f-body: "EB Garamond", Georgia, serif;
  --f-pen-script: "Parisienne", cursive;
  --f-pen-hand: "Homemade Apple", cursive;

  --gutter: 16px;
  --col: 640px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --paper-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .36  0 0 0 0 .2  0 0 0 0 .16  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper) var(--paper-grain);
  color: var(--ink);
  font: 400 18px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.script { font-family: var(--f-script); font-weight: 400; line-height: 1.1; }
.caps {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.display { font-family: var(--f-display); font-weight: 400; line-height: 1.05; letter-spacing: 0.01em; }
.muted { color: var(--ink-2); }
.center { text-align: center; }

/* Buttons: rectangular, hairline, a bare arrow that slides on hover. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 1px solid var(--wine-700); border-radius: 2px;
  background: var(--wine-700); color: var(--on-wine);
  font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s, opacity 0.25s;
}
.btn:hover { transform: translateY(-1px); background: var(--wine-800); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn .arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn.ghost { background: transparent; color: var(--wine-700); }
.btn.ghost:hover { background: rgba(92, 22, 38, 0.06); }
.on-wine .btn { background: var(--on-wine); color: var(--wine-800); border-color: var(--on-wine); }
.on-wine .btn:hover { background: #fff7ea; }
.on-wine .btn.ghost { background: transparent; color: var(--on-wine); border-color: var(--line-on-wine); }
.on-wine .btn.ghost:hover { background: rgba(243, 230, 211, 0.08); }

/* Form fields */
.field { display: grid; gap: 6px; }
.field > span { font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.55); border: 1px solid var(--line-strong); border-radius: 2px;
  font-size: 17px; line-height: 1.4;
  transition: border-color 0.2s, background-color 0.2s;
}
.input:focus { outline: none; border-color: var(--wine-600); background: rgba(255, 252, 246, 0.95); }
textarea.input { resize: vertical; min-height: 96px; }
.on-wine .field > span { color: var(--on-wine-2); }
.on-wine .input { background: rgba(243, 230, 211, 0.07); border-color: var(--line-on-wine); color: var(--on-wine); }
.on-wine .input:focus { border-color: var(--champagne); background: rgba(243, 230, 211, 0.12); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 90;
  max-width: min(92vw, 420px); padding: 12px 18px;
  background: var(--wine-900); color: var(--on-wine); border-radius: 2px;
  font-size: 16px; text-align: center;
  box-shadow: 0 12px 32px rgba(42, 8, 16, 0.3);
  opacity: 0; transform: translate(-50%, 12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reveal on scroll */
.rise { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Presenter control (demo mode only) */
.demo-ctl {
  position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 95;
  display: flex; align-items: center; gap: 0;
  background: rgba(42, 8, 16, 0.92); color: var(--on-wine); border-radius: 2px;
  font-family: var(--f-display); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.demo-ctl .lbl { padding: 0 10px; opacity: 0.6; }
.demo-ctl button { border: 0; background: none; padding: 10px 10px; color: inherit; letter-spacing: inherit; text-transform: inherit; font-weight: 600; opacity: 0.65; }
.demo-ctl button.on { opacity: 1; box-shadow: inset 0 -2px 0 var(--champagne); }
.demo-ctl .min { opacity: 0.6; padding: 10px 12px; }
.demo-ctl.folded button:not(.min), .demo-ctl.folded .lbl { display: none; }
body.has-dock .demo-ctl { bottom: calc(76px + env(safe-area-inset-bottom)); }
