/* ============================================================
   LEXSAS redesign concept ("Lexsas Kimi")
   Design tokens inherited from the LEXSAS brand system.
   Motion: blur-staggered type, scroll-synced index, drawn mark.
   ============================================================ */

:root {
  --paper: #FCFCFA;
  --ink: #22272C;
  --ink-soft: #3A4149;
  --muted: #5B6570;
  --line: #E8E6E1;
  --line-dark: #D9D6CF;

  --blue: #2E7CF6;
  --red: #E8503A;
  --yellow: #F5B301;
  --green: #2FA05A;

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Manrope", -apple-system, "Segoe UI", sans-serif;

  --shell: min(1320px, calc(100% - 4rem));
  --rhythm: clamp(96px, 12vw, 160px);
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-draw: cubic-bezier(.65, 0, .35, 1);
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--blue); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

img, svg { display: block; }

a { color: inherit; }

button { font-family: inherit; }

.shell {
  width: var(--shell);
  margin-inline: auto;
}

section { scroll-margin-top: 96px; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: .6rem 1rem;
  font: 600 .85rem var(--sans);
  text-decoration: none;
  transition: top .25s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Shared type ---------- */

.kicker {
  margin: 0;
  font: 700 .72rem var(--sans);
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker-dark { color: rgba(252, 252, 250, .5); }

.section-title {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.signature-line {
  width: var(--shell);
  margin: 0 auto;
  height: 2px;
  border: 0;
  background: linear-gradient(90deg, var(--blue), var(--red), var(--yellow), var(--green));
}

/* ---------- Underline links (signature hover) ---------- */

.u-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: .5em;
  font: 700 .95rem var(--sans);
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 4px;
}
.u-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .45s var(--ease-out);
}
.u-link:hover::after,
.u-link:focus-visible::after { transform: scaleX(1); }

.u-link-strong { font-size: 1rem; }
.u-link-muted { color: var(--muted); }
.u-arrow { transition: transform .3s var(--ease-out); }
.u-link:hover .u-arrow { transform: translateX(5px); }

/* ---------- Scroll progress (the signature line, alive) ---------- */

.progress-line {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 70;
  pointer-events: none;
}
.progress-line span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--red), var(--yellow), var(--green));
  transform: scaleX(0);
  transform-origin: left center;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(252, 252, 250, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 72px;
  padding-block: .6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  margin-right: auto;
}
.brand-mark { width: 30px; height: 30px; }
.brand-word {
  font: 800 1.22rem var(--sans);
  letter-spacing: -.02em;
  color: var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.2vw, 1.9rem);
}
.nav a {
  position: relative;
  font: 600 .9rem var(--sans);
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 3px;
  white-space: nowrap;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s var(--ease-out);
}
.nav a:hover::after { transform: scaleX(1); }

.lang-toggle {
  flex: none;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: .42rem .85rem;
  font: 800 .72rem var(--sans);
  letter-spacing: .12em;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}
.lang-toggle:hover { background: var(--ink); color: var(--paper); }

/* ---------- The mark, drawn ---------- */

