
/* ------------------------------------------------------------------
   The story: pinned viewport with copy scrolling over it
   ------------------------------------------------------------------ */
.story { position: relative; }
.stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background:
        radial-gradient(80vw 70vh at 70% 40%, rgba(92, 200, 255, 0.06), transparent 70%),
        var(--space);
}
.viewport { width: 100%; height: 100%; }
.no-webgl .viewport { display: none; }
.no-webgl .stage {
    background-image:
        linear-gradient(var(--rule) 1px, transparent 1px),
        linear-gradient(90deg, var(--rule) 1px, transparent 1px);
    background-size: 48px 48px;
}

.steps {
    position: relative;
    z-index: 3;
    margin-top: -100vh;
    margin-top: -100svh;
    pointer-events: none;
}
.step {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 96px var(--gutter);
}
.step + .step { min-height: 110vh; }
.step-card {
    pointer-events: auto;
    max-width: 30rem;
    padding: 28px 30px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: rgba(13, 15, 18, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.step-card p { color: var(--line-2); }
.step-card p + p, .step-card .text-link { margin-top: 16px; }
.step-title {
    margin-bottom: 14px;
    font-size: var(--t-2xl);
    font-weight: 650;
    font-variation-settings: "wdth" 112;
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-wrap: balance;
}
.step-note {
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    font-size: var(--t-sm);
    color: var(--line-3) !important;
}

/* Hero step: the copy is on screen from the first frame */
.step--hero { position: relative; align-items: flex-end; padding-bottom: clamp(72px, 12vh, 140px); }
/* A soft shade behind the hero copy so the plan never fights the text */
.step--hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0, rgba(0, 0, 0, 0.5) 34%, transparent 50%);
    pointer-events: none;
}
.step-card--hero {
    max-width: 40rem;
    padding: 0;
    border: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.hero-heading { font-size: 1rem; font-weight: 400; }
.hero-role, .hero-title { display: block; }
.hero-role {
    margin-bottom: 18px;
    font-family: var(--mono);
    font-size: var(--t-sm);
    color: var(--dim) !important;
}
.hero-title {
    font-size: var(--t-3xl);
    font-weight: 700;
    font-variation-settings: "wdth" 116;
    line-height: 0.95;
    letter-spacing: -0.035em;
    text-wrap: balance;
    text-shadow: 0 2px 30px rgba(13, 15, 18, 0.9);
}
.hero-lede {
    max-width: 29em;
    margin-top: 24px;
    font-size: var(--t-lg);
    line-height: 1.45;
    text-shadow: 0 1px 16px rgba(13, 15, 18, 1);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: var(--t-xs);
    color: var(--line-3);
    white-space: nowrap;
}
.scroll-cue::after {
    content: "";
    display: block;
    width: 1px;
    height: 28px;
    margin: 10px auto 0;
    background: linear-gradient(var(--dim), transparent);
    animation: cue 2s var(--ease) infinite;
    transform-origin: top;
}
@keyframes cue { 0% { transform: scaleY(0); } 60%, 100% { transform: scaleY(1); opacity: 0; } }

/* Projected labels from the 3D scene */
.labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.tag {
    position: absolute;
    top: 0; left: 0;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    color: var(--line);
    background: rgba(13, 15, 18, 0.8);
    border: 1px solid var(--rule-2);
    opacity: 0;
    transition: opacity 0.4s;
    will-change: transform;
}
.tag--flag { color: var(--flag); border-color: rgba(255, 181, 71, 0.55); box-shadow: 0 0 24px rgba(255, 181, 71, 0.25); }
.tag--flag strong { display: block; font-weight: 500; color: var(--line); }
.tag--dim { color: var(--dim); border-color: rgba(92, 200, 255, 0.4); }
.tag--graph { color: #d6d0ff; border-color: rgba(139, 124, 255, 0.55); }

/* CAD crosshair cursor, inside the viewport only */
.crosshair { display: none; }
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .story.has-crosshair .stage { cursor: none; }
    .story.has-crosshair .crosshair { display: block; }
}
.crosshair { position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0; transition: opacity 0.3s; }
.crosshair.is-on { opacity: 1; }
.crosshair-x, .crosshair-y { position: absolute; background: rgba(232, 236, 242, 0.28); }
.crosshair-x { left: 0; right: 0; height: 1px; top: 0; }
.crosshair-y { top: 0; bottom: 0; width: 1px; left: 0; }
.crosshair-box {
    position: absolute;
    top: -6px; left: -6px;
    width: 12px; height: 12px;
    border: 1px solid var(--line);
}
.crosshair-read {
    position: absolute;
    top: 14px; left: 14px;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--dim);
    background: rgba(13, 15, 18, 0.75);
    white-space: nowrap;
}

