/* ======================================================================
   ST69 — EDITING DESK
   Change the variables below first. Sizes use rem (1rem = 16px by default).
   Desktop rules come first; mobile overrides are at the bottom (600px).
   This is plain CSS: .headline here styles class="headline" in index.html.
   ====================================================================== */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/IBMPlexMono-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: 'IBM Plex Mono', monospace;
  font-synthesis: none;

  /* Palette */
  --ink: #080a0b;
  --gold: #bea46c;
  --bright: #e5d3a9;
  --light: #d1cfc5;
  --muted: #93958e;
  --line: #bea46c30;
  --green: #35cc7b;
  --lipstick: #dc5265;

  /* Typography — these are the main controls to tinker with. */
  --title-size: 1.8725rem;
  --title-tracking: .14em;
  --copy-size: 0.7275rem;
  --button-size: .5625rem;
  --status-size: .625rem;
  --terminal-size: .6875rem;

  /* Layout / artwork */
  --header-height: 68px;
  --footer-height: 53px;
  --patch-stage-size: min(440px, 77vw);
  --patch-brightness: 0.85;
  --patch-hover-brightness: 1.05;
  --chart-speed: 200s;
  --edge-gutter: 5vw;
  --signal-copy-gap: 12px;
  --mobile-button-gap: 0px; /* Vertical space between stacked contact buttons. */
}

/* 1. Base + keyboard focus -------------------------------------------- */
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: var(--ink); color: var(--light); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 1px solid var(--bright); outline-offset: 5px; }
.dialog-open { overflow: hidden; }

