/* wharfy — "Night harbor" theme. Static, no-JS, no trackers.
   ----------------------------------------------------------------------------
   The page is deep harbor water at night. Content sits lit on the quay; the
   terminal panels are lit windows on the water; the accents are harbor lights:
   a cyan dock light for every primary affordance, a sodium-amber crane light for
   status. Written from scratch for wharfy — it shares nothing with a template.
   Tech in the bones (mono, a real CLI session), harbor in the light. */

:root {
  /* water */
  --bg: #081521;          /* deep harbor navy */
  --bg-2: #06111b;        /* deeper water (page bottom) */
  --glow: #103253;        /* port-light haze on the horizon */
  /* lit surfaces */
  --panel: #112a3e;       /* a lit console, top */
  --panel-2: #0d2233;     /* a lit console, bottom */
  /* ink */
  --ink: #e3edf5;         /* primary text */
  --muted: #8ca3b7;       /* secondary text */
  --faint: #5d7488;       /* dimmest — disabled output, ticks */
  /* rules */
  --line: rgba(127, 177, 217, 0.14);
  --line-strong: rgba(127, 177, 217, 0.30);
  /* harbor lights */
  --cyan: #4cb2ea;        /* dock light — links, prompt, primary */
  --cyan-bright: #74c6f2; /* hover / lit edge */
  --cyan-ink: #06151f;    /* text on a cyan fill */
  --amber: #f0a843;       /* crane / sodium light — status, next: */
  --green: #46d3a3;       /* signal light — live / ok */

  --frame: 54rem;         /* the wide canvas (header, home, footer) */
  --measure: 42rem;       /* the narrow column for long-form reading */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font: 16.5px/1.65 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  /* Layered water: a port-light haze rising from the top, sinking to deep water,
     over a faint set of depth lines (a nautical chart's soundings). */
  background-image:
    radial-gradient(140% 70% at 50% -8%, var(--glow) 0%, rgba(16, 50, 83, 0) 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%),
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(127, 177, 217, 0.022) 43px 44px);
  background-attachment: fixed;
  background-repeat: no-repeat, no-repeat, repeat;
  min-height: 100vh;
}

/* The frame: header, content and footer share the wide canvas. Long-form text
   narrows itself within it (see prose, below) — the home runs full width. */
.site-header,
.content,
.site-footer {
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

a { color: var(--cyan); text-decoration: none; text-underline-offset: 2px; }
a:hover { color: var(--cyan-bright); }
a:focus-visible,
button:focus-visible,
input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 3px; }

/* ===== header — the dockside waterline ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.site-title {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
/* an anchor riding ahead of the wordmark — the harbor, stated once up front */
.site-title::before {
  content: "⚓";
  margin-right: 0.5rem;
  color: var(--cyan);
  font-size: 0.92em;
  -webkit-text-fill-color: var(--cyan);
}
.site-header-end { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.site-header nav a {
  margin-left: 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}
.site-header nav a:first-child { margin-left: 0; }
.site-header nav a:hover { color: var(--cyan-bright); }

/* CSS-only hamburger (no JS) — revealed on phones by the media query below. */
.nav-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nav-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}
.nav-toggle-btn:hover { color: var(--cyan-bright); }
.nav-toggle:focus-visible ~ .nav-toggle-btn { outline: 2px solid var(--cyan); outline-offset: 2px; }

.ext-icon {
  width: 0.72em; height: 0.72em;
  margin-left: 0.3em;
  vertical-align: -0.05em;
  opacity: 0.55;
}
.site-header nav a:hover .ext-icon,
.footer-nav a:hover .ext-icon { opacity: 1; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.lang-switch { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); gap: 0.5rem; }
.lang-switch a { color: var(--faint); }
.lang-switch a:hover { color: var(--cyan-bright); }
.lang-switch .lang-current { color: var(--ink); font-weight: 600; }

/* ===== shared content ===== */
.content { padding-top: 0; padding-bottom: 2rem; }

