/* ==========================================================================
   CTO register: opinionated, obsessive, technical, frontier AI.
   A public engineering notebook. White page, Markup Blue annotations,
   timestamps to the minute, confidence on every opinion, scored predictions.
   Fewer boxes, more rules: entries are separated like notebook lines.
   ========================================================================== */

.cto-sub { background: var(--bg); }
.cto-mark { font-family: var(--f-display); font-stretch: 125%; font-weight: 760; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.cto-mark i { width: 8px; height: 8px; background: var(--blue); display: inline-block; }
.cto-sub nav a.on { box-shadow: inset 0 -2px 0 var(--blue); }
.search { margin-left: auto; position: relative; flex-shrink: 0; }
.search input { width: 200px; padding: 7px 34px 7px 10px; font-family: var(--f-mono); font-stretch: 87.5%; font-size: 11.5px; background: var(--surface); }
.search kbd { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-family: var(--f-mono); font-size: 10px; border: 1px solid var(--line-strong); padding: 1px 5px; color: var(--muted); background: var(--bg); }
@media (max-width: 760px) { .search { display: none; } }

.note-blue { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 11px; line-height: 1.55; color: var(--blue); }

/* ---- Masthead ---- */
.cto-mast { padding-block: 56px 48px; border-bottom: 1px solid var(--line); }
.cto-mast-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.cto-mast h1 { font-family: var(--f-display); font-stretch: 125%; font-weight: 800; font-size: clamp(56px, 10vw, 150px); line-height: .84; letter-spacing: -.055em; }
.cto-mast .annot { display: flex; gap: 10px; align-items: baseline; margin-top: 18px; }
.author { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; margin-top: 36px; align-items: start; }
.author .ph { --ar: 4 / 5; }
.author h2 { font-family: var(--f-display); font-stretch: 112%; font-weight: 680; font-size: 20px; letter-spacing: -.01em; line-height: 1.25; }
.author p { font-size: 15.5px; line-height: 1.55; color: var(--ink-2); margin-top: 8px; max-width: 52ch; }
.author-stats { display: flex; flex-wrap: wrap; border-top: 1px solid var(--ink); margin-top: 14px; }
.author-stats > div { padding: 10px 18px 0 0; margin-right: 18px; display: grid; gap: 1px; }
.author-stats dt { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.author-stats dd { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 17px; font-weight: 600; }
.author-links { display: flex; gap: 16px; margin-top: 14px; font-family: var(--f-mono); font-stretch: 87.5%; font-size: 11.5px; }
.author-links a { color: var(--blue); border-bottom: 1px solid currentColor; }
@media (max-width: 1000px) { .cto-mast-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; } }
@media (max-width: 520px) { .author { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; } }

.bench .bench-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 12px 14px; border-bottom: 1px solid var(--panel-line); font-size: 14px; line-height: 1.4; }
.bench .bench-item:last-child { border-bottom: 0; }
.bench .led { width: 8px; height: 8px; border-radius: 50%; background: #45BE85; align-self: center; animation: pulse 2.4s ease-in-out infinite; }
.bench .led.paused { background: var(--yellow); animation: none; }
.bench .led.idle { background: var(--panel-muted); animation: none; }
.bench .meta { color: var(--panel-muted); font-size: 10.5px; }
.obsessed { margin-top: 18px; }
.obsessed h3 { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.obsessed ol { list-style: none; border-top: 1px solid var(--ink); }
.obsessed li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 520; align-items: baseline; }
.obsessed li .meta { font-size: 11px; }
.obsessed .up { color: var(--blue); font-family: var(--f-mono); font-size: 11px; }
.obsessed .dn { color: var(--muted); font-family: var(--f-mono); font-size: 11px; }

/* ---- Featured post ---- */
.featured { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 0; border: 1.5px solid var(--ink); background: var(--surface); margin-top: 48px; transition: box-shadow var(--t-fast) var(--ease); }
.featured:hover { box-shadow: 6px 6px 0 var(--blue); }
.featured-copy { padding: 32px; display: grid; gap: 18px; align-content: start; border-right: 1px solid var(--line); }
.featured-copy h2 { font-family: var(--f-display); font-stretch: 118%; font-weight: 760; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.02; letter-spacing: -.035em; }
.featured-copy .dek { font-size: 18px; line-height: 1.5; color: var(--ink-2); }
.featured-fig { padding: 24px; display: grid; gap: 12px; align-content: start; }
.featured-fig .note-blue { border-left: 1px solid var(--blue); padding-left: 10px; }
@media (max-width: 1000px) { .featured { grid-template-columns: minmax(0, 1fr); } .featured-copy { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px; } .featured-fig { padding: 18px; } }

/* ---- Feed layout ---- */
.feed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
@media (max-width: 1080px) { .feed-grid { grid-template-columns: minmax(0, 1fr); } }
.feed-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--ink); padding-top: 12px; margin-bottom: 8px; gap: 12px; flex-wrap: wrap; }
.feed-head h2 { font-family: var(--f-display); font-stretch: 112%; font-weight: 700; font-size: 22px; letter-spacing: -.015em; }