/* HUD */
.hud {
    position: absolute;
    right: var(--gutter);
    bottom: 28px;
    z-index: 2;
    display: grid;
    gap: 10px;
    justify-items: end;
    font-family: var(--mono);
    font-size: var(--t-xs);
    color: var(--line-2);
}
.hud-view { display: flex; gap: 12px; }
.hud-scale { color: var(--line-3); }
.hud-layers { display: flex; gap: 14px; }
.hud-layers li { display: flex; align-items: center; gap: 6px; }
.hud-layers li::before { content: ""; width: 10px; height: 2px; background: currentColor; }
.l-wall::before { background: var(--line) !important; }
.l-dim::before { background: var(--dim) !important; }
.l-flag::before { background: var(--flag) !important; }
.l-graph::before { background: var(--graph) !important; }
.stage-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    height: 2px;
    background: var(--rule);
}
.stage-progress span {
    position: absolute;
    inset: 0;
    background: var(--dim);
    transform-origin: left;
    transform: scaleX(0);
}

/* ------------------------------------------------------------------
   Sheets (regular sections)
   ------------------------------------------------------------------ */
.sheet {
    position: relative;
    padding-block: clamp(96px, 14vh, 160px);
    border-top: 1px solid var(--rule);
    background-image:
        linear-gradient(rgba(232, 236, 242, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 236, 242, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: center top;
}
.sheet--tight { padding-block: clamp(80px, 11vh, 120px); }
.sheet-head { display: grid; gap: 20px; max-width: 46rem; margin-bottom: 56px; }
.display {
    font-size: var(--t-3xl);
    font-weight: 750;
    font-variation-settings: "wdth" 120;
    line-height: 0.92;
    letter-spacing: -0.04em;
}
.display--sm { font-size: clamp(2.6rem, 5.4vw, 4.8rem); }
.title {
    margin-bottom: 48px;
    font-size: var(--t-2xl);
    font-weight: 650;
    font-variation-settings: "wdth" 112;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.sheet-head .title { margin-bottom: 0; }
.sheet-lede { color: var(--line-2); font-size: var(--t-lg); line-height: 1.45; max-width: 36em; }

/* PlanLint monitor */
.monitor {
    position: relative;
    border: 1px solid var(--rule-2);
    border-radius: 12px;
    overflow: hidden;
    background: #07080a;
    box-shadow: 0 60px 120px -60px rgba(92, 200, 255, 0.35);
}
.monitor-bar {
    display: flex;
    gap: 6px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--rule);
    background: var(--space-2);
}
.monitor-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--rule-2); }
.monitor-video { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #07080a; }
.monitor-fallback { padding: 120px 24px; text-align: center; color: var(--line-2); }
.monitor-toggle {
    position: absolute;
    right: 14px; bottom: 14px;
    padding: 6px 12px;
    border: 1px solid var(--rule-2);
    border-radius: 6px;
    background: rgba(13, 15, 18, 0.8);
    font-family: var(--mono);
    font-size: var(--t-xs);
}

.spec {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 56px;
    border-top: 1px solid var(--rule);
}
.spec-item { padding: 28px 28px 0 0; }
.spec-item + .spec-item { padding-left: 28px; border-left: 1px solid var(--rule); }
.spec-item h3 {
    margin-bottom: 10px;
    font-size: var(--t-lg);
    font-weight: 650;
    font-variation-settings: "wdth" 108;
    letter-spacing: -0.015em;
}
.spec-item p { color: var(--line-2); }
.row-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 40px; }
.row-links .tools { margin-left: 8px; }
.row-links--sm { margin-top: 20px; gap: 16px; }

