/* sjbuilds — clean, quiet, readable. */

:root {
    --bg: #fbfbf9;
    --panel: #f3f2ee;
    --text: #1b1b1a;
    --muted: #686864;
    --faint: #a3a39e;
    --line: #e4e3de;
    --live: #2f9e5b;
    --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #121211;
        --panel: #1a1a19;
        --text: #e9e8e4;
        --muted: #9a9993;
        --faint: #5f5e59;
        --line: #282826;
        --live: #4cc47e;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #121211;
    --panel: #1a1a19;
    --text: #e9e8e4;
    --muted: #9a9993;
    --faint: #5f5e59;
    --line: #282826;
    --live: #4cc47e;
    color-scheme: dark;
}

/* ---------- Scenes: time of day (auto mode only) ---------- */

/* Morning: a fresher, cooler light */
:root[data-time="morning"] {
    --bg: #f7f9f8;
    --panel: #eef2f0;
    --line: #e0e5e2;
}

/* Evening: warm dusk */
:root[data-time="evening"] {
    --bg: #1b1613;
    --panel: #251e19;
    --text: #f1e8df;
    --muted: #b4a69a;
    --faint: #6f6257;
    --line: #322922;
    --live: #5cc98a;
    color-scheme: dark;
}

/* ---------- Scenes: season tints ---------- */

:root { --sky: transparent; --sun: transparent; }

:root[data-season="winter"]                      { --sky: rgba(150, 182, 224, .26); }
:root[data-season="winter"][data-theme="dark"]   { --sky: rgba(96, 128, 178, .16); }
:root[data-season="summer"]                      { --sky: rgba(255, 200, 120, .28); --sun: rgba(255, 186, 84, .34); }
:root[data-season="summer"][data-theme="dark"]   { --sky: rgba(255, 150, 80, .10); --sun: rgba(255, 140, 60, .16); }
:root[data-season="summer"][data-time="night"]   { --sun: transparent; }
:root[data-season="monsoon"]                     { --sky: rgba(118, 150, 160, .26); }
:root[data-season="monsoon"][data-theme="dark"]  { --sky: rgba(88, 120, 132, .16); }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
    margin: 0;
    background-color: var(--bg);
    background-image: radial-gradient(1400px 700px at 80% -15%, var(--sky), transparent 70%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color .3s ease, color .3s ease;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }
em { font-style: italic; }

/* Links: hairline underline that draws in on hover */
a {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size .25s ease, color .2s ease;
}
a:hover { background-size: 100% 1px; }

/* Links in running text stay quietly underlined */
p a:not(.go) {
    background-image: linear-gradient(var(--faint), var(--faint));
    background-size: 100% 1px;
}
p a:not(.go):hover { background-image: linear-gradient(var(--text), var(--text)); }

:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; }

.muted { color: var(--muted); }
.small { font-size: 14px; }

.page { max-width: 1080px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 1; }

/* Ambient layers sit behind the content and never take clicks */
.sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: 0; transition: opacity 2s ease; }
.sky.on { opacity: 1; }

/* Summer: a soft sun that slowly breathes in the top corner */
body::before {
    content: ""; position: fixed; top: -220px; right: -160px; width: 560px; height: 560px;
    border-radius: 50%; pointer-events: none; z-index: 0;
    background: radial-gradient(circle, var(--sun) 0%, transparent 65%);
    animation: sun 12s ease-in-out infinite;
}
@keyframes sun {
    0%, 100% { transform: scale(1); opacity: .85; }
    50% { transform: scale(1.08); opacity: 1; }
}

.scene { text-transform: capitalize; }

/* ---------- Header ---------- */

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0; }
.mark { font-family: var(--mono); font-size: 14px; font-weight: 500; background: none; }
.caret { display: inline-block; margin-left: 1px; color: var(--faint); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.top-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; font-size: 14px; color: var(--muted); }
.top-nav a:hover { color: var(--text); }

/* ---------- Scene picker ---------- */

.top { position: relative; }
.scene-picker { position: relative; margin-left: 20px; }

.scene-btn {
    display: inline-flex; align-items: center; gap: 2px;
    height: 32px; padding: 0 8px; border-radius: 999px;
    border: 1px solid var(--line); background: none; color: var(--text); cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}
