/* returntocode.com - shared publication stylesheet
   Identity: white + cobalt, Playfair Display over Source Sans 3.
   Mobile-first: base rules target a 360px screen, wider layouts are layered on at 480 / 768 / 1024. */

:root {
  color-scheme: only light;
  --bg: #FFFFFF;
  --surface: #EEF2F8;
  --ink: #14213D;
  --muted: #5B6478;
  --accent: #1D4ED8;
  --accent-ink: #FFFFFF;
  --rule: rgba(20, 33, 61, 0.22);
  --f-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --pad: 16px;
  --measure: 37.5rem;
  --section-y: 56px;
}

@media (min-width: 480px) {
  :root { --pad: 20px; }
}
@media (min-width: 768px) {
  :root { --pad: 32px; --section-y: 88px; }
}
@media (min-width: 1024px) {
  :root { --pad: 40px; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background-color: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: clamp(1.125rem, 1.06rem + 0.3vw, 1.25rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video, svg { max-width: 100%; }
img { display: block; height: auto; }
button, input, textarea { font: inherit; color: inherit; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, text-decoration-thickness 0.2s ease;
}
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- utilities (small bespoke layer) ---------- */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--pad);
}
.grid12 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 24px;
}
@media (min-width: 768px) {
  .grid12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
.u-muted { color: var(--muted); }

/* ---------- masthead: brand left, nav right, one hairline ---------- */
.masthead {
  background-color: var(--bg);
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}
.mast-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 16px;
  padding-block: 12px;
}
.brand {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: none; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wm-row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; row-gap: 2px; }
.wordmark {
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: clamp(1rem, 0.9rem + 0.6vw, 1.45rem);
  line-height: 1;
  color: var(--ink);
}
.tag {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  line-height: 1;
}
.edition {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  line-height: 1;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  background-color: var(--bg);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-toggle:hover { background-color: var(--ink); color: var(--bg); }
.nav-toggle { justify-content: center; min-width: 44px; }
.nav-label {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (min-width: 480px) {
  .nav-label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
}
.nav-bars, .nav-bars::before, .nav-bars::after {
  display: block;
  width: 18px; height: 2px;
  background-color: currentColor;
  content: "";
  position: relative;
}
.nav-bars::before { position: absolute; top: -6px; left: 0; }
.nav-bars::after { position: absolute; top: 6px; left: 0; }
.js .nav-toggle { display: inline-flex; }

.site-nav { flex-basis: 100%; margin-top: 4px; }
.site-nav ul { display: flex; flex-wrap: wrap; column-gap: 4px; }
.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px 0 0;
  margin-right: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; border-top: 1px solid var(--rule); margin-top: 10px; }
.js .site-nav.is-open ul { flex-direction: column; }
.js .site-nav.is-open a { border-bottom: 1px solid var(--rule); padding-right: 0; margin-right: 0; }

@media (min-width: 768px) {
  .mast-in { flex-wrap: nowrap; padding-block: 16px; }
  .js .nav-toggle { display: none; }
  .site-nav, .js .site-nav, .js .site-nav.is-open {
    display: block;
    flex-basis: auto;
    margin-top: 0;
    border-top: 0;
  }
  .site-nav ul, .js .site-nav.is-open ul { flex-direction: row; flex-wrap: nowrap; }
  .site-nav a, .js .site-nav.is-open a { padding: 0 6px; margin-right: 0; margin-left: 12px; border-bottom: 2px solid transparent; }
  .site-nav a:hover, .site-nav a[aria-current="page"], .js .site-nav.is-open a:hover { border-bottom-color: var(--accent); }
}

/* ---------- article opening: pure typography ---------- */
.art-head { padding-top: 36px; background-color: var(--bg); color: var(--ink); }
.kicker {
  grid-column: 1 / -1;
  margin-bottom: 18px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.3;
}
.title {
  grid-column: 1 / -1;
  max-width: 17em;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 1rem + 3.9vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  text-wrap: balance;
  overflow-wrap: break-word;
  color: var(--ink);
}
.dek {
  grid-column: 1 / -1;
  margin-top: 22px;
  max-width: var(--measure);
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  line-height: 1.45;
  color: var(--ink);
}
.art-meta {
  grid-column: 1 / -1;
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}
.intro { grid-column: 1 / -1; margin-top: 32px; }
.intro p { max-width: var(--measure); }
.intro p + p { margin-top: 1.25em; }

@media (min-width: 768px) {
  .art-head { padding-top: 64px; }
  .kicker { margin-bottom: 24px; }
  .dek { margin-top: 32px; }
  .art-meta { max-width: 16rem; }
}
@media (min-width: 1024px) {
  .kicker { grid-row: 1; }
  .title { grid-row: 2; }
  .dek { grid-column: 5 / -1; grid-row: 3; margin-top: 36px; }
  .art-meta { grid-column: 1 / 5; grid-row: 3; align-self: start; margin-top: 44px; }
  .intro { grid-column: 5 / -1; grid-row: 4; margin-top: 32px; }
}

/* ---------- sections with numbered markers ---------- */
.sec {
  background-color: var(--bg);
  color: var(--ink);
  padding: var(--section-y) 0 calc(var(--section-y) * 0.7);
}
.sec.tint { background-color: var(--surface); }
.sec-head { grid-column: 1 / -1; margin-bottom: 26px; }
.ord {
  display: block;
  margin-bottom: 12px;
  font-family: var(--f-display);
  font-weight: 400;
  font-variant-numeric: lining-nums;
  font-size: clamp(3.25rem, 2.4rem + 3.4vw, 5.25rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--muted);
}
.sec h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.625rem, 1.25rem + 1.5vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.008em;
  text-wrap: balance;
  color: var(--ink);
}
.sec-note {
  margin-top: 18px;
  max-width: 16rem;
  padding-top: 8px;
  border-top: 1px solid var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--muted);
}
.sec-body { grid-column: 1 / -1; min-width: 0; }
.sec-body > * + * { margin-top: 1.25em; }
.sec-body p { max-width: var(--measure); }
.sec-body h3 {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 1.3125rem;
  line-height: 1.3;
  color: var(--ink);
}
.sec-body strong { font-weight: 700; }
.sec-body-late { margin-top: 40px; }

