@charset "utf-8";
/* Self Destruct Note: "mission briefing" theme. Mobile-first. No external fonts or files (privacy + speed). */

:root {
  --bg: #0c0e11;
  --bg-glow: #1a1210;
  --panel: #14181d;
  --panel-2: #1b2027;
  --line: #2a313a;
  --text: #ece8e1;
  --muted: #9aa3ad;
  --accent: #ff5a36;       /* ember */
  --accent-2: #ffb347;     /* flame gold */
  --accent-ink: #1a0b06;
  --ok: #3ddc97;
  --danger: #ff4d5e;
  --paper: #f2e8d5;
  --paper-edge: #e3d4b6;
  --ink: #1d1a16;
  --radius: 14px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Courier New", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

/* Moods change the accent color once a note is revealed (and on the chip picker). */
[data-mood="love"]     { --accent: #ff4f8b; --accent-2: #ffb3cb; }
[data-mood="surprise"] { --accent: #ffbe0b; --accent-2: #fff1a8; --accent-ink: #231a00; }
/* Santa red is too dark for black text, so its buttons use white text (contrast checked: 4.7:1+). */
[data-mood="santa"]    { --accent: #c8243a; --accent-2: #d93240; --accent-ink: #ffffff; --accent-text: #ff7a85; }

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 50% -200px, var(--bg-glow), transparent 70%),
    var(--bg);
}

a { color: var(--accent-2); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
/* Headings get focus programmatically (so screen readers announce new screens); no ring needed there. */
[tabindex="-1"]:focus { outline: none; }

/* Visible only to screen readers. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* "Skip to content" link: hidden until a keyboard user tabs to it. */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--accent-2); color: var(--accent-ink); font-weight: 700;
  padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--accent-ink); }

.wrap { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-bottom: 48px; }