.mark-arc, .mark-x {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
body.loaded .mark-arc,
body.loaded .mark-x {
  animation: mark-draw .8s var(--ease-draw) forwards;
  animation-delay: calc(var(--i) * .1s);
}
@keyframes mark-draw { to { stroke-dashoffset: 0; } }

/* ---------- Hero ---------- */

.hero { padding-top: clamp(64px, 9vh, 116px); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.hero-title {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.7rem, 5.9vw, 5.15rem);
  line-height: 1.04;
  letter-spacing: -.021em;
  max-width: 13ch;
  text-wrap: balance;
}

/* word-split blur entrance (JS adds .split / .on) */
.hero-title .hw { display: inline-block; }
.hero-title.split .hw {
  opacity: 0;
  transform: translateY(.38em);
  filter: blur(9px);
}
.hero-title.split.on .hw {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition:
    opacity .7s ease var(--d, 0s),
    transform .7s var(--ease-out) var(--d, 0s),
    filter .7s ease var(--d, 0s);
}

.lede {
  margin: 26px 0 0;
  max-width: 54ch;
  font-size: 1.13rem;
  line-height: 1.68;
  color: var(--ink-soft);
}

.hero-cta {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-art {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.cred-row {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.cred-item {
  font: 600 .84rem var(--sans);
  letter-spacing: .02em;
  color: var(--ink);
}

/* ---------- Giant wordmark band ---------- */

.wordmark-band {
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
  text-align: center;
}
.wordmark {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(4.6rem, 17.5vw, 15.5rem);
  line-height: .92;
  letter-spacing: -.034em;
  color: var(--ink);
  user-select: none;
}
.wordmark-sub {
  margin: 18px 0 0;
  font: 700 .72rem var(--sans);
  letter-spacing: .22em;
  color: var(--muted);
}

/* ---------- Focus areas: scroll-synced index ---------- */

.work { padding-block: var(--rhythm); }

.work-grid {
  display: grid;
  grid-template-columns: minmax(300px, 430px) 1fr;
  gap: clamp(3rem, 7vw, 7.5rem);
  align-items: start;
}

.work-sticky {
  position: sticky;
  top: 110px;
  --acc: var(--blue);
}

.work-index {
  margin-top: clamp(1.8rem, 4vw, 3rem);
  display: flex;
  align-items: baseline;
  gap: .6rem;
}
.work-num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(4.6rem, 8.5vw, 7.75rem);
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--acc);
  transition: color .5s ease;
  font-variant-numeric: tabular-nums;
}
.work-total { font: 600 .95rem var(--sans); color: var(--muted); }

.work-progress {
  margin-top: 20px;
  width: 132px;
  height: 2px;
  background: var(--line);
}
.work-progress span {
  display: block;
  height: 100%;
  width: 16.66%;
  background: var(--acc);
  transition: width .5s var(--ease-out), background .5s ease;
}

.work-note {
  margin: 26px 0 0;
  max-width: 30ch;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--muted);
}

.work-list { border-top: 1px solid var(--line); }

.area {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.4rem, 4.5vw, 3.6rem);
}
.area-num {
  font: 700 .72rem var(--sans);
  letter-spacing: .14em;
  color: var(--area-acc, var(--muted));
}
.area[data-accent="blue"]   { --area-acc: var(--blue); }
.area[data-accent="red"]    { --area-acc: var(--red); }
.area[data-accent="yellow"] { --area-acc: var(--yellow); }
.area[data-accent="green"]  { --area-acc: var(--green); }

.area h3 {
  margin: 14px 0 12px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  line-height: 1.18;
  letter-spacing: -.01em;
  max-width: 22ch;
}
.area p {
  margin: 0;
  max-width: 62ch;
  line-height: 1.66;
  color: var(--muted);
}

/* ---------- Approach: ink band ---------- */

.approach {
  background: var(--ink);
  color: var(--paper);
  padding-block: var(--rhythm);
}
.approach .section-title { color: var(--paper); }

.principles {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.8rem, 3.5vw, 3rem);
}

.principle {
  border-top: 2px solid var(--pr-acc, var(--paper));
  padding-top: 22px;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .3s ease;
}
.principle[data-accent="blue"]   { --pr-acc: var(--blue); }
.principle[data-accent="yellow"] { --pr-acc: var(--yellow); }
.principle[data-accent="green"]  { --pr-acc: var(--green); }

.principle-num {
  font: 700 .72rem var(--sans);
  letter-spacing: .14em;
  color: var(--pr-acc);
}
.principle h3 {
  margin: 14px 0 12px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--paper);
}
.principle p {
  margin: 0;
  font-size: .97rem;
  line-height: 1.66;
  color: rgba(252, 252, 250, .64);
}

