/* Peter Valalik — personal site
   Concept: a banknote portrait. Security-paper neutrals, banknote green,
   guilloché line work around the portrait, microprint ring.
   Type: Bodoni Moda (display) · IBM Plex Sans (text) · IBM Plex Mono (labels & data). */

/* ---------- tokens ---------- */
:root {
  --paper: #F1F4F2;
  --paper-2: #E6ECE8;
  --card: #F8FAF9;
  --ink: #13201C;
  --ink-2: #35443F;
  --muted: #5D6B66;
  --line: rgba(19, 32, 28, .12);
  --line-2: rgba(19, 32, 28, .24);
  --accent: #1C5A4B;
  --accent-soft: rgba(28, 90, 75, .09);
  --on-accent: #F1F4F2;
  --g1: #1C5A4B;
  --g2: #3B6C7D;
  --header-bg: rgba(241, 244, 242, .82);
  --shadow: 0 1px 2px rgba(19, 32, 28, .05), 0 24px 48px -30px rgba(19, 32, 28, .4);

  --band-bg: #13201C;
  --band-fg: #E6ECE8;
  --band-muted: #9AABA4;
  --band-line: rgba(230, 236, 232, .14);
  --band-accent: #86C9B2;
  --band-g1: #86C9B2;
  --band-g2: #7FA6BF;
  --band-field: color-mix(in srgb, var(--band-bg) 94%, #fff);
  --band-field-focus: color-mix(in srgb, var(--band-bg) 90%, #fff);
  --band-error: #F2A69C;

  --sun: none;
  --moon: block;

  --font-display: 'Bodoni Moda', 'Bodoni 72', Didot, 'Times New Roman', serif;
  --font-sans: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;

  --fs-xs: .78rem;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-lead: clamp(1.125rem, 1.04rem + .38vw, 1.3rem);
  --fs-h3: clamp(1.4rem, 1.22rem + .7vw, 1.8rem);
  --fs-h2: clamp(2.2rem, 1.5rem + 2.8vw, 3.8rem);
  --fs-hero: clamp(3.6rem, 1.4rem + 8vw, 8.6rem);

  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 6px;
  --header-h: 68px;
  --ease: cubic-bezier(.22, .7, .18, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1210;
    --paper-2: #0F1916;
    --card: #111B18;
    --ink: #E3EAE6;
    --ink-2: #B8C5BF;
    --muted: #8B9B95;
    --line: rgba(227, 234, 230, .1);
    --line-2: rgba(227, 234, 230, .2);
    --accent: #86C9B2;
    --accent-soft: rgba(134, 201, 178, .1);
    --on-accent: #0B1210;
    --g1: #86C9B2;
    --g2: #7FA6BF;
    --header-bg: rgba(11, 18, 16, .78);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 28px 56px -32px rgba(0, 0, 0, .9);
    --band-bg: #0F1D19;
    --band-fg: #E3EAE6;
    --band-muted: #93A59E;
    --band-line: rgba(227, 234, 230, .12);
    --sun: block;
    --moon: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0B1210;
  --paper-2: #0F1916;
  --card: #111B18;
  --ink: #E3EAE6;
  --ink-2: #B8C5BF;
  --muted: #8B9B95;
  --line: rgba(227, 234, 230, .1);
  --line-2: rgba(227, 234, 230, .2);
  --accent: #86C9B2;
  --accent-soft: rgba(134, 201, 178, .1);
  --on-accent: #0B1210;
  --g1: #86C9B2;
  --g2: #7FA6BF;
  --header-bg: rgba(11, 18, 16, .78);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 28px 56px -32px rgba(0, 0, 0, .9);
  --band-bg: #0F1D19;
  --band-fg: #E3EAE6;
  --band-muted: #93A59E;
  --band-line: rgba(227, 234, 230, .12);
  --sun: block;
  --moon: none;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
p, ul, ol, dl, dd, figure { margin: 0; }
p { text-wrap: pretty; }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
button { font: inherit; color: inherit; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  display: block;
  width: 18px; height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed; left: 1rem; top: -4rem; z-index: 100;
  padding: .6rem 1rem;
  border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: var(--fs-sm); text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + .75rem); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .8rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: currentColor; opacity: .55; }

/* Display type: Bodoni's large optical sizes have hairlines too thin to read, especially
   light-on-dark. A smaller optical size and a heavier weight keep the character but
   give the thin strokes enough body. */
.hero__name, .hero__tagline, .section-title, .word__word, .contact__title,
.stat dd, .tl-year, .tl-company, .cap__title, .sub-title, .project__name,
.brand__name, .mobile-menu a {
  font-optical-sizing: none;
  font-variation-settings: "opsz" 24;
  font-weight: 500;
}

/* ---------- scroll progress ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: 2px;
  pointer-events: none;
}
.progress__bar {
  display: block; height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
}
/* The frosted background lives on a pseudo-element: a backdrop-filter on the header itself
   would become the containing block of the fixed mobile menu and collapse it. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  backdrop-filter: saturate(1.3) blur(14px);
  box-shadow: 0 1px 0 var(--line);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.menu-open::before { opacity: 1; background: var(--paper); }

.site-header__inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 1.25rem;
}

.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  margin-right: auto;
  text-decoration: none;
  min-width: 0;
}
.brand__mark { width: 34px; height: 34px; color: var(--accent); transition: transform 1.4s var(--ease); }
.brand:hover .brand__mark { transform: rotate(90deg); }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.site-header.show-name .brand__name,
.site-header.menu-open .brand__name { opacity: 1; transform: none; }

.site-nav ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  position: relative; display: block;
  padding: .5rem .75rem;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s;
}
.site-nav a::after {
  content: ""; position: absolute; left: .75rem; right: .75rem; bottom: .3rem;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.site-nav a:hover::after, .site-nav a[aria-current]::after { transform: scaleX(1); }

.header-tools { display: flex; align-items: center; gap: .5rem; }

.lang-switch {
  --i: 0;
  position: relative;
  display: grid; grid-template-columns: repeat(3, 2.5rem);
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
.lang-switch__pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform .5s var(--ease), background-color .35s;
}
.lang-switch__btn {
  position: relative; z-index: 1;
  appearance: none; border: 0; background: none;
  padding: .38rem 0;
  border-radius: 999px;
  font-family: var(--font-mono); font-size: .75rem; font-weight: 500; line-height: 1;
  letter-spacing: .08em;
  color: var(--muted);
  cursor: pointer;
  transition: color .3s;
}
.lang-switch__btn:hover { color: var(--ink); }
.lang-switch__btn[aria-pressed="true"] { color: var(--paper); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--ink); }
.theme-toggle .icon--sun { display: var(--sun); }
.theme-toggle .icon--moon { display: var(--moon); }
.menu-toggle { display: none; }

.mobile-menu {
  position: fixed;
  inset: calc(var(--header-h) + env(safe-area-inset-top, 0px)) 0 0 0;
  z-index: 49;
  overflow-y: auto;
  padding-block: 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
}
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu a {
  display: block;
  padding-block: .7rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.4rem + 2vw, 2.4rem);
  text-decoration: none;
}
.mobile-menu a[aria-current] { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .65rem;
  padding: .85rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 500; line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s;
}
.btn small {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .7;
}
.btn .icon { transition: transform .35s var(--ease); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); color: var(--on-accent); }
.btn--ghost { border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn:hover .icon--arrow { transform: translateX(4px); }
.btn:hover .icon--down { transform: translateY(2px); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + clamp(2.5rem, 7vw, 5.5rem));
  padding-bottom: clamp(3rem, 6vw, 5rem);
  background: radial-gradient(circle at 76% 38%, var(--accent-soft), transparent 42%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero__text { display: grid; gap: 1.5rem; justify-items: start; }

.hero__name {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  line-height: .92;
  letter-spacing: -.02em;
}
.hero__line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.hero__line > span { display: inline-block; }

.hero__tagline {
  margin-top: -.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
  font-style: italic;
  line-height: 1.1;
  color: var(--accent);
}

.hero__lead { max-width: 34rem; font-size: var(--fs-lead); line-height: 1.6; color: var(--ink-2); }

.hero__focus { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .9rem; }
.hero__focus-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.rotator { display: inline-grid; overflow: hidden; font-weight: 500; color: var(--ink); line-height: 1.5; }
.rotator__word {
  grid-area: 1 / 1;
  white-space: nowrap;
  transition: transform .65s var(--ease), opacity .65s var(--ease);
}
.rotator__word.is-entering { transform: translateY(100%); opacity: 0; }
.rotator__word.is-leaving { transform: translateY(-100%); opacity: 0; }

.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .25rem; }

.hero__meta {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  list-style: none; padding: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.hero__meta li, .hero__meta a { display: inline-flex; align-items: center; gap: .5rem; }
.hero__meta a { text-decoration: none; transition: color .2s; }
.hero__meta a:hover { color: var(--accent); }

/* the banknote medallion */
.hero__visual { justify-self: center; width: 100%; max-width: 540px; }
/* overflow clip: the spinning ring's rotated box must not widen the page on phones */
.medallion { position: relative; width: 100%; max-width: 100%; aspect-ratio: 1; overflow: hidden; }
.medallion__canvas, .medallion__ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.medallion__ring { animation: spin 140s linear infinite; }
.medallion__ring text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  fill: var(--muted);
}
.medallion__photo {
  position: absolute; top: 21%; left: 21%;
  width: 58%; height: 58%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--line-2), var(--shadow);
  translate: calc(var(--px, 0) * -7px) calc(var(--py, 0) * -7px);
  transition: translate .8s var(--ease), box-shadow .4s var(--ease);
}

/* figures */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: .45rem; }
.stat dt {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat dd {
  display: flex; align-items: baseline; gap: .15em;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 2rem + 2.4vw, 4.2rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.stat__suffix { font-style: italic; color: var(--accent); }
.stat__note {
  margin-left: .5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  color: var(--muted);
  align-self: center;
}

/* ---------- sections ---------- */
.section { padding-block: clamp(4.5rem, 9vw, 8rem); }

.section-head {
  display: grid; gap: 1.1rem;
  max-width: 48rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.06;
  letter-spacing: -.01em;
}
.section-title em { color: var(--accent); }
.section-intro { max-width: 40rem; font-size: var(--fs-lead); color: var(--ink-2); }

/* about */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.about__text { display: grid; gap: 1.35rem; }
.about__text .section-title { margin-bottom: .4rem; }
.about__text p { max-width: 38rem; color: var(--ink-2); }

.facts { border-top: 1px solid var(--line-2); }
.facts__row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  padding-top: .2rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* expertise */
.cap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.cap {
  position: relative;
  display: grid; grid-template-rows: auto auto 1fr auto; gap: .9rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  isolation: isolate;
  transition: border-color .3s, transform .45s var(--ease);
}
.cap::before, .project::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 62%);
  opacity: 0;
  transition: opacity .4s;
}
.cap:hover, .project:hover { border-color: var(--line-2); transform: translateY(-3px); }
.cap:hover::before, .project:hover::before { opacity: 1; }
.cap__icon { width: 30px; height: 30px; color: var(--accent); stroke-width: 1.25; }
.cap__title { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.15; }
.cap p { color: var(--ink-2); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; align-self: end; list-style: none; padding: 0; }
.tags li {
  padding: .28rem .6rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--ink-2);
}