@media (min-width: 1024px) {
  .sec-head { grid-column: 1 / 5; grid-row: 1; margin-bottom: 0; padding-right: 8px; }
  .sec-body { grid-column: 5 / -1; }
}

/* ---------- full-bleed media ---------- */
.fig { grid-column: 1 / -1; margin: 40px calc(var(--pad) * -1); }
.fig img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.fig.flush { margin-bottom: 0; }
.pos-a img { object-position: 50% 28%; }
.pos-b img { object-position: 60% 46%; }
.pos-c img { object-position: 50% 12%; }
.vid { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background-color: var(--surface); }
.vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 72%; }
@media (min-width: 480px) {
  .fig img, .vid { aspect-ratio: 3 / 2; }
}
@media (min-width: 768px) {
  .fig { margin: 56px 0; }
  .fig.flush { margin-bottom: 0; }
  .fig img, .vid { aspect-ratio: 16 / 9; }
}
@media (min-width: 1024px) {
  .fig img, .vid { aspect-ratio: 2 / 1; }
}
/* the clip is a small portrait source, so on wide screens it keeps a 4:3 frame */
@media (min-width: 768px) {
  .fig-motion .vid { aspect-ratio: 4 / 3; }
  .fig-motion .vid video { object-position: 50% 62%; }
}
@media (min-width: 1024px) {
  .fig-motion { grid-column: 5 / -1; }
}

/* ---------- calls to action: solid rectangular button, square corners ---------- */
.cta-row {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 44px;
  padding: 26px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.cta-lead {
  max-width: 28rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  width: 100%;
  padding: 16px 28px;
  background-color: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--accent);
  border-radius: 0;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background-color: var(--accent-ink); color: var(--accent); text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (min-width: 768px) {
  .cta-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; }
  .btn { width: auto; flex: none; min-width: 19.5rem; }
}
@media (min-width: 1024px) {
  .cta-row { grid-column: 5 / -1; }
}