.scene-btn:hover, .scene-btn[aria-expanded="true"] { border-color: var(--faint); background-color: var(--panel); }
.scene-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; }
.scene-icon + .scene-icon { color: var(--muted); }

.scene-btn svg, .chip svg {
    width: 18px; height: 18px; fill: none; stroke: currentColor;
    stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.scene-panel {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 20;
    width: 300px; max-width: calc(100vw - 32px);
    padding: 16px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--bg); box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
    animation: panel-in .18s ease-out;
}
.scene-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } }

.scene-row + .scene-row { margin-top: 14px; }
.scene-row-title { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0 0 8px !important; }
.chips-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.chip {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 9px 4px 7px; border-radius: 8px;
    border: 1px solid var(--line); background: none; color: var(--muted);
    font: 500 11.5px/1.2 var(--sans); cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--text); background-color: var(--panel); }
.chip svg { width: 20px; height: 20px; }

.scene-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0 !important; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 40px; padding: 0 18px; border-radius: 6px;
    border: 1px solid var(--line); background: none;
    font-size: 14.5px; font-weight: 500;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { border-color: var(--text); }
.btn-solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-solid:hover { background: transparent; color: var(--text); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* "go" links get a small arrow that nudges on hover */
.go { background-image: none; }
.go::after { content: "↗"; margin-left: 4px; color: var(--faint); display: inline-block; transition: transform .2s ease, color .2s ease; }
.go:hover { background-image: linear-gradient(currentColor, currentColor); }
.go:hover::after { transform: translate(2px, -2px); color: var(--text); }

/* ---------- Profile ---------- */

.profile {
    display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 72px; align-items: start;
    padding: 48px 0 56px;
}

/* Avatar sits beside the name, so the row has no dead space */
.id { display: flex; align-items: center; gap: 24px; }
.id .hello { margin-bottom: 8px; }

/* Greeting: a friendly line above the name. The hand waves on arrival and on every hover or tap. */
.greet { font-size: 16px; color: var(--muted); margin: 0 0 22px !important; cursor: default; }
.wave { display: inline-block; transform-origin: 75% 85%; }
.wave.waving { animation: wave 1.4s ease-in-out 1; }
@keyframes wave {
    0%   { transform: rotate(0); }
    12%  { transform: rotate(22deg); }
    24%  { transform: rotate(-10deg); }
    36%  { transform: rotate(22deg); }
    48%  { transform: rotate(-6deg); }
    60%  { transform: rotate(16deg); }
    75%  { transform: rotate(0); }
    100% { transform: rotate(0); }
}

/* "Right now" panel balancing the profile */
.now { border-top: 1px solid var(--text); padding-top: 14px; }
.now-title { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 4px !important; }
.now dl { margin: 0; }
.now dl div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; }
.now dt { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.now dd { margin: 0; }
.now dd a { background-image: linear-gradient(var(--faint), var(--faint)); background-size: 100% 1px; }
.now dd a:hover { background-image: linear-gradient(var(--text), var(--text)); }

.avatar {
    flex: none;
    width: 104px; height: 104px; border-radius: 50%;
    object-fit: cover; object-position: center 20%;
    box-shadow: 0 0 0 1px var(--line);
}

.hello { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 18px; }
#clock { white-space: nowrap; }

.profile h1 { font-size: clamp(38px, 5.4vw, 56px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.headline { font-size: 20px; line-height: 1.5; margin: 18px 0 18px; max-width: 640px; }
.bio { color: var(--muted); max-width: 640px; }

.socials { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--muted); }
.socials a:hover { color: var(--text); }

/* ---------- Facts ---------- */

.facts {
    display: grid; grid-template-columns: repeat(4, 1fr);
    margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.facts div { padding: 22px 20px 22px 0; }
.facts div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.facts dt { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.facts dd { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* ---------- Sections ---------- */

.section { padding: 88px 0 0; }

.section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    padding-bottom: 14px; margin-bottom: 28px; border-bottom: 1px solid var(--text);
}
.section-head h2 { font-size: 22px; font-weight: 600; }
.section-meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
span.section-meta { display: inline-flex; gap: 18px; }
a.section-meta, .section-meta a { color: var(--muted); }
a.section-meta:hover, .section-meta a:hover { color: var(--text); }

/* ---------- Tiles: a ruled grid, no floating cards ---------- */

.tiles {
    display: grid; grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.tile {
    display: flex; flex-direction: column;
    padding: 24px 26px 26px;
    border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
    background: none;
    transition: background-color .25s ease;
}
.tile:hover { background-color: var(--panel); }
.tile h4 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.tile p { color: var(--muted); font-size: 15px; }
.tile-kind { font-family: var(--mono); font-size: 12px; color: var(--muted) !important; margin-bottom: 14px !important; }
.tile .tech, .tile .links { margin-top: auto; padding-top: 16px; }
.tile .links + .tech { padding-top: 6px; }

.tech { font-family: var(--mono); font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14.5px; font-weight: 500; }

.tiles-4 { grid-template-columns: repeat(2, 1fr); }
.tiles-2 { grid-template-columns: repeat(2, 1fr); }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }

/* Off the clock */
.big-word { font-size: 30px !important; letter-spacing: -0.025em; line-height: 1.1; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; margin-left: 6px; vertical-align: -1px; }
.eq i { width: 2px; height: 100%; background: var(--live); border-radius: 1px; transform-origin: bottom; animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-duration: .8s; animation-delay: -.3s; }
.eq i:nth-child(3) { animation-duration: 1.3s; animation-delay: -.6s; }
.eq i:nth-child(4) { animation-duration: .95s; animation-delay: -.15s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

#life .tile { position: relative; overflow: hidden; }

/* Rap: headphones that bob to the beat, notes drifting up, the equalizer kicking in */
.rap-art { position: absolute; top: 18px; right: 20px; width: 44px; height: 44px; color: var(--muted); }
.phones { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: color .3s ease; }
.phones rect { fill: var(--bg); transition: fill .3s ease; }
.note { position: absolute; left: 50%; top: 2px; font-size: 17px; font-weight: 600; line-height: 1; color: var(--live); opacity: 0; pointer-events: none; }
.tile-rap:hover .rap-art { color: var(--text); }
.tile-rap:hover .phones { animation: bob .48s ease-in-out infinite; }
.tile-rap:hover .phones rect { fill: var(--live); }
.tile-rap:hover .note { animation: note-up 1.5s ease-out infinite; }
.tile-rap:hover .n2 { animation-delay: .5s; }
.tile-rap:hover .n3 { animation-delay: 1s; }
@keyframes bob {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-2px) rotate(-4deg); }
    50% { transform: translateY(0) rotate(0); }
    75% { transform: translateY(-2px) rotate(4deg); }
}
@keyframes note-up {
    0%   { opacity: 0; transform: translate(-50%, 6px) rotate(0); }
    20%  { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx, -14px)), -30px) rotate(-12deg); }
}
.n2 { --dx: 12px; }
.n3 { --dx: -4px; }
.tile-rap:hover .eq { height: 14px; }
.tile-rap:hover .eq i { animation-duration: .5s; }
.tile-rap:hover .eq i:nth-child(2) { animation-duration: .36s; }
.tile-rap:hover .eq i:nth-child(3) { animation-duration: .58s; }
.tile-rap:hover .eq i:nth-child(4) { animation-duration: .42s; }