.install { position: relative; border: 1px solid var(--rule); border-radius: 8px; background: #07080a; }
.install pre { margin: 0; padding: 14px 14px 46px; overflow-x: auto; font-size: 0.78rem; line-height: 1.7; color: var(--dim); }
.copy {
    position: absolute; right: 8px; bottom: 8px;
    padding: 4px 10px; border: 1px solid var(--rule-2); border-radius: 5px;
    background: transparent; font-family: var(--mono); font-size: var(--t-xs);
}

/* sota-anchor race */
.race {
    padding: clamp(18px, 3vw, 32px);
    border: 1px solid var(--rule-2);
    border-radius: 12px;
    background: rgba(19, 22, 27, 0.85);
}
.race-task { color: var(--line-2); }
.race-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.lane {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: #090b0d;
    transition: border-color 0.5s, box-shadow 0.5s;
}
.lane--fast.is-done { border-color: rgba(92, 200, 255, 0.5); box-shadow: 0 0 50px -14px rgba(92, 200, 255, 0.55); }
.lane-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600; }
.lane-clock { font-family: var(--mono); font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 400; color: var(--line); }
.lane-track { position: relative; height: 2px; margin: 14px 0 20px; background: var(--rule); overflow: hidden; }
.lane-fill { position: absolute; inset: 0; background: var(--line-3); transform-origin: left; transform: scaleX(0); }
.lane--fast .lane-fill { background: var(--dim); }
.lane-steps { display: grid; gap: 9px; flex: 1; }
.lane-steps li { position: relative; padding-left: 24px; color: var(--line-3); transition: color 0.3s; }
.lane-steps li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.45em;
    width: 10px; height: 10px;
    border: 1px solid var(--line-3);
    transform: rotate(45deg);
    transition: background-color 0.3s, border-color 0.3s;
}
.lane-steps li.is-on { color: var(--line); }
.lane-steps li.is-on::before { background: var(--line-2); border-color: var(--line-2); }
.lane--fast .lane-steps li.is-on::before { background: var(--dim); border-color: var(--dim); }
.lane-result { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--line-2); }
.lane-result span {
    display: block;
    font-size: clamp(2.4rem, 4.6vw, 3.6rem);
    font-weight: 700;
    font-variation-settings: "wdth" 116;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--line);
    font-variant-numeric: tabular-nums;
}
.race-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; color: var(--line-3); font-size: var(--t-sm); }