/* ---------- compact editorial aside (checklist) ---------- */
.aside {
  max-width: var(--measure);
  padding: 24px 22px 14px;
  background-color: var(--surface);
  color: var(--ink);
  border-top: 4px solid var(--accent);
}
.aside h3 { margin-bottom: 16px; }
.checks li, .dashes li { position: relative; padding-left: 34px; margin-bottom: 14px; }
.checks li::before {
  content: "";
  position: absolute; left: 0; top: 0.32em;
  width: 20px; height: 20px;
  border: 2px solid var(--accent);
  background-color: var(--bg);
}
.checks li::after {
  content: "";
  position: absolute; left: 7px; top: calc(0.32em + 2px);
  width: 6px; height: 10px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.dashes li::before {
  content: "";
  position: absolute; left: 2px; top: 0.82em;
  width: 16px; height: 2px;
  background-color: var(--ink);
}

/* ---------- first steps: plain list, no numbered badges ---------- */
.steps li {
  padding: 2px 0 2px 18px;
  margin-bottom: 16px;
  max-width: var(--measure);
  border-left: 3px solid var(--accent);
}

/* ---------- question and answer ---------- */
.qa { padding-top: 22px; border-top: 1px solid var(--rule); }
.qa:first-of-type { border-top-color: var(--ink); }
.qa h3 { margin-bottom: 8px; }
.sec-body > .qa { margin-top: 1.4em; }

/* ---------- trade-off columns ---------- */
.tradeoffs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 0;
}
.to-col {
  padding: 26px 22px 12px;
  background-color: var(--surface);
  color: var(--ink);
  border-top: 4px solid var(--accent);
}
.to-col.is-limits { border-top-color: var(--ink); }
.to-col h3 {
  margin-bottom: 18px;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 1.3125rem;
  line-height: 1.3;
}
.to-col li { font-size: 1.0625rem; line-height: 1.55; }
@media (min-width: 768px) {
  .tradeoffs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 8px; }
  .to-col { padding: 32px 30px 16px; }
}

/* ---------- footer: colophon bar + three-column editorial grid ---------- */
.footer {
  background-color: var(--surface);
  color: var(--ink);
  border-top: 1px solid var(--ink);
}
.colophon { border-bottom: 1px solid var(--rule); }
.colophon-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 20px;
}
.colophon-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
}
.colophon-brand .mark { width: 26px; height: 26px; color: var(--ink); }
.colophon-date { font-size: 0.9375rem; color: var(--muted); }
.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding-block: 32px 44px;
}
.foot-label {
  margin-bottom: 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.org, .byline-note { font-size: 1rem; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.page-links { display: flex; flex-direction: column; }
.page-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.page-links a:hover { color: var(--accent); padding-left: 6px; }
@media (min-width: 768px) {
  .foot-grid { grid-template-columns: 1.25fr 1.25fr 0.8fr; gap: 48px; padding-block: 44px 56px; }
}

/* ---------- legal and about pages ---------- */
.legal { padding: 44px 0 var(--section-y); background-color: var(--bg); color: var(--ink); }
.legal .kicker { margin-bottom: 14px; }
.legal-title {
  grid-column: 1 / -1;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.1rem + 3vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--ink);
}
.updated {
  grid-column: 1 / -1;
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
}
.legal-body { grid-column: 1 / -1; margin-top: 28px; min-width: 0; }
.legal-body > * + * { margin-top: 1.1em; }
.legal-body p, .legal-body ul { max-width: var(--measure); }
.legal-summary { font-size: 1.3125rem; line-height: 1.5; color: var(--ink); }
.legal-body h2 {
  margin-top: 2em;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.8rem);
  line-height: 1.2;
  color: var(--ink);
}
.legal-body ul { padding-left: 0; }
.legal-body ul li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.legal-body ul li::before {
  content: "";
  position: absolute; left: 0; top: 0.7em;
  width: 10px; height: 2px;
  background-color: var(--accent);
}
.imprint { padding: 20px 22px; background-color: var(--surface); color: var(--ink); border-top: 4px solid var(--accent); }
.imprint p { font-size: 1rem; line-height: 1.6; }
@media (min-width: 768px) {
  .legal { padding-top: 72px; }
  .legal-body { margin-top: 40px; }
}
@media (min-width: 1024px) {
  .legal-body { grid-column: 5 / -1; }
}
