/* ==========================================================================
   eracleous.cv — Frederiki Eracleous
   ========================================================================== */

:root {
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --surface: #ffffff;
  --ink: #17161b;
  --ink-2: #57545f;
  --ink-3: #8b8894;
  --line: rgba(23, 22, 27, 0.09);
  --line-2: rgba(23, 22, 27, 0.16);
  --accent: #4a2fa6;
  --accent-ink: #ffffff;
  --accent-soft: #ece7fa;
  --gold: #c99a1d;
  --live: #1f9d55;
  --glass: rgba(255, 255, 255, 0.66);
  --shadow-sm: 0 1px 2px rgba(23, 22, 27, .05), 0 2px 8px rgba(23, 22, 27, .04);
  --shadow-md: 0 1px 2px rgba(23, 22, 27, .04), 0 12px 32px -8px rgba(23, 22, 27, .14);
  --shadow-lg: 0 2px 4px rgba(23, 22, 27, .04), 0 30px 60px -20px rgba(40, 24, 90, .28);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --maxw: 1200px;
  --radius: 22px;
}

:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
    --bg: #0e0d12;
    --bg-2: #141319;
    --surface: #18171e;
    --ink: #f3f1f7;
    --ink-2: #aeabb8;
    --ink-3: #7c7987;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.14);
    --accent: #a996ff;
    --accent-ink: #120d24;
    --accent-soft: #221c3b;
    --gold: #e5bb45;
    --live: #3ccf7a;
    --glass: rgba(24, 23, 30, 0.62);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 30px 70px -20px rgba(0, 0, 0, .8);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
em { font-style: italic; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .footer { position: relative; z-index: 1; }

.skip {
  position: fixed; left: 1rem; top: 1rem; z-index: 100;
  padding: .6rem 1rem; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none;
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}
.skip:focus { transform: none; }

.kicker {
  display: inline-block;
  font: 600 .75rem/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

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

/* ---------- Floating nav ---------- */
.nav-wrap {
  position: fixed; top: max(14px, env(safe-area-inset-top)); left: 0; right: 0;
  z-index: 50;
  display: flex; justify-content: center;
  padding: 0 12px;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  padding: 6px;
  max-width: 100%;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.35);
  animation: nav-in 900ms var(--ease-out) 700ms both;
}
@keyframes nav-in {
  from { opacity: 0; transform: translateY(-10px) scale(.98); filter: blur(6px); }
}
.nav-mark {
  flex: none;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  font: italic 400 1.05rem/1 var(--serif);
  text-decoration: none;
  letter-spacing: .02em;
}
.nav-links {
  position: relative; min-width: 0;
  display: flex; align-items: center;
  overflow-x: auto; scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  position: relative; z-index: 1;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: .875rem; font-weight: 500; letter-spacing: -.005em;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 200ms ease;
}
.nav-links a[aria-current="true"] { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--ink); }
}
.nav-indicator {
  position: absolute; left: 0; top: 50%;
  height: 36px; width: var(--w, 0);
  margin-top: -18px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transform: translateX(var(--x, 0));
  opacity: var(--o, 0);
  transition: transform 450ms var(--ease-drawer), width 450ms var(--ease-drawer), opacity 200ms ease;
}
.nav-cta {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px 0 12px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: .85rem; font-weight: 600;
  text-decoration: none;
  transition: transform 160ms var(--ease-out);
}
.nav-cta svg { width: 16px; height: 16px; }
.nav-cta:active, .nav-mark:active { transform: scale(.95); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 24px;
  border-radius: 999px;
  font-size: .95rem; font-weight: 600; letter-spacing: -.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-md); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
  .btn-ghost:hover { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: min(100svh, 980px);
  padding: 130px var(--gutter) 64px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  position: relative;
}
.hero::after { /* soft aura behind portrait */
  content: ""; position: absolute; z-index: -1;
  right: 0; top: 12%;
  width: 55%; aspect-ratio: 1;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 28px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: .8125rem; font-weight: 500; color: var(--ink-2);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--live) 50%, transparent);
  animation: pulse 2.4s var(--ease-out) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--live) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}
