/* ==========================================================================
   Jon Prado — Digital Portfolio
   Breakpoints (mirrors the original Framer site):
     mobile   < 810px
     tablet   810–1023px
     laptop   1024–1439px
     desktop  ≥ 1440px
   ========================================================================== */

:root {
  --bg: #000;
  --fg: #fff;
  --fg-dim: rgba(255, 255, 255, 0.5);
  --fg-muted: rgba(176, 176, 176, 0.66);
  --line: rgba(255, 255, 255, 0.1);
  --line-faint: rgba(255, 255, 255, 0.06);
  --accent: #0019ff;

  --font-sans: "Manrope", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;

  --gutter: 120px;
  --nav-h: 84px;
  --radius: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* type scale */
  --t-display: 105px;
  --t-title: 105px;
  --t-lead: 44px;
  --t-h2: 64px;
  --t-h3: 32px;
  --t-body: 18px;
  --t-mono: 14px;
}

@media (max-width: 1439px) {
  :root { --gutter: 80px; --t-display: 7.3vw; --t-title: 80px; --t-lead: 3.6vw; --t-h2: 4.6vw; }
}
@media (max-width: 1023px) {
  :root { --gutter: 48px; --t-display: 64px; --t-title: 60px; --t-lead: 34px; --t-h2: 48px; --t-h3: 26px; }
}
@media (max-width: 809px) {
  :root {
    --gutter: 24px; --nav-h: 64px;
    --t-display: 37px; --t-title: 36px; --t-lead: 24px; --t-h2: 30px; --t-h3: 22px;
    --t-body: 16px; --t-mono: 12px;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; font-weight: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}
.mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0;
}
.label { color: var(--fg-dim); }
.dim { color: var(--fg-muted); }
.hi { color: var(--fg); }

/* ---------- ambient layers: grain + column lines ---------- */
.grain {
  position: fixed; inset: -100%;
  width: 300%; height: 300%;
  pointer-events: none; z-index: 100;
  opacity: 0.07;
  animation: grain 0.8s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
.columns {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
}
.columns .container { height: 100%; display: grid; grid-template-columns: repeat(8, 1fr); }
.columns span { border-left: 1px solid var(--line-faint); }
.columns span:last-child { border-right: 1px solid var(--line-faint); }
@media (max-width: 809px) {
  .columns .container { grid-template-columns: repeat(4, 1fr); }
  .columns span:nth-child(n+5) { display: none; }
  .columns span:nth-child(4) { border-right: 1px solid var(--line-faint); }
}
main, footer { position: relative; z-index: 1; }

/* grid marker: a circle and dash centred on the element's bottom-right corner,
   which for full-width elements is the right-hand grid line (as on the original) */
.mark { position: relative; }
.mark::before, .mark::after { content: ""; position: absolute; pointer-events: none; z-index: 2; }
.mark::after { right: -36px; bottom: 0; width: 72px; height: 1px; background: rgba(255, 255, 255, 0.25); }
.mark::before {
  right: -12px; bottom: -12px; width: 24px; height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
}
/* blur lives on a pseudo-element: backdrop-filter on .nav itself would trap the fixed mobile overlay */
.nav::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.nav .container { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav .container::after {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0;
  height: 1px; background: var(--line);
}
.nav-progress {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0;
  height: 1px; background: var(--fg); transform-origin: left; transform: scaleX(0); z-index: 1;
}
.brand { font-size: 20px; line-height: 1; letter-spacing: -0.02em; position: relative; z-index: 2; }
.nav-links { display: flex; gap: 34px; font-size: 16px; }
.nav-links a { color: var(--fg-dim); transition: color 0.25s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); }
.menu-btn { display: none; align-items: center; gap: 12px; font-size: 16px; color: var(--fg-dim); position: relative; z-index: 2; }
.menu-btn .icon { width: 14px; height: 10px; position: relative; }
.menu-btn .icon::before, .menu-btn .icon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: currentColor;
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}
.menu-btn .icon::before { top: 2px; }
.menu-btn .icon::after { top: 8px; }
.menu-open .menu-btn { color: var(--fg); }
.menu-open .menu-btn .icon::before { top: 5px; transform: rotate(45deg); }
.menu-open .menu-btn .icon::after { top: 5px; transform: rotate(-45deg); }

