/* WakeWire — EPIC WIN brand, CSS only.
   Tokens follow rnd's brand.ts (same values, same names) so the two sites read as one brand.
   Layout switches on orientation, not width breakpoints; the root size is set from viewport units
   and everything else is relative to it. Portrait reads larger than landscape. */

@font-face { font-family: "Audiowide"; src: url("/fonts/audiowide-normal-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Expletus Sans"; src: url("/fonts/expletus-sans-normal-400-700-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("/fonts/special-elite-normal-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/fonts/space-mono-normal-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/fonts/space-mono-normal-700-latin.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Teko"; src: url("/fonts/teko-normal-300-700-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
/* Size-matched fallbacks (values from rnd brand.ts, measured in Chromium) keep layout still while fonts load. */
@font-face { font-family: "Audiowide Fallback"; src: local("Arial"), local("Liberation Sans"), local("Helvetica"); size-adjust: 125.99%; ascent-override: 78.57%; descent-override: 23.02%; line-gap-override: 0%; }
@font-face { font-family: "Special Elite Fallback"; src: local("Courier New"), local("Liberation Mono"), local("Courier"); size-adjust: 87.36%; ascent-override: 80.13%; descent-override: 34.34%; line-gap-override: 0%; }
@font-face { font-family: "Expletus Sans Fallback"; src: local("Arial"), local("Liberation Sans"), local("Helvetica"); size-adjust: 98.84%; ascent-override: 104.21%; descent-override: 31.37%; line-gap-override: 0%; }
@font-face { font-family: "Space Mono Fallback"; src: local("Courier New"), local("Liberation Mono"), local("Courier"); size-adjust: 101.98%; ascent-override: 109.82%; descent-override: 35.3%; line-gap-override: 0%; }
@font-face { font-family: "Teko Fallback"; src: local("Arial"), local("Liberation Sans"), local("Helvetica"); size-adjust: 72.08%; ascent-override: 133.19%; descent-override: 66.59%; line-gap-override: 0%; }

:root {
  color-scheme: light dark;
  --c-teal: #00ccbb; --c-teal-hi: #00ffcc; --c-magenta: #b800b8; --c-magenta-hi: #c700c7;
  --c-purple: #731983; --c-magenta-text: #e85ce8; --c-teal-deep: #00756b;
  --bg: light-dark(#f7f3f9, #110d16);
  --surface: light-dark(#ffffff, #1a1420);
  --surface-2: light-dark(#efe8f3, #231a2b);
  --ink: light-dark(#1a1320, #ece6f0);
  --muted: light-dark(#5a4f63, #b0a6b8);
  --accent-text: light-dark(var(--c-magenta), var(--c-magenta-text));
  --teal-text: light-dark(var(--c-teal-deep), var(--c-teal));
  --edge: light-dark(#c9b6d3, #4a3556);
  --edge-hot: var(--c-magenta-hi);
  --ok: light-dark(#00756b, #00ffcc);
  --bad: light-dark(#a3122a, #ff7a8e);
  --g-display: linear-gradient(100deg, light-dark(var(--c-teal-deep), var(--c-teal-hi)) 0%, light-dark(var(--c-purple), var(--c-teal)) 40%, light-dark(var(--c-magenta), var(--c-magenta-text)) 75%, light-dark(var(--c-teal-deep), var(--c-teal-hi)) 100%);
  --g-brand: linear-gradient(135deg, var(--c-teal-hi), var(--c-teal) 30%, var(--c-magenta-hi) 65%, var(--c-purple));
  --g-surface: linear-gradient(160deg, light-dark(rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.035)), transparent 42%), linear-gradient(200deg, light-dark(#ffffff, #231a2b), light-dark(#efe8f3, #1a1420) 70%);
  --shade-a: light-dark(rgb(60 20 70 / 0.25), rgb(0 0 0 / 0.55));
  --shade-b: light-dark(rgb(60 20 70 / 0.16), rgb(0 0 0 / 0.45));
  --lit: light-dark(rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.07));
  --shadow-2: inset 1px 1px 0 var(--lit), 2px 3px 0 var(--shade-a), 6px 10px 24px var(--shade-b);
  --shadow-press: inset 2px 2px 4px var(--shade-a), inset -1px -1px 0 var(--lit);
  --glow-teal: 0 0 14px light-dark(rgb(0 117 107 / 0.3), rgb(0 204 187 / 0.45));
  --r-rest: 0; --r-focus: 0.457rem;
  --ridge: 3px ridge var(--edge);
  --f-display: "Audiowide", "Audiowide Fallback", sans-serif;
  --f-heading: "Expletus Sans", "Expletus Sans Fallback", sans-serif;
  --f-text: "Special Elite", "Special Elite Fallback", serif;
  --f-mono: "Space Mono", "Space Mono Fallback", monospace;
  --f-slab: "Teko", "Teko Fallback", sans-serif;
  --gutter: 1.5rem;
  --frame: 46rem;
}

/* Root size from viewport units, by orientation. Portrait reads larger. */
@media (orientation: landscape) { :root { font-size: clamp(15px, 0.55vw + 0.6vh, 21px); } }
@media (orientation: portrait)  { :root { font-size: clamp(16px, 2.6vw + 0.5vh, 24px); } }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.55 var(--f-text);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
body > header, main, body > footer { width: min(100% - 2 * var(--gutter), var(--frame)); margin-inline: auto; }

h1 {
  font: 400 2.4rem/1.1 var(--f-display);
  margin: 1.5rem 0 0.5rem;
  background: var(--g-display);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2, h3 { font-family: var(--f-heading); font-weight: 700; margin: 1.5rem 0 0.5rem; }
h2 { font-size: 1.7rem; } h3 { font-size: 1.27rem; }
body > header p, footer { color: var(--muted); }
code, output, data, dd { font-family: var(--f-mono); }

/* Panels: dimensional surfaces with ridge borders, sharp at rest. */
main > section, form, fieldset, #status, #transfers > li > article {
  background: var(--g-surface);
  border: var(--ridge);
  border-radius: var(--r-rest);
  box-shadow: var(--shadow-2);
  padding: 1rem 1.25rem;
  margin-block: 1rem;
  transition: border-radius 160ms ease, border-color 160ms ease;
}
main > section { padding: 1.25rem 1.5rem; }
form:focus-within, fieldset:focus-within { border-radius: var(--r-focus); border-color: var(--edge-hot); }
legend, label { font-family: var(--f-slab); font-size: 1.2rem; letter-spacing: 0.02em; }

button, input[type="file"]::file-selector-button {
  font: 1.1rem/1 var(--f-slab);
  letter-spacing: 0.04em;
  color: #0b0810;
  background: var(--g-brand);
  border: var(--ridge);
  border-color: var(--c-teal);
  border-radius: var(--r-rest);
  padding: 0.6rem 1.1rem;
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
button:hover { box-shadow: var(--shadow-2), var(--glow-teal); }
button:active { box-shadow: var(--shadow-press); }
button:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--teal-text); outline-offset: 2px; border-radius: var(--r-focus);
}
button:disabled { filter: grayscale(1); opacity: 0.6; cursor: not-allowed; }

textarea, output {
  display: block; width: 100%;
  font: 0.95rem/1.4 var(--f-mono);
  color: var(--ink); background: var(--surface);
  border: var(--ridge); border-radius: var(--r-rest);
  padding: 0.6rem; margin-block: 0.5rem;
}
output { overflow-wrap: anywhere; user-select: all; }

#status { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
#status dt { font-family: var(--f-slab); font-size: 1.15rem; color: var(--teal-text); }
#status dd { margin: 0; overflow-wrap: anywhere; }
[data-tone="ok"] { color: var(--ok); }
[data-tone="bad"] { color: var(--bad); font-weight: 700; }

#transfers { list-style: none; padding: 0; margin: 0; }
#transfers > li > article > header { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; }
#transfers [data-role="dir"] { font-family: var(--f-slab); font-size: 1.15rem; color: var(--accent-text); }
#transfers [data-role="name"] { overflow-wrap: anywhere; }
#transfers [data-role="body"] { white-space: pre-wrap; font-family: var(--f-mono); background: var(--surface); border: var(--ridge); padding: 0.6rem; }
#transfers a { color: var(--teal-text); font-family: var(--f-slab); font-size: 1.2rem; }
progress { width: 100%; accent-color: var(--c-teal); }

/* Landscape: status and controls side by side when there is room. */
@media (orientation: landscape) {
  #line { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; align-items: start; }
  #line > h2, #share, #line > section { grid-column: 1 / -1; }
}

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