/* The editorial presentation: one full-width scroll on dark glass. Sizes are
   set from the width of the scroller itself (container units), so the same
   markup works full-bleed, beside a floating panel, and on a phone. */

.editorial {
  position: fixed;
  inset: 0;
  z-index: 2;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow-y: auto;
  container-type: inline-size;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
  transition: padding 800ms var(--ease);
}
.editorial > * { width: min(1180px, 100% - clamp(32px, 9cqw, 130px)); margin-inline: auto; }

.kick { display: block; color: var(--label, var(--faint-white)); font: 600 0.72rem var(--sans); letter-spacing: 0.18em; text-transform: uppercase; }

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(200px, 0.62fr); align-items: center; gap: clamp(24px, 5cqw, 80px); padding: 90px 0 150px; }
.hero h1 { margin: 18px 0 0; font: 600 clamp(3rem, 9.4cqw, 9.2rem) / 0.88 var(--sans); letter-spacing: -0.055em; }
.hero h1 span { display: block; animation: heroLine 1200ms var(--ease) both; }
.hero h1 b { font-weight: inherit; }
.hero h1 span:nth-child(2) { animation-delay: 110ms; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.74); }
@keyframes heroLine { from { opacity: 0; transform: translateY(0.4em); filter: blur(14px); } }
/* "Designer" does not fade in like the line above it: its outline is drawn
   (see drawOutline). While the drawing runs the real outline is clear; when it
   ends the two cross over and the word is left exactly as it is set. */
.hero h1 .lock-b { position: relative; animation: none; transition: -webkit-text-stroke-color 400ms ease; }
.hero h1 .lock-b.is-drawing { -webkit-text-stroke-color: transparent; transition: none; }
.outline-draw { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; transition: opacity 400ms ease; }
.is-drawn > .outline-draw { opacity: 0; }
.outline-draw text { fill: none; stroke: rgba(255, 255, 255, 0.74); stroke-width: 1px; -webkit-text-stroke: 0; letter-spacing: 0; animation: outlineDraw 1500ms cubic-bezier(0.55, 0.05, 0.25, 1) both; }
@keyframes outlineDraw { to { stroke-dashoffset: 0; } }
/* The intro paragraph is exactly as wide as the line under it: from the pin to
   the end of "Applied AI". The wrapper takes its width from that line, and the
   paragraph fills it without contributing a width of its own. */