/* 2. Cosmic layers --------------------------------------------------- */
.cosmos {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: linear-gradient(#07090a44, #07090a66), url('assets/starfield.jpg') center 67% / max(160vw, 1500px) auto;
  opacity: .81;
  pointer-events: none;
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(ellipse at 50% 40%, transparent 18%, #080a0b80 75%, #080a0bcc 100%);
  pointer-events: none;
}

/* 3. Header / footer ------------------------------------------------- */
.beacon-header, .beacon-footer { margin-inline: var(--edge-gutter); display: flex; align-items: center; }
.beacon-header { height: var(--header-height); border-bottom: 1px solid var(--line); justify-content: flex-end; }
.status { display: flex; align-items: center; gap: 10px; margin: 0; font-size: var(--status-size); letter-spacing: .17em; color: #b5b9ac; }
.status span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: beacon-signal 6.9s linear infinite; }
.beacon-footer { min-height: var(--footer-height); border-top: 1px solid var(--line); font-size: .5625rem; letter-spacing: .12em; color: #9d9c8f; }
.beacon-footer sup { margin-left: 3px; font-size: .4375rem; color: var(--gold); }

/* 4. Page composition ------------------------------------------------ */
.beacon {
  min-height: calc(100svh - var(--header-height) - var(--footer-height));
  padding: 30px 24px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}
.invocation { max-width: 720px; margin: 0 0 24px; font-size: var(--copy-size); line-height: 1.9; letter-spacing: .01em; color: #c8c6b9; text-wrap: balance; }
.insignia-stage { position: relative; display: grid; place-items: center; width: var(--patch-stage-size); aspect-ratio: 1; margin: 12px 0 16px; isolation: isolate; }
.celestial-disc {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: url('assets/celestial-chart.jpg') center / cover;
  opacity: .32;
  filter: sepia(.15) brightness(.8);
  mask-image: radial-gradient(circle, #000 63%, transparent 72%);
  animation: chart-drift var(--chart-speed) linear infinite;
  transition: opacity 1s, filter 1s;
}
.orbit { position: absolute; border: 1px solid #c2a06245; border-radius: 50%; pointer-events: none; transition: transform 1.6s, opacity .8s; }
.outer { inset: -5px; opacity: .65; transform: rotate(18deg); }
/* Start above west/144. The hover travels farther upward, away from it. */
.outer::after { content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); top: 50%; left: -2px; box-shadow: 0 0 12px #bea46c88; }
.inner { inset: 18px; border-style: dashed; opacity: .5; }
.insignia { width: 73%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: #090c0e; box-shadow: 0 12px 40px #0009, 0 0 50px #bea46c10; position: relative; transition: transform .9s, box-shadow .9s;}
.insignia img { display: block; width: 100%; height: 100%; border-radius: 50%; filter: brightness(var(--patch-brightness)); transition: filter .9s;}
.insignia-stage:has(.insignia:hover, .insignia:focus-visible) .celestial-disc { opacity: .6; filter: sepia(.15) brightness(1); }
.insignia-stage:has(.insignia:hover, .insignia:focus-visible) .outer { transform: rotate(53deg); opacity: 1; }
.insignia:hover, .insignia:focus-visible, .insignia[aria-pressed='true'] { transform: scale(1.025); box-shadow: 0 12px 45px #000b, 0 0 70px #bea46c29; }
.insignia:hover img, .insignia:focus-visible img { filter: brightness(var(--patch-hover-brightness)); }
.coordinate { position: absolute; font-size: .5rem; letter-spacing: .12em; color: #a18b59; }
.north { top: -18px; font-size: .4375rem; }
.west { left: -28px; }
.east { right: -26px; }
.figure { font-size: .5rem; letter-spacing: .18em; color: var(--gold); margin: 4px 0 18px; }
.figure > span { margin: 0 10px; color: #7c765e; }

/* 5. Rolling celestial title + lipstick sticker ----------------------- */
.headline { display: flex; align-items: baseline; gap: .55em; font-size: var(--title-size); font-weight: 400; letter-spacing: var(--title-tracking); line-height: 1.4; margin: 12px 0 0; white-space: nowrap; }
.typed-title { display: inline-flex; }
.typed-title > span, .title-glyph { display: inline-block; position: relative; }
.title-glyph { vertical-align: bottom; }
.glyph-window { display: inline-block; height: 1.4em; overflow: hidden; vertical-align: bottom; }
.glyph-reel { display: flex; flex-direction: column; }
.glyph-reel > span { display: block; height: 1.4em; flex-shrink: 0; }
.is-rolling .glyph-reel { animation: letter-roll 1.15s cubic-bezier(.22,.65,.25,1) both; animation-direction: var(--roll-direction, normal); }
.is-celestial .glyph-window { animation: celestial-emphasis 1.6s ease-in-out both; }
.title-number { position: relative; font-size: inherit; letter-spacing: inherit; }
.secret-number { padding: 0; border: 0; background: none; overflow: visible; }
.number-default { transition: opacity .25s; }
.number-secret { position: absolute; z-index: 5; width: 164px; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-13deg) scale(.75); opacity: 0; pointer-events: none; transition: opacity .2s, transform .35s cubic-bezier(.2,.8,.2,1.2); filter: drop-shadow(0 3px 5px #000b); }
.number-secret img { display: block; width: 100%; height: auto; }
.east .number-secret { width: 126px; left: auto; right: -16px; transform: translateY(-50%) rotate(-16deg) scale(.75); }
.secret-number:is(:hover, :focus-visible, .is-revealed) { z-index: 6; }
.secret-number:is(:hover, :focus-visible, .is-revealed) .number-default { opacity: .2; }
.secret-number:is(:hover, :focus-visible, .is-revealed) .number-secret { opacity: 1; transform: translate(-50%, -50%) rotate(-9deg) scale(1); }
.east:is(:hover, :focus-visible, .is-revealed) .number-secret { transform: translateY(-50%) rotate(-12deg) scale(1); }

/* 6. Contact controls ------------------------------------------------ */
.contact-actions { display: flex; justify-content: center; align-items: center; gap: 24px; margin: 0 0 0; }
.contact { display: flex; align-items: center; gap: 13px; min-height: 24px; padding: 11px 0; border: 0; background: none; font-size: var(--button-size); line-height: 1.9; letter-spacing: .09em; color: var(--gold); transition: color .3s, text-shadow .3s; }
.contact:hover { color: #efdeb4; text-shadow: 0 0 18px #bea46c80; }
.bracket { font-size: 22px; color: #817354; }
.contact:hover .bracket { color: var(--bright); }
.action-divider { width: 1px; height: 25px; background: linear-gradient(transparent, #bea46c55, transparent); }
.audio-status { min-height: 1.5em; margin: 28px 0 6px; font-size: .5375rem; line-height: 1.8; letter-spacing: .11em; color: #92978a; }

/* 7. Dialog shells --------------------------------------------------- */
dialog { padding: 0; width: min(660px, calc(100vw - 32px)); max-height: calc(100svh - 40px); overflow: auto; border: 1px solid #aa925c77; background: #090d0ff5; color: #c7beaa; box-shadow: 0 0 100px #000b, 0 0 50px #bea46c10; }
dialog::backdrop { background: #030608b8; backdrop-filter: blur(8px); }
dialog[open] { animation: materialize .45s ease-out; }
.terminal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; margin: 0; padding: 12px 24px; font-size: .625rem; line-height: 1.6; letter-spacing: .12em; background: #bea46c05; }
.terminal-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; margin: 0; padding: 12px 24px; font-size: .525rem; line-height: 1.6; letter-spacing: .12em; background: #bea46c05; }
.terminal-bar { border-bottom: 1px solid var(--line); }
.terminal-bar h2 { margin: 0; font-size: inherit; line-height: inherit; font-weight: 400; letter-spacing: inherit; color: var(--gold); }
.dot { width: 4px; height: 4px; margin-right: 8px; vertical-align: middle; border-radius: 50%; background: var(--gold); }
.close { padding: 4px 0; min-height: 32px; border: 0; background: none; color: #a99c80; font-size: inherit; line-height: inherit; letter-spacing: inherit; }
.close span { font-size: 18px; margin-left: 10px; vertical-align: middle; }
.close:hover { color: #fff0cc; }

/* 8. CNM content + seven prompts --------------------------------------- */
.cnm-intro { padding: 25px 24px 18px; border-bottom: 1px solid #bea46c15; margin-bottom: 20px; }
.terminal-description { margin: 0 0 10px; font-size: .5625rem; letter-spacing: .18em; color: #c2ac7c; }
.terminal-subtitle { margin: 0; font-size: .625rem; line-height: 1.9; color: #939b8e; }
.terminal-screen { padding: 22px 24px 12px; min-height: 140px; max-height: 32svh; overflow-y: auto; scrollbar-color: #5b523d transparent; font-size: var(--terminal-size); line-height: 1.9; }
.terminal-screen p { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal-screen .boot-one, .terminal-screen .boot-two { margin-bottom: 0; }
.terminal-screen .boot-three { margin-top: 1em; }
.boot-two { color: #d9c48c; }
.muted { color: #858d81; }
.echo { color: #7f8a7e; margin-top: 15px !important; }
.boot-one { animation: boot .4s both; }
.boot-two { animation: boot .4s .25s both; }
.boot-three { animation: boot .4s .5s both; }
form { display: flex; align-items: center; gap: 10px; margin: 16px 24px 24px; border-top: 1px solid #bda16c20; padding-top: 12px; font-size: var(--terminal-size); }
label { white-space: nowrap; color: #b6a37a; }
label span { color: #758271; }
input { min-width: 0; width: 100%; background: none; border: 0; border-radius: 0; color: #ded1b4; font-size: var(--terminal-size); padding: 8px 0; }
input::placeholder { color: #768277; }
form button { background: none; border: 0; color: var(--gold); font-size: 21px; padding: 5px; }
.terminal-bottom { border-top: 1px solid var(--line); color: #798074; }

/* 9. Eddie command echo ---------------------------------------------- */
#echo-dialog { width: min(540px, calc(100vw - 32px)); }
.echo-body { padding: 33px 30px 32px; }
.echo-source { font-size: .5rem; letter-spacing: .18em; color: #a39370; margin: 0; }
.waveform { height: 55px; display: flex; align-items: center; gap: 5px; margin: 26px 0 20px; opacity: .65; }
.waveform i { width: 2px; height: 10px; background: #b9a172; animation: whisper 2.7s ease-in-out infinite; transform-origin: center; }
.waveform i:nth-child(3n) { height: 27px; animation-delay: -.8s; }
.waveform i:nth-child(4n) { height: 40px; animation-delay: -1.6s; }
.waveform i:nth-child(5n) { height: 19px; animation-delay: -2.2s; }
.echo-message { font-size: .9375rem; line-height: 1.9; color: #d0c3a2; margin: 0; }
.echo-end { font-size: .5rem; letter-spacing: .18em; margin: 30px 0 0; color: #717d70; }
.echo-end span { color: #b8a271; }
.noscript { text-align: center; font-size: .6875rem; margin: 10px 20px 30px; }

/* 10. Motion --------------------------------------------------------- */
@keyframes chart-drift { to { transform: rotate(360deg); } }
@keyframes materialize { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes boot { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes letter-roll { to { transform: translateY(-66.666667%); } }
@keyframes celestial-emphasis { 0%, 100% { color: inherit; filter: blur(0); text-shadow: none; } 35% { color: #fff0ce; filter: blur(.35px); text-shadow: 0 0 6px #fff0ce, 0 0 18px #bea46c, 0 0 30px #bea46c88; } 65% { color: var(--bright); text-shadow: 0 0 9px #e5d3a999; } }

@keyframes beacon-signal { 0%, 45%, 51%, 68%, 72%, 100% { opacity: 1; box-shadow: 0 0 5px #35cc7b88, 0 0 14px #35cc7b44; } 46%, 49%, 69.5% { opacity: .35; box-shadow: none; } 47.5%, 50%, 71% { opacity: .8; } }
@keyframes whisper { 0%, 100% { transform: scaleY(.35); opacity: .3; } 45% { transform: scaleY(1); opacity: 1; } 70% { transform: scaleY(.55); opacity: .6; } }

/* 11. Responsive breakpoints — edit these for smaller screens. -------- */
@media (min-height: 950px) and (min-width: 700px) {
  .invocation { margin-bottom: 30px; }
}

/* Phone: 600px wide or narrower. Variables here override desktop values. */
@media (max-width: 600px) {
  :root {
    --header-height: 57px;
    --footer-height: 48px;
    --edge-gutter: 22px;
    --patch-stage-size: min(76vw, 370px);
    --title-size: 1.5875rem;
    --copy-size: .6175rem;
    --button-size: .5rem;
    --status-size: .55rem;
    --terminal-size: .625rem;
  }
  .beacon { padding: 30px 20px 22px; }
  .cosmos { background-size: auto 150vh; background-position: 48% 61%; }
  .invocation { max-width: 330px; margin-bottom: 24px; }
  .insignia-stage { margin: 20px; }
  .figure { margin-bottom: 19px; font-size: .4375rem; }
  .contact-actions { gap: 18px; }
  .contact { gap: 9px; letter-spacing: .04em; min-height: 0px; padding: 0px 0; margin-top: 0px;}
  .contact .bracket {line-height: 1.9;}
  .beacon-footer { font-size: .5rem; }
  .terminal-bar, .terminal-bottom { padding: 12px 16px; font-size: .5625rem; }
  .cnm-intro { padding: 22px 16px 16px; }
  .terminal-subtitle { font-size: .5625rem; }
  .terminal-screen { padding: 20px 16px 12px; min-height: 120px; }
  form { margin: 14px 16px 20px; gap: 6px; }
  .echo-body { padding: 27px 23px; }
  .echo-message { font-size: .8125rem; }
  .waveform { gap: 4px; }
  .audio-status { max-width: 300px; margin-bottom: 24px;}
}

@media (max-width: 350px) {
  :root { --button-size: .4375rem; --title-size: 1.25rem; }
  .contact-actions { gap: 10px; }
  .contact { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Footer wraps naturally on narrow screens. */
.beacon-footer { justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 18px; line-height: 1.8; }
.footer-channel { color: var(--gold); }
.footer-note { color: var(--muted); font-size: .875em; }
@media (max-width: 600px) { .beacon-footer { justify-content: center; text-align: center; gap: 6px 18px; } .footer-note { flex-basis: 100%; } .title-number .number-secret { width: 136px; left: 0; } }

/* Links share the original contact control treatment. */
a.contact { text-decoration: none; }
.contact-actions { flex-wrap: nowrap; }

/* Stack before the desktop row runs out of room; keep phone typography at 600px. */
@media (max-width: 700px) {
  .contact-actions { flex-direction: column; gap: var(--mobile-button-gap); }
  .contact-actions .action-divider { display: none; }
}

.return-icon { display: block; width: 18px; height: 18px; margin: auto; }

#terminal-help { padding: 4px 0; min-height: 32px; border: 0; background: none; color: #b3a17a; font-size: inherit; line-height: inherit; letter-spacing: inherit; }
#terminal-help:hover { color: #f0ddb1; }

@media (min-width: 601px) and (max-width: 700px) {
  .contact-actions { gap: 8px; margin-top: 16px; }
  .contact-actions .contact { min-height: 32px; padding: 0; }
  .contact-actions .contact .bracket { line-height: 1.75; }
}

/* Expand small icon hit areas without changing the page composition. */
.coordinate.secret-number::before { content: ''; position: absolute; inset: 50% auto auto 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); }
#command-form button { min-width: 28px; min-height: 28px; }
