@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/JetBrainsMono-Regular.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/JetBrainsMono-Bold.ttf"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/fonts/Barlow-Regular.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/fonts/Barlow-Bold.ttf"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow SemiCondensed"; src: url("/static/fonts/BarlowSemiCondensed-Bold.ttf"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0C1420; --panel: #121D2E; --line: #22334D;
  --cyan: #2CB9DD; --cyan-bright: #4FD8F7;
  --text: #DCE7F2; --muted: #7E8FA6; --ember: #FF8A3D;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --body: "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--body);
  font-size: 1.05rem; line-height: 1.6; min-height: 100vh;
  display: flex; flex-direction: column; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-bright); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
code, pre, .mono { font-family: var(--mono); font-size: 0.92em; }
.accent { color: var(--cyan); }
.ember { color: var(--ember); }
.muted { color: var(--muted); }

.site-header { display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-name { font-family: var(--mono); font-weight: 700; letter-spacing: -.02em; }
.header-right { display: flex; align-items: center; gap: 1.25rem; min-width: 0; }
.site-nav { display: flex; gap: 1.25rem; font-family: "Barlow SemiCondensed", var(--body);
  text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; white-space: nowrap; }
.cta-btn { font-family: var(--mono); font-weight: 700; font-size: .85rem;
  background: var(--cyan); color: #06121B; border-radius: 6px; padding: .45rem .9rem;
  white-space: nowrap; flex-shrink: 0; }
.cta-btn:hover { background: var(--cyan-bright); color: #06121B; text-decoration: none; }
@media (max-width: 820px) {
  .brand-name { display: none; }            /* logo only: the menu never wraps */
  .site-nav { gap: .9rem; }
  .site-header { padding-inline: 1rem; }
}

.wrap { flex: 1; width: min(46rem, 100% - 2.5rem); margin-inline: auto; padding-block: 2.5rem; }

.hero { margin-bottom: 2.5rem; }
.eyebrow { font-family: var(--mono); color: var(--ember); font-size: .85rem;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: .75rem; }
.hero h1 { font-family: var(--mono); font-weight: 700; font-size: clamp(1.9rem, 5.5vw, 3rem);
  line-height: 1.15; margin-bottom: 1rem; }
.lede { color: var(--muted); max-width: 38rem; }
.lede strong { color: var(--text); }

.creator form, .terminal { background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 1.25rem; }
.creator label { display: block; margin-bottom: .4rem; font-size: .9rem; }
textarea, input[type="date"], input[type="password"], input[type="text"] {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: .6rem .75rem; font-family: var(--mono); font-size: .95rem; }
textarea { resize: vertical; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem; margin-block: 1rem; }
button, .ghost-btn { font-family: var(--mono); font-weight: 700; font-size: 1rem;
  border-radius: 6px; padding: .65rem 1.25rem; cursor: pointer; }
button { background: var(--cyan); color: #06121B; border: 1px solid var(--cyan); }
button:hover { background: var(--cyan-bright); border-color: var(--cyan-bright); }
.ghost-btn { display: inline-block; background: none; border: 1px solid var(--line); }
.row { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; align-items: center; }
.error { color: var(--ember); margin-top: .75rem; }

.terminal { margin-top: 1.5rem; overflow-x: auto; }
.link-pill { display: block; width: 100%; text-align: left; margin-block: .75rem;
  background: var(--bg); color: var(--cyan-bright); border: 1px dashed var(--cyan);
  border-radius: 8px; padding: .8rem 1rem; font-size: 1.05rem; letter-spacing: .02em;
  cursor: copy; word-break: break-all; font-weight: 400; }
.link-pill:hover { background: var(--panel); border-style: solid; color: var(--cyan-bright); }
.result-meta { margin-bottom: .5rem; }
.grow { flex: 1; }
button.ghost-btn { background: none; color: var(--cyan); border: 1px solid var(--line); }
button.ghost-btn:hover { background: var(--panel); border-color: var(--cyan);
  color: var(--cyan-bright); }
.qr-row { display: flex; gap: 1.25rem; align-items: center; margin-top: 1rem;
  flex-wrap: wrap; }
.qr-row[hidden] { display: none; }   /* author display beats the UA hidden rule */
.qr-tile { background: #FFFFFF; padding: 12px; border-radius: 10px; line-height: 0;
  position: relative; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 0 24px rgba(44, 185, 221, .12); }
.qr-tile img { width: 148px; height: 148px; image-rendering: pixelated; }
.qr-caption { font-size: .8rem; line-height: 1.5; }
.terminal p { margin-block: .35rem; }
pre.terminal { line-height: 1.5; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  margin-top: 3rem; padding: 0; }
.steps li { list-style: none; border-top: 1px solid var(--line); padding-top: .9rem;
  font-size: .95rem; color: var(--muted); }
.steps li strong { color: var(--text); }
.steps .n { display: block; color: var(--cyan); font-size: .85rem;
  letter-spacing: .1em; margin-bottom: .4rem; }
.home-coda { margin-top: 2.5rem; text-align: center; font-size: .95rem;
  max-width: 34rem; margin-inline: auto; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; gap: 1rem; } }
.explain { margin-top: 1rem; }
.explain h2 { font-family: var(--mono); font-size: 1.3rem; margin: 2rem 0 .75rem; }
.explain ol, .explain ul { padding-left: 1.25rem; display: grid; gap: .5rem;
  margin-bottom: .75rem; }
.diagram { line-height: 1.4; font-size: .82rem; }
.audit-list code { color: var(--cyan); }


.site-footer { border-top: 1px solid var(--line); padding: 1.5rem; text-align: center;
  font-size: .9rem; color: var(--muted); display: grid; gap: .5rem; }
.site-footer nav { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; align-items: center; }
.site-footer nav a { display: inline-flex; align-items: center; }

.reveal-box { text-align: left; }
.secret-output { white-space: pre-wrap; word-break: break-word; background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 1rem; margin-block: 1rem; }
.burned-stamp { display: inline-block; font-family: var(--mono); font-weight: 700;
  color: var(--ember); border: 2px solid var(--ember); border-radius: 4px;
  padding: .15rem .6rem; transform: rotate(-3deg); text-transform: uppercase;
  letter-spacing: .1em; }

@media (prefers-reduced-motion: no-preference) {
  .terminal:not([hidden]) { animation: rise .25s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }

  /* ---- the forging show: staged entrance of the result panel ---- */
  #result-panel:not([hidden]) .result-meta,
  #result-panel:not([hidden]) .row {
    animation: fadeup .45s ease-out both;
  }
  #result-panel:not([hidden]) .result-meta { animation-delay: 1.05s; }
  #result-panel:not([hidden]) .row { animation-delay: 1.25s; }
  @keyframes fadeup { from { opacity: 0; transform: translateY(8px); } }

  .link-pill.locked { animation: lockpulse 1s ease-out; }
  @keyframes lockpulse {
    0%   { border-color: var(--ember); color: var(--ember);
           box-shadow: 0 0 0 0 rgba(255, 138, 61, .6); }
    60%  { border-color: var(--cyan); color: var(--cyan-bright);
           box-shadow: 0 0 26px 6px rgba(44, 185, 221, .25); }
    100% { box-shadow: 0 0 0 0 rgba(44, 185, 221, 0); }
  }

  /* ---- QR reveal: pop in, then a scanline sweeps the tile ---- */
  .qr-row:not([hidden]) .qr-tile {
    animation: qrpop .4s cubic-bezier(.2, 1.4, .4, 1);
  }
  @keyframes qrpop { from { opacity: 0; transform: scale(.82); } }
  .qr-row:not([hidden]) .qr-tile::after {
    content: ""; position: absolute; left: 0; right: 0; height: 22%;
    background: linear-gradient(180deg, transparent,
                rgba(44, 185, 221, .55), transparent);
    animation: qrscan 1.1s ease-in-out .25s;
    opacity: 0;
  }
  @keyframes qrscan {
    0%   { top: -25%; opacity: 1; }
    100% { top: 110%; opacity: 1; }
  }
  .qr-row:not([hidden]) .qr-caption { animation: fadeup .45s ease-out .5s both; }

  /* ---- reveal show: plaintext decodes, then the burned stamp slams down ---- */
  #state-secret:not([hidden]) .lede { animation: fadeup .45s ease-out .9s both; }
  #state-secret:not([hidden]) .row { animation: fadeup .45s ease-out 1.15s both; }
  #state-secret .burned-stamp { opacity: 0; }
  #state-secret .burned-stamp.slam { animation: stampin .45s cubic-bezier(.2, 1.6, .4, 1) both; }
  @keyframes stampin {
    0%   { opacity: 0; transform: scale(2.4) rotate(-15deg); }
    55%  { opacity: 1; transform: scale(.94) rotate(-1deg); }
    100% { opacity: 1; transform: scale(1) rotate(-3deg); }
  }
}

/* ---- 404: one friendly card, a link crumbling to ash ---- */
.e404-card { max-width: 36rem; margin-inline: auto; padding: 2rem; }
.e404-h { font-size: 1.5rem; margin-bottom: .75rem; }
.e404-card .row { margin-top: 1.5rem; }
.vanish { font-size: clamp(1.1rem, 4vw, 1.5rem); letter-spacing: .06em;
  color: var(--cyan-bright); margin-block: 1.25rem 1.75rem; }
.vanish span { display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  .vanish span { animation: charburn 6s ease-in-out infinite; }
  @keyframes charburn {
    0%, 30%  { opacity: 1; transform: none; color: inherit; }
    38%      { color: var(--ember); opacity: 1; transform: translateY(-2px); }
    48%      { color: var(--ember); opacity: 0; transform: translateY(-16px) rotate(12deg); }
    82%      { opacity: 0; transform: translateY(-16px); }
    88%      { opacity: 0; transform: none; }
    100%     { opacity: 1; color: inherit; }
  }
  .vanish span:nth-child(1)  { animation-delay: .00s; }
  .vanish span:nth-child(2)  { animation-delay: .12s; }
  .vanish span:nth-child(3)  { animation-delay: .24s; }
  .vanish span:nth-child(4)  { animation-delay: .36s; }
  .vanish span:nth-child(5)  { animation-delay: .48s; }
  .vanish span:nth-child(6)  { animation-delay: .60s; }
  .vanish span:nth-child(7)  { animation-delay: .72s; }
  .vanish span:nth-child(8)  { animation-delay: .84s; }
  .vanish span:nth-child(9)  { animation-delay: .96s; }
  .vanish span:nth-child(10) { animation-delay: 1.08s; }
  .vanish span:nth-child(11) { animation-delay: 1.20s; }
  .vanish span:nth-child(12) { animation-delay: 1.32s; }
  .vanish span:nth-child(13) { animation-delay: 1.44s; }
  .vanish span:nth-child(14) { animation-delay: 1.56s; }
  .vanish span:nth-child(15) { animation-delay: 1.68s; }
  .vanish span:nth-child(16) { animation-delay: 1.80s; }
  .vanish span:nth-child(17) { animation-delay: 1.92s; }
  .vanish span:nth-child(18) { animation-delay: 2.04s; }
}
