/* ConfessionDiary site. Palette and fonts are the Reels' own (render/player.js, assets/theme.css). */
:root {
  --navy: #0F1A2E;
  --navy-deep: #0A1222;
  --wall: #1E2A44;
  --paper: #F3EADB;
  --paper-dim: #E7E0D4;
  --ink: #1C1A17;
  --chalk: #EADFCB;
  --chalk-dim: #A5AABA;
  --lamp: #F6C77A;
  --rose: #C8566B;
  --rose-light: #E07A8C;
  --amber: #D9963B;
  --red: #E8364F;
  --line: rgba(234, 223, 203, .14);
  --display: "Playfair Display", Georgia, serif;
  --letter: "Lora", Georgia, serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--navy-deep); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; color: var(--chalk); font: 16px/1.6 var(--sans); background: var(--navy-deep); overflow-x: hidden; }
a { color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* paper grain over everything, like the Reels */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: .5; mix-blend-mode: soft-light;
  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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.kicker { font: 600 11px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--chalk-dim); margin: 0 0 10px; }
h2 { font: 800 clamp(32px, 6vw, 56px)/1.08 var(--display); margin: 0 0 14px; color: var(--paper); text-wrap: balance; }
.lede { max-width: 56ch; color: var(--chalk-dim); margin: 0 0 22px; font: italic 18px/1.55 var(--letter); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-left)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--sans); text-decoration: none; cursor: pointer;
  color: var(--chalk); background: rgba(15, 26, 46, .55); border: 1px solid rgba(234, 223, 203, .35); border-radius: 999px; padding: 12px 18px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: border-color .2s, background .2s;
}
.pill:hover { border-color: var(--lamp); }
.pill.solid { background: var(--paper); color: var(--navy); border-color: var(--paper); }
.pill.solid:hover { background: #fff; }
.pill[hidden] { display: none; }

/* ---------------------------------------------------------------- top bar */
.skip { position: fixed; z-index: 70; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  font: 600 13px/1 var(--sans); text-decoration: none; color: var(--navy); background: var(--lamp); border-radius: 999px; padding: 11px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: opacity .4s, transform .4s; }
body.past-desk .skip, body.at-cover .skip { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }
.bar { position: fixed; z-index: 50; inset: 0 0 auto 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  background: linear-gradient(var(--navy-deep), rgba(10, 18, 34, 0)); }
.bar .brand { font: 800 20px/1 var(--display); text-decoration: none; color: var(--paper); }
.bar nav { display: flex; align-items: center; gap: 16px; font: 500 13px/1 var(--sans); }
.bar nav a { text-decoration: none; color: var(--chalk-dim); }
.bar nav a:hover { color: var(--paper); }
.bar nav .pill { padding: 9px 14px; color: var(--paper); }
@media (max-width: 640px) { .bar nav a:not(.pill) { display: none; } }

/* ---------------------------------------------------------------- the desk (pinned) */
.desk { position: relative; }
.stage { position: relative; height: 100vh; height: 100svh; width: 100%; overflow: hidden; background: var(--navy); }
.layer { position: absolute; inset: 0; will-change: transform; }
.layer svg { width: 100%; height: 100%; }
#layer-glow { mix-blend-mode: screen; }
.vignette { position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background: radial-gradient(ellipse at 50% 60%, rgba(10,18,34,0) 35%, rgba(10,18,34,.85) 100%); }
.win { animation: twinkle 7s ease-in-out infinite; animation-delay: var(--k); }
@keyframes twinkle { 50% { opacity: .15; } }
.steam { animation: steam 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.steam.s2 { animation-delay: -1.4s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(10px) scaleY(.8); } 40% { opacity: .4; } 100% { opacity: 0; transform: translateY(-30px) scaleY(1.1); } }
.pen-hand { animation: write 1.1s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes write { to { transform: translate(-14px, 6px) rotate(-4deg); } }
.phone-glow { animation: buzz 2.6s ease-in-out infinite; }
@keyframes buzz { 50% { opacity: .35; } }
.shade { filter: drop-shadow(0 0 30px rgba(246,199,122,.6)); }

.intro { position: absolute; z-index: 3; left: 0; right: 0; top: max(66px, 8svh); text-align: center; padding: 0 20px; pointer-events: none;
  text-shadow: 0 2px 20px rgba(10,18,34,.8); }
.intro h1 { font: 800 clamp(40px, 10vw, 104px)/1 var(--display); margin: 6px 0 10px; color: var(--paper); letter-spacing: -.01em; }
.intro .kicker { color: var(--chalk); }
.intro .tagline { font: 700 clamp(24px, 4.4vw, 38px)/1.15 var(--hand); color: var(--lamp); margin: 0; }
.cue { position: absolute; left: 0; right: 0; bottom: max(84px, 11svh); margin: 0; text-align: center; font: 500 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--chalk-dim); }
.cue i { display: block; width: 1px; height: 34px; margin: 12px auto 0; background: linear-gradient(var(--chalk), transparent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* on a wide screen the title sits beside Tarika, over the bookshelf, not over her */
@media (min-aspect-ratio: 1/1) {
  .intro { top: 50%; transform: translateY(-58%); left: max(28px, 5vw); right: auto; width: min(36vw, 520px); text-align: left; padding: 0; }
  .intro::before { content: ""; position: absolute; z-index: -1; inset: -40vh -10vw -40vh -20vw; background: radial-gradient(closest-side, rgba(10,18,34,.82), rgba(10,18,34,0)); }
  .intro h1 { font-size: clamp(44px, 5.6vw, 96px); }
}

/* the page she is writing; GSAP moves it from the desk to the middle of the screen */
.page { position: absolute; z-index: 4; left: 50%; top: 50%; aspect-ratio: 9 / 16;
  width: min(calc(76svh * 9 / 16), calc(100vw - 40px), 470px); perspective: 2200px; will-change: transform; }
.page-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 3px; overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,.45), 0 4px 10px rgba(0,0,0,.3); }
.front { container-type: inline-size; background: var(--paper); color: var(--ink); padding: 9cqw 9cqw 7cqw;
  background-image: repeating-linear-gradient(transparent 0 calc(9.6cqw - 1px), rgba(28,26,23,.09) calc(9.6cqw - 1px) 9.6cqw);
  background-position: 0 23cqw; display: flex; flex-direction: column; }
.note-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 2.4cqw; margin-bottom: 6cqw;
  font: 600 3.4cqw/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.note-head span:first-child { font: 800 4.4cqw/1 var(--display); text-transform: none; letter-spacing: 0; }
.note-hello { font: 700 10cqw/1 var(--hand); margin: 0 0 3cqw; color: var(--rose); }
.note-body { font: 500 6.5cqw/1.48 var(--hand); margin: 0; flex: 1; }
.note-body .ps { display: block; margin-top: 3cqw; color: var(--rose); }
.note-sign { font: 700 8.4cqw/1 var(--hand); margin: 4cqw 0 0; text-align: right; color: var(--rose); }
.note-foot { font: italic 3.6cqw/1 var(--letter); opacity: .65; margin: 5cqw 0 0; text-align: center; }
.back { transform: rotateY(180deg); background: var(--paper); }
.back svg { width: 100%; height: 100%; }
.tonight-actions { position: absolute; z-index: 5; left: 0; right: 0; bottom: max(70px, 7svh); text-align: center; visibility: hidden; padding: 0 16px; }
.tonight-actions .kicker { color: var(--chalk); }

/* ---------------------------------------------------------------- the shelf */
.shelf-wrap { position: relative; padding: 110px 0 70px; background: linear-gradient(var(--navy), var(--navy-deep)); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { font: 600 13px/1 var(--sans); color: var(--chalk); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--paper); color: var(--navy); border-color: var(--paper); }
.shelf-scroller { position: relative; }
.shelf { list-style: none; margin: 0; display: flex; gap: clamp(14px, 2.4vw, 28px); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding: 34px max(20px, calc((100vw - 1120px) / 2 + 20px)) 30px; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.slot { flex: 0 0 clamp(150px, 40vw, 230px); scroll-snap-align: center; }
.slot[hidden] { display: none; }
.cover-card { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 3px;
  transition: box-shadow .3s; box-shadow: 0 18px 30px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.4); }
.cover-card img { width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 3px; background: var(--paper-dim); }
.cover-card:hover { box-shadow: 0 26px 44px rgba(0,0,0,.6), 0 0 0 2px var(--lamp); }
.ribbon { position: absolute; z-index: 1; top: 10px; left: -6px; font: 800 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  background: var(--lamp); color: var(--navy); padding: 6px 9px; border-radius: 2px; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.ribbon.part { top: auto; bottom: 12px; background: var(--red); color: var(--paper); }
.slot-label { margin: 12px 0 0; font: 13px/1.3 var(--sans); color: var(--chalk-dim); }
.slot-label b { color: var(--paper); margin-right: 4px; }
.ledge { height: 18px; margin: -66px auto 0; position: relative; z-index: -0; pointer-events: none;
  background: linear-gradient(#4C372C, #3A2A22 40%, #24190F); box-shadow: 0 16px 30px rgba(0,0,0,.5); }
.arrow { position: absolute; z-index: 2; top: 40%; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(15,26,46,.8);
  color: var(--paper); font: 28px/1 var(--display); cursor: pointer; display: none; }
.arrow.prev { left: 12px; } .arrow.next { right: 12px; }
@media (hover: hover) and (min-width: 800px) { .arrow { display: block; } }

/* ---------------------------------------------------------------- confessors */
.confessors { padding: 100px 0 80px; background: var(--navy-deep); }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.person { background: var(--navy); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.person svg { width: 100%; height: clamp(240px, 30vw, 320px); }
.person-text { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.person h3 { font: 800 30px/1 var(--display); margin: 0; color: var(--paper); }
.trait { font: italic 16px/1.45 var(--letter); margin: 0; }
.count { font: 13px/1.5 var(--sans); color: var(--chalk-dim); margin: 0 0 10px; flex: 1; }
.person .pill { align-self: flex-start; }

/* ---------------------------------------------------------------- the letter */
.write { padding: 100px 0 120px; background: radial-gradient(ellipse at 20% 0%, rgba(246,199,122,.12), transparent 60%), var(--navy); }
.letter { max-width: 720px; }
.paper-letter { background: var(--paper); color: var(--ink); border-radius: 4px; padding: clamp(22px, 5vw, 48px); transform: rotate(-.6deg);
  box-shadow: 0 30px 60px rgba(0,0,0,.45); font: 17px/1.5 var(--letter); }
.paper-letter .dear { font: 700 40px/1 var(--hand); color: var(--rose); margin: 0 0 14px; }
.paper-letter textarea, .paper-letter input:not([type]), .paper-letter select {
  font: 500 23px/36px var(--hand); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid rgba(28,26,23,.25); width: 100%; padding: 2px 4px; border-radius: 0; }
.paper-letter textarea { resize: vertical; min-height: 220px; border: 0;
  background: repeating-linear-gradient(transparent 0 35px, rgba(28,26,23,.14) 35px 36px); }
.paper-letter select { font-size: 21px; appearance: none; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231C1A17' fill='none' stroke-width='1.6'/%3E%3C/svg%3E") right 6px center no-repeat; padding-right: 24px; }
.paper-letter textarea:focus, .paper-letter input:focus, .paper-letter select:focus { outline: none; background-color: rgba(246,199,122,.18); }
.paper-letter ::placeholder { color: rgba(28,26,23,.38); }
.paper-letter label { display: block; }
.inline { margin: 16px 0 0; }
.inline span, .sign legend { display: block; font: italic 15px/1.3 var(--letter); opacity: .7; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 22px; }
.inline[hidden] { display: none; }
.sign { border: 0; padding: 0; margin: 20px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.sign legend { margin-bottom: 8px; }
.radio input { position: absolute; opacity: 0; }
.radio span { display: inline-block; font: 600 13px/1 var(--sans); border: 1px solid rgba(28,26,23,.3); border-radius: 999px; padding: 9px 13px; cursor: pointer; }
.radio input:checked + span { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.radio input:focus-visible + span { outline: 2px solid var(--rose); outline-offset: 2px; }
.sign .name { flex-basis: 100%; }
.check { display: flex !important; gap: 10px; align-items: flex-start; margin: 12px 0 0; font: 15px/1.4 var(--letter); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--rose); flex: none; }
.send-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.seal { background: var(--navy) !important; color: var(--paper) !important; border-color: var(--navy) !important; font-size: 15px; }
.seal:disabled { opacity: .6; }
.status { margin: 0; font: italic 15px/1.4 var(--letter); color: var(--rose); }
.sent p { font-size: 18px; }

/* ---------------------------------------------------------------- one issue */
dialog.issue { width: min(860px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 0; border: 0; border-radius: 12px; background: var(--paper); color: var(--ink); overflow: auto; }
dialog.issue::backdrop { background: rgba(10,18,34,.78); backdrop-filter: blur(4px); }
.issue .close { position: absolute; right: 10px; top: 8px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(28,26,23,.08); font: 28px/1 var(--sans); cursor: pointer; color: var(--ink); }
.issue-grid { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 26px; padding: 26px; }
.issue-grid img { width: 100%; height: auto; aspect-ratio: 9/16; border-radius: 3px; box-shadow: 0 16px 30px rgba(0,0,0,.25); }
.issue .kicker { color: rgba(28,26,23,.6); }
.issue h3 { font: italic 700 28px/1.2 var(--letter); margin: 0 0 12px; }
.issue-caption { margin: 0 0 16px; }
.issue blockquote { margin: 0 0 18px; padding: 12px 0 12px 16px; border-left: 4px solid var(--rose); font: italic 22px/1.35 var(--letter); }
.issue-ask { margin-bottom: 18px; }
.issue-ask .ask { font: 700 20px/1.3 var(--letter); margin: 0 0 10px; }
.issue-ask .opt { display: inline-block; margin: 0 8px 8px 0; border: 2px solid var(--navy); border-radius: 999px; padding: 8px 14px; font: 600 14px/1 var(--sans); }
.issue-ask .hint { margin: 4px 0 0; font: 800 14px/1 var(--sans); color: var(--red); }
.issue .row { justify-content: flex-start; }
.issue .pill.solid { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.soon { font: italic 13px/1.4 var(--letter); opacity: .55; margin: 14px 0 0; }
@media (max-width: 640px) {
  .issue-grid { grid-template-columns: 1fr; padding: 18px; }
  .issue-grid img { max-width: 240px; margin: 0 auto; }
}

.foot { padding: 40px 20px 90px; text-align: center; color: var(--chalk-dim); font-size: 14px; border-top: 1px solid var(--line); }
.foot .brand { font: 800 22px/1 var(--display); color: var(--paper); margin-bottom: 6px; }

/* ---------------------------------------------------------------- reduced motion: the same story, without moving */
body.still .desk, body.still .stage { height: auto; }
body.still .stage { padding: 90px 0 40px; }
body.still .layer, body.still .vignette { position: absolute; height: 100svh; }
body.still .intro { position: relative; top: 0; margin-bottom: 30px; }
body.still .cue { display: none; }
body.still .page { position: relative; left: auto; top: auto; margin: 0 auto 24px; perspective: none; }
body.still .page-inner { display: grid; gap: 24px; height: auto; }
body.still .face { position: relative; aspect-ratio: 9 / 16; backface-visibility: visible; }
body.still .back { transform: none; }
body.still .tonight-actions { position: relative; bottom: auto; visibility: visible; }
body.still .skip { display: none; }
@media (prefers-reduced-motion: reduce) { .win, .steam, .pen-hand, .phone-glow, .cue i { animation: none !important; } }