h1 {
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 680;
  margin: 0 0 1.15rem;
  color: #f1f6fb;
}
h2 { font-size: 1.4rem; line-height: 1.28; letter-spacing: -0.015em; font-weight: 660; margin: 2rem 0 1rem; }
h3 { font-size: 1.1rem; line-height: 1.3; font-weight: 640; margin: 1.8rem 0 0.5rem; }
p, ul, ol, blockquote { margin: 0 0 1rem; }

blockquote {
  margin-inline: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
}

code, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: rgba(127, 177, 217, 0.1);
  color: #cfe6f5;
  padding: 0.12em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}
pre {
  padding: 1rem 1.15rem;
  overflow-x: auto;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  color: #cfe0ee;
  border: 1px solid var(--line);
  border-top-color: var(--line-strong);
  border-radius: 9px;
}
pre code { background: none; padding: 0; color: inherit; }

time { color: var(--faint); font-size: 0.85rem; font-family: var(--mono); }

/* ===== copy-to-clipboard (progressive enhancement, JS-injected) ===== */
.highlight, .install .cta-line { position: relative; }
.copy-btn {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  color: var(--muted);
  background: rgba(127, 177, 217, 0.08);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.highlight:hover .copy-btn,
.install .cta-line:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--cyan-bright); border-color: var(--cyan); }
.copy-btn.copied { color: var(--green); border-color: var(--green); opacity: 1; }
.install .cta-line .copy-btn { top: 50%; right: 0.35rem; transform: translateY(-50%); }
@media (hover: none) { .copy-btn { opacity: 0.7; } }

/* ===== home: hero ===== */
.hero { padding-top: 3.6rem; }
.hero h1 { font-weight: 640; font-size: clamp(2rem, 6.4vw, 2.7rem); margin-bottom: 1.6rem; max-width: 22ch; }
.lede { font-size: 1.1rem; color: #c5d4e1; margin: 0 0 0.75rem; max-width: 40rem; }
.hero-breadth { font-size: 1rem; color: var(--muted); margin: 0 0 1.7rem; max-width: 40rem; }
.hero-breadth b { color: var(--cyan); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin: 0 0 1rem; }

.btn {
  display: inline-block;
  background: var(--cyan);
  color: var(--cyan-ink);
  font-weight: 650;
  padding: 0.75rem 1.3rem;
  border-radius: 8px;
  font-size: 0.98rem;
  white-space: nowrap;
  box-shadow: 0 8px 26px -10px rgba(76, 178, 234, 0.7);
}
.btn:hover { background: var(--cyan-bright); color: var(--cyan-ink); }

/* the hero install panel — a small lit console of its own */
.install { flex: 1; min-width: 18rem; display: flex; flex-direction: column; gap: 0.55rem; }
.os-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.os-tabs { display: flex; gap: 0.4rem; }
.os-tabs label {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.38rem 0.78rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}
.os-tabs label:hover { color: var(--ink); border-color: var(--cyan); }
#os-mac:checked ~ .os-tabs label[for="os-mac"],
#os-win:checked ~ .os-tabs label[for="os-win"],
#os-linux:checked ~ .os-tabs label[for="os-linux"] {
  color: var(--cyan-ink);
  background: var(--cyan);
  border-color: var(--cyan);
}
#os-mac:focus-visible ~ .os-tabs label[for="os-mac"],
#os-win:focus-visible ~ .os-tabs label[for="os-win"],
#os-linux:focus-visible ~ .os-tabs label[for="os-linux"] { outline: 2px solid var(--cyan); outline-offset: 2px; }
.os-panel { display: none; }
#os-mac:checked ~ .os-panel.os-mac,
#os-win:checked ~ .os-panel.os-win,
#os-linux:checked ~ .os-panel.os-linux { display: block; }

