/* =====================================================================================
   Beyond the Wire — shared theme for beyondthewire.us, status.beyondthewire.us and the panel.
   THIS FILE IS IDENTICAL in site/public, status/public and panel/public. Edit one, copy to all
   three (scripts/sync-theme.sh does it). It loads after each site's own stylesheet.

   Brand: palette 6B Classic Crimson (navy · cream · crimson), Sora / Manrope / IBM Plex Mono,
   the >btw▍ lockup and the Minecraft photo.
   Direction "Studio": warm and premium, softer corners, the photo carries the Minecraft feel.
   Structure (UI/UX Pro Max, "admin dashboard" profile, see design-system/): Minimalism & Swiss —
   calm type scale, sentence-case labels, hairline borders, one accent, quiet chrome.
     - Sora for headings, Manrope for everything you read and click, IBM Plex Mono only for data
       (IDs, ports, prices in tables, the console).
     - Crimson is the brand accent: main actions, the current page, focus. Destructive actions
       are outlined red (never the solid crimson), status uses green / amber / grey.
     - The photo is a band at the top of public pages, fading into navy; app pages are plain.
   ===================================================================================== */

/* ---------- Fonts: served from this site (no third-party request before first paint) ---------- */
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('/fonts/sora-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/sora-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/manrope-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --bg: #0a1120; --surface: #111a2c; --inset: #0d1526; --line: #26344d; --btn-line: #34425a;
  --text: #f3ead8; --muted: #a39c8f; --off: #8b93a3; --term-bg: #070c17; --term-text: #d9e1ee;
  --red: #ef4444;                       /* brand crimson: marks, current page, text on navy (5.0:1) */
  --accent: #c81e1e; --on-accent: #fff8ee;   /* solid buttons: deeper crimson, cream text (5.4:1) */
  --on-red: #0a1120; --red-deep-fg: #fca5a5; --red-deep-bg: #450a0a;
  --ok: #4ade80; --maint: #f59e0b;
  --shadow: none;
  --shadow-pop: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 44px -14px rgba(0,0,0,.65);
  --glass: color-mix(in srgb, var(--surface) 80%, transparent);
  --scrim: none; --photo-halo: none; --on-photo-muted: #a39c8f;
  --font-head: 'Sora', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-sm: 8px; --radius: 14px; --radius-lg: 16px;
  --text-xs: 12px; --text-sm: 14px; --text-md: 16px; --text-lg: 20px;
  --control-h: 38px; --control-h-sm: 30px;
  --dur-fast: 120ms; --dur: 200ms; --dur-slow: 300ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
  --band: rgba(10, 17, 32, .62);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f0e4; --surface: #fbf7ef; --inset: #f1e9da; --line: #dccfb8; --btn-line: #cdbfa6;
    --text: #0b1526; --muted: #5f5a52; --off: #6b7280; --term-bg: #0b1526; --term-text: #e8eef8;
    --red: #dc2626; --accent: #c81e1e; --on-accent: #fff8ee;
    --on-red: #fff8ee; --red-deep-fg: #991b1b; --red-deep-bg: #991b1b1f;
    --ok: #15803d; --maint: #b45309;
    --shadow-pop: 0 18px 44px -16px rgba(60, 40, 10, .28);
    --band: rgba(246, 240, 228, .7);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f0e4; --surface: #fbf7ef; --inset: #f1e9da; --line: #dccfb8; --btn-line: #cdbfa6;
  --text: #0b1526; --muted: #5f5a52; --off: #6b7280; --term-bg: #0b1526; --term-text: #e8eef8;
  --red: #dc2626; --accent: #c81e1e; --on-accent: #fff8ee;
  --on-red: #fff8ee; --red-deep-fg: #991b1b; --red-deep-bg: #991b1b1f;
  --ok: #15803d; --maint: #b45309;
  --shadow-pop: 0 18px 44px -16px rgba(60, 40, 10, .28);
  --band: rgba(246, 240, 228, .7);
  color-scheme: light;
}

