/* Layout: one reading column on a route-card grid; header strip, generous whitespace, cards only for posts. */
:root {
  --paper: #f2f3ef;
  --paper-2: #e7e9e3;
  --ink: #17202a;
  --ink-2: #4a5560;
  --rule: #c9cdc4;
  --steel: #22476b;
  --amber: #e2a224;
  --amber-ink: #17202a;
  --ok: #2f6b3a;
  --bad: #a3332b;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --max: 68rem;
  --read: 40rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12171c;
    --paper-2: #1b2229;
    --ink: #e8eae5;
    --ink-2: #a9b2ba;
    --rule: #2e3740;
    --steel: #8db4dc;
    --amber: #f0b43c;
    --amber-ink: #12171c;
    --ok: #7cc48a;
    --bad: #f08a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--steel); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Header */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1rem; }
.brand { display: flex; align-items: baseline; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand b { font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand span { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.nav { display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap; font-family: var(--display); font-weight: 600; font-size: 0.95rem; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--amber); }

/* Type */
h1, h2, h3 { font-family: var(--display); line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
.label { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.lede { font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--ink-2); max-width: var(--read); }
p { margin: 0; }
.stack { display: grid; gap: 1rem; }
.stack-lg { display: grid; gap: 2rem; }
.read { max-width: var(--read); }
.wrap.read { max-width: var(--max); }
.wrap.read > * { max-width: var(--read); }

section { padding-block: clamp(3rem, 7vw, 5.5rem); }
section + section { border-top: 1px solid var(--rule); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--display); font-weight: 700; font-size: 1rem;
  padding: 0.8rem 1.25rem; border-radius: 3px; text-decoration: none;
  border: 2px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer;
}
.btn:hover { background: var(--paper-2); color: var(--ink); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn[disabled] { opacity: 0.55; cursor: progress; }

/* Hero */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero .stack-lg > * { max-width: 52rem; }

/* The line: five stations, one of them the constraint */
.line { margin: 1rem 0 0; padding-top: 1.8rem; overflow-x: auto; }
.line ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(5.5rem, 1fr)); gap: 0; min-width: 30rem; }
.line li { position: relative; padding: 0.9rem 0.75rem 0.75rem; border-top: 3px solid var(--rule); font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); }
.line li b { display: block; font-family: var(--display); font-size: 0.95rem; color: var(--ink); font-weight: 650; }
.line li.constraint { border-top-color: var(--amber); }
.line li.constraint::before { content: "constraint"; position: absolute; top: -1.6rem; left: 0.75rem; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); background: var(--amber); color: var(--amber-ink); padding: 0.1rem 0.4rem; }
.line figcaption { margin-top: 0.5rem; font-size: 0.95rem; color: var(--ink-2); }

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem 2.5rem; margin-top: 2rem; }
.pillar { display: grid; gap: 0.5rem; align-content: start; padding-top: 1rem; border-top: 2px solid var(--ink); }
.pillar p { color: var(--ink-2); font-size: 1rem; }
.pillar a { font-family: var(--display); font-weight: 650; font-size: 0.95rem; }

/* Posts */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 2rem; margin-top: 2rem; }
.post-card { display: grid; gap: 0.6rem; align-content: start; text-decoration: none; color: var(--ink); min-width: 0; }
.post-card .cover { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; object-fit: cover; background: var(--paper-2); border-radius: 2px; }
.post-card h3 { font-size: 1.12rem; }
.post-card:hover h3 { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; }
.post-card p { color: var(--ink-2); font-size: 0.98rem; }
.post-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; }
.post-list li { border-top: 1px solid var(--rule); }
.post-list a { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 0.9rem 0; text-decoration: none; color: var(--ink); }
.post-list a:hover span:first-child { text-decoration: underline; text-decoration-color: var(--amber); }
.post-list .meta { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); white-space: nowrap; }
.empty { padding: 1.5rem; border: 1px dashed var(--rule); color: var(--ink-2); max-width: var(--read); }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.chip { font-family: var(--display); font-weight: 600; font-size: 0.9rem; padding: 0.45rem 0.9rem; border: 1.5px solid var(--rule); border-radius: 99px; background: transparent; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Article */
.article { max-width: var(--read); }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); }
.article .body { display: grid; gap: 1.1rem; margin-top: 2rem; }
.article .body h2 { font-size: 1.6rem; margin-top: 1rem; }
.article .body h3 { margin-top: 0.75rem; }
.article .body ul, .article .body ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.4rem; }
.article .body blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--amber); color: var(--ink-2); }
.article .body figure { margin: 0; }
.article .body hr { border: 0; border-top: 1px solid var(--rule); width: 100%; }
.video-link { display: grid; gap: 0.5rem; text-decoration: none; color: var(--ink); }
.video-link .thumb { position: relative; }
.video-link .thumb::after { content: "▶ Watch on YouTube"; position: absolute; left: 0.75rem; bottom: 0.75rem; font-family: var(--display); font-weight: 700; font-size: 0.9rem; background: var(--amber); color: var(--amber-ink); padding: 0.35rem 0.7rem; }