.hero-name {
  margin: 0;
  font: 400 clamp(3.6rem, 10.5vw, 9.25rem)/.9 var(--serif);
  letter-spacing: -.035em;
}
.hero-name .line { display: block; overflow: hidden; padding: .04em .06em .08em 0; margin-bottom: -.08em; }
.hero-name .line > span { display: inline-block; }
.hero-name .italic { font-style: italic; color: var(--accent); padding-left: .5em; }
.hero-lede {
  max-width: 34rem;
  margin: 32px 0 36px;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-2);
  letter-spacing: -.011em;
}
.hero-lede em { font-style: normal; color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Portrait: arch + EU star ring */
.hero-portrait {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 400px);
  aspect-ratio: 4 / 5;
  display: grid; place-items: center;
}
.stars { position: absolute; inset: -6% -8%; pointer-events: none; }
.stars i {
  position: absolute;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  transform: scale(0) rotate(-72deg);
  animation: star-in 700ms var(--ease-out) both;
  animation-delay: calc(900ms + var(--i) * 55ms);
}
@keyframes star-in { to { transform: scale(1) rotate(0deg); } }
.arch {
  position: relative;
  width: 78%;
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px 28px 28px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
}
.arch.tilting { transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); }
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; image-rendering: auto; }
.arch::after { /* glass sheen */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 40%);
  pointer-events: none;
}
.now-card {
  position: absolute; left: -6%; bottom: 8%;
  display: grid; gap: 2px;
  padding: 14px 18px 15px;
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  animation: card-in 800ms var(--ease-out) 1300ms both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(.96); filter: blur(4px); } }
.now-label { font-size: .6875rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.now-role { font: 400 1.25rem/1.2 var(--serif); letter-spacing: -.01em; }
.now-org { font-size: .8125rem; color: var(--ink-2); }

/* Load choreography (runs once) */
.load { animation: rise 900ms var(--ease-out) both; animation-delay: calc(var(--d) * 110ms + 100ms); }
.load-up { animation: line-up 1000ms var(--ease-out) both; animation-delay: calc(var(--d) * 110ms + 100ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } }
@keyframes line-up { from { transform: translateY(105%); } }

/* ---------- Stats ---------- */
.stats {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 28px 24px 30px 0;
  border-top: 1px solid var(--line-2);
  display: grid; gap: 8px; align-content: start;
}
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat-num { font: 400 clamp(2.8rem, 5vw, 4rem)/1 var(--serif); letter-spacing: -.03em; }
.stat-label { font-size: .875rem; color: var(--ink-2); max-width: 14rem; line-height: 1.45; }

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(5rem, 11vw, 9rem) var(--gutter) 0;
}
.section-title {
  margin: 18px 0 0;
  font: 400 clamp(2.6rem, 5.6vw, 4.6rem)/.98 var(--serif);
  letter-spacing: -.03em;
}
.section-title em { color: var(--accent); }
.section-sub { margin: 20px 0 0; color: var(--ink-2); max-width: 30rem; }