.post { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.post-when { display: grid; gap: 8px; align-content: start; font-family: var(--f-mono); font-stretch: 87.5%; font-size: 11px; color: var(--muted); }
.post-when .d { font-size: 13px; font-weight: 600; color: var(--ink); }
.post-body { display: grid; gap: 12px; min-width: 0; }
.post h3 { font-family: var(--f-display); font-stretch: 112%; font-weight: 700; font-size: clamp(21px, 2.1vw, 27px); line-height: 1.14; letter-spacing: -.02em; }
.post h3 a:hover { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.post .dek { font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 64ch; }
.post .tags { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 640px) { .post { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 22px 0; } .post-when { grid-template-columns: auto auto auto; justify-content: start; gap: 10px; align-items: center; } }

.post-fig { background: var(--surface); border: 1px solid var(--line-strong); }
.post-fig .fig-in { padding: 16px; }
.post-fig .fig-cap { padding: 9px 16px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-stretch: 87.5%; font-size: 10.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Stack diagram (automation stack then vs now) */
.stackcmp { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); align-items: stretch; }
.stackcmp .col { display: grid; gap: 4px; }
.stackcmp .col > .eyebrow { margin-bottom: 4px; }
.stackcmp .lyr { border: 1.5px solid var(--ink); padding: 9px 12px; font-size: 14px; font-weight: 560; background: var(--surface); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.stackcmp .lyr .meta { font-size: 10px; }
.stackcmp .lyr.auto { background: var(--yellow); color: #15181A; }
.stackcmp .lyr.auto .meta { color: #15181A; }
.stackcmp .lyr.person { border-color: var(--forest); border-radius: 999px; }
.stackcmp .lyr.old { border-style: dashed; color: var(--muted); font-weight: 450; }
.stackcmp .arrows { display: grid; align-content: center; justify-items: center; font-family: var(--f-mono); color: var(--blue); font-size: 16px; }
@media (max-width: 560px) { .stackcmp { grid-template-columns: minmax(0, 1fr); gap: 12px; } .stackcmp .arrows { transform: rotate(90deg); } }

/* Model note verdict */
.mnote { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-strong); background: var(--surface); }
.mnote > div { padding: 12px; border-right: 1px solid var(--line); display: grid; gap: 3px; }
.mnote > div:last-child { border-right: 0; }
.mnote .v { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 15px; font-weight: 600; }
.mnote .v.up { color: var(--pass); } .mnote .v.dn { color: var(--fail); } .mnote .v.eq { color: var(--muted); }
.mnote p { font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
@media (max-width: 640px) { .mnote { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mnote > div:nth-child(2) { border-right: 0; } .mnote > div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* Reaction */
.react-src { border-left: 3px solid var(--line-strong); padding: 4px 0 4px 14px; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.react-src .meta { display: block; margin-top: 4px; }

/* ---- Side column ---- */
.side { display: grid; gap: 40px; }
.side-block h2 { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; border-top: 2px solid var(--ink); padding-top: 10px; margin-bottom: 4px; display: flex; justify-content: space-between; }
.thought { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.thought p { font-family: var(--f-display); font-stretch: 106%; font-weight: 580; font-size: 17px; line-height: 1.38; letter-spacing: -.005em; }
.thought .row { gap: 10px; }
.conf { display: inline-flex; gap: 2px; align-items: center; }
.conf i { width: 9px; height: 7px; border: 1px solid var(--blue); display: inline-block; }
.conf i.f { background: var(--blue); }
.conf-l { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 10.5px; color: var(--blue); }
.thought .upd { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 11px; color: var(--blue); line-height: 1.5; }
.thought s { color: var(--muted); text-decoration-color: var(--fail); }

.ledger { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ledger td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.4; }
.ledger td:first-child { padding-right: 10px; }
.ledger td:last-child { text-align: right; white-space: nowrap; }
.ledger .meta { display: block; font-size: 10.5px; margin-top: 3px; }
.res { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 6px; border: 1px solid; display: inline-block; }
.res.open { color: var(--blue); border-color: var(--blue); }
.res.right { color: var(--pass); border-color: var(--pass); }
.res.wrong { color: var(--fail); border-color: var(--fail); }
.ledger-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--blue); margin-top: 12px; }
.ledger-sum > div { padding: 8px 10px; display: grid; gap: 1px; border-right: 1px solid var(--blue); }
.ledger-sum > div:last-child { border-right: 0; }
.ledger-sum dt { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); }
.ledger-sum dd { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 16px; font-weight: 600; }

.tagcloud { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.tagcloud a { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 11px; padding: 5px 8px; border: 1px solid var(--line-strong); display: inline-flex; gap: 8px; transition: all var(--t-fast) var(--ease); }
.tagcloud a span { color: var(--muted); }
.tagcloud a:hover { border-color: var(--blue); color: var(--blue); }
.archive { list-style: none; padding-top: 6px; }
.archive li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-family: var(--f-mono); font-stretch: 87.5%; font-size: 12px; }
.archive li span:last-child { color: var(--muted); }

/* ---- Long reads ---- */
.longreads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.lr { padding: 24px 24px 28px 0; display: grid; gap: 12px; align-content: start; border-right: 1px solid var(--line); }
.lr + .lr { padding-left: 24px; }
.lr:last-child { border-right: 0; }
.lr .mins { font-family: var(--f-mono); font-stretch: 100%; font-size: 52px; font-weight: 700; letter-spacing: -.05em; line-height: .9; }
.lr .mins small { font-size: 12px; letter-spacing: .06em; font-weight: 500; color: var(--muted); margin-left: 6px; }
.lr h3 { font-family: var(--f-display); font-stretch: 112%; font-weight: 700; font-size: 20px; line-height: 1.2; letter-spacing: -.015em; }
.lr:hover h3 { text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: 4px; }
.lr p { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 900px) { .longreads { grid-template-columns: minmax(0, 1fr); } .lr, .lr + .lr { padding: 20px 0; border-right: 0; border-bottom: 1px solid var(--line); } }

.subscribe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; background: var(--blue); color: #FFFFFF; padding: 32px; }
.subscribe h2 { font-family: var(--f-display); font-stretch: 118%; font-weight: 740; font-size: clamp(24px, 3vw, 34px); line-height: 1.1; letter-spacing: -.02em; }
.subscribe p { color: rgba(255, 255, 255, .8); font-size: 15px; margin-top: 8px; }
.subscribe form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.subscribe input { background: #FFFFFF; color: #15181A; border-color: #FFFFFF; }
.subscribe .btn { background: #15181A; color: #FFFFFF; border-color: #15181A; }
.subscribe .meta { color: rgba(255, 255, 255, .8); grid-column: 1 / -1; }
:root[data-theme="dark"] .subscribe { background: #22306E; }
@media (max-width: 800px) { .subscribe { grid-template-columns: minmax(0, 1fr); padding: 22px; } }

/* ==========================================================================
   CTO article (long form with sidenotes)
   ========================================================================== */
.art-head { padding-block: 48px 36px; display: grid; gap: 20px; max-width: 980px; }
.art-head h1 { font-family: var(--f-display); font-stretch: 118%; font-weight: 780; font-size: clamp(36px, 5.4vw, 72px); line-height: .98; letter-spacing: -.04em; }
.art-head .dek { font-size: clamp(18px, 1.8vw, 22px); line-height: 1.5; color: var(--ink-2); max-width: 58ch; }
.art-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-family: var(--f-mono); font-stretch: 87.5%; font-size: 11.5px; color: var(--muted); border-block: 1px solid var(--line); padding-block: 12px; }
.art-meta .by { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); }
.art-meta .by .ph { width: 32px; height: 32px; --ar: 1; }
.art-grid { display: grid; grid-template-columns: minmax(0, 680px) 260px; gap: 56px; padding-bottom: 72px; }
.art { font-size: 18.5px; line-height: 1.7; color: var(--ink-2); }
.art > * + * { margin-top: 1.1em; }
.art h2 { font-family: var(--f-display); font-stretch: 112%; font-weight: 720; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); margin-top: 2em; padding-top: 14px; border-top: 2px solid var(--ink); }
.art strong { color: var(--ink); font-weight: 620; }
.art a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.art .wide { margin-inline: 0; }
.art .sn { position: relative; }
.art sup { font-family: var(--f-mono); font-size: 10px; color: var(--blue); font-weight: 600; }
.art .pull { font-family: var(--f-display); font-stretch: 112%; font-weight: 700; font-size: 28px; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); border-left: 4px solid var(--blue); padding-left: 20px; margin-block: 1.4em; }
.art .update { border: 1px solid var(--blue); padding: 14px 16px; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.art .update .note-blue { display: block; margin-bottom: 4px; }
.art ul.art-list { padding-left: 1.2em; }
.art ul.art-list li + li { margin-top: .4em; }
.art-side { display: grid; gap: 22px; align-content: start; }
.art-side .sidenote { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 11.5px; line-height: 1.6; color: var(--blue); border-top: 1px solid var(--blue); padding-top: 8px; }
.art-side .sidenote b { font-weight: 600; }
.art-side .toc { position: sticky; top: calc(var(--nav-h) + 64px); }
.art-side .toc h4 { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; border-top: 2px solid var(--ink); padding-top: 8px; }
.art-side .toc ol { list-style: none; margin-top: 6px; }
.art-side .toc a { display: block; padding: 5px 0; font-size: 13.5px; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.art-side .toc a:hover { color: var(--blue); }
@media (max-width: 1080px) {
  .art-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .art .wide { margin-inline: 0; }
  .art-side .toc { position: static; }
}
.author-box { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; border: 1px solid var(--line-strong); background: var(--surface); padding: 18px; align-items: start; }
.author-box .ph { --ar: 1; }
.next-prev { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.next-prev a { border: 1px solid var(--line-strong); padding: 16px; display: grid; gap: 4px; background: var(--surface); transition: border-color var(--t-fast) var(--ease); }
.next-prev a:hover { border-color: var(--blue); }
.next-prev strong { font-family: var(--f-display); font-stretch: 106%; font-weight: 650; font-size: 16px; line-height: 1.3; }
@media (max-width: 640px) { .next-prev { grid-template-columns: minmax(0, 1fr); } }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.share a { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 11px; padding: 6px 10px; border: 1px solid var(--line-strong); }
.share a:hover { border-color: var(--blue); color: var(--blue); }