@media (max-width: 809px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; align-items: flex-end; gap: 14px;
    padding: calc(var(--nav-h) + 24px) var(--gutter) 0;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
  }
  .nav-links a { color: rgba(255, 255, 255, 0.7); transform: translateY(-8px); transition: transform 0.45s var(--ease), color 0.25s; }
  .menu-open .nav-links { opacity: 1; visibility: visible; }
  .menu-open .nav-links a { transform: none; }
  .menu-open .nav-links a:nth-child(2) { transition-delay: 0.04s; }
  .menu-open .nav-links a:nth-child(3) { transition-delay: 0.08s; }
  .menu-open { overflow: hidden; }
}

/* ---------- hero (home) ---------- */
.hero { padding-top: calc(var(--nav-h) + 8px); }
.hero-meta { display: flex; justify-content: space-between; gap: 16px; line-height: 1.2; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }
.hero-title {
  margin-top: 44px;
  font-size: var(--t-display); font-weight: 500;
  line-height: 1.25; letter-spacing: -0.038em;
  color: var(--fg-muted);
}
.hero-title .hi { color: var(--fg); }
.rotator { display: block; position: relative; height: 1.25em; overflow: hidden; color: var(--accent); }
.rotator span {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  transform: translateY(110%); opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.8s var(--ease);
}
.rotator span.is-active { transform: none; opacity: 1; }
.rotator span.is-leaving { transform: translateY(-110%); opacity: 0; }

/* box fits the 3D block: its projection is 0.978× as tall as wide, plus room for the tilt */
.lattice { margin-top: 80px; aspect-ratio: 1 / 1.06; position: relative; }
.lattice svg { width: 100%; height: 100%; display: block; }
.lattice path, .lattice circle { stroke: rgba(255, 255, 255, 0.2); fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.lattice .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s var(--ease) forwards; }
.lattice circle { opacity: 0; animation: fade 0.6s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@media (max-width: 809px) { .lattice { margin-top: 40px; } }
/* vertical lines of the lattice: same grid + 1px borders as .columns, so they land on the same pixels */
.lattice-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); }
.lattice-cols span {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  transform-origin: 50% 0; animation: grow 2.4s var(--ease) both;
}
.lattice-cols span:last-child { border-right: 1px solid rgba(255, 255, 255, 0.2); }
@keyframes grow { from { transform: scaleY(0); } }
@media (max-width: 809px) {
  .lattice-cols { grid-template-columns: repeat(4, 1fr); }
  .lattice-cols span:nth-child(n+5) { display: none; }
  .lattice-cols span:nth-child(4) { border-right: 1px solid rgba(255, 255, 255, 0.2); }
}
.lattice svg { position: absolute; inset: 0; }
/* 3D lattice (lattice3d.js): cross-fades over the 2D version once WebGL is running */
.lattice-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1s var(--ease); touch-action: pan-y; }
.lattice svg, .lattice-cols { transition: opacity 1s var(--ease); pointer-events: none; }
.lattice.is-3d .lattice-canvas { opacity: 1; }
.lattice.is-3d svg, .lattice.is-3d .lattice-cols { opacity: 0; }
.lattice.has-model .lattice-canvas { cursor: grab; }
.lattice.is-dragging .lattice-canvas { cursor: grabbing; }
.lattice.is-dropping { outline: 1px dashed rgba(255, 255, 255, 0.4); outline-offset: -1px; }
/* callouts on the 3D model (lattice3d.js places them each frame); hidden until the model is in */
.lattice .callouts, .lattice .callout-lines { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; } /* above the canvas and its grid lines */
.lattice.has-callouts .callouts, .lattice.has-callouts .callout-lines { opacity: var(--callout-shown, 1); }
.lattice.is-3d .callout-lines svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1; overflow: visible; }
.lattice .callout-lines path { stroke: rgba(255, 255, 255, 0.85); stroke-width: 1; fill: none; }
.lattice .callout-lines .ring { stroke: #fff; stroke-width: 1.25; fill: none; opacity: 1; animation: none; }
.lattice .callout-lines .dot { fill: #fff; stroke: none; }
.lattice .callouts { margin: 0; padding: 0; list-style: none; font-family: "Oxanium", var(--font-sans); font-weight: 300; color: var(--fg); }
.lattice .callouts > li {
  position: absolute; white-space: nowrap; padding: 0 4px;
  font-size: max(11px, calc(var(--callout-unit, 158px) * 0.076)); line-height: 1.2;
}
.lattice .callouts > li > span { display: block; margin-top: -0.6em; } /* centre the title on its leader */
.lattice .callouts > li.left { text-align: right; }
.lattice .callouts ul { margin: 0.45em 0 0; padding: 0; list-style: none; font-size: 0.85em; line-height: 1.25; }
.lattice .callouts ul li::before { content: "-"; }
.lattice:not(.is-3d) .callouts { display: none; }

/* ---------- stacked project cards (home) ---------- */
.stack { padding: 40px 0 120px; }
.card {
  --card-bg: #b2b2b2; --card-fg: #fff;
  position: sticky; top: calc(var(--nav-h) + 40px + var(--i, 0) * 22px);
  display: flex; flex-direction: column;
  height: min(651px, 78vh);
  margin-bottom: 140px;
  padding: 0 24px 24px;
  background: var(--card-bg); color: var(--card-fg);
  border-radius: var(--radius);
  transform-origin: 50% 0;
  will-change: transform;
  overflow: hidden;
}
.card:last-child { margin-bottom: 0; }
.card-meta {
  display: flex; justify-content: space-between;
  padding: 24px 0 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--card-fg) 20%, transparent);
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 12px; }
.card-title { font-size: var(--t-h2); font-weight: 500; line-height: 1.35; letter-spacing: -0.042em; }
.arrow { width: clamp(24px, 3.4vw, 50px); flex: none; transition: transform 0.45s var(--ease); }
.arrow path { stroke: currentColor; stroke-width: 2.5; fill: none; }
.card:hover .arrow, .row:hover .arrow { transform: rotate(-45deg); }
.card-media { flex: 1; min-height: 0; margin-top: 12px; display: flex; align-items: center; justify-content: center; }
.card-media img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform 0.9s var(--ease);
}
.card:hover .card-media img { transform: scale(1.035); }
@media (max-width: 809px) {
  .card { height: 70vh; margin-bottom: 80px; padding: 0 14px 14px; top: calc(var(--nav-h) + 16px + var(--i, 0) * 14px); }
  .card-meta { padding: 14px 0 10px; }
}