/* shared lit-console surface (hero install + session blocks) */
.cta, .console {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 14px 38px -16px rgba(0, 0, 0, 0.7);
  font-family: var(--mono);
}
.cta {
  padding: 1rem 1.15rem;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cta-line { display: flex; align-items: flex-start; gap: 0.6rem; }
.cta .pr, .console .pr { color: var(--cyan); }
.cta .cm {
  color: #d2e4f1; flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; -ms-overflow-style: none;
}
.cta .cm::-webkit-scrollbar { display: none; }

/* ===== home: the session =====
   The page below the hero is one wharfy run, stacked top to bottom. No marketing
   cards: each step is a short claim (the margin note) over the real output that
   backs it (the lit console), and the closing `next:` names the command that
   opens the following console — so the page demonstrates the product's promise
   (output is the contract; every command says what's next) by being a run you
   read. A dotted dock-light rail strings the steps together. */
.session { padding-top: 4rem; }
.session-intro { font-size: 1.05rem; color: var(--muted); margin: 0 0 2.4rem; max-width: 42rem; }
.session-intro::before { content: "// "; color: var(--cyan); font-family: var(--mono); }

.step { position: relative; padding-bottom: 2.2rem; }
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.6rem;
  bottom: 0.5rem;
  height: 1.3rem;
  border-left: 2px dotted var(--cyan);
  opacity: 0.5;
}
.step-note { font-size: 1.06rem; line-height: 1.5; color: var(--ink); margin: 0 0 0.9rem; max-width: 40rem; }
.step-note b { color: var(--cyan); font-weight: 600; }

.console { padding: 1rem 1.2rem; font-size: 0.88rem; line-height: 1.7; overflow-x: auto; }
.c-cmd { white-space: pre; }
.console .cmd { color: #eef5fb; }
.c-out { color: var(--muted); white-space: pre; }
/* status rows: channel · tag · state · version, in aligned mono columns; the
   console scrolls sideways on narrow screens rather than reflowing. */
.c-row { display: grid; grid-template-columns: 7.5rem 5rem 6.5rem auto; gap: 0 1rem; width: max-content; min-width: 100%; }
.c-ch { color: #d6e4f0; }
.c-probe { color: var(--faint); }
.st-live { color: var(--green); }
.st-wait { color: var(--amber); }
.st-none { color: var(--faint); }
.c-ver { color: var(--muted); }
.c-next { margin-top: 0.55rem; color: #cfe0ee; white-space: pre; }
.c-next .kw { color: var(--amber); font-weight: 600; }

/* ===== home: closer ===== */
.closer { padding-top: 4.4rem; }
.closer-lead,
.closer-punch {
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0;
}
.closer-lead { font-weight: 600; color: var(--ink); }
.closer-punch { font-weight: 680; color: var(--cyan); margin-bottom: 1.2rem; }

/* ===== prose pages (single / list / 404) — narrowed for reading ===== */
.post, .page-header, .page-intro, .notfound {
  max-width: var(--measure);
  margin-inline: auto;
}
.post, .page-header, .notfound { padding-top: 3rem; }
.post-header { margin-bottom: 1.3rem; }
.post-header h1, .page-header h1 { margin-bottom: 0.4rem; }
.page-header { padding-top: 3rem; }
.page-intro { color: var(--muted); }
.post a, .page-intro a { text-decoration: underline; text-decoration-color: var(--line-strong); }
.post a:hover, .page-intro a:hover { text-decoration-color: var(--cyan); }

.post-list { list-style: none; padding: 0; max-width: var(--measure); margin-inline: auto; }
.post-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

/* ===== footer — the far end of the quay ===== */
.site-footer {
  margin-top: 4.5rem;
  padding-top: 1.4rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.site-footer p { margin: 0; }
.footer-meta { display: flex; flex-direction: column; gap: 0.3rem; }
.site-footer a { color: var(--faint); white-space: nowrap; }
.site-footer a:hover { color: var(--cyan-bright); }
.footer-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.45rem 1rem; }
.site-footer-credit { flex-basis: 100%; margin-top: 0.4rem; opacity: 0.65; font-size: 0.72rem; }

/* ===== responsive ===== */
@media (max-width: 30rem) {
  .site-header { flex-wrap: wrap; }
  .nav-toggle-btn { display: inline-flex; }
  .site-header-end {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    margin-top: 1rem;
  }
  #nav-toggle:checked ~ .site-header-end { display: flex; }
  .site-header nav:not(.lang-switch) { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .site-header nav:not(.lang-switch) a { margin-left: 0; font-size: 0.95rem; }
}