/* Cricket: a red ball bowled across the tile; it pitches once and carries through */
.ball {
    position: absolute; left: -20px; bottom: 22px; width: 13px; height: 13px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e8665c, #a8231b 65%, #7d1712);
    opacity: 0; pointer-events: none;
}
.ball::after {
    content: ""; position: absolute; left: 50%; top: 1px; bottom: 1px; width: 0;
    border-left: 1px dashed rgba(255, 255, 255, .75); transform: translateX(-50%) rotate(22deg);
}
.tile-cricket:hover .ball { animation: bowl 2.2s forwards; }
@keyframes bowl {
    0%   { opacity: 1; left: -20px; transform: translateY(-58px) rotate(0); animation-timing-function: linear; }
    30%  { left: 42%; transform: translateY(0) rotate(300deg); animation-timing-function: linear; }       /* pitches */
    55%  { left: calc(100% - 58px); transform: translateY(-4px) rotate(560deg); animation-timing-function: cubic-bezier(.15, .75, .3, 1); } /* meets the bat */
    92%  { opacity: 1; }
    100% { opacity: 0; left: 16%; transform: translateY(-190px) rotate(1180deg); }                        /* lofted back over the bowler */
}

/* The bat waits in its backlift, comes down as the ball arrives, and follows through */
.bat {
    position: absolute; right: 40px; bottom: 8px; width: 13px; height: 44px;
    transform-origin: 50% 3px; transform: rotate(-65deg); opacity: 0; pointer-events: none;
}
.bat .grip { fill: #3b3b3a; }
.bat .blade { fill: #dcb57f; stroke: #a7824f; stroke-width: 1; }
.bat .spine { stroke: #b8925c; stroke-width: 1.2; stroke-linecap: round; }
.tile-cricket:hover .bat { animation: swing 2.2s forwards; }
@keyframes swing {
    0%   { opacity: 0; transform: rotate(-65deg); }
    10%  { opacity: 1; transform: rotate(-65deg); }
    46%  { transform: rotate(-78deg); animation-timing-function: cubic-bezier(.6, 0, .9, .5); } /* a touch more backlift, then down */
    55%  { transform: rotate(4deg); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }    /* contact */
    72%  { transform: rotate(82deg); }                                                          /* follow-through */
    100% { opacity: 1; transform: rotate(82deg); }
}

/* A small "crack" ring at the moment of contact */
.impact {
    position: absolute; right: 41px; bottom: 15px; width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--live); opacity: 0; transform: scale(.2); pointer-events: none;
}
.tile-cricket:hover .impact { animation: crack 2.2s forwards; }
@keyframes crack {
    0%, 54% { opacity: 0; transform: scale(.2); }
    56%     { opacity: .9; transform: scale(.6); }
    72%     { opacity: 0; transform: scale(1.8); }
    100%    { opacity: 0; transform: scale(1.8); }
}

/* Perseverance: progress that takes its time */
.grind { display: block; width: 0; height: 2px; margin: 10px 0 12px; background: var(--text); transition: width 2.8s cubic-bezier(.25, .6, .3, 1); }
.tile-word:hover .grind { width: 100%; }

/* Writing tiles are whole links */
.article { color: inherit; }
.article:hover { background-size: 0 0; }
.article h4 { font-size: 19px; line-height: 1.35; }
.article .read { margin-top: auto; padding-top: 16px; font-size: 14.5px; font-weight: 500; }
.article .read { display: inline-block; transition: transform .2s ease; }
.article:hover .read { transform: translateX(3px); }

/* ---------- LinkedIn teasers: a slow, pausable marquee ---------- */

.li-feed { margin-top: 36px; }
.li-feed[hidden] { display: none; }
.li-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.li-title { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 0 !important; }
.li-head .go { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.li-head .go:hover { color: var(--text); }

.marquee { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.marquee::-webkit-scrollbar { display: none; }
.marquee-track { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; width: max-content; }
.marquee-track li { scroll-snap-align: start; }

.marquee.is-moving {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.marquee.is-moving .marquee-track { animation: marquee var(--marquee-duration, 40s) linear infinite; }
.marquee.is-moving:hover .marquee-track,
.marquee.is-moving:focus-within .marquee-track { animation-play-state: paused; }
/* The list is rendered twice; sliding by half its width (plus half a gap) loops seamlessly */
@keyframes marquee { to { transform: translateX(calc(-50% - 8px)); } }

.li-card {
    display: flex; flex-direction: column; gap: 10px;
    width: 320px; height: 100%; padding: 20px 22px;
    border: 1px solid var(--line); background: none;
    transition: background-color .25s ease, border-color .25s ease;
}
.li-card:hover { background-color: var(--panel); border-color: var(--faint); }
.li-card.has-img { padding-top: 0; }
.li-img {
    display: block; width: calc(100% + 44px); max-width: none; margin: 0 -22px 4px;
    aspect-ratio: 16 / 9; object-fit: cover; object-position: center 35%;
    border-bottom: 1px solid var(--line);
}
.li-card:not(.has-img) .li-text { -webkit-line-clamp: 9; }
.li-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.li-text {
    font-size: 15px; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.li-more { margin-top: auto; font-size: 14px; font-weight: 500; color: var(--muted); transition: color .2s ease; }
.li-card:hover .li-more { color: var(--text); }

/* ---------- Work ---------- */

.work { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }
.work-side { position: sticky; top: 24px; }
.work-side h3 { font-size: 19px; font-weight: 600; }
.work-side > p.muted { margin: 4px 0 0; }

.path { list-style: none; padding: 0; margin: 24px 0; position: relative; }
.path::before { content: ""; position: absolute; left: 3px; top: 10px; bottom: 10px; border-left: 1px dashed var(--faint); }
.path li { position: relative; padding-left: 22px; margin-bottom: 16px; font-size: 15px; line-height: 1.45; }
.path li:last-child { margin-bottom: 0; }
.path li::before {
    content: ""; position: absolute; left: 0; top: 6px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--bg); border: 1px solid var(--muted);
}
.path li:last-child::before { background: var(--live); border-color: var(--live); }
.path-when { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- Products ---------- */

.product {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start;
    padding: 8px 0 56px;
}
.product + .product { padding-top: 56px; border-top: 1px solid var(--line); }

.product-title { display: flex; align-items: baseline; gap: 14px; }
.product-title h3 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.one-liner { font-size: 17px; margin: 6px 0 0; }

.product h4 { font-size: 13px; font-weight: 500; color: var(--muted); margin: 22px 0 6px; font-family: var(--mono); }
.product-text > p:not(.one-liner):not(.tech):not(.links) { color: var(--muted); }
.product-text em { color: var(--text); }
.product .tech { margin-top: 18px; }
.product .links { margin-top: 12px; }

.status { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pip { width: 6px; height: 6px; border-radius: 50%; background: var(--live); position: relative; }
.pip::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: var(--live); animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
    0% { transform: scale(1); opacity: .5; }
    70%, 100% { transform: scale(2.6); opacity: 0; }
}

.points { list-style: none; padding: 0; margin: 0; }
.points li { position: relative; padding-left: 18px; color: var(--muted); margin-bottom: 8px; font-size: 15px; }
.points li::before { content: "–"; position: absolute; left: 0; color: var(--faint); }

.product-media {
    display: grid; place-items: center; position: sticky; top: 24px;
    background: var(--panel); border-radius: 10px; overflow: hidden;
}
.product-media img { transition: transform .6s ease; }
.product-media:hover img { transform: scale(1.02); }
.product-media:hover { background-size: 0 0; }
.media-wide { padding: 32px; }
.media-wide img { border-radius: 6px; border: 1px solid var(--line); }
.media-phone { padding: 32px 0; }
.media-phone img { width: 46%; border-radius: 16px; }

.play {
    position: absolute; right: 14px; bottom: 14px;
    font-family: var(--mono); font-size: 12px; font-weight: 500;
    background: var(--bg); color: var(--text); border: 1px solid var(--line);
    padding: 5px 10px; border-radius: 6px;
}

/* ---------- Resume ---------- */

.resume { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 72px; align-items: start; }
.lead-sm { font-size: 19px; margin-bottom: 20px; }
.resume-facts { margin: 0; border-top: 1px solid var(--line); }
.resume-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.resume-facts dt { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding-top: 2px; }
.resume-facts dd { margin: 0; }

/* Show the top of the page only, fading out, so it matches the text column's height */
.resume-preview {
    display: block; position: relative; background: var(--panel);
    padding: 20px 20px 0; border-radius: 10px;
    max-height: 400px; overflow: hidden;
}
.resume-preview::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
    background: linear-gradient(to bottom, transparent, var(--panel));
}
.resume-preview:hover { background-size: 0 0; }
.resume-preview img { border: 1px solid var(--line); border-radius: 2px; transition: transform .5s ease; }
.resume-preview:hover img { transform: translateY(-4px); }

/* ---------- Contact & footer ---------- */

.contact {
    display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 72px; align-items: end;
    margin-top: 88px; padding: 56px 0 72px; border-top: 1px solid var(--text);
}
.contact h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.02em; }
.contact .muted { max-width: 520px; margin: 14px 0 0; }
.contact-links .socials { margin-top: 16px; }
.email {
    font-size: 20px; font-weight: 500;
    background-image: linear-gradient(var(--faint), var(--faint)); background-size: 100% 1px;
}
.email:hover { background-image: linear-gradient(var(--text), var(--text)); }
.email-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.copy-email {
    height: 30px; padding: 0 12px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--line); background: none; color: var(--muted);
    font: 500 13px/1 var(--sans); transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.copy-email:hover { border-color: var(--text); color: var(--text); }
.copy-email.copied { border-color: var(--live); color: var(--live); }

.foot {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px;
    padding: 24px 0 40px; border-top: 1px solid var(--line);
    font-size: 13px; color: var(--muted);
}
.foot-links { display: flex; gap: 20px; }
.foot a:hover { color: var(--text); }

/* ---------- Load-in: one soft, staggered rise ---------- */

.js .rise { opacity: 0; transform: translateY(10px); }
.js.ready .rise {
    opacity: 1; transform: none;
    transition: opacity .7s ease, transform .7s ease;
    transition-delay: calc(var(--i, 0) * 80ms);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .rise { opacity: 1; transform: none; }
    .caret, .pip::after, .marquee-track, body::before, .scene-panel, .wave, .eq i, .phones, .note, .ball, .bat, .impact { animation: none !important; }
    .grind { transition: none; }
    .sky { display: none; }
    a, .btn, .tile, .product-media img, .resume-preview img, .go::after, .scene-btn, .chip, .article .read { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .profile { grid-template-columns: 1fr; gap: 40px; align-items: start; }
    .now { max-width: 560px; }
    .work { grid-template-columns: 1fr; gap: 28px; }
    .work-side { position: static; }
    .product { grid-template-columns: 1fr; gap: 28px; }
    .product .product-media { order: -1; position: static; }
    .resume { grid-template-columns: 1fr 260px; gap: 32px; }
    .contact { grid-template-columns: 1fr; gap: 28px; align-items: start; }
}

@media (max-width: 680px) {
    .page { padding: 0 16px; }
    .top { padding: 20px 0; }
    .top-nav { gap: 14px; }
    .top-nav a[href="#projects"], .top-nav a[href="#writing"] { display: none; }

    .profile { padding: 16px 0 40px; }
    .id { gap: 16px; }
    .avatar { width: 72px; height: 72px; }
    .id .hello { font-size: 11.5px; margin-bottom: 4px; }
    .profile h1 { font-size: 32px; }
    .headline { font-size: 18px; }

    .facts { grid-template-columns: 1fr 1fr; }
    .facts div { padding: 18px 12px 18px 0; }
    .facts div + div { padding-left: 12px; }
    .facts div:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
    .facts div:nth-child(4) { border-top: 1px solid var(--line); }
    .facts dt { font-size: 24px; }

    .section { padding-top: 64px; }
    .section-head { flex-direction: column; gap: 4px; }

    .tiles, .tiles-2, .tiles-3, .tiles-4 { grid-template-columns: 1fr; }
    .tile { padding: 20px; }

    .media-wide { padding: 16px; }
    .media-phone img { width: 60%; }

    .resume { grid-template-columns: 1fr; }
    .resume-preview { max-width: 320px; }
    .resume-facts div { grid-template-columns: 90px 1fr; }

    .contact { margin-top: 64px; padding: 40px 0 56px; }
    .now dl div { grid-template-columns: 84px 1fr; }
}


/* ---------- Case study ---------- */

.cs { max-width: 720px; margin: 0 auto; padding: 24px 0 40px; }
.cs-back { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.cs-back:hover { color: var(--text); }
.cs-hero h1 { font-size: clamp(40px, 6vw, 60px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; }
.cs-lede { font-size: 20px; line-height: 1.55; margin: 18px 0 32px !important; }

.cs-meta { margin: 0; border-top: 1px solid var(--text); }
.cs-meta div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.cs-meta dt { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding-top: 2px; }
.cs-meta dd { margin: 0; }

.cs-figure { margin: 48px 0 0; }
.cs-figure img { width: 100%; border: 1px solid var(--line); border-radius: 10px; }
/* Let key visuals break out of the reading column on wide screens */
@media (min-width: 900px) {
    .cs-wide { margin-left: -90px; margin-right: -90px; }
}

.cs-section { margin-top: 72px; }
.cs-num { font-family: var(--mono); font-size: 12.5px; color: var(--live); margin-bottom: 6px !important; }
.cs-section h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 18px; }
.cs-section h3 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; }
.cs-section > p { font-size: 17px; line-height: 1.7; }
.cs code { font-family: var(--mono); font-size: .88em; background: var(--panel); padding: 1px 5px; border-radius: 4px; }

.cs-list { list-style: none; padding: 0; margin: 16px 0 0; }
.cs-list li { position: relative; padding-left: 20px; margin-bottom: 12px; font-size: 16.5px; line-height: 1.65; color: var(--muted); }
.cs-list li::before { content: "–"; position: absolute; left: 0; color: var(--faint); }
.cs-list li strong { color: var(--text); }
.cs-checks li::before { content: "✓"; color: var(--live); }

.cs-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.cs-steps li { counter-increment: step; position: relative; padding: 0 0 18px 44px; font-size: 16.5px; line-height: 1.65; color: var(--muted); }
.cs-steps li::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid var(--line); font: 500 13px/1 var(--mono); color: var(--text);
}
.cs-steps li:last-child::before { background: var(--live); border-color: var(--live); color: #fff; }
.cs-steps li strong { color: var(--text); }

.cs-quote {
    margin: 20px 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--live);
    font-family: var(--mono); font-size: 14.5px; line-height: 1.9; color: var(--text);
}

/* Fragmentation chart */
.cs-chart { margin: 28px 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 10px; }
.cs-chart-title { font-weight: 600; margin-bottom: 18px !important; }
.cs-chart-title span { display: block; font: 400 12.5px/1.5 var(--mono); color: var(--muted); margin-top: 2px; }
.bar-row { display: grid; grid-template-columns: 210px 1fr 56px; gap: 14px; align-items: center; margin-bottom: 12px; font-size: 14.5px; }
.bar-track { position: relative; height: 14px; background: var(--panel); border-radius: 3px; }
.bar { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v) / 4.5 * 100%); border-radius: 3px; }
.bar-bad { background: #d4574e; }
.bar-good { background: var(--live); }
.bar-ideal { position: absolute; top: -4px; bottom: -4px; left: calc(var(--v) / 4.5 * 100%); border-left: 1px dashed var(--text); }
.bar-value { font: 600 14px/1 var(--mono); text-align: right; }
.cs-chart figcaption { font-size: 13.5px; color: var(--muted); margin-top: 14px; line-height: 1.6; }

/* Grow the bars in once the chart scrolls into view */
.js .cs-chart .bar { transform-origin: left; transform: scaleX(0); transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.js .cs-chart.in .bar { transform: scaleX(1); }
.js .cs-chart.in .bar-good { transition-delay: .25s; }

/* Architecture diagram */
.cs-diagram { margin: 28px 0; padding: 20px; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.cs-diagram svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: var(--sans); }
.d-box { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.d-key { stroke: var(--live); }
.d-title { fill: var(--text); font-size: 15px; font-weight: 600; }
.d-sub { fill: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.d-note { fill: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.d-line { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.d-dash { stroke-dasharray: 4 4; }
.d-head { fill: var(--muted); }
.cs-swipe { display: none; position: sticky; left: 0; margin-top: 10px; font: 400 12.5px/1.4 var(--mono); color: var(--muted); }
@media (max-width: 680px) { .cs-swipe { display: block; } }

.cs-post { display: flex; align-items: center; gap: 18px; margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: none; }
.cs-post:hover { background-color: var(--panel); background-size: 0 0; border-color: var(--faint); }
.cs-post img { width: 160px; border-radius: 6px; flex: none; }
.cs-post span { font-weight: 500; }

.cs-end { margin-top: 88px; padding-top: 40px; border-top: 1px solid var(--text); }
.cs-end h2 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }

/* Homepage link into the case study */
.cs-link { font-weight: 600; }

@media (max-width: 680px) {
    .cs-lede { font-size: 18px; }
    .cs-meta div { grid-template-columns: 84px 1fr; }
    .cs-section { margin-top: 56px; }
    .cs-section h2 { font-size: 24px; }
    .bar-row { grid-template-columns: 1fr 52px; }
    .bar-label { grid-column: 1 / -1; font-size: 13.5px; }
    .cs-post { flex-direction: column; align-items: flex-start; }
    .cs-post img { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .js .cs-chart .bar { transform: none; transition: none; }
}