/* About */
.about { display: grid; grid-template-columns: 1fr 3fr; gap: 2rem; }
.about-quote {
  margin: 0 0 40px;
  font: 400 clamp(2rem, 4.2vw, 3.4rem)/1.08 var(--serif);
  letter-spacing: -.025em;
  text-wrap: balance;
}
.about-quote em { color: var(--accent); }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; color: var(--ink-2); }
.about-cols p { margin: 0; }
.focus { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.focus li, .chips li {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: .875rem; font-weight: 500;
  background: color-mix(in oklab, var(--surface) 60%, transparent);
}

/* Experience */
.experience { display: grid; grid-template-columns: 1fr 1.55fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.section-head.sticky { position: sticky; top: 120px; }
.timeline { position: relative; padding-left: 36px; }
.roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.rail {
  position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px;
  background: var(--line-2);
  border-radius: 2px;
  overflow: hidden;
}
.rail-fill {
  position: absolute; inset: 0;
  background: linear-gradient(var(--accent), var(--gold));
  transform-origin: 50% 0;
  transform: scaleY(var(--tp, 0));
}
.role {
  position: relative;
  padding: 26px 28px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.role::before { /* timeline node */
  content: "";
  position: absolute; left: -36px; top: 32px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-2);
  transition: border-color 300ms ease, background-color 300ms ease, box-shadow 300ms ease;
}
.role.passed::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}
.role-feature {
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%),
    var(--surface);
  border-color: color-mix(in oklab, var(--accent) 30%, var(--line));
}
.role-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-meta time { font-size: .8125rem; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.tag {
  font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.tag-live { background: color-mix(in oklab, var(--live) 14%, transparent); color: var(--live); }
.role-title { margin: 10px 0 4px; font: 400 clamp(1.6rem, 2.4vw, 2rem)/1.1 var(--serif); letter-spacing: -.02em; }
.role-org { margin: 0; font-weight: 600; font-size: .95rem; }
.role-org span { font-weight: 400; color: var(--ink-3); }
.role-points { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--ink-2); font-size: .95rem; }
.role-points li { position: relative; padding-left: 18px; }
.role-points li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 6px; height: 1.5px; background: var(--accent); border-radius: 2px;
}
.more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 420ms var(--ease-drawer); }
.more > div { overflow: hidden; min-height: 0; }
.more .role-points { margin-top: 8px; opacity: 0; transform: translateY(-4px); transition: opacity 300ms ease, transform 420ms var(--ease-drawer); }
.more.open { grid-template-rows: 1fr; }
.more.open .role-points { opacity: 1; transform: none; }
.more-btn {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 14px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent;
  font-size: .8125rem; font-weight: 600;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.more-btn:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .more-btn:hover { background: var(--bg); } }
.more-btn i { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 300ms var(--ease-drawer); }
.more-btn[aria-expanded="true"] i { transform: translateY(2px) rotate(-135deg); }

/* Education */
.education .section-head { max-width: 40rem; }
.edu-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.edu {
  display: flex; flex-direction: column;
  padding: 26px 26px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  min-height: 260px;
}
.edu-top { display: flex; justify-content: space-between; align-items: baseline; }
.edu-deg { font: italic 400 2.6rem/1 var(--serif); color: var(--accent); letter-spacing: -.02em; }
.edu-top time { font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.edu h3 { margin: 28px 0 6px; font: 600 1.125rem/1.35 var(--sans); letter-spacing: -.015em; text-wrap: balance; }
.edu-school { margin: 0; color: var(--ink-2); font-size: .9rem; }
.edu-link { margin-top: auto; padding-top: 20px; font-size: .8125rem; font-weight: 600; color: var(--ink-3); text-decoration: none; transition: color 200ms ease; align-self: flex-start; }
@media (hover: hover) and (pointer: fine) { .edu-link:hover { color: var(--accent); } }
.thesis {
  margin: 16px 0 0;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--radius);
  background: #17161b; color: #f3f1f7;
  position: relative; overflow: hidden;
}
:root[data-theme="dark"] .thesis { background: var(--accent-soft); border: 1px solid var(--line); }
.thesis .kicker { color: var(--gold); }
.thesis p { margin: 16px 0 0; max-width: 52rem; font: italic 400 clamp(1.6rem, 3.4vw, 2.6rem)/1.15 var(--serif); letter-spacing: -.015em; text-wrap: balance; }
.thesis::after {
  content: "“"; position: absolute; right: 28px; top: -24px;
  font: 400 16rem/1 var(--serif); color: var(--gold); opacity: .18; pointer-events: none;
}