.pull {
  margin: clamp(4.5rem, 9vw, 7.5rem) 0 0;
  padding: 0;
  max-width: 940px;
}
.pull p {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.9rem);
  line-height: 1.22;
  letter-spacing: -.012em;
  color: var(--paper);
}
.pull cite {
  display: block;
  margin-top: 22px;
  font: 700 .72rem var(--sans);
  font-style: normal;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: rgba(252, 252, 250, .45);
}

/* ---------- Experience ---------- */

.experience { padding-block: var(--rhythm); }

.exp-grid {
  display: grid;
  grid-template-columns: minmax(280px, 430px) 1fr;
  gap: clamp(3rem, 7vw, 7.5rem);
  align-items: start;
}
.exp-head .section-title { max-width: 14ch; }

.exp-lede {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1.32;
  letter-spacing: -.01em;
  color: var(--ink);
  max-width: 30ch;
}
.exp-body > p:not(.exp-lede) {
  margin: 22px 0 0;
  max-width: 62ch;
  line-height: 1.7;
  color: var(--muted);
}

.exp-facts {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
}
.exp-facts li {
  position: relative;
  padding-left: 20px;
  font: 600 .85rem var(--sans);
  color: var(--ink);
}
.exp-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .48em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fact-dot, var(--ink));
}
.exp-facts li:nth-child(1) { --fact-dot: var(--blue); }
.exp-facts li:nth-child(2) { --fact-dot: var(--red); }
.exp-facts li:nth-child(3) { --fact-dot: var(--yellow); }
.exp-facts li:nth-child(4) { --fact-dot: var(--green); }

.exp-body .u-link { margin-top: 34px; }

/* ---------- Insights ---------- */

.insights { padding-bottom: var(--rhythm); }

.insight-list {
  margin-top: clamp(2.2rem, 4.5vw, 3.4rem);
  border-top: 1px solid var(--line);
}

.insight-row {
  display: grid;
  grid-template-columns: 150px 1fr 48px;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  align-items: baseline;
  padding-block: 30px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.insight-date {
  font: 700 .72rem var(--sans);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}
.insight-title {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  transition: color .3s ease;
}
.insight-summary {
  display: block;
  margin-top: 7px;
  font-size: .95rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 66ch;
}
.insight-arrow {
  justify-self: end;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink);
  transition: transform .3s var(--ease-out), color .3s ease;
}
.insight-row:hover .insight-title { color: var(--blue); }
.insight-row:hover .insight-arrow { transform: translateX(7px); color: var(--blue); }

/* ---------- FAQ ---------- */

.faq { padding-bottom: var(--rhythm); }

.faq-list {
  margin-top: clamp(2.2rem, 4.5vw, 3.4rem);
  max-width: 880px;
  border-top: 1px solid var(--line);
}
.faq-item { border-bottom: 1px solid var(--line); }

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 26px 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.3;
  color: var(--ink);
  transition: color .25s ease;
}
.faq-q:hover { color: var(--blue); }

.faq-icon {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform .35s var(--ease-out);
}
.faq-icon::before { left: 0; top: 6px; width: 14px; height: 2px; }
.faq-icon::after  { left: 6px; top: 0; width: 2px; height: 14px; }
.faq-item.open .faq-icon::after { transform: rotate(90deg); }

.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease-out);
}
.faq-a-inner { overflow: hidden; }
.faq-a p {
  margin: 0;
  padding: 0 3rem 26px 0;
  max-width: 70ch;
  line-height: 1.66;
  color: var(--muted);
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }

/* ---------- Contact ---------- */

.contact { padding-block: calc(var(--rhythm) * .85); }

.contact-title {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3.1rem, 8.5vw, 7.2rem);
  line-height: 1;
  letter-spacing: -.028em;
}

.contact-mail {
  position: relative;
  display: inline-block;
  margin-top: 34px;
  font: 700 clamp(1.25rem, 2.6vw, 1.9rem) var(--sans);
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 8px;
}
.contact-mail::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--red), var(--yellow), var(--green));
  transition: height .25s ease;
}
.contact-mail:hover::after { height: 5px; }