/* ---------- shared sections ---------- */
.section { padding: 120px 0; }
.section-label {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 40px;
}
.section-label.rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.split { display: grid; grid-template-columns: repeat(8, 1fr); column-gap: 0; }
.about-teaser .split { grid-template-rows: auto 1fr; } /* extra height from the spanning portrait goes to row 2, not the text row */
.about-teaser .text { grid-column: 1 / 5; grid-row: 1; align-self: start; font-size: var(--t-h3); line-height: 1.6; padding-right: 32px; }
.about-teaser .portrait { grid-column: 6 / 9; grid-row: 1 / span 2; }
.about-teaser .portrait img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
/* CV button sits right under the paragraph; its marker lands on the paragraph column's edge (line 5) */
.about-teaser .cta-row { grid-column: 1 / 5; grid-row: 2; align-self: start; margin-top: 48px; }
.about-teaser .cta-row .btn { width: 50%; }
/* buttons span the first two grid columns; the row stays full width so its marker lands on the right grid line */
.cta-row .btn { width: 25%; }
@media (max-width: 809px) {
  .split { grid-template-columns: 1fr; }
  .about-teaser .text, .about-teaser .portrait, .about-teaser .cta-row { grid-column: 1; grid-row: auto; }
  .about-teaser .cta-row .btn { width: 100%; }
  .about-teaser .portrait { margin-top: 40px; }
  .about-teaser .cta-row { margin-top: 40px; }
  .cta-row .btn { width: 100%; }
}

