/* Self-hosted fonts: Besley (variable, wght axis 400 to 900) and Albert
   Sans (one variable file covers 400 to 700). Latin and latin-ext
   subsets only, from the Google Fonts CSS API; licenses sit beside the
   files (OFL-Besley.txt, OFL-AlbertSans.txt). */
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/albert-sans-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/albert-sans-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: 'Besley';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/static/fonts/besley-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Besley';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/static/fonts/besley-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;
}

/* Gopher relay stylesheet (design reference)
   Layout: one left-aligned column, 1120px wide, on a pale sky ground (the
   sky seen through the burrow in the banner). The courier artwork is the
   only hero, held in a rounded panel so the warm painting sits on the cool
   ground. The signed-in shell is a quiet top bar; the current page gets a
   fur-orange underline. The footer is the burrow: dark chocolate earth.
   Ink and accents were sampled from assets/brand/banner.jpg and
   avatar-512.png so the site and the artwork read as one thing. */

:root {
  --lockup: grayscale(1);
  /* surfaces */
  --ground: #eef3f3;         /* page; the sky through the burrow, greyed */
  --surface: #ffffff;        /* cards, inputs */
  --inset: #e2eaea;          /* command blocks, hover fills, table heads */
  --line: #d3dede;           /* hairlines */
  --line-strong: #a9bdbd;    /* input borders */
  /* ink */
  --chestnut: #3d1908;       /* wordmark, headings; the banner's "Gopher" */
  --ink: #3b2a20;            /* body text */
  --muted: #6e665f;          /* secondary text */
  /* brand accents */
  --teal: #0a6667;           /* actions and links; "Surface results." */
  --teal-deep: #084f50;
  --teal-soft: #d6e8e6;
  --fur: #c76026;            /* current-page marker, small warm touches */
  --brass: #d09c53;          /* focus ring; the satchel buckle */
  --cream: #fad084;          /* the parcel; footer type */
  --earth: #2b1508;          /* footer, the tunnel */
  --earth-2: #50250b;
  /* state (separate from the accent) */
  --ok: #4f7d2a;      --ok-soft: #e1ecd4;
  --warn: #a8701a;    --warn-soft: #fbeac4;
  --bad: #b23a1f;     --bad-soft: #f7dcd4;
  /* type */
  --display: "Besley", "Clarendon", "Rockwell", Georgia, serif;
  --sans: "Albert Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --t-xs: 0.8125rem;  /* 13 */
  --t-sm: 0.9rem;     /* 14.4 */
  --t-base: 1rem;     /* 16 */
  --t-lg: 1.1875rem;  /* 19 */
  --t-xl: 1.4375rem;  /* 23 */
  --t-2xl: 1.8125rem; /* 29 */
  --t-3xl: 2.375rem;  /* 38 */
  --t-4xl: 3.25rem;   /* 52 */
  --t-wordmark: clamp(4rem, 9vw, 6.5rem);
  --shadow: 0 1px 2px rgba(20, 40, 40, 0.06), 0 10px 28px -18px rgba(20, 40, 40, 0.35);
  --radius-card: 14px;
  --radius-control: 8px;
  --radius-code: 6px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

/* Dark theme: the burrow. Same hue family as the footer. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #1d0f07; --surface: #2a160b; --inset: #35200f;
    --line: #4b2d18; --line-strong: #6a4428;
    --chestnut: #fbeed4; --ink: #e9d9bd; --muted: #bfa184;
    --teal: #3f9c9b; --teal-deep: #5bb3b1; --teal-soft: #173c3b;
    --fur: #e3803f; --brass: #e0ad63; --cream: #fad084;
    --earth: #120904; --earth-2: #2b1508;
    --ok: #a3c76e; --ok-soft: #2a3a17;
    --warn: #e7b86a; --warn-soft: #3f2e10;
    --bad: #f08c74; --bad-soft: #4a1d12;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
    --lockup: grayscale(1) invert(1) brightness(1.15);
  }
}
:root[data-theme="dark"] {
  --ground: #1d0f07; --surface: #2a160b; --inset: #35200f;
  --line: #4b2d18; --line-strong: #6a4428;
  --chestnut: #fbeed4; --ink: #e9d9bd; --muted: #bfa184;
  --teal: #3f9c9b; --teal-deep: #5bb3b1; --teal-soft: #173c3b;
  --fur: #e3803f; --brass: #e0ad63; --cream: #fad084;
  --earth: #120904; --earth-2: #2b1508;
  --ok: #a3c76e; --ok-soft: #2a3a17;
  --warn: #e7b86a; --warn-soft: #3f2e10;
  --bad: #f08c74; --bad-soft: #4a1d12;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -18px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
  --lockup: grayscale(1) invert(1) brightness(1.15);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.55;
  min-height: 100%;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--teal-deep); }
h1, h2, h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  color: var(--chestnut);
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--t-3xl); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: var(--t-2xl); font-weight: 700; }
h3 { font-size: var(--t-xl); font-weight: 700; }
p { margin: 0; }
.lede { font-size: var(--t-lg); line-height: 1.5; max-width: 46ch; }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
code, kbd { font-family: var(--mono); font-size: 0.92em; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: var(--radius-code); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 2rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.row > * { min-width: 0; }

/* ---------- top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--ground); }
.topbar .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--chestnut); }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.brand span {
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 900; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1;
}
.nav { display: flex; gap: 0.25rem; margin-left: 0.5rem; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: var(--t-sm);
  padding: 0.55rem 0.7rem; border-radius: var(--radius-control); position: relative;
}
.nav a:hover { background: var(--inset); color: var(--chestnut); }
.nav a[aria-current="page"] { color: var(--chestnut); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: -1px;
  height: 3px; border-radius: 2px 2px 0 0; background: var(--fur);
}
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; font-size: var(--t-sm); color: var(--muted); }
.topbar .who form { margin: 0; }
@media (max-width: 640px) {
  .topbar .wrap { flex-wrap: wrap; row-gap: 0; padding-block: 0.5rem; }
  .nav { order: 3; width: 100%; margin-left: -0.7rem; }
  .topbar .who .email { display: none; }
}

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center;
  background: var(--teal); color: #fff; border: 1.5px solid var(--teal);
  padding: 0.6rem 1.1rem; border-radius: var(--radius-control);
  font: 600 var(--t-sm)/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.btn-lg { padding: 0.8rem 1.4rem; font-size: var(--t-base); }
.btn-secondary { background: transparent; color: var(--chestnut); border-color: var(--chestnut); }
.btn-secondary:hover { background: var(--inset); color: var(--chestnut); border-color: var(--chestnut); }
.btn-quiet { background: transparent; color: var(--teal); border-color: transparent; padding-inline: 0.6rem; }
.btn-quiet:hover { background: var(--inset); color: var(--teal-deep); border-color: transparent; }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.btn-copy {
  background: var(--surface); color: var(--teal); border: 1px solid var(--line-strong);
  padding: 0.3rem 0.6rem; font-size: var(--t-xs); border-radius: var(--radius-code); flex: 0 0 auto;
}
.btn-copy:hover { background: var(--teal-soft); color: var(--teal-deep); border-color: var(--teal); }
.btn-copy.copied { color: var(--ok); border-color: var(--ok); }
.btn svg { width: 18px; height: 18px; flex: none; }

label { display: block; font-weight: 600; font-size: var(--t-sm); color: var(--chestnut); margin-bottom: 0.3rem; }
.hint { font-size: var(--t-xs); color: var(--muted); margin-top: 0.3rem; }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; font: 400 var(--t-base)/1.4 var(--sans); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-control);
  padding: 0.55rem 0.75rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--brass); outline-offset: 0; border-color: var(--brass); }
.field { max-width: 420px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }

/* ---------- command block ---------- */
.cmd {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: var(--inset); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.85rem 1rem;
}
.cmd code { flex: 1 1 auto; min-width: 0; font-size: var(--t-sm); line-height: 1.5; color: var(--chestnut); overflow-wrap: anywhere; white-space: pre-wrap; }
.cmd .prompt { color: var(--muted); user-select: none; }

/* ---------- cards and panels ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow); padding: 1.25rem 1.4rem;
}
.panel { border-top: 1px solid var(--line); padding-top: 1.25rem; }

/* ---------- settings: banners, field errors, disclosures ---------- */
.banner { margin: 0; padding: 0.7rem 1rem; border-radius: var(--radius-control); border-left: 4px solid var(--teal); background: var(--surface); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.banner-ok { border-left-color: var(--ok); }
.banner-warn { border-left-color: var(--warn); }
.banner-bad { border-left-color: var(--bad); }
.field-error { color: var(--bad); font-size: var(--t-sm); font-weight: 600; margin-top: 0.3rem; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
label.check { display: flex; gap: 0.6rem; align-items: center; font-weight: 600; }
label.check input { width: auto; }
details.more { border-top: 1px solid var(--line); padding-top: 0.9rem; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: var(--t-sm); color: var(--teal); }
details.more[open] > summary { margin-bottom: 1rem; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; padding-block: 2rem 1.25rem; }
.page-head .sub { color: var(--muted); margin-top: 0.4rem; }
main.app { padding-bottom: 4rem; }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: 0.45rem; font-size: var(--t-xs); font-weight: 600;
  padding: 0.25rem 0.65rem 0.25rem 0.5rem; border-radius: 999px; line-height: 1.3; white-space: nowrap;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-off { background: var(--inset); color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.45rem; vertical-align: middle; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-bad { background: var(--bad); } .dot-off { background: var(--line-strong); }

/* definition rows */
.kv { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: 0.45rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); font-size: var(--t-sm); padding-top: 0.1rem; }
.kv dd { margin: 0; min-width: 0; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 0.15rem 0; } .kv dd { margin-bottom: 0.6rem; } }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th { text-align: left; font-weight: 600; color: var(--muted); padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { font-variant-numeric: tabular-nums; }

/* tabs under a page head */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); }
.tabs a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: var(--t-sm); padding: 0.6rem 0.8rem; position: relative; }
.tabs a:hover { color: var(--chestnut); }
.tabs a[aria-current="page"] { color: var(--chestnut); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0.8rem; right: 0.8rem; bottom: -1px; height: 3px; background: var(--fur); border-radius: 2px 2px 0 0; }