/* ---------- Page: plain navy / cream; the photo is a band at the top of public pages ---------- */
html, html:has(body.in-app) { background: var(--bg); }
body { background: transparent; color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.6; }
@media (max-width: 640px) { body { font-size: 16px; } }
::selection { background: color-mix(in srgb, var(--red) 35%, transparent); }
h1, h2, h3, .on-photo-muted { text-shadow: none; }

/* ---------- Type ---------- */
h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -0.03em; }
h2 { font-family: var(--font-head); font-weight: 600; font-size: 18px; line-height: 1.25; letter-spacing: -0.02em; }
h3 { font-family: var(--font-head); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.panel-head h2 { font-size: 16px; }
.prompt { display: none; }                         /* the "> btw …" terminal lines */
.label, th, thead th, .stat .label, .tile .label, .spec .label, .crm-inline .label, .alloc h3 {
  font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .01em; text-transform: none; color: var(--muted);
}
.role-pill, .staff-pill, .kind-pill, .reserved-tag, .urgent, .sev, .ack, .stage-pill, .emoji-label, .mention-badge, .chip, .plan .pill {
  font-family: var(--font-ui); letter-spacing: 0; text-transform: none; font-weight: 600;
}
.mono, code, kbd, .term, td.mono { font-family: var(--font-mono); }
a { text-underline-offset: 3px; }

/* ---------- Surfaces: hairline borders, no drop shadows, one radius scale ---------- */
.panel, .tile, .server-card, .empty, .crm-col, .crm-card, .menu-pop, .more-sheet, dialog, .addon { border-radius: var(--radius); box-shadow: none; }
.menu-pop, .more-sheet, dialog { box-shadow: var(--shadow-pop); border: 1px solid var(--btn-line); }
.panel-head { padding: 14px 18px; }
.tile { padding: 14px 16px; }
.tile-val { font-family: var(--font-head); font-weight: 600; font-size: 24px; letter-spacing: -0.01em; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.stat-val, .spec .v { font-family: var(--font-ui); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.stats, .specs { border-radius: var(--radius-sm); }
td, .facts li { font-variant-numeric: tabular-nums; }

/* ---------- Quiet chrome: no window dots; card captions stay as small mono labels ---------- */
.win-dots { display: none; }
.win-bar { background: transparent; padding: 10px 16px; }
.win-title, .win-bar > span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.brand .tag { display: none; }

/* ---------- Controls ---------- */
.btn { min-height: var(--control-h); padding: 0 16px; border-radius: 10px; font-family: var(--font-ui); font-weight: 600; font-size: 14px; letter-spacing: 0; gap: 7px; }
.btn .icon { width: 16px; height: 16px; }
.btn-sm { min-height: var(--control-h-sm); padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
.btn-primary:hover:not(:disabled) { filter: none; background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--btn-line); }
.btn-ghost:hover:not(:disabled) { background: var(--inset); border-color: var(--btn-line); }
.btn-ok, .btn-warn, .btn-stop { background: transparent; }
.btn-ok:hover:not(:disabled), .btn-warn:hover:not(:disabled), .btn-stop:hover:not(:disabled) { filter: none; background: var(--inset); }
.btn-danger { background: transparent; color: var(--red-deep-fg); border: 1px solid color-mix(in srgb, var(--red) 55%, transparent); }
.input, select.input { min-height: var(--control-h); padding: 0 12px; border-radius: 10px; font-size: 15px; background: var(--surface); border: 1px solid var(--btn-line); color: var(--text); }
textarea.input { padding: 10px 12px; }
.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); outline: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
button, [role="tab"], summary, label.check, .crm-card[draggable="true"] { cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* Shared header: lockup + site switcher (Home · Status · Panel) */
.topbar { padding-top: 22px; padding-bottom: 22px; }
.brand img { height: 44px; }
.sitenav { padding: 3px; gap: 2px; border-radius: 12px; box-shadow: none; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.sitenav a { min-height: 32px; padding: 0 12px; font-family: var(--font-ui); font-weight: 600; font-size: 14px; border-radius: 9px; }
.sitenav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.theme-toggle { background: var(--glass); }
@media (max-width: 640px) { .brand img { height: 36px; } }

/* Badges: small, sentence-case, dot + text */
.badge { font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 2px 8px; gap: 6px; }
.badge .dot { width: 6px; height: 6px; }

/* Footer */
.site-footer, .app-footer { font-family: var(--font-body); }
.site-footer h2, .sf-col h2 { font-family: var(--font-ui); font-weight: 600; font-size: 12px; letter-spacing: .01em; text-transform: none; color: var(--muted); text-shadow: none; }
.sf-logo small { font-family: var(--font-ui); letter-spacing: .02em; text-transform: none; font-size: 12px; }
.sf-bottom, .sf-fine { font-family: var(--font-ui); }

/* ---------- Panel ---------- */
.page-head { padding: 8px 0 20px; align-items: center; }
.page-head .muted { font-size: 14px; max-width: 72ch; }
.server-name { font-size: 18px; }
.server-card .card-body { padding: 16px; gap: 14px; }
.nav a, .nav-more, .tabs button, .tabs a, .side-search, .seg button { font-family: var(--font-ui); font-weight: 600; letter-spacing: 0; }
.tabs button, .tabs a { font-size: 14px; min-height: 38px; }
.who { font-family: var(--font-ui); font-size: 13px; }
.app-footer { font-size: 12px; }
@media (min-width: 981px) {
  .nav a { min-height: 34px; padding: 0 10px; font-size: 14px; }
  .nav a[aria-current="page"] { background: var(--inset); box-shadow: inset 2px 0 0 var(--red); }
  .nav a:hover { background: var(--inset); }
  .side-search { min-height: 34px; font-size: 13px; background: transparent; }
  body.in-app .appbar { gap: 12px; }
  .side-brand img { height: 36px; }
}
html:has(body.in-app) { background: radial-gradient(900px 420px at 100% -8%, color-mix(in srgb, var(--red) 7%, transparent), transparent 62%), var(--bg); }
.server-head { background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.server-head h1 { font-size: clamp(24px, 2.6vw, 30px); }
dialog::backdrop { background: rgba(5, 9, 18, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@media (max-width: 980px) { body.in-app .appbar { background: var(--glass); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); } }
dialog .panel-body h2 { font-size: 18px; }
.ticket-title { font-weight: 700; }
.toast { font-family: var(--font-ui); border-radius: var(--radius); }
.tl-dot { width: 8px; height: 8px; box-shadow: none; }
.tile-val.risk { color: var(--red); }

/* Sign-in card (panel) */
.auth .panel, .auth-card { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* ---------- Website (beyondthewire.us + legal pages) ---------- */
section { margin-top: 64px; }
.hero h1, .hero-copy h1 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -0.035em; }
.hero-lede { font-size: 18px; color: var(--muted); }
.section-head h2, section > h2 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -0.02em; }
.section-head { gap: 8px; }
.section-head .label { color: var(--red); }        /* the eyebrow keeps the brand colour, in sentence case */
.start-card .big { font-weight: 600; font-size: 52px; letter-spacing: -0.03em; }
.plan h3, .upgrade-head h3 { font-size: 20px; }
.plan-price .big { font-weight: 600; font-size: 38px; letter-spacing: -0.02em; }
.plan-price .per, .start-card .per { font-family: var(--font-ui); }
.plan .body, .upgrade .body { padding: 20px; }
.plan.featured { border-color: color-mix(in srgb, var(--red) 70%, transparent); }
.plan .pill { font-size: 12px; }
.subnav a, .nav a { font-family: var(--font-ui); font-weight: 600; }
.subnav .subnav-cta { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.hero-chips li { font-family: var(--font-ui); font-weight: 600; font-size: 13px; }
.legal-nav a { font-family: var(--font-ui); font-weight: 600; font-size: 13px; }
.legal-nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Outline buttons over the photo band get the same frosted backing as the header */
html:not(:has(body.in-app)) .btn-ghost { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
td { font-family: var(--font-ui); }
td.mono, .price, .upgrade-head .price, .addon .mono { font-family: var(--font-mono); }
.policy h3 { font-size: 16px; }
.cta-band h2 { font-size: 24px; }
.order-dialog h2 { font-size: 24px; }
.legal h1, article h1 { font-size: clamp(30px, 3.4vw, 40px); }
.legal h2, article h2 { font-size: 20px; margin-top: 28px; }
.why-icon { border-radius: var(--radius-sm); }
.hl { background-image: linear-gradient(var(--red), var(--red)); }

/* ---------- Public pages use the whole desktop screen ----------
   Design rule (MASTER.md, "Full-screen desktop"): the website and status page are designed for a
   1920px+ monitor first and scale down, never the other way round. Wide content column, big hero
   that fills the first screen, display-size headings, generous section spacing. App screens in the
   panel stay compact; this only applies to <body class="site-page">. */
body.site-page { font-size: 16px; }
@media (min-width: 1100px) { body.site-page { font-size: 17px; } }
.site-page .wrap, .site-page .page { max-width: 1920px; padding-left: clamp(16px, 5vw, 112px); padding-right: clamp(16px, 5vw, 112px); }
.site-page section { margin-top: clamp(64px, 8vw, 144px); }
.site-page .hero { min-height: min(76vh, 1200px); align-items: center; gap: clamp(32px, 5vw, 104px); margin-top: clamp(16px, 3vw, 56px); }
.site-page .hero h1, .site-page .hero-copy h1 { font-size: clamp(40px, 5vw, 96px); line-height: 1.02; letter-spacing: -0.04em; max-width: 17ch; }
.site-page .hero-lede, .site-page .lede { font-size: clamp(17px, 1.3vw, 22px); max-width: 52ch; }
.site-page .hero-copy { gap: clamp(18px, 1.6vw, 28px); }
.site-page .section-head h2, .site-page section > h2 { font-size: clamp(28px, 3.2vw, 56px); line-height: 1.08; letter-spacing: -0.03em; }
.site-page .section-head p { font-size: clamp(16px, 1.15vw, 20px); max-width: 62ch; }
.site-page .section-head { margin-bottom: clamp(20px, 2vw, 36px); }
.site-page .why-grid, .site-page .plans, .site-page .upgrades, .site-page .tiles { gap: clamp(16px, 1.6vw, 28px); }
.site-page .start-card .big { font-size: clamp(52px, 4.6vw, 84px); }
.site-page .plan-price .big { font-size: clamp(38px, 2.8vw, 52px); }
.site-page .plan h3, .site-page .upgrade-head h3, .site-page .why-grid h3 { font-size: clamp(18px, 1.35vw, 24px); }
.site-page .legal h1, .site-page article h1 { font-size: clamp(32px, 3.6vw, 60px); }
html:not(:has(body.in-app)) body.site-page::before { height: min(1100px, 100vh); }
.site-page .features, .site-page .why-grid p, .site-page .step p, .site-page .upgrade p, .site-page .policy p { font-size: clamp(15px, 1vw, 18px); }
.site-page .plan .body, .site-page .upgrade .body { padding: clamp(20px, 1.6vw, 32px); }
.site-page .hero-chips li { font-size: clamp(13px, .85vw, 15px); }
@media (max-width: 900px) { .site-page .hero { min-height: 0; } }

/* ---------- Status page ---------- */
.status-strip, .motd, .notice, .help-link { font-family: var(--font-ui); letter-spacing: 0; }
.status-strip { font-weight: 600; }
.host { font-family: var(--font-mono); }          /* addresses are data */
.server-icon { border-radius: var(--radius-sm); }
.server-mark { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--font-head); font-weight: 600; font-size: 20px; color: var(--text);
  background: linear-gradient(135deg, color-mix(in srgb, var(--red) 22%, var(--inset)), var(--inset)); border-radius: inherit; }
.overview .tile-val, .tiles .tile-val { font-size: 28px; }
.statusbar, .status-bar { border-radius: var(--radius); box-shadow: none; }
.player-pill { font-family: var(--font-ui); font-weight: 600; }
.notice { border-radius: var(--radius-sm); }