/* Results as a dimension string: each value sits on a dimension line */
.dims { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dims .dim {
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    gap: 14px;
    padding: 30px 24px 0;
}
.dims .dim::before, .dims .dim::after { content: ""; position: absolute; }
.dims .dim::before { top: 10px; left: 0; right: 0; height: 1px; background: var(--dim); opacity: 0.6; }
.dims .dim::after {
    top: 4px; left: 0;
    width: 1px; height: 13px;
    background: var(--dim);
    box-shadow: calc(var(--w, 0px)) 0 0 var(--dim);
}
.dims .dim:last-child { border-right: 1px solid transparent; }
.dims .dim:last-child::before { right: 0; }
.dims .dim:last-child { background: linear-gradient(var(--dim), var(--dim)) right 4px / 1px 13px no-repeat; }
.dims .dim dd {
    font-size: clamp(2.8rem, 5.6vw, 5rem);
    font-weight: 300;
    font-variation-settings: "wdth" 120;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
.dims .times { font-family: system-ui, sans-serif; font-weight: 200; }
.dims .dim dt { color: var(--line-2); max-width: 17em; font-size: var(--t-sm); }

/* Services */
.services {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--rule-2);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(13, 15, 18, 0.7);
}
.service { padding: clamp(24px, 3.4vw, 40px); transition: background-color 0.3s; }
.service:hover { background: rgba(92, 200, 255, 0.04); }
.service:nth-child(odd) { border-right: 1px solid var(--rule); }
.service:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
.service h3 {
    font-size: var(--t-xl);
    font-weight: 650;
    font-variation-settings: "wdth" 110;
    line-height: 1.12;
    letter-spacing: -0.02em;
}
.service p { margin-top: 12px; color: var(--line-2); max-width: 32em; }
.service .tools { color: var(--dim); }

/* Experience */
.timeline { max-width: 54rem; border-left: 1px solid var(--rule-2); }
.role { position: relative; display: grid; grid-template-columns: 10rem 1fr; gap: 28px; padding: 0 0 56px 28px; }
.role::before {
    content: "";
    position: absolute;
    left: -5px; top: 7px;
    width: 9px; height: 9px;
    background: var(--space);
    border: 1px solid var(--dim);
    transform: rotate(45deg);
}
.role-when { padding-top: 2px; font-family: var(--mono); font-size: var(--t-xs); color: var(--line-2); }
.role h3 { font-size: var(--t-xl); font-weight: 650; font-variation-settings: "wdth" 108; letter-spacing: -0.02em; line-height: 1.1; }
.role-where { margin-top: 4px; color: var(--dim); font-size: var(--t-sm); }
.role ul { display: grid; gap: 8px; margin-top: 14px; }
.role li { color: var(--line-2); }
.education { margin-top: 8px; color: var(--line-2); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
    padding: 28px;
    border: 1px solid var(--rule-2);
    border-radius: 12px;
    background: rgba(19, 22, 27, 0.85);
    transition: border-color 0.3s, transform 0.4s var(--ease);
}
.card:hover { border-color: rgba(92, 200, 255, 0.4); transform: translateY(-3px); }
.card-meta { font-family: var(--mono); font-size: var(--t-xs); color: var(--dim); }
.card h3 {
    margin: 12px 0 12px;
    font-size: var(--t-2xl);
    font-weight: 700;
    font-variation-settings: "wdth" 116;
    letter-spacing: -0.03em;
    line-height: 1;
}
.card > p:not(.card-meta) { color: var(--line-2); }

/* Writing */
.posts { max-width: 56rem; border-top: 1px solid var(--rule); }
.post { display: grid; gap: 8px; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.post-meta { font-family: var(--mono); font-size: var(--t-xs); color: var(--line-3); }
.post-title {
    font-size: var(--t-xl);
    font-weight: 650;
    font-variation-settings: "wdth" 108;
    letter-spacing: -0.02em;
    line-height: 1.15;
    transition: color 0.2s;
}
.post:hover .post-title { color: var(--dim); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact .sheet-lede { margin-top: 24px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 28px; }
.contact-grid > * { min-width: 0; }
.form {
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--rule-2);
    border-radius: 12px;
    background: rgba(19, 22, 27, 0.9);
}
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: var(--t-sm); color: var(--line-2); }
.field input, .field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--rule-2);
    border-radius: 8px;
    background: #07080a;
    color: var(--line);
    font: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--dim); box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.18); }