/* ---------- Header / footer ---------- */
.site-header { border-bottom: 1px solid var(--line); background: rgba(12, 14, 17, .8); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); text-decoration: none; font-size: 15px;
}
.logo:hover { color: var(--text); }
.logo-mark { width: 26px; height: 26px; }
.nav { display: flex; gap: 16px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0 28px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); display: inline-block; padding: 8px 0; } /* bigger tap targets on phones */

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-text, var(--accent)); margin: 0 0 10px;
}
h1 { font-size: clamp(30px, 7vw, 44px); line-height: 1.1; margin: 0 0 12px; letter-spacing: -.02em; }
h2 { font-size: 22px; line-height: 1.25; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.lede { color: var(--muted); font-size: 17px; margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.flame { color: var(--accent-text, var(--accent)); }

.hero { padding: 36px 0 20px; }

/* ---------- Panels & form ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.panel + .panel, .panel + .ad-slot, .ad-slot + .panel { margin-top: 18px; }

label, .label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field { margin-top: 18px; }
.field:first-child { margin-top: 0; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

textarea, input[type="text"], input[type="password"], select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
textarea {
  min-height: 180px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
}
textarea:focus, input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea::placeholder, input::placeholder { color: #8a939d; }
[aria-invalid="true"] { border-color: var(--danger); }

.counter span:last-child { white-space: nowrap; }
.counter { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }
.counter.over { color: var(--danger); }

/* Chip-style radio groups */
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chips legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; font-size: 14px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  transition: border-color .15s, color .15s, background .15s;
}
.chip input:checked + span { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.chip input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }

details.more { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.more summary:hover { color: var(--text); }
details.more[open] summary { margin-bottom: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 12px 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  text-decoration: none; transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: #3a434f; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 6px 24px -8px var(--accent);
}
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.05); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); }
.btn-danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger-solid { color: #fff; background: #c8243a; border-color: #c8243a; } /* white on this red: 5.4:1 */
.btn-danger-solid:hover { background: #a91d30; border-color: #a91d30; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 22px; font-size: 17px; }
.btn.is-done { border-color: var(--ok); color: var(--ok); }
/* On the bright primary buttons, keep the dark text and add a green ring instead (green-on-orange is unreadable). */
.btn-primary.is-done { color: var(--accent-ink); box-shadow: 0 0 0 3px var(--ok); }
.btn.is-failed { border-color: var(--danger); color: #ffc2c8; background: var(--panel-2); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--text); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.notice { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-top: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.notice.error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: #ffc2c8; }
.notice.warn { border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); }

/* ---------- Link result ---------- */
.link-box {
  display: flex; gap: 8px; align-items: stretch; margin-top: 8px;
}
.link-box input { font-family: var(--mono); font-size: 13px; min-width: 0; }
.link-box .btn { flex-shrink: 0; }
@media (max-width: 440px) { .link-box { flex-direction: column; } }

/* ---------- Labels & the private status-link panel ---------- */
.note-label {
  display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; font-size: 15px;
}
.panel-private { border: 2px dashed #4b5562; background: #12161b; }

/* ---------- Send options + QR ---------- */
.send-label { margin-top: 18px; }
.send-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.send-row .btn { font-size: 14px; padding: 11px 10px; }
@media (min-width: 560px) { .send-row { display: flex; flex-wrap: wrap; } }
.qr-panel { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); text-align: center; }
.qr-panel canvas { width: 100%; max-width: 280px; height: auto; border-radius: 12px; background: #fff; }
.qr-panel .actions { justify-content: center; }

/* ---------- Feature strip ---------- */
.uses { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.use { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
a.use { color: var(--text); text-decoration: none; transition: border-color .15s; }
a.use:hover { border-color: var(--accent); color: var(--text); }
.use b { display: block; font-size: 15px; margin-bottom: 2px; }
.use span { font-size: 13px; color: var(--muted); }
@media (min-width: 620px) { .uses { grid-template-columns: repeat(4, 1fr); } }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 14px 14px 14px 52px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 13px;
  background: var(--accent); color: var(--accent-ink);
}

/* ---------- Ad placeholders ---------- */
/* Hidden on the live site until you turn ads on. Outlined on localhost so you can see them. */
.ad-slot { display: none; }
.show-ad-slots .ad-slot {
  display: grid; place-items: center; min-height: 100px; margin: 18px 0;
  border: 2px dashed #3b4450; border-radius: 12px; color: #6c7580;
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}
.show-ad-slots .ad-slot::before { content: "Ad placeholder · " attr(data-ad-slot); }

/* ---------- Prose pages ---------- */
.prose h2 { margin-top: 32px; }
.prose p, .prose li { color: #cfd4da; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.callout { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; margin: 18px 0; }

/* ---------- Reveal page ---------- */
.sealed { text-align: center; padding: 28px 18px; margin-top: 28px; }
.sealed .envelope { font-size: 54px; line-height: 1; margin-bottom: 10px; filter: drop-shadow(0 8px 24px color-mix(in srgb, var(--accent) 50%, transparent)); }
.sealed h1 { font-size: clamp(26px, 6vw, 36px); }
.sealed .pw-field { text-align: left; max-width: 360px; margin: 18px auto 0; }
.sealed .btn-lg { margin-top: 20px; min-width: 240px; }
.warn-line {
  display: inline-block; margin-top: 4px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-2);
}
.pulse { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.reveal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 26px 0 14px; }
.reveal-head h1 { font-size: clamp(22px, 5.5vw, 30px); margin: 0; text-wrap: balance; }

/* The paper "dossier" the message is printed on */
.stage { position: relative; }
.dossier {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(80, 60, 30, .08) 31px 32px),
    linear-gradient(180deg, var(--paper), var(--paper-edge));
  color: var(--ink);
  border-radius: 6px;
  padding: 44px 20px 26px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .8), inset 0 0 60px rgba(120, 90, 40, .18);
}
.dossier .stamp {
  position: absolute; top: 12px; right: 12px; transform: rotate(-8deg);
  font-family: var(--mono); font-weight: 800; font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 85%, #000); border: 2px solid currentColor; border-radius: 4px; padding: 3px 8px;
  opacity: .85;
}
.dossier .meta { white-space: pre-line; line-height: 1.6; padding-right: 110px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #7a6a52; margin-bottom: 12px; }
.message {
  font-family: var(--mono); font-size: 16px; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  margin: 0; min-height: 3em;
}
.message .ch { display: inline; }

/* Countdown ring */
.countdown { position: relative; width: 58px; height: 58px; flex-shrink: 0; }
.countdown svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown .track { stroke: var(--line); }
.countdown .bar { stroke: var(--accent); transition: stroke-dashoffset 1s linear; }
.countdown .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 16px; }
.countdown .num.long { font-size: 13px; }
.countdown.urgent .num { color: var(--accent-text, var(--accent)); animation: pulse .5s ease-in-out infinite; }
/* Paused: the ring dims and the number blinks slowly, so it clearly isn't running. */
.countdown.paused svg { opacity: .35; }
.countdown.paused .num { animation: pulse 1.6s ease-in-out infinite; }

/* ---- Burn effect ---- */
.burning .w { white-space: nowrap; }
.burning .ch {
  display: inline-block;
  white-space: pre;
  animation: ash 1.1s ease-in forwards;
  animation-delay: var(--d, 0s);
}
@keyframes ash {
  0%   { color: var(--ink); }
  25%  { color: #b33a00; text-shadow: 0 0 6px #ff7a18; }
  45%  { color: #ffb347; text-shadow: 0 0 12px #ff5a00; }
  100% { color: #333; transform: translate(var(--x, 0), -70px) rotate(var(--r, 0)) scale(.2); opacity: 0; filter: blur(2px); }
}
/* A line of fire rises up the page, leaving char behind. */
.dossier::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(0deg,
    rgba(14, 10, 8, .96) 0%, rgba(14, 10, 8, .96) 38%,
    #7a1d00 44%, #ff5a00 47%, #ffd27a 49%, rgba(255, 180, 80, .35) 53%, transparent 60%);
  background-size: 100% 260%;
  background-position: 0 0%;
}
.burning .dossier::after { animation: fireline 2.4s ease-in forwards; }
@keyframes fireline {
  0%   { opacity: 1; background-position: 0 0%; }
  100% { opacity: 1; background-position: 0 100%; }
}
.burning .dossier { animation: crumble .7s ease-in 2.3s forwards; }
@keyframes crumble { to { transform: scale(.92) translateY(10px); opacity: 0; filter: blur(3px); } }
.ember {
  position: absolute; bottom: 0; width: 5px; height: 5px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff3c4, #ffb347 40%, #ff5a00 70%, transparent 72%);
}

.burned { text-align: center; padding: 40px 18px; }
.burned .ashes { font-size: 48px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .burning .ch { animation: none; }
  .burning .dossier { animation: fade .4s forwards; }
  @keyframes fade { to { opacity: 0; } }
}

/* ---------- Status page ---------- */
.status-badge {
  display: inline-block; font-family: var(--mono); font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  font-size: 18px; padding: 6px 14px; border: 3px solid currentColor; border-radius: 6px; transform: rotate(-3deg);
  margin: 6px 0 14px;
}
.status-badge.waiting { color: var(--accent-2); }
.status-badge.read { color: var(--ok); }
.status-badge.gone { color: var(--muted); }
.status-badge.danger { color: var(--danger); }

/* ---------- Dialog ---------- */
dialog {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog form { padding: 20px; }
dialog h2 { margin-bottom: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--muted); }
.check input { margin-top: 4px; }