.hero-fit { display: grid; width: fit-content; max-width: 100%; }
.hero-fit .lede { width: 0; min-width: 100%; max-width: none; }
.lede { max-width: 46ch; margin-top: 28px; color: var(--soft-white); font-size: 1.04rem; line-height: 1.62; animation: floatIn 1000ms 320ms var(--ease) both; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; color: var(--faint-white); font-size: 0.8rem; animation: floatIn 1000ms 420ms var(--ease) both; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; animation: floatIn 1000ms 520ms var(--ease) both; }
.ghost-btn { padding: 10px 16px; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 4px; background: rgba(255, 255, 255, 0.05); font-size: 0.84rem; backdrop-filter: blur(12px); transition: background 200ms ease, border-color 200ms ease, transform 200ms ease, color 200ms ease; }
.ghost-btn:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.6); transform: translateY(-1px); }
.ghost-btn--solid { background: var(--white); border-color: var(--white); color: #172331; }
.ghost-btn--solid:hover { background: var(--a4); color: #172331; }
.hero-portrait { position: relative; margin: 0; aspect-ratio: 3 / 4.1; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; background: #d8d2c8; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5); overflow: hidden; animation: floatIn 1300ms 200ms var(--ease) both; }
.hero-portrait img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 15%; filter: grayscale(1) contrast(1.08); transform: scale(1.08); will-change: transform; }

/* ── bands ──────────────────────────────────────────────────────────────── */
.band { padding: clamp(50px, 9vh, 110px) 0; border-top: 1px solid rgba(255, 255, 255, 0.14); scroll-margin-top: 70px; }
.band-head { display: grid; gap: 14px; margin-bottom: clamp(24px, 4cqw, 48px); }
.band-head h2 { margin: 0; font: 600 clamp(2.2rem, 5.6cqw, 5rem) / 0.94 var(--sans); letter-spacing: -0.045em; }

.editorial :is(.band-head, .row, .feature, .columns article, .outro) { opacity: 0; transform: translateY(26px); filter: blur(8px); transition: opacity 800ms ease, transform 900ms var(--ease), filter 800ms ease, background 280ms ease; }
.editorial :is(.band-head, .row, .feature, .columns article, .outro).in { opacity: 1; transform: none; filter: none; }

/* experience as a ledger */
.row { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.5fr); gap: 24px; align-items: baseline; padding: 20px 14px; border-top: 1px solid rgba(255, 255, 255, 0.12); border-radius: 4px; }
.row:hover { background: rgba(255, 255, 255, 0.05); }
.row-dates { color: var(--label, var(--faint-white)); font-size: 0.76rem; letter-spacing: 0.04em; }
.row h3 { margin: 0; font: 600 1.26rem var(--sans); letter-spacing: -0.02em; }
.row-role { display: block; margin-top: 4px; color: var(--a1); font-size: 0.82rem; }
.row p { color: var(--soft-white); font-size: 0.92rem; line-height: 1.58; }
/* several roles at one employer: a vertical timeline, newest at the top */
.row-timeline { position: relative; margin: 0; padding: 2px 0 2px 26px; list-style: none; display: grid; gap: 22px; }
.row-timeline::before { position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1.5px; border-radius: 1px; background: linear-gradient(180deg, var(--a1), color-mix(in srgb, var(--a1) 22%, transparent)); content: ""; }
.row-timeline li { position: relative; display: grid; gap: 4px; border-radius: 4px; }
.row-timeline li::before { position: absolute; left: -26px; top: 4px; width: 8px; height: 8px; border: 2px solid var(--a1); border-radius: 50%; background: #14202e; content: ""; transition: transform 400ms var(--ease), background 300ms ease; }
/* the role he is in now is a filled node */
.row-timeline li:first-child::before { background: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 18%, transparent); }
.row-timeline li:hover::before { transform: scale(1.25); }
.tl-when { color: var(--label, var(--faint-white)); font-size: 0.72rem; letter-spacing: 0.04em; }
.row-timeline b { color: var(--white); font: 600 1.02rem var(--sans); letter-spacing: -0.01em; }
.row-timeline p { color: var(--soft-white); font-size: 0.92rem; line-height: 1.58; }

/* projects as large alternating features */
.features { display: grid; gap: clamp(36px, 7cqw, 96px); }
.feature { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(20px, 4cqw, 56px); align-items: center; padding: 14px; margin: -14px; border-radius: 6px; cursor: pointer; }
/* six projects at first; the rest arrive when asked for */
.features .feature.is-more { display: none; }
.features.show-more .feature.is-more { display: grid; animation: rise 700ms var(--ease) both; }
.features-foot { display: flex; justify-content: center; margin-top: clamp(30px, 6cqw, 70px); }
.more-btn { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 4px; background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(12px); font-size: 0.84rem; transition: background 220ms ease, border-color 220ms ease, transform 300ms var(--ease), gap 400ms var(--ease); }
.more-btn:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.6); transform: translateY(-2px); gap: 14px; }
.more-btn svg { rotate: 90deg; }

/* alternate sides, but every image is the same (large) size */
.feature:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.feature:nth-child(even) .feature-visual { order: 2; }
.feature:hover { background: rgba(255, 255, 255, 0.04); }
.feature:focus-visible { outline: 1px solid rgba(255, 255, 255, 0.6); outline-offset: 4px; }
.feature-visual { aspect-ratio: 16 / 10; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 4px; background: #1b2636 center / cover no-repeat; filter: grayscale(0.7) contrast(0.95) brightness(0.9); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42); transition: filter 600ms ease, transform 900ms var(--ease); }
.feature:hover .feature-visual,
.feature.is-expanded .feature-visual,
.feature.is-cited .feature-visual { filter: none; transform: scale(1.012); }
.feature-copy { display: grid; gap: 12px; align-content: center; }
.feature-num { color: var(--label, var(--faint-white)); font-size: 0.74rem; letter-spacing: 0.16em; }
.feature .project-meta { color: var(--a1); }
.feature h3 { margin: 0; font: 600 clamp(1.9rem, 4.4cqw, 3.8rem) / 0.96 var(--sans); letter-spacing: -0.045em; }
.feature-copy p { max-width: 44ch; color: var(--soft-white); line-height: 1.6; }
.feature-open { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--white); font-size: 0.8rem; opacity: 0.55; transition: opacity 240ms ease, gap 300ms var(--ease); }
.feature:hover .feature-open { opacity: 1; gap: 12px; }
.feature.is-expanded .feature-open { display: none; }

