/* Crown Network design system: tokens, base, browser surfaces and shared chrome.
   Every page loads this file; the landing adds home.css, the app pages add app.css. */

@font-face { font-family: "Host Grotesk"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("/fonts/host-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Host Grotesk"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("/fonts/host-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  --bg: #08090a;
  --bg-raised: #0f1011;
  --bg-panel: #141517;
  --bg-hover: #1a1b1e;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.14);
  --text: #f7f8f8;
  --text-2: #b4b8c0;
  --text-3: #8a8f98;
  --gold: #d4a537;
  --gold-soft: rgb(212 165 55 / 0.14);
  --green: #4cc38a;
  --gem: #e1261c;
  --danger: #f08a80;

  --font: "Host Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --t-xs: 0.8125rem;
  --t-sm: 0.875rem;
  --t-base: 1rem;
  --t-lg: 1.1875rem;
  --t-xl: 1.5rem;
  --t-2xl: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --t-3xl: clamp(2.25rem, 1.4rem + 3.4vw, 3.5rem);
  --t-hero: clamp(3rem, 1.6rem + 5.2vw, 4.75rem);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --gutter: clamp(20px, 4vw, 56px);
  --maxw: 1200px;
  --bar-h: 64px;

  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-pill: 999px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -8px rgb(0 0 0 / 0.6);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--t-base); line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; }
.pixel { image-rendering: pixelated; shape-rendering: crispEdges; }

/* Browser surfaces */
::selection { background: var(--gold); color: #120d03; }
:root { caret-color: var(--gold); accent-color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: var(--r-sm); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: currentColor; }
html { scrollbar-color: rgb(255 255 255 / 0.18) transparent; scrollbar-width: thin; }
table, .nums { font-variant-numeric: tabular-nums; }
code, kbd { font-family: var(--mono); font-size: 0.92em; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-4); border-radius: var(--r);
  background: var(--text); color: var(--bg);
  font-size: var(--t-sm); font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: #fff; } }
.btn--small { height: 32px; padding: 0 var(--s-3); font-size: var(--t-xs); border-radius: 8px; }
.btn--lg { height: 48px; padding: 0 var(--s-5); font-size: var(--t-base); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover { background: var(--bg-hover); } }
.btn--danger { background: transparent; color: var(--danger); border-color: rgb(240 138 128 / 0.35); }
@media (hover: hover) and (pointer: fine) { .btn--danger:hover { background: rgb(240 138 128 / 0.08); } }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.is-done { background: var(--green); color: #04140b; }
.link-btn { appearance: none; background: none; border: 0; padding: 0; color: var(--text-3); font-size: var(--t-sm); cursor: pointer; text-decoration: underline; text-underline-offset: 0.22em; }
.link-btn:hover { color: var(--text); }

/* Address field: the one action of the site */
.address {
  display: inline-flex; align-items: center; gap: var(--s-4);
  padding: 5px 5px 5px var(--s-4);
  background: var(--text); color: var(--bg); border-radius: var(--r);
}
.address code { font-size: 0.9375rem; font-weight: 500; letter-spacing: -0.01em; }
.address .btn { height: 38px; border-radius: 7px; background: var(--bg); color: var(--text); }
@media (hover: hover) and (pointer: fine) { .address .btn:hover { background: #24262a; } }
.address .btn.is-done { background: #0d5a33; color: #fff; }

/* Live dot */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.is-on { background: var(--green); box-shadow: 0 0 0 3px rgb(76 195 138 / 0.18); }
.dot.is-off { background: var(--danger); }
@media (prefers-reduced-motion: no-preference) {
  .dot.is-on { animation: pulse 2.4s var(--ease) infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(76 195 138 / 0.04); } }
}

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 50; height: var(--bar-h);
  display: flex; align-items: center; gap: var(--s-6); padding: 0 var(--gutter);
  background: rgb(8 9 10 / 0.78); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(150%) blur(12px);
}
.bar__brand { display: flex; align-items: center; gap: var(--s-3); font-weight: 600; font-size: 0.9375rem; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; flex: none; }
.bar__brand img, .bar__brand svg { width: 26px; height: 16px; }
.bar__nav { display: flex; gap: var(--s-6); margin: 0 auto; font-size: var(--t-sm); }
.bar__nav a { color: var(--text-3); text-decoration: none; transition: color 160ms var(--ease); }
.bar__nav a:hover, .bar__nav a[aria-current="page"] { color: var(--text); }
.bar__user { display: flex; align-items: center; gap: var(--s-4); font-size: var(--t-sm); color: var(--text-3); }
.bar__user a { text-decoration: none; }
@media (max-width: 760px) { .bar { gap: var(--s-4); } .bar__nav { display: none; } .bar__user { margin-left: auto; gap: var(--s-3); white-space: nowrap; } }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: var(--s-6) var(--gutter); }
.foot__in { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); align-items: center; font-size: var(--t-xs); color: var(--text-3); }
.foot__in nav { display: flex; gap: var(--s-5); }
.foot__in a { color: var(--text-2); text-decoration: none; }
.foot__in a:hover { color: var(--text); }
.foot__note { margin-left: auto; }
@media (max-width: 760px) { .foot__note { margin-left: 0; } }

/* Small shared atoms */
.tag { display: inline-block; padding: 0 7px; border: 1px solid rgb(212 165 55 / 0.45); border-radius: var(--r-sm); color: var(--gold); font-size: 0.6875rem; font-weight: 500; line-height: 1.6; letter-spacing: 0.02em; vertical-align: 2px; }
.empty-line { color: var(--text-3); font-size: var(--t-sm); padding: var(--s-4) 0; border-top: 1px solid var(--line); margin: var(--s-5) 0 0; }