/* Europe — stamps */
.europe { overflow-x: clip; overflow-clip-margin: 24px; }
.europe .section-head { max-width: 44rem; }
.stamps { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 22px; }
.stamp {
  position: relative;
  filter: drop-shadow(0 1px 1px rgba(23,22,27,.06)) drop-shadow(0 12px 20px rgba(23, 22, 27, .10));
  transform: rotate(var(--r));
}
.stamp-inner { /* the paper, with perforated edges */
  position: relative; isolation: isolate;
  height: 100%;
  padding: 30px 30px 32px;
  background: var(--surface);
  -webkit-mask:
    radial-gradient(circle, #0000 4px, #000 4.5px) -7px -7px / 14px 14px round,
    linear-gradient(#000 0 0) 7px 7px / calc(100% - 14px) calc(100% - 14px) no-repeat;
          mask:
    radial-gradient(circle, #0000 4px, #000 4.5px) -7px -7px / 14px 14px round,
    linear-gradient(#000 0 0) 7px 7px / calc(100% - 14px) calc(100% - 14px) no-repeat;
}
.stamp-inner::before { /* printed frame */
  content: ""; position: absolute; inset: 14px; z-index: -1;
  border: 1px solid var(--line-2);
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in oklab, var(--accent) 5%, transparent) 10px 11px),
    color-mix(in oklab, var(--accent-soft) 50%, var(--surface));
}
:root[data-theme="dark"] .stamp { filter: drop-shadow(0 12px 22px rgba(0,0,0,.5)); }
.stamp-top { display: flex; gap: .6em; padding-right: 64px; font-size: .6875rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.stamp h3 { margin: 22px 0 6px; font: 400 clamp(2rem, 3vw, 2.5rem)/1 var(--serif); letter-spacing: -.02em; }
.stamp-prog { margin: 0; font-weight: 600; font-size: .9rem; color: var(--accent); }
.stamp-desc { margin: 10px 0 0; font-size: .875rem; color: var(--ink-2); line-height: 1.5; }
.postmark {
  position: absolute; right: -14px; top: -18px;
  width: 92px; height: 92px;
  color: var(--accent);
  opacity: .55;
  transform: rotate(-18deg);
  mix-blend-mode: multiply;
  pointer-events: none;
}
.postmark circle { fill: none; stroke: currentColor; stroke-width: 1.6; }
.postmark text { fill: currentColor; font: 700 9px/1 var(--sans); letter-spacing: 1.4px; }
:root[data-theme="dark"] .postmark { mix-blend-mode: screen; }
@media (hover: hover) and (pointer: fine) {
  .js .stamp.in.settled:hover { transform: rotate(0deg) translateY(-4px) scale(1.015); }
}
/* stamp reveal: pressed onto the page */
.js .stamp { opacity: 0; transform: rotate(calc(var(--r) * 3)) scale(1.08); }
.js .stamp.in {
  opacity: 1; transform: rotate(var(--r));
  transition: opacity 350ms ease, transform 600ms cubic-bezier(.34, 1.4, .64, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js .stamp.in.settled { transition: transform 450ms var(--ease-drawer); transition-delay: 0ms; }
.js .stamp .postmark { opacity: 0; transform: rotate(-40deg) scale(1.3); transition: opacity 300ms ease, transform 500ms var(--ease-out); }
.js .stamp.in .postmark { opacity: .55; transform: rotate(-18deg) scale(1); transition-delay: calc(var(--i, 0) * 70ms + 260ms); }

.eyp {
  margin: 36px 0 0;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 20px 12px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: .95rem; color: var(--ink-2);
}
.eyp strong { color: var(--ink); font-weight: 600; }
.eu-mark { width: 30px; height: 30px; border-radius: 50%; background: #1f3d99; position: relative; flex: none; }
.eu-mark::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  background: radial-gradient(circle, #f5c518 1.3px, transparent 1.6px) 0 0 / 6.6px 6.6px;
  -webkit-mask: radial-gradient(circle, transparent 5.5px, #000 6px, #000 9px, transparent 9.5px);
          mask: radial-gradient(circle, transparent 5.5px, #000 6px, #000 9px, transparent 9.5px);
}

/* More about — bento */
.more-about { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.panel {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.langs { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 18px; }
.lang-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.lang-name { font: 400 1.5rem/1 var(--serif); letter-spacing: -.01em; }
.lang-lvl { font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.cefr { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.cefr i { height: 8px; border-radius: 4px; background: var(--line-2); position: relative; overflow: hidden; }
.cefr i::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 500ms var(--ease-out);
}
.panel.in .cefr i:nth-child(1)::after { --n: 1; }
.panel.in .cefr i:nth-child(2)::after { --n: 2; }
.panel.in .cefr i:nth-child(3)::after { --n: 3; }
.panel.in .cefr i:nth-child(4)::after { --n: 4; }
.panel.in .cefr i:nth-child(5)::after { --n: 5; }
.panel.in .cefr i:nth-child(6)::after { --n: 6; }
.panel.in .lang .cefr i::after {
  transform: scaleX(clamp(0, calc(var(--lvl) - var(--n) + 1), 1));
  transition-delay: calc(var(--n) * 60ms + 200ms);
}
.cefr-legend { margin: 10px 0 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; font-size: .6875rem; font-weight: 600; color: var(--ink-3); letter-spacing: .06em; }
.chips { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips-soft li { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.panel-title { margin: 18px 0 0; font: 400 1.9rem/1.1 var(--serif); letter-spacing: -.02em; }
.panel-title span { font: 500 .8125rem/1 var(--sans); color: var(--ink-3); letter-spacing: 0; margin-left: 6px; }
.panel-text { margin: 12px 0 0; color: var(--ink-2); font-size: .95rem; }

/* Contact */
.contact {
  max-width: var(--maxw);
  margin: clamp(5rem, 11vw, 9rem) auto 0;
  padding: 0 var(--gutter);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.contact-title {
  margin: 18px 0 0;
  font: 400 clamp(3.4rem, 10vw, 8.5rem)/.92 var(--serif);
  letter-spacing: -.04em;
}
.contact-title em { color: var(--accent); }
.contact-sub { margin: 24px 0 0; color: var(--ink-2); max-width: 32rem; font-size: 1.05rem; }
.contact-actions {
  margin-top: 36px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 24px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  max-width: 100%;
}
.email {
  font-size: clamp(1rem, 2.4vw, 1.3rem); font-weight: 600; letter-spacing: -.015em;
  text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size 300ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .email:hover { background-size: 100% 1.5px; } }
.copy {
  position: relative; flex: none;
  height: 46px; min-width: 104px; padding: 0 18px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: .875rem; font-weight: 600;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform 160ms var(--ease-out), background-color 250ms ease;
  -webkit-tap-highlight-color: transparent;
}
.copy:active { transform: scale(.96); }
.copy > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 6px; transition: opacity 200ms ease, transform 300ms var(--ease-out), filter 200ms ease; }
.copy svg { width: 16px; height: 16px; }
.copy-done { opacity: 0; transform: translateY(8px); filter: blur(3px); }
.copy.done { background: var(--live); color: #fff; }
.copy.done .copy-label { opacity: 0; transform: translateY(-8px); filter: blur(3px); }
.copy.done .copy-done { opacity: 1; transform: none; filter: none; }
.contact-foot { margin: 28px 0 0; font-size: .875rem; color: var(--ink-3); }

.footer {
  max-width: var(--maxw);
  margin: clamp(5rem, 10vw, 8rem) auto 0;
  padding: 28px var(--gutter) max(28px, env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line);
  font-size: .8125rem; color: var(--ink-3);
}

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); filter: blur(4px); }
.js .reveal.in {
  opacity: 1; transform: none; filter: none;
  transition: opacity 700ms var(--ease-out), transform 800ms var(--ease-out), filter 700ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 112px; min-height: 0; }
  .hero-portrait { order: -1; width: min(78%, 330px); }
  .hero::after { width: 90%; right: 5%; top: 4%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .about, .experience { grid-template-columns: 1fr; }
  .section-head.sticky { position: static; }
  .edu-grid, .stamps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav-links a { padding: 9px 10px; font-size: .8125rem; }
  .nav-cta span { display: none; }
  .nav-cta { padding: 0; width: 38px; justify-content: center; }
  .hero-name .italic { padding-left: .3em; }
  .now-card { left: -4%; bottom: 4%; padding: 10px 14px 11px; }
  .now-role { font-size: 1.05rem; }
  .btn { flex: 1 1 auto; }
  .about-cols, .more-about, .edu-grid, .stamps { grid-template-columns: 1fr; }
  .edu { min-height: 0; }
  .timeline { padding-left: 26px; }
  .role { padding: 22px 20px 20px; }
  .role::before { left: -26px; width: 14px; height: 14px; }
  .rail { left: 6px; }
  .contact-actions { padding-left: 18px; }
  .postmark { right: -6px; width: 80px; height: 80px; }
  .footer { flex-direction: column; gap: 4px; }
}
@media (max-width: 440px) {
  .nav-links a[href="#education"], .nav-links a[href="#about"] { display: none; }
  .nav { gap: 4px; padding: 5px; }
  .nav-links a { padding: 9px 8px; font-size: .8rem; }
  .nav-mark { display: none; }
  .nav-sep { display: none; }
}
@media (max-width: 370px) {
  .nav-links a { padding: 9px 6px; font-size: .75rem; }
  .nav-cta { width: 34px; height: 34px; }
}

/* ---------- Accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }
  .js .reveal, .js .reveal.in { transform: none; filter: none; transition: opacity 300ms ease; }
  .js .stamp, .js .stamp.in, .js .stamp.in.settled:hover { transform: rotate(var(--r)); transition: opacity 300ms ease; }
  .js .stamp .postmark, .js .stamp.in .postmark { transform: rotate(-18deg); transition: opacity 300ms ease; }
  .arch { transform: none !important; }
  .status-dot { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav, .now-card { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0,0,0,.35); --line-2: rgba(0,0,0,.5); --ink-2: var(--ink); }
}

/* ---------- Theme toggle (segmented switch) ---------- */
.nav-sep { flex: none; width: 1px; height: 20px; margin: 0 4px 0 2px; background: var(--line-2); }
.theme-toggle {
  --track: rgba(23, 22, 27, .06);
  --thumb: #ffffff;
  flex: none;
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  width: 68px; height: 38px; padding: 4px;
  border: 0; border-radius: 999px;
  background: var(--track);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out);
}
:root[data-theme="dark"] .theme-toggle { --track: rgba(255, 255, 255, .06); --thumb: #2c2a36; }
.theme-toggle:active { transform: scale(.96); }
.tt-thumb {
  position: absolute; left: 4px; top: 4px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--thumb);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform 380ms var(--ease-drawer);
}
:root[data-theme="dark"] .tt-thumb { transform: translateX(30px); }
.theme-toggle svg {
  position: relative; justify-self: center;
  width: 16px; height: 16px;
  color: var(--ink-3);
  transition: color 250ms ease, transform 380ms var(--ease-drawer);
}
:root:not([data-theme="dark"]) .tt-sun { color: var(--gold); transform: rotate(45deg); }
:root[data-theme="dark"] .tt-moon { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover svg { color: var(--ink-2); }
  :root:not([data-theme="dark"]) .theme-toggle:hover .tt-sun { color: var(--gold); }
  :root[data-theme="dark"] .theme-toggle:hover .tt-moon { color: var(--ink); }
}

/* Smooth theme switch: the colour tokens themselves animate on :root, and every
   element reads them in the same frame — so the whole page changes in lockstep
   (no per-element transitions that lag behind inherited colours). */
@property --bg { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --bg-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --surface { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink-3 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --line { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --line-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-ink { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-soft { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --gold { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --live { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --glass { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --track { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --thumb { syntax: '<color>'; inherits: true; initial-value: transparent; }
:root.theme-anim { transition: --bg 400ms ease, --bg-2 400ms ease, --surface 400ms ease, --ink 400ms ease, --ink-2 400ms ease, --ink-3 400ms ease, --line 400ms ease, --line-2 400ms ease, --accent 400ms ease, --accent-ink 400ms ease, --accent-soft 400ms ease, --gold 400ms ease, --live 400ms ease, --glass 400ms ease; }
:root.theme-anim .theme-toggle { transition: --track 400ms ease, --thumb 400ms ease, transform 160ms var(--ease-out); }
/* pause every other per-element transition during the switch so nothing trails behind */
.theme-anim *:not(.tt-thumb):not(.theme-toggle):not(.theme-toggle svg),
.theme-anim *::before, .theme-anim *::after { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .tt-thumb, .theme-toggle svg { transition: none; }
}