/* Forms */
.form { display: grid; gap: 1.2rem; max-width: 34rem; margin-top: 2rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-family: var(--display); font-weight: 650; font-size: 0.98rem; }
.field .req { color: var(--bad); margin-left: 0.2rem; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--rule); border-radius: 3px; padding: 0.7rem 0.8rem; width: 100%;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--steel); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--steel) 25%, transparent); }
.field .err { color: var(--bad); font-size: 0.9rem; min-height: 0; }
.field [aria-invalid="true"] { border-color: var(--bad); }
.form-error { color: var(--bad); }
.thanks { padding: 1.25rem 1.5rem; border-left: 4px solid var(--ok); background: var(--paper-2); max-width: 34rem; margin-top: 2rem; }
.skeleton { height: 14rem; max-width: 34rem; margin-top: 2rem; background: repeating-linear-gradient(180deg, var(--paper-2) 0 2.8rem, transparent 2.8rem 4rem); }

.subscribe { display: grid; gap: 1rem; }
.subscribe .form { margin-top: 0; grid-template-columns: 1fr auto; align-items: end; max-width: 36rem; }
.subscribe .form .form-error, .subscribe .form .thanks-inline { grid-column: 1 / -1; }
@media (max-width: 34rem) { .subscribe .form { grid-template-columns: 1fr; } }

/* FAQ */
.faq { display: grid; gap: 1.25rem; margin-top: 1.5rem; max-width: var(--read); }
.faq dt { font-family: var(--display); font-weight: 700; }
.faq dd { margin: 0.2rem 0 0; color: var(--ink-2); }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding-block: 2.5rem 3rem; font-size: 0.95rem; color: var(--ink-2); }
.site-foot .wrap { display: grid; gap: 1.5rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-family: var(--display); font-weight: 600; }
.foot-links a { color: var(--ink); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; text-decoration-color: var(--amber); }
.mono { font-family: var(--mono); font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Industry index: sectors with their industries */
.sectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 2.5rem 3rem; margin-top: 2rem; }
.sector ul { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; }
.sector li { border-top: 1px solid var(--rule); }
.sector a { display: grid; gap: 0.15rem; padding: 0.75rem 0; text-decoration: none; color: var(--ink); }
.sector a b { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.sector a span { color: var(--ink-2); font-size: 0.95rem; }
.sector a:hover b { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; }
a.pillar { text-decoration: none; color: var(--ink); }
a.pillar:hover h3 { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; }
.needs { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.needs li { font-family: var(--display); font-weight: 600; font-size: 0.95rem; padding: 0.4rem 0.8rem; background: var(--paper-2); border-left: 3px solid var(--amber); }
.steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 1rem; }
.steps b { font-family: var(--display); }
.byline { margin-top: 1rem; font-family: var(--mono); font-size: 0.85rem; color: var(--ink-2); }
.tags { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.tags ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-family: var(--display); font-weight: 600; }
.subscribe .form { grid-template-columns: 1fr; max-width: 34rem; }
.subscribe { grid-template-columns: minmax(0, 1fr); }
.form-error, .mono { overflow-wrap: anywhere; }

/* TW notes */
main p, main li { overflow-wrap: anywhere; }
.notes-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: 3rem; align-items: start; }
.notes-posts { grid-template-columns: minmax(0, 1fr); margin-top: 1rem; }
.ask-box { position: sticky; top: 1.5rem; display: grid; gap: 0.75rem; padding: 1.5rem; background: var(--paper-2); border-top: 4px solid var(--amber); }
.ask-box .form, .ask-box .thanks { margin-top: 0.5rem; max-width: none; }
@media (max-width: 52rem) { .notes-grid { grid-template-columns: minmax(0, 1fr); } .ask-box { position: static; } }

/* TW brand */
.brand img { display: block; height: 40px; width: auto; max-width: 70vw; }
@media (prefers-color-scheme: light) { :root { --steel: #4b6277; --amber: #fac551; } }

/* TW founder */
.founder { display: flex; align-items: center; gap: 1.25rem; }
.founder img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; flex: none; }
.founder-name { font-weight: 700; font-size: 1.25rem; margin: 0; }
.founder-facts { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; }
.founder-facts li { padding: 0.75rem 1rem; background: var(--paper-2); border-top: 3px solid var(--amber); }
.founder-facts b { display: block; font-size: 1.35rem; }
.founder-quote { margin: 0; padding-left: 1rem; border-left: 4px solid var(--amber); font-style: italic; }

.founder > div { min-width: 0; }
.founder .label { white-space: normal; overflow-wrap: normal; }
.founder-facts { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.founder-facts li { overflow-wrap: normal; word-break: normal; }

/* TW founder fix 2 */
.read > * { min-width: 0; }
.founder-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 40rem) { .founder-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.founder-facts li { font-size: 0.95rem; }
.founder-facts b { font-size: 1.2rem; }