.field [aria-invalid="true"] { border-color: #ff7a7a; }
.honeypot { position: absolute; left: -9999px; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-status { color: var(--line-2); font-size: var(--t-sm); }
.form-status.is-ok { color: #5ee39a; }
.form-status.is-error { color: #ff9a9a; }
/* Small line above a featured heading */
.kicker { color: var(--dim); font-size: var(--t-sm); font-weight: 500; }
.sheet-head .kicker { margin-bottom: -8px; }

/* About, with education as a drawing title block */
.about { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-text { max-width: 40rem; }
.about-text p { color: var(--line-2); font-size: var(--t-lg); line-height: 1.55; }
.about-text p + p { margin-top: 20px; }
.title-block {
    border: 1px solid var(--rule-2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
}
.title-block h3 {
    padding: 12px 18px;
    border-bottom: 1px solid var(--rule-2);
    font-size: var(--t-sm);
    font-weight: 600;
    font-variation-settings: "wdth" 112;
}
.title-block dl > div { display: grid; grid-template-columns: 6.5rem 1fr; border-bottom: 1px solid var(--rule); }
.title-block dl > div:last-child { border-bottom: 0; }
.title-block dt, .title-block dd { padding: 12px 18px; }
.title-block dt { border-right: 1px solid var(--rule); font-family: var(--mono); font-size: var(--t-xs); color: var(--line-3); padding-top: 15px; }
.title-block-num { font-size: var(--t-xl); font-weight: 300; font-variation-settings: "wdth" 116; color: var(--dim); font-variant-numeric: tabular-nums; }

/* Project rows: name and links on the left, detail on the right */
.project {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
    gap: clamp(24px, 5vw, 72px);
    padding: 40px 0;
    border-top: 1px solid var(--rule);
}
.project:last-child { border-bottom: 1px solid var(--rule); }
.project h3 {
    margin: 10px 0 8px;
    font-size: var(--t-2xl);
    font-weight: 700;
    font-variation-settings: "wdth" 116;
    letter-spacing: -0.03em;
    line-height: 1;
}
.project-role { color: var(--line-2); font-size: var(--t-sm); max-width: 22em; }
.project .tools { margin-top: 20px; }
.ticks { display: grid; gap: 10px; max-width: 44rem; }
.ticks li { position: relative; padding-left: 22px; color: var(--line-2); }
.ticks li::before {
    content: "";
    position: absolute;
    left: 2px; top: 0.62em;
    width: 8px; height: 1px;
    background: var(--dim);
}

/* Skills, grouped like drawing layers */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.skill { padding: 26px 28px; border: 1px solid var(--rule-2); border-radius: 12px; background: rgba(19, 22, 27, 0.85); }
.skill h3 { margin-bottom: 16px; font-size: var(--t-lg); font-weight: 650; font-variation-settings: "wdth" 108; letter-spacing: -0.015em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 5px 11px; border: 1px solid var(--rule-2); border-radius: 999px; font-size: var(--t-sm); color: var(--line-2); }

/* Writing extras */
.post-excerpt { color: var(--line-2); max-width: 44rem; }
.post-more { color: var(--dim); font-size: var(--t-sm); }

/* Entrances */
.reveal { opacity: 0; transform: translateY(28px); }

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 1000px) {
    .dims { grid-template-columns: 1fr 1fr; row-gap: 40px; }
    .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .step { align-items: flex-end; padding-bottom: 72px; }
    .step-card { padding: 22px; }
    .hud { display: none; }
    .step--hero { background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.92) 46%); }
    .hero-title { font-size: clamp(2.3rem, 10vw, 2.8rem); }
    .hero-lede { font-size: var(--t-base); margin-top: 16px; }
    .hero-actions { margin-top: 22px; gap: 10px; }
    .hero-actions .btn { padding: 11px 16px; }
    .hero-role { margin-bottom: 12px; font-size: var(--t-xs); }
    .scroll-cue { display: none; }
    .step--hero { padding-bottom: 64px; }
    .step--hero::before { display: none; }
    .step-card--hero { padding: 0; }
    .race-lanes, .spec, .services, .contact-grid, .cards, .dims, .about, .project, .skills { grid-template-columns: 1fr; }
    .spec-item, .spec-item + .spec-item { padding: 24px 0 0; border-left: 0; }
    .service:nth-child(odd) { border-right: 0; }
    .service:not(:last-child) { border-bottom: 1px solid var(--rule); }
    .role { grid-template-columns: 1fr; gap: 6px; }
    .race-foot { flex-direction: column; align-items: flex-start; }
    .row-links .tools { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .scroll-cue::after { animation: none; }
    .reveal { opacity: 1; transform: none; }
    .card:hover { transform: none; }
}