.expertise__more {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}
.sub-title { font-family: var(--font-display); font-size: clamp(1.5rem, 1.3rem + .8vw, 2rem); line-height: 1.15; }
.sub-caption { margin-top: .4rem; font-size: var(--fs-sm); color: var(--muted); }

.toolbox__list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem;
  margin-top: 1.5rem;
  list-style: none; padding: 0;
}
.toolbox__item { display: flex; align-items: baseline; gap: .6rem; padding-block: .55rem; font-size: var(--fs-sm); }
.toolbox__leader { flex: 1; min-width: 1rem; border-bottom: 1px dotted var(--line-2); transform: translateY(-.28em); }
.toolbox__code {
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--accent);
}

.flow__steps { position: relative; display: grid; margin-top: 1.5rem; list-style: none; padding: 0; }
.flow__steps::before {
  content: ""; position: absolute; left: 1.1rem; top: 1.65rem; bottom: 1.65rem;
  width: 1px; background: var(--line-2);
}
.flow__steps::after {
  content: ""; position: absolute; left: calc(1.1rem - 3px); top: 1.65rem;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  opacity: 0;
  animation: travel 6s linear infinite;
}
.flow__step {
  display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 1rem; align-items: center;
  padding-block: .55rem;
}
.flow__num {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 2.2rem; height: 2.2rem;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--font-mono); font-size: .78rem; font-weight: 500;
  color: var(--accent);
  animation: ping 6s linear infinite;
  animation-delay: calc(var(--k) * 1.275s);
}
.flow__label { font-weight: 500; line-height: 1.35; }

