/* ryderdrobny.com v05: the shared system. Every page links this file; page-only layout stays in the page.
   v14 (2026-10-23): every page on the dark ground of v13's Open Residency 1:1 (g-or1). Off-white for what leads,
   one grey for what needs little attention, the blue buttons, the underline in the lifted blue. The text colours
   are solved in build/build.py against the brightest the home page's light gets under text, so every line clears
   WCAG AA on every page; build.py rewrites the block between the two markers. */
:root {
  color-scheme: dark;
  /* tokens:start */
  --ground: #060B0E;
  --ink: #F7F3F0;
  --muted: #ABAAA9;
  --faint: #AAABAB;
  --rule: #24282B;
  --bar: rgba(247, 243, 240, 0.12);
  --blue: #1B3684;
  --blue-press: #15296A;
  --blue-text: #A9BBF0;
  --mark: #3B5FCC;
  --on-blue: #FFFFFF;
  /* tokens:end */
  --margin: 40px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html { background: var(--ground); }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.mono {
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; border: 0; margin: -1px;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* Launch switch: data-launch on <html> hides anything whose page doesn't exist yet. */
html[data-launch] [data-ships-later] { display: none !important; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; }

/* ---------- The ground: one soft grey light from above, live film grain ---------- */
/* v14: Open Residency's dark ground. The inner pages carry a soft grey lift at the top centre, the home page's
   light in CSS; the home page sprays its own light (assets/hero.js) and hides this one. The dark blur and the paper
   specks belonged to the light paper and stay off. */
.ground { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blur { position: absolute; border-radius: 50%; }
.blur.light {
  width: 120vmax; height: 80vmax; left: calc(50% - 60vmax); top: -46vmax;
  background: radial-gradient(closest-side, rgba(138,137,133,0.17), rgba(138,137,133,0.06) 55%, rgba(138,137,133,0));
}
.blur.dark { display: none; }
#specks { display: none; }
/* The grain sits over display type and the blue buttons. Small text sits above it (.lift). */
#grain { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; opacity: 0.1; }
.lift { position: relative; z-index: 6; }
/* Printed display type: rough edges and grain knocked out of the fill (the SVG filter in each page). */
.print { filter: url(#print); }

/* ---------- Page frame: the corners, and the content between them ---------- */
.page {
  position: relative; /* no z-index: .lift text has to reach above the grain */
  min-height: 100vh; min-height: 100svh;
  padding: 24px var(--margin);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
/* Top: name left, the nav in the center, the right column empty so the nav sits on the true center. */
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: baseline; column-gap: 24px; }
.top .name { justify-self: start; color: var(--ink); }
.top nav { display: flex; gap: 28px; color: var(--muted); }
.top a { transition: color 160ms var(--ease-out); }
.top a:hover { color: var(--ink); }
/* 2026-11-04: selection and caret on the brand blue, so the dark ground never shows the browser default. */
::selection { background: var(--mark); color: var(--on-blue); }
input, textarea { caret-color: var(--mark); }
.top nav a[aria-current="page"] { color: var(--ink); }

/* Bottom: the social buttons on the center, the byline right. */
.foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 24px; color: var(--muted); }
.foot .social { grid-column: 2; display: flex; gap: 8px; }
.foot .by { grid-column: 3; justify-self: end; }

/* ---------- The blue button: Subscribe and the three social links are one family ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  height: 48px; min-width: 48px; padding: 0 22px;
  border: 0; border-radius: 0;
  background: var(--blue); color: var(--on-blue);
  font: 500 16px/1 "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 120ms var(--ease-out), opacity 160ms var(--ease-out);
}
.btn:hover { background: var(--blue-press); }
.btn:active { transform: scale(0.97); }
/* v05: the social buttons one size down, so the resources strip leads. Same square blue family. */
.btn.sm { height: 40px; min-width: 40px; padding: 0 15px; font-size: 15px; }

/* ---------- The placeholder slot: grey bars wherever Ryder's own words go ---------- */
.pitch { margin: 28px 0 36px; max-width: 30rem; }
.pitch span { display: block; height: 12px; margin: 9px 0; background: var(--bar); }
.pitch span:first-child { width: 92%; }
.pitch span:last-child { width: 58%; }
.bar { display: inline-block; height: 0.62em; background: var(--bar); vertical-align: 0.06em; }

/* ---------- The form: idle, loading, success, error ---------- */
/* minmax(0, 1fr): without it the column sizes to the input's intrinsic width and overflows narrow columns. */
form.subscribe { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); max-width: 30rem; }
.fields, .status { grid-area: 1 / 1; }
.fields { display: flex; align-items: stretch; }
.subscribe input[type=email] {
  flex: 1 1 auto; min-width: 0;
  height: 48px; padding: 0 2px; margin-right: 12px;
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font: 400 16px/1 "Inter", sans-serif;
  transition: box-shadow 160ms var(--ease-out), border-color 160ms var(--ease-out);
  -webkit-appearance: none; appearance: none;
}
.subscribe input[type=email]::placeholder { color: var(--muted); opacity: 1; }
.subscribe input[type=email]:focus { outline: none; border-bottom-color: var(--mark); box-shadow: 0 1px 0 0 var(--mark); }
.subscribe input[type=email]:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: inset 0 0 0 1000px var(--ground); }
.subscribe input[type=email]:-webkit-autofill:focus { box-shadow: inset 0 0 0 1000px var(--ground), 0 1px 0 0 var(--mark); }
.status { margin: 0; font: 400 16px/1.5 "Inter", sans-serif; color: var(--ink); }
.status:empty { display: none; }
form[data-state="loading"] .btn { opacity: 0.6; cursor: progress; }
form[data-state="loading"] .btn:active { transform: none; }
form[data-state="success"] .fields { visibility: hidden; }
form[data-state="success"] .status { display: flex; align-items: center; height: 48px; padding: 0 2px; border-bottom: 1px solid var(--ink); }
form[data-state="error"] .status { position: absolute; top: calc(100% + 10px); left: 2px; right: 0; }

/* ---------- Display type ---------- */
.display {
  margin: 0;
  color: var(--ink);
  font-family: "Archivo", "Inter", sans-serif;
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(40px, 4.85vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.label { margin: 0; color: var(--muted); font-weight: 400; }

/* ---------- Pages with one centred column: resources, the audit, the archive, an issue ---------- */
.idx { margin: 0 0 20px; color: var(--muted); display: flex; flex-wrap: wrap; column-gap: 18px; row-gap: 4px; }
.idx a { transition: color 160ms var(--ease-out); }
.idx a:hover { color: var(--ink); }
.back { margin: 0; color: var(--muted); }
.back a { color: var(--ink); transition: color 160ms var(--ease-out); }
.back a:hover { color: var(--muted); }

/* ---------- Phone ---------- */
/* The foot stacks a step earlier than the rest of the phone layout: from 701 to 779px the byline
   "Written by Ryder Drobny" otherwise wraps to two lines (measured 2026-11-04). */
@media (max-width: 780px) {
  .foot { display: flex; flex-direction: column; align-items: center; gap: 16px; }
  .foot .by { justify-self: auto; }
}

@media (max-width: 700px) {
  :root { --margin: 16px; }
  .page { padding-top: 18px; padding-bottom: 24px; }
  /* Name and nav can't share a centered row at 360: the nav goes right, as in v03. Since the Founders link went
     live (2026-11-03) the nav has three words: the name never breaks, the nav wraps instead on the narrowest phones. */
  .top { grid-template-columns: auto auto; justify-content: space-between; column-gap: 12px; }
  .top .name { white-space: nowrap; }
  .top nav { gap: 14px; flex-wrap: wrap; justify-content: flex-end; row-gap: 2px; }
  /* 44px tap targets on the nav and name at phone widths; the negative margin keeps the drawn layout as it was. */
  .top a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; }
  .print { filter: url(#print-sm); }
  .display { font-size: clamp(28px, calc((100vw - 32px) / 10.6), 44px); line-height: 1.04; }
  .pitch { margin: 22px 0 28px; }
}
@media (max-width: 340px) { .top nav { gap: 12px; } }
@media (prefers-reduced-motion: reduce) {
  .top a, .btn, .subscribe input[type=email], .idx a, .back a { transition: none; }
}

/* v14: the underline under "founders" in the lifted blue, which reads on the dark ground (#1B3684 doesn't). */
.u path { fill: var(--mark); }

/* The newsletter's value line, in his words (Oct 25). Replaces the grey pitch bars where his words exist. */
p.pitch.says { margin: 18px 0 40px; max-width: 34rem; font: 400 18px/1.55 "Inter", sans-serif; letter-spacing: -0.005em; color: var(--muted); text-wrap: pretty; }
@media (max-width: 700px) { p.pitch.says { font-size: 16px; margin: 14px 0 32px; } }