.btn {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  height: 36px; width: 100%;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.btn:hover { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.btn svg { width: 10px; height: 10px; }
.btn svg path { stroke: currentColor; stroke-width: 1.4; fill: none; }

.say-hello .big {
  font-size: var(--t-h2); font-weight: 500; line-height: 1.25; letter-spacing: -0.042em;
  color: var(--fg-muted); max-width: 13em;
}
.say-hello .big .hi { color: var(--fg); }
.say-hello .big a { color: var(--fg); background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.5s var(--ease); }
.say-hello .big a:hover { background-size: 100% 1px; }
.say-hello .cta-row { margin-top: 64px; }

/* ---------- footer ---------- */
.footer { padding: 40px 0 48px; }
.footer .container { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.footer .container::before { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: -40px; height: 1px; background: var(--line); }
.footer .links { display: flex; gap: 34px; font-size: 16px; }
.footer .links a { color: var(--fg-dim); transition: color 0.25s; }
.footer .links a:hover { color: var(--fg); }
.footer .copy { color: var(--fg-dim); }
@media (max-width: 809px) {
  .footer .container { flex-direction: column; align-items: flex-start; }
}

/* ---------- inner page header ---------- */
.page-head { padding-top: calc(var(--nav-h) + 8px); }
.page-title {
  font-size: var(--t-title); font-weight: 500; line-height: 1.15; letter-spacing: -0.042em;
  color: var(--fg-muted);
}
.lead {
  margin: 120px 0 0 12.5%; width: 75%;
  font-size: var(--t-lead); font-weight: 500; line-height: 1.42; letter-spacing: -0.035em;
}
@media (max-width: 809px) { .lead { margin: 56px 0 0; width: 100%; } }

/* a logo in place of the title text: sized like the title's letters, same line box, so the layout and marker stay put */
.page-title .title-logo { display: block; height: 0.74em; width: auto; margin: 0.2em 0 0.21em; }

/* scroll-driven word reveal */
.reveal-words .w { color: var(--fg-muted); transition: color 0.4s ease; }
.reveal-words .w.on { color: var(--fg); }

/* fade-up on enter */
.fx { opacity: 0; transform: translateY(32px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.fx.in { opacity: 1; transform: none; }

/* ---------- projects page ---------- */
.project-list { padding: 120px 0 40px; }
.project-row { display: grid; grid-template-columns: repeat(8, 1fr); margin-bottom: 120px; }
.project-row .card { position: relative; top: auto; grid-column: 1 / 7; height: auto; aspect-ratio: 4 / 4.2; margin: 0; }
.project-row .excerpt { grid-column: 8 / 9; padding-left: 14px; line-height: 1.45; align-self: start; position: sticky; top: calc(var(--nav-h) + 40px); }
@media (max-width: 1023px) {
  .project-row .card { grid-column: 1 / 9; aspect-ratio: 4 / 3.6; }
  .project-row .excerpt { grid-column: 1 / 9; position: static; padding: 20px 0 0; max-width: 42ch; }
}
@media (max-width: 809px) { .project-row { margin-bottom: 72px; } .project-row .card { aspect-ratio: 3 / 4; } }

/* ---------- about page ---------- */
.stats { display: grid; grid-template-columns: 3fr 3fr 2fr; margin-top: 120px; border-top: 1px solid var(--line); }
.stats > div { padding: 10px 14px 0 0; }
.stats .mono { display: block; margin-bottom: 12px; }
.stats h3 { font-size: 22px; line-height: 1.6; }
@media (max-width: 809px) { .stats { grid-template-columns: 1fr; } .stats > div { padding: 14px 0 18px; border-bottom: 1px solid var(--line); } }

.hello-block { margin-top: 120px; align-items: center; }
.hello-block .portrait { grid-column: 2 / 5; }
.hello-block .portrait img { width: 100%; aspect-ratio: 2520 / 4012; object-fit: cover; }
.hello-block .text { grid-column: 6 / 9; font-size: 24px; line-height: 1.7; }
@media (max-width: 1023px) { .hello-block .portrait { grid-column: 1 / 5; } .hello-block .text { grid-column: 5 / 9; padding-left: 24px; font-size: 20px; } }
@media (max-width: 809px) { .hello-block .portrait, .hello-block .text { grid-column: 1; padding: 0; } .hello-block .text { margin-top: 32px; } }

.timeline { margin-top: 120px; }
.entry { display: grid; grid-template-columns: repeat(8, 1fr); padding: 40px 0; border-top: 1px solid var(--line); }
.entry .period { grid-column: 1 / 4; font-size: 22px; color: var(--fg-muted); }
.entry .role { grid-column: 4 / 7; padding-right: 24px; }
.entry .role h3 { font-size: 22px; line-height: 1.5; }
.entry .role p { color: var(--fg-dim); font-size: 14px; line-height: 1.6; margin-top: 6px; }
.entry .desc { grid-column: 7 / 9; color: var(--fg-dim); font-size: 14px; line-height: 1.65; }
@media (max-width: 809px) {
  .entry { grid-template-columns: 1fr; gap: 12px; padding: 28px 0; }
  .entry .period, .entry .role, .entry .desc { grid-column: 1; }
  .entry .period { font-size: 16px; }
}

/* ---------- contact page ---------- */
.socials { display: grid; grid-template-columns: repeat(8, 1fr); margin-top: 120px; padding-bottom: 240px; }
.social { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 18px; }
/* instagram: columns 2–4, marker on the 5th line; linkedin: columns 6–8, marker on the right edge */
.social-ig { grid-column: 2 / 5; }
.social-li { grid-column: 6 / 9; }
.social .ico {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line); transition: background 0.3s, border-color 0.3s;
}
.social .ico svg { width: 16px; height: 16px; }
.social .ico svg * { stroke: currentColor; fill: none; stroke-width: 1.4; transition: stroke 0.3s; }
.social:hover .ico { background: var(--fg); border-color: var(--fg); color: var(--bg); }
/* .mark-spin: the marker brightens and its dash flips a half turn on hover, as on the original.
   Social links trigger it themselves; button rows only when the button is hovered. */
.mark-spin::after { transition: transform 0.6s var(--ease), background-color 0.3s; }
.mark-spin::before { transition: border-color 0.3s; }
.social.mark-spin:is(:hover, :focus-visible)::after,
.cta-row.mark-spin:has(.btn:is(:hover, :focus-visible))::after { transform: rotate(180deg); background-color: rgba(255, 255, 255, 0.5); }
.social.mark-spin:is(:hover, :focus-visible)::before,
.cta-row.mark-spin:has(.btn:is(:hover, :focus-visible))::before { border-color: rgba(255, 255, 255, 0.5); }
.social strong { font-weight: 400; display: block; font-size: 16px; line-height: 1.4; }
.social .mono { color: var(--fg-dim); }
@media (max-width: 809px) { .socials { grid-template-columns: 1fr; gap: 28px; margin-top: 64px; padding-bottom: 120px; } .social-ig, .social-li { grid-column: 1; } }

/* ---------- case study ---------- */
.cs-hero { margin-top: 120px; }
.cs-hero .index { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cs-hero .index::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cs-hero figure { margin: 0 0 0 25%; background: var(--card-bg); }
.cs-hero img { width: 100%; max-height: 86vh; object-fit: contain; }
@media (max-width: 809px) { .cs-hero { margin-top: 56px; } .cs-hero figure { margin: 0; } }
.cs-hero .lattice { margin-top: 0; } /* the 3D scene, full width */
.cs-hero .lattice + figure { margin-top: 48px; } /* Reflectiv: hero image below the grid */

.cs-body { display: grid; grid-template-columns: repeat(8, 1fr); padding-top: 120px; }
.cs-content { grid-column: 1 / 6; padding-right: 48px; min-width: 0; }
.cs-aside { grid-column: 7 / 9; padding-left: 14px; }
.cs-aside dl { position: sticky; top: calc(var(--nav-h) + 40px); margin: 0; }
.cs-aside dt { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--fg-dim); }
.cs-aside dt:first-child { margin-top: 0; }
.cs-aside dd { margin: 10px 0 0; font-size: 16px; line-height: 1.5; }
@media (max-width: 1023px) {
  .cs-body { grid-template-columns: 1fr; }
  .cs-aside { grid-column: 1; grid-row: 1; padding: 0 0 64px; }
  .cs-aside dl { position: static; display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 14px; }
  .cs-aside dt { grid-row: 1; margin-top: 0; }
  .cs-aside dd { grid-row: 2; }
  .cs-content { grid-column: 1; padding: 0; }
}
@media (max-width: 809px) { .cs-aside dl { grid-template-columns: repeat(2, 1fr); } .cs-aside dt:nth-of-type(n+3) { grid-row: 3; margin-top: 20px; } .cs-aside dd:nth-of-type(n+3) { grid-row: 4; } }

.cs-content h3 { font-size: var(--t-h3); font-weight: 500; line-height: 1.3; letter-spacing: -0.03em; margin: 88px 0 20px; }
.cs-content h3:first-child { margin-top: 0; }
.cs-content p { color: rgba(255, 255, 255, 0.72); margin: 0 0 18px; }
.cs-content p.statement { color: var(--fg); font-size: 24px; line-height: 1.5; letter-spacing: -0.03em; margin: 48px 0 24px; }
.cs-content p strong { color: var(--fg); font-weight: 500; }
.cs-content p a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.cs-content figure { margin: 40px 0; }
.cs-content figure img { width: 100%; border-radius: 2px; }
.cs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 40px 0; }
.cs-grid img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.cs-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 809px) { .cs-grid, .cs-grid.three { grid-template-columns: 1fr 1fr; gap: 8px; } }

/* carousel */
.carousel { margin: 40px 0; position: relative; }
.carousel-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track img { flex: 0 0 100%; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; scroll-snap-align: start; }
.carousel-ui { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.carousel-ui .btns { display: flex; gap: 8px; }
.carousel-ui button {
  width: 40px; height: 40px; border: 1px solid var(--line); display: grid; place-items: center;
  transition: background 0.3s, color 0.3s;
}
.carousel-ui button:hover { background: var(--fg); color: var(--bg); }
.carousel-ui button svg { width: 14px; height: 14px; }
.carousel-ui button path { stroke: currentColor; stroke-width: 1.5; fill: none; }

/* see also rows */
.see-also { padding: 120px 0 0; }
.row {
  --card-bg: #b2b2b2; --card-fg: #fff;
  display: grid; grid-template-columns: repeat(8, 1fr); align-items: center;
  height: 88px; margin-bottom: 8px; overflow: hidden;
  background: var(--card-bg); color: var(--card-fg);
  border-radius: 2px;
}
.row .thumb { grid-column: 1 / 3; height: 100%; background: rgba(0, 0, 0, 0.12); overflow: hidden; }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.row:hover .thumb img { transform: scale(1.08); }
.row .info { grid-column: 3 / 8; padding-left: 14px; }
.row .info .mono { opacity: 0.7; }
.row .info h3 { font-size: 28px; line-height: 1.2; margin-top: 6px; letter-spacing: -0.03em; }
.row .arrow { grid-column: 8; justify-self: end; margin-right: 18px; width: 22px; }
@media (max-width: 809px) { .row { height: 76px; grid-template-columns: 76px 1fr 44px; } .row .thumb { grid-column: 1; } .row .info { grid-column: 2; } .row .arrow { grid-column: 3; margin-right: 14px; } .row .info h3 { font-size: 22px; } }

/* ---------- blog ---------- */
.posts { margin-top: 120px; }
.post { display: grid; grid-template-columns: repeat(8, 1fr); padding: 28px 0; border-top: 1px solid var(--line); align-items: baseline; }
.post time { grid-column: 1 / 3; color: var(--fg-dim); }
.post h3 { grid-column: 3 / 8; font-size: var(--t-h3); line-height: 1.3; letter-spacing: -0.03em; transition: color 0.3s; }
.post .arrow { grid-column: 8; justify-self: end; width: 20px; }
.post:hover h3 { color: var(--accent); }
.post:hover .arrow { transform: rotate(-45deg); }
.prose { margin: 120px 0 0 12.5%; width: 75%; }
.prose p { color: rgba(255, 255, 255, 0.72); margin: 0 0 18px; }
@media (max-width: 809px) {
  .post { grid-template-columns: 1fr 24px; gap: 8px; }
  .post time, .post h3 { grid-column: 1; } .post .arrow { grid-column: 2; grid-row: 1 / 3; }
  .prose { margin: 56px 0 0; width: 100%; }
}

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; }
.notfound .lead a { color: var(--accent); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .fx { opacity: 1; transform: none; }
  .lattice .draw { stroke-dashoffset: 0; } .lattice circle { opacity: 1; }
  .card { transform: none !important; }
}