@keyframes travel {
  0% { top: 1.65rem; opacity: 0; }
  3% { opacity: 1; }
  85% { top: calc(100% - 1.65rem - 7px); opacity: 1; }
  92%, 100% { top: calc(100% - 1.65rem - 7px); opacity: 0; }
}
@keyframes ping {
  0%, 9% { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  22%, 100% { background: var(--paper); border-color: var(--line-2); color: var(--accent); }
}

/* the 43-letter word */
.word { background: var(--paper-2); }
.word__word {
  display: flex; flex-wrap: wrap; row-gap: 2rem;
  margin-top: 1.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, .9rem + 5.2vw, 5.6rem);
  line-height: 1;
  letter-spacing: -.015em;
}
.morph { display: inline-flex; flex-direction: column; gap: .9rem; }
.morph__de { transition: color .25s; }
.morph:not(:last-child) .morph__de::after { content: "·"; margin-inline: .04em; color: var(--accent); }
.morph__gloss {
  margin-right: 1.25rem;
  padding-top: .6rem;
  border-top: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .25s, border-color .25s;
}
.morph:hover .morph__de { color: var(--accent); }
.morph:hover .morph__gloss { color: var(--accent); border-color: var(--accent); }
.word__caption { max-width: 42rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); font-size: var(--fs-lead); color: var(--ink-2); }
.word__note { max-width: 42rem; margin-top: .9rem; font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .03em; color: var(--muted); }