/* gopher list */
.gopher-list { display: grid; gap: 1rem; }
.gopher-card { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1.5rem; align-items: start; }
.gopher-card h2 a { color: inherit; text-decoration: none; }
.gopher-card h2 a:hover { color: var(--teal); }
.gopher-card .meta { color: var(--muted); font-size: var(--t-sm); }
.gopher-card .sources { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: var(--t-sm); padding-top: 0.75rem; border-top: 1px solid var(--line); margin-top: 0.5rem; }
.gopher-card .sources span { white-space: nowrap; }
.gopher-card .actions { display: flex; gap: 0.5rem; align-items: center; }
@media (max-width: 520px) { .gopher-card { grid-template-columns: 1fr; } .gopher-card .actions { order: 3; } }

/* empty state */
.empty { display: grid; grid-template-columns: 160px 1fr; gap: 2rem; align-items: center; }
.empty img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: var(--shadow); }
@media (max-width: 640px) { .empty { grid-template-columns: 1fr; justify-items: start; } }

/* centred single-purpose pages (sign in, approve) */
.focus { max-width: 520px; margin: 0 auto; padding-block: 3rem 4rem; }
.focus .avatar { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.code-input {
  font-family: var(--display); font-optical-sizing: auto; font-weight: 800;
  font-size: var(--t-3xl); letter-spacing: 0.12em; text-align: center; color: var(--chestnut);
  padding: 0.5rem 0.75rem; text-transform: uppercase;
}

/* steps (a real sequence): the number sits inline before the title */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: step; display: grid; gap: 0.5rem; align-content: start; }
.steps h3 { font-size: var(--t-xl); }
.steps h3::before { content: counter(step); color: var(--teal); margin-right: 0.5rem; }
.steps p { max-width: 38ch; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; gap: 1.5rem; } }