.contact-note {
  margin: 26px 0 0;
  max-width: 54ch;
  line-height: 1.68;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 64px;
  overflow: hidden;
}
.footer-brand .brand-mark { width: 28px; height: 28px; }

.footer-disclaimer {
  margin: 22px 0 0;
  max-width: 74ch;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--muted);
}

.footer-meta {
  margin-top: 30px;
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
  display: flex;
  align-items: center;
  gap: 1.8rem;
  flex-wrap: wrap;
  font: 600 .85rem var(--sans);
  color: var(--ink);
}

.footer-wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(4rem, 18.5vw, 17rem);
  line-height: .78;
  letter-spacing: -.034em;
  text-align: center;
  color: var(--line);
  user-select: none;
  transform: translateY(22%);
}
@supports ((-webkit-text-stroke: 1px black)) {
  .footer-wordmark {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--line-dark);
  }
}

/* ---------- Reveal system ---------- */

.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity .8s ease var(--d, 0s),
    transform .8s var(--ease-out) var(--d, 0s);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Language swap fade ---------- */

body.lang-swap main,
body.lang-swap .site-footer {
  opacity: 0;
  transition: opacity .18s ease;
}
main, .site-footer { transition: opacity .3s ease; }

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

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 420px; margin-inline: auto; width: 100%; }
  .hero-title { max-width: 14ch; }

  .work-grid, .exp-grid { grid-template-columns: 1fr; }
  .work-sticky { position: static; }
  .work-index { align-items: center; }
  .work-note { max-width: 52ch; }
}

@media (max-width: 860px) {
  .principles { grid-template-columns: 1fr; gap: 2.6rem; }
  .insight-row { grid-template-columns: 1fr; gap: 8px; }
  .insight-arrow { display: none; }
  .cred-row { grid-template-columns: 1fr 1fr; gap: 1.4rem; }
}

@media (max-width: 720px) {
  :root { --shell: min(100% - 2.5rem, 1320px); }

  .header-inner { flex-wrap: wrap; gap: .9rem 1.4rem; padding-block: .8rem; }
  .brand { margin-right: auto; }
  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-top: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }

  .hero { padding-top: 48px; }
  .hero-title { font-size: clamp(2.45rem, 11vw, 3.4rem); }

  .work-num { font-size: 4.2rem; }
  .faq-q { font-size: 1.05rem; }
  .footer-meta { gap: 1.2rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-title.split .hw { opacity: 1; transform: none; filter: none; }
  .mark-arc, .mark-x { stroke-dashoffset: 0; }
  .principle { transform: none !important; }
}

/* ---------- Hero visual: n8n canvas metamorphosis ---------- */

.hv {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  position: relative;
}

@keyframes flow-pop { to { transform: scale(1); } }

/* --- n8n canvas metamorphosis (workflow becomes the mark) --- */

.morph-svg { width: min(100%, 480px); height: auto; }

/* Dotted canvas backdrop */
.mw-grid { opacity: 0; }
.hero-art[data-active="5"] .mw-grid {
  animation: mw-fade-life 3.9s ease .1s forwards;
}
@keyframes mw-fade-life {
  0% { opacity: 0; }
  10% { opacity: 1; }
  86% { opacity: 1; }
  100% { opacity: 0; }
}