.feature .project-detail { grid-column: 1 / -1; order: 3; }
.feature.is-expanded .project-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 40px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.14); animation: rise 600ms var(--ease) both; }
.feature .project-detail p,
.feature .project-detail li { color: var(--soft-white); }
.feature .project-detail .project-tagline { grid-column: 1 / -1; color: var(--white); font-size: 1.3rem; letter-spacing: -0.02em; }
.feature .project-detail li::before { color: var(--ah, var(--a1)); }
.feature .project-gallery,
.feature .project-actions { grid-column: 1 / -1; }
.feature .project-gallery img { border-color: rgba(255, 255, 255, 0.16); background: #1b2636; }
.feature .chip-btn { border-color: rgba(255, 255, 255, 0.26); background: rgba(255, 255, 255, 0.06); color: var(--white); }
.feature .chip-btn:hover { background: rgba(255, 255, 255, 0.16); }
.feature .chip-btn--quiet { border-color: transparent; background: none; color: var(--faint-white); }

.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3cqw, 44px); }
.columns article { padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.3); }
.columns h3 { margin: 0 0 14px; font: 600 1.2rem var(--sans); letter-spacing: -0.02em; }
.columns ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; color: var(--soft-white); font-size: 0.92rem; }
.editorial .tool-chips i { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.05); color: var(--soft-white); }

.outro { display: grid; gap: 16px; padding: clamp(60px, 10vh, 120px) 0 30px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.outro-mail { justify-self: start; font: 600 clamp(1.3rem, 4.6cqw, 4rem) var(--sans); letter-spacing: -0.04em; border-bottom: 1px solid rgba(255, 255, 255, 0.3); overflow-wrap: anywhere; transition: border-color 240ms ease, color 240ms ease; }
.outro-mail:hover { color: var(--a1); border-color: var(--a1); }
.outro p { color: var(--faint-white); font-size: 0.84rem; }
/* "Reach out to me": the line itself is the button; the agent drafts the message */
.outro-reach { justify-self: start; display: inline-flex; align-items: baseline; gap: 0.3em; padding: 0; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.3); background: none; font: 600 clamp(2rem, 6.4cqw, 5.4rem) / 1 var(--sans); letter-spacing: -0.045em; text-align: left; transition: color 300ms ease, border-color 300ms ease, gap 500ms var(--ease); }
.outro-reach span { color: var(--ag, var(--a1)); transition: translate 500ms var(--ease); }
.outro-reach:hover { color: var(--a4); border-color: var(--ag, var(--a1)); gap: 0.45em; }
/* now: small, true signs of life */
.now { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.now-item { display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px; background: rgba(17, 27, 40, 0.5); backdrop-filter: blur(14px); color: var(--soft-white); font-size: 0.76rem; }
.now-item b { color: var(--white); font-weight: 700; }
.now-item em { color: var(--label, var(--faint-white)); font-style: normal; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* cited, on dark */
.editorial .is-cited { animation: darkCited 4.6s ease both; }
@keyframes darkCited { 8%, 72% { background: rgba(169, 191, 217, 0.1); } }

/* a narrow scroller: beside a wide panel, or a phone */
@container (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-content: center; padding: 84px 0 120px; }
  .hero-portrait { max-width: 220px; order: -1; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 16px 6px; }
  .feature,
  .feature:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .feature:nth-child(even) .feature-visual { order: 0; }
  .feature.is-expanded .project-detail,
  .columns { grid-template-columns: minmax(0, 1fr); }
}
