/* ============================================
   HOME — "built by agents". Every block is real HTML; agents.js only animates it into place.
   ============================================ */

/* tokens, type, buttons, header and footer come from style.css */
body.home { position: relative; }
body.home main { overflow-x: clip; }
.home em { font-style: normal; color: var(--red); }
.defs { position: absolute; width: 0; height: 0; }

/* ============================================
   HERO
   ============================================ */
.hx { position: relative; min-height: 100svh; padding: 0 var(--pad); overflow: hidden;
  background: radial-gradient(60% 55% at 58% 62%, rgba(255,59,47,.16), transparent 70%), var(--bg); }
.hx-word { position: absolute; left: 0; right: 0; top: clamp(3.6rem, 7vh, 5rem); text-align: center; font: 400 20.6vw/.8 var(--display);
  text-transform: uppercase; letter-spacing: -.005em; color: var(--red); white-space: nowrap; user-select: none; pointer-events: none; }
.hx-in { position: relative; max-width: var(--max); min-height: 100svh; margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; padding-bottom: clamp(4.5rem, 9vh, 6rem); }
.hx-copy { position: relative; z-index: 3; grid-column: 1; max-width: 40rem; }
.hx-hello { font: italic 400 clamp(1.5rem, 2.4vw, 2.2rem)/1 var(--serif); color: var(--fg); margin-bottom: .4rem; }
.hx-name { font: 400 clamp(3rem, 6.1vw, 7rem)/.86 var(--display); text-transform: uppercase; letter-spacing: .002em; }
.hx-name span { display: block; white-space: nowrap; }
.hx-name i { font-style: normal; color: var(--red); }
.hx-role { margin-top: 1.1rem; font: 600 .9rem/1.35 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.hx-bio { margin-top: 1rem; max-width: 40ch; color: #c9c5bd; font-size: 1rem; }
.hx-bio a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.hx-cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }

.hx-photo { position: absolute; z-index: 2; left: 50%; bottom: 0; height: min(88svh, 900px); aspect-ratio: 800 / 919; transform: translateX(-40%); }
.hx-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.hx-photo .true { display: none; }
.hx-photo.lens .true { display: block; -webkit-mask-image: linear-gradient(transparent, transparent); mask-image: linear-gradient(transparent, transparent); }
.hx-hint { position: absolute; right: 2%; top: 46%; color: var(--mute); opacity: 0; transition: opacity .6s; white-space: nowrap; }
.hx-photo.lens .hx-hint { opacity: .9; }
.hx-photo.lens.used .hx-hint { opacity: 0; }

.hx-stats { position: relative; z-index: 3; grid-column: 3; list-style: none; display: grid; gap: 1.6rem; text-align: right; }
.hx-stats b { display: block; font: 400 clamp(2.6rem, 4.4vw, 4.4rem)/.85 var(--display); color: var(--red); }
.hx-stats span { display: block; margin-top: .35rem; font: 500 .72rem/1.35 var(--mono); text-transform: uppercase; color: var(--mute); }

/* ticker */
.ticker { border-block: 1px solid var(--line); overflow: hidden; background: var(--bg); }
.ticker-track { display: flex; width: max-content; animation: tick 42s linear infinite; }
.ticker span { display: flex; align-items: center; gap: 2.4rem; padding: 1.05rem 1.2rem 1.05rem 0; font: 400 clamp(1.2rem, 2vw, 1.7rem)/1 var(--display); text-transform: uppercase; white-space: nowrap; }
.ticker span::after { content: "✳"; color: var(--red); font-size: .8em; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ============================================
   SECTIONS
   ============================================ */
.sx { max-width: var(--max); margin: 0 auto; padding: clamp(6rem, 12vw, 11rem) var(--pad) 0; }
.sx-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); align-items: end; column-gap: 3rem; row-gap: 1rem; margin-bottom: clamp(3rem, 6vw, 5.5rem); }
.sx-head .kicker { grid-column: 1 / -1; }
.sx-head-row { grid-template-columns: minmax(0, 1fr) auto; }
.kicker { color: var(--red); }
.sx-title { font: 400 clamp(3.6rem, 9.6vw, 10rem)/.84 var(--display); text-transform: uppercase; letter-spacing: .002em; }
.sx-lede { color: var(--mute); font-size: 1.02rem; max-width: 46ch; }