/* experience timeline */
.timeline {
  --when-w: 7.5rem;
  --node-x: calc(var(--when-w) + 1.75rem);
  --progress: 0;
  position: relative;
  list-style: none; margin: 0; padding: 0;
}
.timeline::before, .timeline::after {
  content: ""; position: absolute; top: .9rem; bottom: 0; left: var(--node-x);
  width: 1px;
}
.timeline::before { background: var(--line-2); }
.timeline::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--progress)); }

.tl-item {
  position: relative;
  display: grid; grid-template-columns: var(--when-w) minmax(0, 1fr); column-gap: 3.5rem;
  padding-bottom: clamp(2.75rem, 5vw, 4rem);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-when { padding-top: .1rem; text-align: right; }
.tl-year {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: lining-nums;
}
.tl-node {
  position: absolute; top: .9rem; left: var(--node-x);
  width: 11px; height: 11px;
  margin: -5px 0 0 -5px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--paper);
  transition: background-color .4s, border-color .4s;
}
.tl-item.is-past .tl-node { background: var(--accent); border-color: var(--accent); }
.tl-item--current .tl-node::after {
  content: ""; position: absolute; inset: -6px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  animation: pulse 2.6s var(--ease) infinite;
}

.tl-body { display: grid; gap: .5rem; max-width: 46rem; }
.tl-company { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.15; }
.tl-role { font-size: var(--fs-base); font-weight: 600; line-height: 1.4; }
.tl-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .03em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tl-text { color: var(--ink-2); }
.tl-list { display: grid; gap: .4rem; padding-left: 1.1rem; color: var(--ink-2); overflow-wrap: break-word; }
.tl-list li::marker { color: var(--accent); }
.tl-roles {
  display: grid; gap: 1.5rem;
  margin-top: 1rem;
  padding-left: 1.4rem;
  border-left: 1px dashed var(--line-2);
  list-style: none;
}
.tl-subrole { position: relative; display: grid; gap: .3rem; }
.tl-subrole::before {
  content: ""; position: absolute; left: calc(-1.4rem - 3px); top: .6rem;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  opacity: .6;
}
.tl-link {
  display: inline-flex; align-items: center; gap: .35rem;
  justify-self: start;
  margin-top: .2rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.tl-link .icon { width: 15px; height: 15px; }

/* projects */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.project {
  position: relative;
  display: grid; align-content: start; gap: .7rem;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  isolation: isolate;
  transition: border-color .3s, transform .45s var(--ease);
}
.project--wide { grid-column: span 2; grid-row: span 2; padding: clamp(1.6rem, 3vw, 2.5rem); }
.project__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  color: var(--muted);
}
.project__code {
  padding: .12rem .45rem;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-weight: 500;
  color: var(--ink);
}
.project__tag { margin-left: auto; color: var(--accent); font-weight: 500; }
.project__name { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.15; }
.project--wide .project__name { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 3rem); }
.project__desc { font-size: var(--fs-sm); color: var(--ink-2); }
.project--wide .project__desc { font-size: var(--fs-base); }
.project__list { display: grid; margin-top: .75rem; list-style: none; padding: 0; }
.project__list li {
  display: flex; gap: .8rem; align-items: baseline;
  padding-block: .75rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .82rem;
}
.project__list li::before { content: ""; flex: none; width: .9rem; height: 1px; background: var(--accent); transform: translateY(-.3em); }