/* two-column where/what list */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.split ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.split li { margin-bottom: 0.35rem; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }

/* ---------- marketing (front page) ---------- */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 3rem; align-items: center; padding-block: 3rem 3.5rem; }
.hero .copy { min-width: 0; }
.wordmark {
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 900; font-size: var(--t-wordmark); line-height: 0.95; letter-spacing: -0.02em; color: var(--chestnut);
}
.slogan {
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 700; font-size: var(--t-3xl); line-height: 1.1; color: var(--chestnut); margin-top: 1rem;
}
.slogan .surface { color: var(--teal); display: block; }
.hero .lede { margin-top: 1.5rem; }
.hero .cta { margin-top: 2rem; }
.hero .note { margin-top: 0.9rem; }
.hero .art { border-radius: 28px; overflow: hidden; aspect-ratio: 32 / 35; max-width: 100%; box-shadow: var(--shadow); background: #fdf6e6; }
.hero .art img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2rem; padding-block: 2.5rem 3rem; }
  .hero .art { aspect-ratio: 4 / 3; }
  .hero .art img { object-position: center 30%; }
}
.section { padding-block: 4rem; border-top: 1px solid var(--line); }
.section h2 { font-size: var(--t-3xl); margin-bottom: 1.5rem; max-width: 20ch; }
.section .intro { max-width: 60ch; margin-bottom: 2rem; font-size: var(--t-lg); }
.works { margin-top: 1.75rem; display: flex; flex-direction: column; gap: 0.6rem; }
.works .lead { font-size: var(--t-sm); color: var(--muted); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; list-style: none; margin: 0; padding: 0; min-width: 0; }
.tools li { display: flex; align-items: center; }
.tools img { height: 22px; width: auto; max-width: 130px; filter: var(--lockup); opacity: 0.82; }
.start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.start ol { margin: 0; padding-left: 1.2rem; }
.start li { margin-bottom: 0.6rem; }
@media (max-width: 800px) { .start { grid-template-columns: 1fr; } }

.footer { background: linear-gradient(180deg, var(--earth-2) 0%, var(--earth) 100%); color: var(--cream); margin-top: 2rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; justify-content: space-between; padding-block: 2.5rem; }
.footer .brand { color: var(--cream); }
.footer .tag { font-family: var(--display); font-optical-sizing: auto; font-weight: 600; font-size: var(--t-lg); color: var(--cream); }
.footer .tag .surface { color: #7cc4c2; }
.footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer nav a { color: var(--cream); text-decoration: none; font-size: var(--t-sm); opacity: 0.9; }
.footer nav a:hover { opacity: 1; text-decoration: underline; }
.footer .fine { width: 100%; font-size: var(--t-xs); opacity: 0.7; }

/* app footer: just a hairline and the slogan */
.app-foot { border-top: 1px solid var(--line); margin-top: 3rem; }
.app-foot .wrap { padding-block: 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: var(--t-xs); color: var(--muted); }
