/* About page. Loads after style.css (fonts, tokens, contact, footer, HUD). */
body.about { background: var(--paper); color: var(--ink); }
/* Scoped with :where so the shared contact block keeps its homepage styles. */
.about main > section:not(#contact) { padding: clamp(96px, 14vh, 160px) clamp(16px, 4vw, 56px); }
.about :where(#principles, #off-hours) h2 { font: 500 clamp(40px, 5.2vw, 88px)/1 var(--display); letter-spacing: -0.04em; max-width: 14ch; text-wrap: balance; }
.about h3 { font: 500 clamp(22px, 2vw, 30px)/1.15 Instrument, Arial, sans-serif; letter-spacing: -0.01em; }
.about :where(#open, #experience, #principles, #off-hours) p { font: 400 17px/1.55 Instrument, Arial, sans-serif; color: var(--ink); max-width: 60ch; margin: 0; }
.about :focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.about-nav { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: calc(18px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 56px) 18px; mix-blend-mode: difference; color: #fff; }
.about-nav .wordmark, .about-nav a, .about-nav button { color: #fff; text-decoration: none; font: 500 15px Instrument, Arial, sans-serif; }
.about-nav nav { display: flex; align-items: baseline; gap: 28px; }
.about-nav button { padding: 0; border: 0; background: none; cursor: pointer; }
.about-nav button span { display: inline-block; transition: rotate 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
[data-theme="dark"] .about-nav button span { rotate: 180deg; }

/* Hero: copy left, a fanned stack of photos right. */
.open { display: grid; grid-template-columns: minmax(0, 760px) 260px; justify-content: start; gap: 18px clamp(40px, 4vw, 64px); align-items: start; padding-top: clamp(140px, 20vh, 220px) !important; }
.open-copy { display: grid; gap: 18px; }
.open-copy > p { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; max-width: 58ch; }
.open-copy strong { font-weight: 600; color: var(--ink); }
.open h1 { grid-column: 1 / -1; font: 500 clamp(40px, 4.6vw, 80px)/0.98 var(--display); letter-spacing: -0.045em; text-wrap: balance; margin: 0 0 12px; }
.open .open-meta { color: var(--ink); }
.stack { position: relative; display: grid; width: min(100%, 260px); margin-top: 6px; aspect-ratio: 4 / 5; padding: 0; border: 0; background: none; cursor: pointer; }
.stack img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; border: 10px solid #fff; border-radius: 4px; box-shadow: 0 18px 40px -18px #0006;
  z-index: calc(10 - var(--pos)); rotate: calc(-4deg + var(--pos) * 9deg); translate: calc(var(--pos) * 7%) calc(var(--pos) * 3%);
  transition: rotate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.stack:hover img[style*="--pos: 0"] { rotate: -2deg; }
@media (prefers-reduced-motion: reduce) { .stack img { transition: none; } }

/* Experience: rotated label beside a native accordion. */
.experience { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 5vw, 96px); }
.side-label { --from: -110%; writing-mode: vertical-rl; rotate: 180deg; justify-self: start; align-self: start; margin: 0;
  font: 500 clamp(56px, 7vw, 120px)/0.9 var(--display); letter-spacing: -0.04em; }
.jobs { border-top: 1px solid var(--line); }
.job { border-bottom: 1px solid var(--line); }
.job summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 9.5em 24px; gap: 4px 32px; align-items: baseline;
  padding: 26px 0; cursor: pointer; font: 400 16px/1.4 Instrument, Arial, sans-serif; color: var(--muted); }
.job summary::-webkit-details-marker { display: none; }
.job summary b { font: 500 clamp(20px, 1.8vw, 26px)/1.2 Instrument, Arial, sans-serif; color: var(--ink); letter-spacing: -0.01em; }
.job time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.job summary i { position: relative; width: 16px; height: 16px; align-self: center; justify-self: end; }
.job summary i::before, .job summary i::after { content: ""; position: absolute; inset: 7px 0 auto; height: 2px; background: var(--ink); transition: rotate 0.3s; }
.job summary i::after { rotate: 90deg; }
.job[open] summary i::after { rotate: 0deg; }
.job summary:hover b { color: var(--blue); }
.job summary b { transition: translate 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s; }
.job summary:hover b { translate: 10px 0; }
.job-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 16px clamp(24px, 4vw, 64px); padding: 4px 0 40px; }
.job-lead { display: grid; gap: 10px; align-content: start; }
.job-lead p:first-child { font: 500 clamp(20px, 1.7vw, 26px)/1.2 var(--display) !important; letter-spacing: -0.02em; color: var(--ink) !important; max-width: 18ch !important; text-wrap: balance; }
.job-where { font-size: 14px !important; color: var(--muted) !important; }
.job-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; max-width: 68ch; font: 400 16px/1.55 Instrument, Arial, sans-serif; color: var(--ink); }
.job-body li { position: relative; padding-left: 22px; }
.job-body li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 10px; height: 2px; background: var(--blue); }
.about .job-tools { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* How I work: plain rows. */
.pr-list { list-style: none; padding: 0; margin: 48px 0 0; border-top: 1px solid var(--line); }
.pr-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); gap: 8px 40px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); }
.pr-list h3 { margin: 0; }
/* One small drawing per principle; each loops its idea, static under reduced motion. */
.pr-g { width: 120px; height: 70px; overflow: hidden; fill: none; stroke: currentColor; stroke-width: 1.5; color: var(--ink); transition: color 0.3s; }
.pr-list li:hover .pr-g { color: var(--blue); }
.pr-g * { transform-box: fill-box; transform-origin: center; }
.g-read .hl, .g-venn .team, .g-rep .done { stroke: none; fill: var(--blue); fill-opacity: 0.25; }
.g-rep .done { fill: none; stroke: var(--blue); stroke-width: 2; opacity: 0; }
.g-venn .user { stroke-dasharray: 3 3; }
.g-wave .w2 { stroke: var(--blue); }
.g-zoom rect { scale: var(--s); }
.g-zoom circle { fill: var(--blue); stroke: none; }
.g-tz .hand { rotate: var(--h); transform-origin: 50% 100%; }
.g-tz .dot { fill: var(--blue); stroke: none; }
.pr-tag { font: 400 0.55em Instrument, Arial, sans-serif; color: var(--muted); vertical-align: 0.35em; letter-spacing: 0.02em; }
@keyframes read { 0%, 16% { translate: 0 0; fill-opacity: 0.25; } 22%, 36% { translate: 0 12px; } 42%, 56% { translate: 0 24px; } 62%, 76% { translate: 0 36px; fill-opacity: 0.25; } 84%, 100% { translate: 0 36px; fill-opacity: 0; } }
@keyframes draw { 0%, 62% { stroke-dashoffset: 156; } 86%, 100% { stroke-dashoffset: 0; } }
@keyframes morph { 0%, 15% { rx: 0; rotate: 0deg; stroke: currentColor; } 45%, 65% { rx: 20px; rotate: 90deg; stroke: var(--blue); } 95%, 100% { rx: 0; rotate: 180deg; stroke: currentColor; } }
@keyframes collapse { 0%, 40% { translate: 0 0; opacity: 1; } 60%, 88% { translate: var(--dx) 0; opacity: 1; } 94% { translate: var(--dx) 0; opacity: 0; } 100% { translate: 0 0; opacity: 0; } }
@keyframes done { 0%, 62% { opacity: 0; } 70%, 88% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes team { 0%, 10% { fill-opacity: 0; } 30%, 80% { fill-opacity: 0.25; } 95%, 100% { fill-opacity: 0; } }
@keyframes user { 0%, 40% { fill: var(--blue); fill-opacity: 0; stroke-dasharray: 3 3; } 60%, 80% { fill: var(--blue); fill-opacity: 0.25; stroke-dasharray: 3 0; } 95%, 100% { fill: var(--blue); fill-opacity: 0; } }
@keyframes flow { to { translate: -48px 0; } }
@keyframes tick { to { rotate: calc(var(--h) + 360deg); } }
@keyframes hop { 0%, 20% { translate: 0 0; } 40%, 55% { translate: 28px 0; } 75%, 90% { translate: 56px 0; } 100% { translate: 0 0; } }
@keyframes zoom { from { scale: 0.1; opacity: 0; } 25% { opacity: 1; } to { scale: 1.25; opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .g-read .hl { animation: read 5s infinite cubic-bezier(0.65, 0, 0.35, 1); }
  .g-read .frame { stroke-dasharray: 156; animation: draw 5s infinite cubic-bezier(0.65, 0, 0.35, 1); }
  .g-morph rect { animation: morph 4.5s infinite cubic-bezier(0.65, 0, 0.35, 1); }
  .g-rep rect { animation: collapse 4.5s infinite cubic-bezier(0.76, 0, 0.24, 1); }
  .g-rep .done { animation: done 4.5s infinite; }
  .g-venn .team { animation: team 4.5s infinite ease-in-out; }
  .g-venn .user { animation: user 4.5s infinite ease-in-out; }
  .g-wave path { animation: flow 2.4s infinite linear; }
  .g-wave .w2 { animation-duration: 3.6s; }
  .g-tz .hand { animation: tick 6s infinite steps(12); }
  .g-tz .dot { animation: hop 6s infinite cubic-bezier(0.65, 0, 0.35, 1); }
  .g-zoom rect { animation: zoom 4s infinite linear var(--d); }
}

/* Off hours: a full-bleed two-row rail on About, a masonry wall on the archive page. */
.off-hours { --gut: clamp(16px, 4vw, 56px); --row: clamp(150px, 19vw, 270px); }
.oh-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 40px; align-items: end; }
.oh-head h2, .oh-head > p { grid-column: 1; }
.oh-actions { grid-column: 2; grid-row: 1 / 3; display: flex; align-items: center; gap: 8px; }
.oh-actions :is(button, a) { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 1.5px solid var(--line); border-radius: 999px;
  background: none; color: var(--ink); font: 500 15px Instrument, Arial, sans-serif; text-decoration: none; cursor: pointer; transition: background 0.3s, color 0.3s, border-color 0.3s; }
.oh-actions .oh-step { width: 44px; padding: 0; justify-content: center; }
.oh-actions :is(button, a):hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.oh-actions .oh-all { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.oh-count { font-variant-numeric: tabular-nums; }
.oh-shuffle span { display: inline-block; rotate: calc(var(--turn, 0) * 360deg); transition: rotate 0.8s cubic-bezier(0.65, 0, 0.35, 1); }
.oh-rail { position: relative; margin: 48px calc(-1 * var(--gut)) 0; padding: 0 var(--gut); overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.oh-rail::-webkit-scrollbar { display: none; }
.oh-rail.is-drag { cursor: grabbing; }
.oh-rail.is-drag .oh-item { pointer-events: none; }
.oh-track { display: grid; gap: 12px; width: max-content; will-change: transform; }
.oh-row { display: flex; gap: 12px; height: var(--row); }
.oh-item, .oh-cell { position: relative; display: block; overflow: hidden; border-radius: 4px; background: var(--line); color: var(--ink); text-decoration: none; }
.oh-item { flex: none; height: 100%; aspect-ratio: var(--ar); }
.oh-item :is(img, video), .oh-cell :is(img, video) { display: block; width: 100%; height: 100%; object-fit: cover; }
.oh-item :is(img, video) { scale: 1.14; translate: calc(var(--px, 0) * -5%) 0; transition: scale 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.oh-item:is(:hover, :focus-visible) :is(img, video) { scale: 1.22; }
.oh-cap { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 5px 10px; border-radius: 3px; background: var(--paper); color: var(--ink);
  font: 500 13px/1.3 Instrument, Arial, sans-serif; translate: 0 calc(100% + 12px); transition: translate 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
:is(.oh-item, .oh-cell):is(:hover, :focus-visible) .oh-cap { translate: 0 0; }
.oh-bar { height: 2px; margin-top: 24px; background: var(--line); }
.oh-bar i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }
.oh-empty { margin-top: 24px !important; color: var(--muted) !important; }
.oh-empty a { color: var(--blue); }

.archive { padding: clamp(120px, 18vh, 200px) clamp(16px, 4vw, 56px) clamp(64px, 10vh, 120px); }
.archive-back { font: 500 15px Instrument, Arial, sans-serif; color: var(--muted); text-decoration: none; }
.archive-back:hover { color: var(--ink); }
.archive h1 { margin: 20px 0 0; font: 500 clamp(56px, 9vw, 150px)/0.95 var(--display); letter-spacing: -0.05em; }
.archive-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin: 32px 0 40px; }
.archive-count { margin: 0; font: 400 17px Instrument, Arial, sans-serif; color: var(--muted); font-variant-numeric: tabular-nums; }
.oh-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.oh-filters button { height: 40px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: none; color: var(--ink);
  font: 500 15px Instrument, Arial, sans-serif; cursor: pointer; transition: background 0.3s, color 0.3s; }
.oh-filters [aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.oh-wall { columns: 4 260px; column-gap: 12px; }
.oh-cell { aspect-ratio: var(--ar); margin-bottom: 12px; break-inside: avoid; }
.oh-cell[hidden] { display: none; }
.oh-cell :is(img, video) { transition: scale 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.oh-cell:hover :is(img, video) { scale: 1.05; }
.oh-lb { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: clamp(16px, 3vw, 40px); border: 0;
  background: color-mix(in srgb, var(--paper) 98%, transparent); color: var(--ink); display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 16px; }
.oh-lb:not([open]) { display: none; }
.oh-lb::backdrop { background: transparent; }
.oh-lb-media { min-height: 0; display: grid; place-items: center; }
.oh-lb-media :is(img, video) { max-width: 100%; max-height: calc(100dvh - 2 * clamp(16px, 3vw, 40px) - 60px); border-radius: 4px; object-fit: contain; }
.oh-lb-bar { display: flex; align-items: center; gap: 8px; font: 400 15px Instrument, Arial, sans-serif; }
.oh-lb-cap { margin: 0 auto 0 0; }
.oh-lb-cap b { font-weight: 500; }
.oh-lb-cap a { color: var(--blue); }
.oh-lb-count { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 8px; }
.oh-lb-bar button { height: 44px; min-width: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink);
  font: 500 15px Instrument, Arial, sans-serif; cursor: pointer; }
.oh-lb-bar button:hover { background: var(--ink); color: var(--paper); }

.about .contact { height: auto; min-height: 0; gap: 48px; }
.about ::selection { background: var(--blue); color: var(--paper); }
:root:has(body.about) { scrollbar-color: var(--muted) var(--paper); }
.open h1 em { font-style: normal; color: var(--blue); }
.open h1 .w, .rise { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.04em 0.1em; margin-bottom: -0.1em; }
.open h1 .w > span, .rise > span { display: inline-block; }
.stack-hint { position: absolute; inset: auto 0 -44px; font: 400 13px Instrument, Arial, sans-serif; color: var(--muted); letter-spacing: 0.04em; }
.stack-hint b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .side-label, .stack { position: sticky; top: 110px; } }

/* Motion. Everything above is the resting state; this only adds entrances. */
@keyframes rise { from { transform: translateY(var(--from, 110%)) rotate(var(--r, 5deg)); } }
@keyframes deal { from { rotate: 0deg; translate: 0 14%; clip-path: inset(100% 0 0 0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: no-preference) {
  .open h1 .w > span { animation: rise 1s cubic-bezier(0.16, 0.84, 0.2, 1) calc(0.15s + var(--i) * 0.045s) backwards; }
  .open h1 em .w > span { --r: -12deg; }
  .open-copy > p { animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.75s backwards; }
  .open-copy > p:nth-of-type(n+2) { animation-delay: 0.85s; } .open-copy > p:nth-of-type(n+3) { animation-delay: 0.95s; } .open-copy > p:nth-of-type(n+4) { animation-delay: 1.05s; }
  .stack img { animation: deal 1.2s cubic-bezier(0.16, 1, 0.3, 1) calc(0.45s + var(--pos) * 0.14s) backwards; }
  .stack-hint { animation: fade-up 0.6s ease 1.4s backwards; }
  .job-body { transition: none; }
  .job[open] .job-body > * { animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
  .job[open] .job-body > :last-child { animation-delay: 0.08s; }
  .job::details-content { transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1), content-visibility 0.5s allow-discrete; height: 0; overflow: clip; }
  .job[open]::details-content { height: auto; }
  .jobs { interpolate-size: allow-keywords; }

  /* Scroll entrances, armed by about.js adding html.about-motion. */
  .about-motion .rise:not(.is-in) > span { transform: translateY(var(--from, 110%)) rotate(4deg); }
  .about-motion .rise > span { transition: transform 1s cubic-bezier(0.16, 0.84, 0.2, 1); }
  .about-motion .jobs .job, .about-motion .pr-list li { position: relative; transition: opacity 0.7s, translate 0.9s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--i, 0) * 0.06s); }
  .about-motion .jobs:not(.is-in) .job, .about-motion .pr-list:not(.is-in) li { opacity: 0; translate: 0 32px; }
  .about-motion .job::after, .about-motion .pr-list li::after { content: ""; position: absolute; inset: auto 0 -1px; height: 1px; background: var(--ink); transform-origin: 0 50%;
    transition: transform 1.1s cubic-bezier(0.76, 0, 0.24, 1) calc(var(--i, 0) * 0.06s + 0.1s), opacity 0.6s calc(var(--i, 0) * 0.06s + 1s); }
  .about-motion :is(.jobs, .pr-list):not(.is-in) :is(.job, li)::after { transform: scaleX(0); }
  .about-motion :is(.jobs, .pr-list).is-in :is(.job, li)::after { opacity: 0; }
  /* Rail entrance and Shuffle: each tile unrolls like a blind, staggered along its row. */
  .about-motion .oh-item { transition: clip-path 0.8s cubic-bezier(0.76, 0, 0.24, 1) calc(var(--i, 0) * 0.05s); }
  .about-motion :is(.oh-rail:not(.is-in), .oh-rail.is-out) .oh-item { clip-path: inset(0 0 100% 0); }
  .about-motion .oh-rail.is-out .oh-item { transition-duration: 0.45s; transition-delay: calc(var(--i, 0) * 0.02s); }
  .oh-cell { animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
  .oh-lb[open] { transition: opacity 0.35s, display 0.35s allow-discrete, overlay 0.35s allow-discrete; }
  @starting-style { .oh-lb[open] { opacity: 0; } }
  .oh-lb-media > * { animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
}

@media (max-width: 719px) {
  .oh-head { grid-template-columns: 1fr; }
  .oh-actions { grid-column: 1; grid-row: auto; flex-wrap: wrap; }
  .oh-actions .oh-step { display: none; }
  .open, .experience, .pr-list li { grid-template-columns: 1fr; }
  .stack { width: min(64%, 260px); margin: 8px 0 32px; }
  .side-label { writing-mode: horizontal-tb; rotate: none; font-size: clamp(40px, 11vw, 56px); --from: 110%; }
  .job-body { grid-template-columns: 1fr; }
  .job summary { grid-template-columns: minmax(0, 1fr) 24px; }
  .job summary b { grid-column: 1; }
  .job summary :is(span, time) { grid-column: 1; }
  .job summary i { grid-column: 2; grid-row: 1; }
}