/* contact band */
.contact {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--band-bg);
  color: var(--band-fg);
}
.contact__art {
  position: absolute; z-index: -1;
  top: 50%; right: -30rem;
  width: min(62rem, 130vw);
  aspect-ratio: 1;
  translate: 0 -50%;
  opacity: .42;
  pointer-events: none;
}
.contact .eyebrow { color: var(--band-accent); }
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.contact__intro { display: grid; gap: 1.4rem; justify-items: start; }
.contact__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 1.3rem + 4.4vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -.015em;
}
.contact__title em { color: var(--band-accent); }
.contact__text { max-width: 32rem; font-size: var(--fs-lead); color: var(--band-muted); }
.contact__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.btn--light { background: var(--band-fg); color: var(--band-bg); }
.btn--light:hover { background: var(--band-accent); color: var(--band-bg); }
.btn--outline-light { border-color: var(--band-line); color: var(--band-fg); }
.btn--outline-light:hover { border-color: var(--band-fg); }

.contact-form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .45rem; }
.field label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--band-muted);
}
.field input, .field textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid var(--band-line);
  border-radius: var(--radius);
  background: var(--band-field);
  color: var(--band-fg);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color .2s, background-color .2s;
}
.field textarea { min-height: 9.5rem; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--band-muted); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--band-accent);
  background: var(--band-field-focus);
}
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--band-fg);
  box-shadow: 0 0 0 100px var(--band-bg) inset;
}
.field [aria-invalid="true"] { border-color: var(--band-error); }
.field__error { font-size: .85rem; color: var(--band-error); }
.field__error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form__footer { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.25rem; margin-top: .25rem; }
.contact-form button[disabled] { opacity: .6; cursor: progress; }
.contact-form__status { font-size: var(--fs-sm); color: var(--band-muted); }
.contact-form__status.is-success { color: var(--band-accent); }
.contact-form__status.is-error { color: var(--band-error); }
.contact-form__note { font-size: .82rem; color: var(--band-muted); }
.contact :focus-visible { outline-color: var(--band-accent); }

