/* ============================================================
   GOdin — styles
   Palette: deep night blue for the watch surfaces, cool stone
   for reading surfaces, bronze for anything you can act on.
   ============================================================ */

:root {
  --night:   #0E1622;
  --slab:    #16202F;
  --slab-2:  #1D293A;
  --stone:   #ECEDE9;
  --stone-2: #E1E3DE;
  --ink:     #151B22;
  --ink-mid: #4A545F;
  --line:    #CFD2CC;
  --line-dk: #2A3648;

  --bronze:      #C08A3E;
  --bronze-deep: #8A5A17;

  --ok:    #7FA98A;
  --warn:  #D3A44A;
  --stale: #C0705E;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --shell: 1120px;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--cond);
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5.4vw, 3.9rem); line-height: 1.06; }
h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.14; }
h3 { font-size: 1.2rem; line-height: 1.3; }

p { margin: 0 0 1.05em; max-width: 64ch; }

a { color: var(--bronze-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

code { font-family: var(--mono); font-size: 0.92em; }

:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
  border-radius: 2px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bronze);
  color: var(--night);
  padding: 10px 16px;
  z-index: 10;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */

.topbar {
  background: var(--night);
  color: var(--stone);
  border-bottom: 1px solid var(--line-dk);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 66px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  color: var(--stone);
  text-decoration: none;
}
.wordmark-mark { width: 26px; height: 26px; color: var(--bronze); flex: none; }

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.95rem;
}
.topnav a {
  color: #C3CBD6;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.topnav a:hover { color: #fff; border-bottom-color: var(--bronze); }
.topnav-source { color: var(--bronze) !important; }

/* ---------- hero ---------- */

.hero {
  background: var(--night);
  color: var(--stone);
  padding-block: clamp(56px, 8vw, 104px) clamp(56px, 8vw, 96px);
  border-bottom: 1px solid var(--line-dk);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero-copy h1 { color: #F6F7F5; }

.lede {
  margin-top: 22px;
  font-size: 1.12rem;
  line-height: 1.62;
  color: #BFC8D2;
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.btn-primary { background: var(--bronze); color: var(--night); }
.btn-primary:hover { background: #D69C4C; color: var(--night); }
.btn-ghost { border-color: #46536A; color: #DDE3EA; }
.btn-ghost:hover { border-color: var(--bronze); color: #fff; }

.hero-meta {
  margin-top: 26px;
  font-size: 0.92rem;
  color: #8794A4;
  max-width: 46ch;
}

/* ---------- fleet wall ---------- */

.wall {
  background: var(--slab);
  border: 1px solid var(--line-dk);
  padding: 18px 20px 20px;
}

.wall-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-dk);
}
.wall-title { font-family: var(--cond); font-weight: 600; font-size: 1.05rem; color: #E7EAEE; }
.wall-count { font-size: 0.85rem; color: #7F8C9C; }

.wall-list { list-style: none; margin: 0; padding: 0; }

.host {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name state" "os state";
  gap: 0 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  animation: settle .5s ease both;
  animation-delay: calc(var(--i, 0) * 55ms + 120ms);
}
.host:last-child { border-bottom: 0; padding-bottom: 2px; }

.host-name {
  grid-area: name;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: #E7EAEE;
}
.host-os {
  grid-area: os;
  font-size: 0.8rem;
  color: #78859A;
}
.host-state {
  grid-area: state;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #AEB9C6;
  white-space: nowrap;
}
.host-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.s-ok    { color: var(--ok); }
.s-warn  { color: var(--warn); }
.s-stale { color: var(--stale); }

@keyframes settle {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- bands ---------- */

.band { padding-block: clamp(56px, 7vw, 92px); }
.band-alt { background: var(--stone-2); }

.band h2 + .section-lede { margin-top: 16px; }

.section-lede {
  font-size: 1.08rem;
  color: var(--ink-mid);
  max-width: 58ch;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.split-text h2 { margin-bottom: 20px; }

.aside-title {
  font-size: 1rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 4px;
}

.facts { margin: 0; }
.fact { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fact dt { font-weight: 600; margin-bottom: 3px; }
.fact dd { margin: 0; color: var(--ink-mid); font-size: 0.96rem; max-width: 46ch; }

/* ---------- how it works ---------- */

.flow {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.step {
  padding: 0 26px;
  border-left: 1px solid var(--line);
}
.step:first-child { padding-left: 0; border-left: 0; }
.step:last-child { padding-right: 0; }

.step-num {
  display: block;
  font-family: var(--cond);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bronze-deep);
  line-height: 1;
  margin-bottom: 12px;
}
.step h3 { margin-bottom: 8px; }
.step p { font-size: 0.96rem; color: var(--ink-mid); margin: 0; }

/* ---------- tabs ---------- */

.tabs { margin-top: 36px; }

.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 10px 4px;
  margin-right: 24px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink-mid);
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--bronze); }

.tabpanel { padding-top: 26px; }

.step-head {
  font-size: 1.02rem;
  margin-bottom: 10px;
}
.step-head + .code { margin-top: 0; }
.tabpanel .code + .step-head { margin-top: 28px; }

/* ---------- code blocks ---------- */

.code {
  position: relative;
  margin: 14px 0 0;
  background: var(--night);
  border: 1px solid var(--line-dk);
}

.code pre {
  margin: 0;
  padding: 18px 92px 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: #DDE4EC;
  tab-size: 2;
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 11px;
  font: 500 0.78rem var(--sans);
  color: #B6C1CE;
  background: var(--slab-2);
  border: 1px solid #34435A;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.copy:hover { color: #fff; border-color: var(--bronze); }
.copy[data-done="true"] { color: var(--ok); border-color: var(--ok); }

.note {
  margin-top: 22px;
  font-size: 0.94rem;
  color: var(--ink-mid);
  border-left: 2px solid var(--bronze);
  padding-left: 14px;
  max-width: 62ch;
}

/* ---------- two columns ---------- */

.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 56px);
  margin-top: 36px;
}
.col h3 { margin-bottom: 12px; }
.col p { font-size: 0.98rem; }
.col .code + p { margin-top: 18px; }

/* ---------- compatibility table ---------- */

.compat {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}
.compat caption {
  text-align: left;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.compat th {
  text-align: left;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink-mid);
  padding: 12px 12px 8px 0;
}
.compat td {
  padding: 10px 12px 10px 0;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.compat .yes { color: #3F7A55; }
.compat .no  { color: #A3402C; }

/* ---------- footer ---------- */

.footer {
  background: var(--night);
  color: #96A2B1;
  padding-block: 44px;
  font-size: 0.94rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer p { margin: 10px 0 0; max-width: 34ch; }
.wordmark-static { color: var(--stone); }
.footer-nav { display: grid; gap: 9px; }
.footer-nav a { color: #B7C2CF; text-decoration: none; }
.footer-nav a:hover { color: var(--bronze); text-decoration: underline; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-grid,
  .split,
  .cols { grid-template-columns: minmax(0, 1fr); }

  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }

  .aside-title, .compat caption { margin-top: 8px; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }

  .topbar-inner { padding-block: 12px; }
  .topnav { gap: 16px; font-size: 0.9rem; flex-wrap: wrap; }

  .flow { grid-template-columns: minmax(0, 1fr); }
  .step { padding: 0 0 0 18px; border-left: 1px solid var(--line); }
  .step:first-child { padding-left: 18px; border-left: 1px solid var(--line); }

  .code pre { padding: 46px 16px 16px; font-size: 0.82rem; }
  .copy { top: 8px; right: 8px; }

  .host { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "os" "state"; gap: 2px; }
  .host-state { margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