/* Gray n8n wire, then LEXSAS gradient flowing over it */
.mw-wire, .mw-color {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.hero-art[data-active="5"] .mw-wire {
  animation: mw-wire-life 3.9s linear .15s forwards;
}
@keyframes mw-wire-life {
  0% { stroke-dashoffset: 1; opacity: 1; }
  31% { stroke-dashoffset: 0; }
  88% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.hero-art[data-active="5"] .mw-color {
  animation: mw-color-life 2.1s linear 2.1s forwards;
}
@keyframes mw-color-life {
  0% { stroke-dashoffset: 1; opacity: 1; }
  55% { stroke-dashoffset: 0; }
  85% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Node chrome */
.mw-box {
  fill: var(--paper);
  stroke: #D8DDE2;
  stroke-width: 1.5;
  filter: drop-shadow(0 3px 6px rgba(34, 39, 44, .10));
}
.mw-port { fill: var(--paper); stroke: #9AA1A9; stroke-width: 2; }
.mw-badge { fill: #E8503A; stroke: var(--paper); stroke-width: 2; }

/* Entrance pop on inner group, migration on outer group */
.mw-pop {
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
}
.hero-art[data-active="5"] .mw-pop {
  animation: flow-pop .45s var(--ease-out) forwards;
  animation-delay: calc(.7s + var(--i) * .18s);
}

.mw-node {
  transform-box: fill-box;
  transform-origin: center;
}
.hero-art[data-active="5"] .mw-node {
  animation: mw-migrate .85s cubic-bezier(.5, 0, .3, 1) forwards;
  animation-delay: calc(3.45s + var(--i) * .07s);
}
@keyframes mw-migrate {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  72% { opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(.14); opacity: 0; }
}

/* Dashed sub-node connectors (marching dots) */
.mw-dash { opacity: 0; }
.hero-art[data-active="5"] .mw-dash {
  animation: mw-dash-life 2.2s linear forwards;
  animation-delay: calc(1.2s + var(--i) * .1s);
}
@keyframes mw-dash-life {
  0% { opacity: 0; stroke-dashoffset: 26; }
  8% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; stroke-dashoffset: 0; }
}

/* Sub-nodes */
.mw-snode {
  opacity: 0;
  transform: scale(.4);
  transform-box: fill-box;
  transform-origin: center;
}
.hero-art[data-active="5"] .mw-snode {
  animation: mw-snode-life 2.1s var(--ease-out) forwards;
  animation-delay: calc(1.5s + var(--i) * .12s);
}
@keyframes mw-snode-life {
  0% { opacity: 1; transform: scale(.4); }
  14% { transform: scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}

/* Labels */
.mw-name, .mw-sub, .mw-slabel {
  font-family: var(--sans);
  text-transform: uppercase;
  opacity: 0;
}
.mw-name { font-weight: 700; font-size: 13px; letter-spacing: .12em; fill: var(--ink); }
.mw-sub { font-weight: 600; font-size: 10px; letter-spacing: .14em; fill: var(--muted); }
.mw-slabel { font-weight: 600; font-size: 9.5px; letter-spacing: .12em; fill: var(--muted); }
.hero-art[data-active="5"] .mw-name,
.hero-art[data-active="5"] .mw-sub {
  animation: mw-label-life 3.05s ease .75s forwards;
}
.hero-art[data-active="5"] .mw-slabel {
  animation: mw-label-life 2s ease 1.7s forwards;
}
@keyframes mw-label-life {
  0% { opacity: 0; transform: translateY(6px); }
  9% { opacity: 1; transform: translateY(0); }
  84% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

/* Mark arcs sweep in from the corners where the nodes landed */
.morph-arc, .morph-x {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.hero-art[data-active="5"] .morph-arc,
.hero-art[data-active="5"] .morph-x {
  animation: mark-draw .75s var(--ease-draw) forwards;
  animation-delay: calc(4.15s + var(--i) * .12s);
}

/* ---------- Reduced motion: hero final state ---------- */

@media (prefers-reduced-motion: reduce) {
  .mw-scene { display: none; }
  .morph-arc, .morph-x { stroke-dashoffset: 0; }
}

/* ---------- Inner pages (about, insights, contact, articles) ---------- */

.page-hero {
  padding-top: clamp(56px, 10vh, 110px);
  padding-bottom: clamp(2.2rem, 5vw, 4rem);
}
.page-hero .kicker { display: inline-block; margin-bottom: 1.1rem; }
.page-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -.015em;
  color: var(--ink);
  max-width: 18ch;
}
.page-lede {
  margin-top: 1.4rem;
  max-width: 56ch;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  line-height: 1.75;
  color: var(--ink-soft);
}

.page-section { padding-block: clamp(1.8rem, 4.5vw, 3.2rem); }
.page-heading {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: clamp(1.2rem, 3vw, 2rem);
}
.body-copy {
  max-width: 68ch;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--ink);
}

/* About: bio */
.bio-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.bio-portrait { position: sticky; top: 110px; }
.bio-portrait img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  filter: grayscale(.15) contrast(1.02);
}
.bio-portrait figcaption {
  margin-top: .8rem;
  font: 600 .72rem var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.bio-text p {
  font-family: var(--serif);
  font-size: clamp(1.06rem, 1.5vw, 1.2rem);
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 1.3em;
  max-width: 62ch;
}
.bio-text p:first-child::first-letter {
  font-size: 3.1em;
  line-height: .85;
  float: left;
  padding: .06em .12em 0 0;
  font-weight: 700;
  color: var(--ink);
}

/* About: career timeline */
.timeline { border-top: 1px solid var(--line); }
.job {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: clamp(1.2rem, 3vw, 3rem);
  padding-block: clamp(1.6rem, 3.5vw, 2.4rem);
  border-bottom: 1px solid var(--line);
}
.job-years {
  font: 800 .72rem var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: .45em;
}
.job:first-child .job-years,
.job:nth-child(2) .job-years { color: var(--ink); }
.job h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: .35rem;
}
.job .company {
  font: 600 .85rem var(--sans);
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: .9rem;
}
.job ul { list-style: none; margin: 0; padding: 0; }
.job li {
  position: relative;
  padding-left: 1.3em;
  margin-bottom: .55em;
  font-size: .98rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 68ch;
}
.job li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: .55em;
  height: 2px;
  background: var(--ink);
}

/* About: education + courses */
.duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.plain-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.plain-list li {
  padding: .9em 0;
  border-bottom: 1px solid var(--line);
  font-size: .98rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.affil-line {
  margin-top: 1.4rem;
  font: 600 .8rem var(--sans);
  letter-spacing: .06em;
  color: var(--muted);
}

/* Insights index: reuse .insight-row, full list */
.insight-index { border-top: 1px solid var(--line); }

/* Contact */
.contact-rows {
  border-top: 1px solid var(--line);
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}
.contact-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.contact-row dt {
  font: 800 .72rem var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-row dd { margin: 0; font-size: 1.05rem; color: var(--ink); }
.contact-row dd a { color: var(--ink); text-decoration-color: rgba(34, 39, 44, .3); }

/* Article pages */
.article-hero {
  padding-top: clamp(56px, 9vh, 100px);
  padding-bottom: clamp(1.8rem, 4vw, 3rem);
}
.article-hero .kicker { display: inline-block; margin-bottom: 1rem; }
.article-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  color: var(--ink);
  max-width: 24ch;
}
.article-lede {
  margin-top: 1.2rem;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 58ch;
}
.prose { max-width: 68ch; padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.prose p, .prose li {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--ink);
}
.prose p { margin: 0 0 1.25em; }
.prose h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 2.2em 0 .8em;
}
.prose h3 {
  font: 800 .95rem var(--sans);
  letter-spacing: .02em;
  color: var(--ink);
  margin: 2em 0 .7em;
}
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose a { color: var(--ink); text-decoration-color: rgba(34, 39, 44, .35); }
.prose blockquote {
  margin: 2em 0;
  padding: .2em 0 .2em 1.4em;
  border-left: 3px solid var(--ink);
}
.prose blockquote p { font-size: 1.15rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .6em .8em; border-bottom: 1px solid var(--line); }
.prose th {
  font: 800 .72rem var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

@media (max-width: 860px) {
  .bio-grid { grid-template-columns: 1fr; }
  .bio-portrait { position: static; max-width: 300px; }
  .job { grid-template-columns: 1fr; gap: .4rem; }
  .duo-grid { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr; gap: .2rem; }
}

/* Insights index: category tag under the date */
.insight-cat {
  display: block;
  margin-top: 6px;
  font: 600 .66rem var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
}