/* footer */
.site-footer {
  padding-block: 1.6rem calc(1.6rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--band-line);
  background: var(--band-bg);
  color: var(--band-muted);
  font-size: var(--fs-sm);
}
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
.site-footer a { color: var(--band-fg); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.site-footer a:hover { color: var(--band-accent); }
.site-footer :focus-visible { outline-color: var(--band-accent); }

/* ---------- motion ---------- */
main, .site-nav { transition: opacity .2s ease; }
.is-switching main, .is-switching .site-nav { opacity: .12; }
.i18n-pending main, .i18n-pending .site-header { opacity: 0; }

.js .hero-anim {
  animation: rise 1s var(--ease) both;
  animation-delay: calc(var(--d, 0) * 90ms + 120ms);
  animation-play-state: paused;
}
.js .hero__line > .hero-anim { animation-name: rise-line; animation-duration: 1.1s; }
.js .hero__visual.hero-anim { animation-name: fade; animation-duration: 1.6s; }
.js.is-ready .hero-anim { animation-play-state: running; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 240px;
    }
  }
}

@keyframes rise { from { opacity: 0; translate: 0 1.25rem; } to { opacity: 1; translate: 0 0; } }
@keyframes rise-line { from { translate: 0 105%; } to { translate: 0 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes reveal { from { opacity: 0; translate: 0 2.25rem; } to { opacity: 1; translate: 0 0; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .js .hero-anim, .medallion__ring, .flow__steps::after, .flow__num, .tl-item--current .tl-node::after { animation: none !important; }
  .flow__steps::after { display: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .site-nav { display: none; }
  .menu-toggle { display: inline-grid; }
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__visual { order: -1; max-width: 400px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; }
  .about__grid, .expertise__more, .contact__grid { grid-template-columns: minmax(0, 1fr); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project--wide { grid-column: 1 / -1; grid-row: auto; }
  .contact__art { right: -40%; top: 18%; }
}

@media (max-width: 640px) {
  .cap-grid, .toolbox__list, .bento { grid-template-columns: minmax(0, 1fr); }
  .facts__row { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .timeline { --node-x: .35rem; }
  .timeline::before, .timeline::after { top: .6rem; }
  .tl-item { grid-template-columns: minmax(0, 1fr); padding-left: 2rem; row-gap: .5rem; }
  .tl-when { text-align: left; }
  .tl-year { font-size: 1.6rem; }
  .tl-node { top: .6rem; }
  .tl-roles { padding-left: 1.1rem; }
  .tl-subrole::before { left: calc(-1.1rem - 3px); }
  .stat__note { display: none; }
}

@media (max-width: 420px) {
  .lang-switch { grid-template-columns: repeat(3, 2.2rem); }
  .header-tools { gap: .35rem; }
  .icon-btn { width: 36px; height: 36px; }
  .brand__name { display: none; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .progress, .skip-link, .medallion__canvas, .medallion__ring, .contact__art, .hero__cta, .contact-form, .contact__actions { display: none !important; }
  :root { --paper: #fff; --card: #fff; --ink: #000; --ink-2: #222; --muted: #555; }
  .contact, .site-footer { --band-bg: #fff; --band-fg: #000; --band-muted: #444; --band-line: #ccc; --band-accent: #1C5A4B; }
  .hero-anim, .reveal { animation: none !important; opacity: 1 !important; translate: none !important; }
  .section { padding-block: 2rem; }
}