/* ——— case studies ——— */
.case { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start;
  padding-block: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line); }
.case-flip .case-text { order: 2; }
.case-meta { color: var(--mute); display: flex; gap: .8rem; }
.case-meta span { color: var(--red); }
.case-title { margin-top: .8rem; font: 400 clamp(4rem, 9vw, 9rem)/.84 var(--display); text-transform: uppercase; }
.case-title i { font-style: normal; color: var(--red); }
.case-lede { margin-top: 1.2rem; font-size: 1.12rem; line-height: 1.55; color: #d8d4cc; max-width: 46ch; }
.case-facts { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 1.6rem; margin: 2rem 0 2.2rem; }
.case-facts li { padding-top: .9rem; border-top: 1px solid var(--line); font-size: .9rem; line-height: 1.5; color: var(--mute); }
.case-facts b { display: block; margin-bottom: .25rem; color: var(--fg); font-weight: 600; }
.case-visual { position: relative; padding-bottom: 14%; }

.browser { border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px var(--line-2); }
.browser-bar { display: flex; align-items: center; gap: .4rem; padding: .6rem .8rem; background: #ecebe8; }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #c9c7c2; }
.browser-bar i:first-child { background: #ff5f57; } .browser-bar i:nth-child(2) { background: #febc2e; } .browser-bar i:nth-child(3) { background: #28c840; }
.browser-bar span { margin-left: .8rem; padding: .2rem .8rem; border-radius: 6px; background: #fff; font: 500 .72rem/1.4 var(--mono); color: #555; }
.browser img { display: block; width: 100%; height: auto; }
.browser-sm { position: absolute; right: -4%; bottom: 0; width: 46%; max-height: 62%; transform: rotate(2.5deg); }
.browser-sm img { aspect-ratio: 1; object-fit: cover; object-position: top; }

/* Praxos queue board (illustration) */
.qboard { position: relative; border-radius: 16px; padding: clamp(1.2rem, 2.4vw, 2rem); background: linear-gradient(160deg, #161615, #0e0e0d);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px var(--line-2); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.2rem; }
.qb-head { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--mute); padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.qb-live { color: #3ddc84; }
.qb-now { border-radius: 12px; background: var(--red); color: #140403; padding: 1.2rem; display: flex; flex-direction: column; justify-content: space-between; min-height: 15rem; }
.qb-token { font: 400 clamp(3.4rem, 5.4vw, 5.6rem)/.85 var(--display); white-space: nowrap; }
.qb-list { list-style: none; display: grid; align-content: start; }
.qb-list li { display: grid; grid-template-columns: 3.6rem 1fr auto; gap: .6rem; padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: .7rem; color: var(--mute); }
.qb-list b { color: var(--fg); font-weight: 500; }
.qb-list em { color: var(--fg); }
.qb-ai { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.2rem; align-items: center; padding: 1rem; border-radius: 12px; background: var(--bg-3); }
.qb-ai .mono { grid-column: 1 / -1; color: var(--mute); }
.qb-ai svg { width: 9rem; height: 2rem; color: var(--red); }
.qb-ai p:last-child { font-size: .88rem; color: #d8d4cc; }
.qboard figcaption { position: absolute; left: 0; bottom: -2rem; color: var(--mute); }

/* ——— more builds ——— */
.builds { padding-top: clamp(4rem, 8vw, 7rem); }
.builds-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 1rem; border-bottom: 1px solid var(--line-2); }
.builds-title { font: 400 clamp(2rem, 4vw, 3.4rem)/1 var(--display); text-transform: uppercase; }
.builds-head .mono { color: var(--mute); }
.plist { list-style: none; }
.prow { position: relative; display: grid; grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 15rem) 3.5rem 5.5rem; column-gap: clamp(1rem, 2.4vw, 2rem);
  align-items: baseline; padding: clamp(1.4rem, 2.6vw, 2rem) 0; border-bottom: 1px solid var(--line); }
.prow-n, .prow-s, .prow-y { color: var(--mute); }
.prow-s { line-height: 1.7; font-size: .68rem; }
.prow-t { font: 400 clamp(1.8rem, 3.6vw, 3.3rem)/.92 var(--display); text-transform: uppercase; transition: transform .6s var(--ease), color .3s; }
.prow-d { max-width: 60ch; margin-top: .8rem; font-size: .92rem; color: var(--mute); }
.prow-d a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--red); }
.prow-go { justify-self: end; white-space: nowrap; }
.prow-go:hover { color: var(--red); }
.prow:hover .prow-t { transform: translateX(.5rem); color: var(--red); }

/* ——— numbers ——— */
.nums { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.nums li { padding: 2rem 1.2rem 2.4rem 0; border-right: 1px solid var(--line); }
.nums li + li { padding-left: 1.4rem; }
.nums li:last-child { border-right: 0; }
.nums b { font: 400 clamp(4.5rem, 10vw, 10rem)/.8 var(--display); color: var(--red); font-variant-numeric: tabular-nums; }
.nums i { font: 400 clamp(2rem, 4vw, 4rem)/1 var(--display); font-style: normal; color: var(--red); }
.nums span { display: block; margin-top: 1rem; font: 500 .74rem/1.4 var(--mono); text-transform: uppercase; color: var(--mute); }
.xp { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin-top: clamp(3rem, 6vw, 5rem); }
.xp li { padding-top: 1.2rem; border-top: 2px solid var(--fg); }
.xp-when { color: var(--red); }
.xp h3 { margin: .7rem 0 .5rem; font: 600 1.12rem/1.3 var(--sans); }
.xp p { color: var(--mute); font-size: .92rem; }

/* ——— how I work ——— */
.about { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.about-lead { font-size: clamp(1.4rem, 2.4vw, 2.1rem); line-height: 1.25; font-weight: 500; letter-spacing: -.01em; margin-bottom: 1.2rem; }
.about-text > p:not(.about-lead) { color: var(--mute); max-width: 58ch; }
.papers { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.2rem; }
.papers li { padding: 1.1rem; border-radius: 12px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.papers .mono { color: var(--red); }
.papers a, .papers p { display: block; margin-top: .5rem; font-weight: 600; line-height: 1.35; }
.papers a:hover { color: var(--red); }
.note { background: var(--red); color: #160403; padding: 1.6rem 1.6rem 1.4rem; border-radius: 4px; transform: rotate(-2.2deg); box-shadow: 0 30px 60px -20px rgba(255,59,47,.45); }
.note-big { margin: .8rem 0 1.2rem; font: 400 clamp(2.2rem, 3.6vw, 3.4rem)/.92 var(--display); text-transform: uppercase; }

.stack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.4rem; margin-top: clamp(4rem, 8vw, 7rem); }
.stack > div { padding-top: 1rem; border-top: 1px solid var(--line-2); }
.stack h3 { color: var(--red); margin-bottom: .6rem; font-weight: 500; }
.stack p { color: var(--mute); font-size: .92rem; line-height: 1.6; }
.stack b { color: var(--fg); font-weight: 600; }

.years { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: clamp(4rem, 8vw, 7rem); border-top: 1px solid var(--line); }
.years li { padding: 1.2rem 1rem 0 0; position: relative; }
.years li::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.years-y { display: block; font: 400 clamp(2rem, 3.4vw, 3.2rem)/1 var(--display); }
.years p { margin-top: .5rem; font-size: .86rem; color: var(--mute); line-height: 1.45; }

.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; margin-top: clamp(4rem, 8vw, 7rem); }
.strip figure { position: relative; overflow: hidden; border-radius: 10px; aspect-ratio: 3 / 4; background: var(--bg-2); }
.strip img { width: 100%; height: 100%; object-fit: cover; filter: url(#duo); transform: scale(1.02); transition: filter .5s, transform 1s var(--ease); }
.strip figure:hover img { filter: none; transform: scale(1.07); }
.strip figcaption { position: absolute; left: .8rem; bottom: .7rem; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.8); }

.more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line); }
.more a { position: relative; display: block; padding: 1.2rem 2.2rem 1.4rem 0; border-bottom: 1px solid var(--line); }
.more a::after { content: "→"; position: absolute; right: 1rem; top: 1.2rem; transition: transform .4s var(--ease), color .3s; }
.more a:hover::after { transform: translateX(.3rem); color: var(--red); }
.more span { display: block; font-weight: 600; }
.more small { display: block; margin-top: .2rem; color: var(--mute); font-size: .84rem; }

/* ——— writing ——— */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.post-img { aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--bg-2); margin-bottom: 1rem; }
.post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.post:hover .post-img img { transform: scale(1.05); }
.post .mono { color: var(--mute); }
.post h3 { margin-top: .4rem; font: 600 1.2rem/1.3 var(--sans); transition: color .3s; }
.post:hover h3 { color: var(--red); }

/* ——— contact ——— */
.cx { position: relative; max-width: var(--max); margin: 0 auto; padding: clamp(7rem, 14vw, 13rem) var(--pad) clamp(6rem, 10vw, 9rem); }
.cx-title { margin-top: 1rem; font: 400 clamp(4rem, 13vw, 13.5rem)/.82 var(--display); text-transform: uppercase; max-width: 9ch; }
.cx-side { position: absolute; right: var(--pad); top: clamp(9rem, 16vw, 15rem); text-align: right; font: 400 clamp(1.8rem, 3.6vw, 3.4rem)/.9 var(--display); text-transform: uppercase; }
.cx-lede { margin-top: 2.4rem; color: var(--mute); max-width: 44ch; }
.cx-mail { display: inline-block; margin-top: 1.4rem; font: 600 clamp(1.4rem, 3.4vw, 2.8rem)/1.1 var(--sans); letter-spacing: -.015em;
  background: linear-gradient(var(--red), var(--red)) 0 100% / 100% 3px no-repeat; padding-bottom: .3rem; transition: color .3s; overflow-wrap: anywhere; }
.cx-mail:hover { color: var(--red); }
.cx-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }

/* ============================================
   AGENTS (cursors, selection boxes, status bar)
   ============================================ */
html.agents [data-build]:not(.built) { opacity: 0; }
.ag-layer { position: absolute; inset: 0; z-index: 60; pointer-events: none; overflow: clip; }   /* cursors never widen the page */
.ag { position: absolute; left: 0; top: 0; display: flex; align-items: flex-start; gap: 1px; will-change: transform; transition: opacity .4s; }
.ag svg { width: 16px; height: 18px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.ag b { margin-top: 13px; padding: .18rem .5rem; border-radius: 3px 999px 999px 999px; background: var(--c); color: #0a0a0a;
  font: 600 .62rem/1.3 var(--mono); letter-spacing: .02em; white-space: nowrap; }
.sel { position: absolute; left: 0; top: 0; border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 9%, transparent); border-radius: 2px; }
.sel::before, .sel::after { content: ""; position: absolute; width: 6px; height: 6px; background: #fff; border: 1.5px solid var(--c); }
.sel::before { left: -4px; top: -4px; } .sel::after { right: -4px; bottom: -4px; }
.sel i { position: absolute; left: -1.5px; bottom: 100%; margin-bottom: 4px; padding: .12rem .4rem; background: var(--c); color: #0a0a0a; border-radius: 2px;
  font: 600 .58rem/1.3 var(--mono); font-style: normal; white-space: nowrap; }
.caret { display: inline-block; width: .08em; min-width: 2px; height: 1em; margin-left: .04em; vertical-align: -.12em; background: var(--c); animation: caret .9s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.agents-ui { display: none; }
html.agents .agents-ui { display: block; }
.status { position: fixed; left: 50%; bottom: 1rem; z-index: 70; transform: translateX(-50%); display: flex; align-items: center; gap: .5rem;
  padding: .5rem .9rem; border-radius: 999px; background: rgba(18,18,17,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px var(--line-2), 0 10px 30px rgba(0,0,0,.5); color: var(--mute); font-size: .66rem; white-space: nowrap; transition: opacity .6s, transform .6s var(--ease); }
.status b { color: var(--fg); font-weight: 500; }
.status-task { color: var(--fg); }
.dock { display: flex; gap: 4px; margin-right: .15rem; }
.dock i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--c); transition: background .3s, transform .3s var(--ease); }
.dock i.home { background: var(--c); transform: scale(1.15); }   /* filled = parked at home, ring = out building */
.status-bar { width: 72px; height: 3px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.status-bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--red); transition: width .4s; }
.status.done { opacity: 0; transform: translate(-50%, 1rem); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .hx-photo { transform: translateX(-30%); height: min(78svh, 760px); }
  .stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prow { grid-template-columns: 2.6rem minmax(0, 1fr) minmax(0, 12rem) 5rem; }
  .prow-y { display: none; }
}
@media (max-width: 900px) {
  .sx-head { grid-template-columns: 1fr; }
  .case, .about { grid-template-columns: 1fr; }
  .case-flip .case-text { order: 0; }
  .case-visual { padding-bottom: 18%; }
  .nums { grid-template-columns: 1fr 1fr; }
  .nums li:nth-child(2) { border-right: 0; }
  .nums li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .nums li:nth-child(3) { padding-left: 0; }
  .xp { grid-template-columns: 1fr; }
  .years { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2rem; }
  .strip { grid-template-columns: repeat(5, 62%); overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); scrollbar-width: none; }
  .strip figure { scroll-snap-align: start; }
  .posts { grid-template-columns: 1fr; }
  .note { max-width: 26rem; }
  .prow { grid-template-columns: 2.2rem minmax(0, 1fr) auto; row-gap: .6rem; }
  .prow-n { grid-row: 1; }
  .prow-main { grid-column: 2 / 4; grid-row: 1; }
  .prow-s { grid-column: 2 / 4; grid-row: 2; }
  .prow-go { grid-column: 2 / 4; grid-row: 3; justify-self: start; }
}
@media (max-width: 720px) {
  .hx { padding-top: 4.8rem; }
  .hx-word { position: relative; top: auto; font-size: 21.5vw; margin: 0 calc(var(--pad) * -1); }
  .hx-in { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding-bottom: 5rem; }
  .hx-photo { order: -1; position: relative; left: auto; transform: none; height: auto; width: 100%; margin-top: -11vw; }
  .hx-photo img:first-child { position: relative; }
  .hx-photo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(transparent, var(--bg)); }
  .hx-copy { margin-top: -5.5rem; }
  .hx-stats { grid-template-columns: repeat(3, 1fr); text-align: left; margin-top: 2.4rem; gap: 1rem; }
  .hx-hint { display: none; }
  .case-facts { grid-template-columns: 1fr; }
  .browser-sm { display: none; }
  .case-visual { padding-bottom: 0; }
  .qboard { grid-template-columns: 1fr; }
  .qb-now { min-height: 0; }
  .papers { grid-template-columns: 1fr; }
  .stack { grid-template-columns: 1fr 1fr; }
  .years { grid-template-columns: 1fr 1fr; }
  .more { grid-template-columns: 1fr; }
  .cx-side { position: static; text-align: left; margin-top: 1.4rem; }
  .sx-head-row { grid-template-columns: 1fr; justify-items: start; }
  .status { bottom: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .strip img, .post-img img, .prow-t { transition: none; }
}
