/* Muhammet Furkan Karakaya - site styles (v2)
   VT323 for the terminal identity, IBM Plex Sans for reading. */

@font-face {
  font-family: "VT323";
  src: url("/assets/fonts/vt323-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bg: #1c2238;
  --bg-2: #242c48;
  --surface: rgba(39, 47, 75, 0.82);
  --surface-solid: #262d47;
  --glass: rgba(33, 40, 66, 0.78);
  --line: rgba(160, 180, 220, 0.16);
  --line-strong: rgba(160, 180, 220, 0.3);
  --ink: #eaeef6;
  --text: #d3dae8;
  --muted: #aeb9cf;
  --accent: #86d0dd;
  --accent-2: #b9adf7;
  --on-accent: #14192c;
  --focus: #f3c37c;
  --tint: rgba(134, 208, 221, 0.12);
  --tint-strong: rgba(134, 208, 221, 0.2);
  --tint-2: rgba(185, 173, 247, 0.16);
  --orb-1: rgba(134, 208, 221, 0.16);
  --orb-2: rgba(185, 173, 247, 0.14);
  --orb-3: rgba(110, 160, 230, 0.12);
  --floater: rgba(134, 208, 221, 0.15);
  --fig-bg: #e7ebf3;
  --fig-dim: 0.94;
  --shadow: 0 18px 40px -24px rgba(4, 8, 20, 0.75);
  --shadow-lift: 0 28px 56px -26px rgba(4, 8, 20, 0.85);

  --display: "VT323", ui-monospace, "Courier New", monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 84rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 42rem;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef2f9;
    --bg-2: #e4eaf5;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #fbfcfe;
    --glass: rgba(250, 251, 254, 0.8);
    --line: rgba(40, 60, 100, 0.12);
    --line-strong: rgba(40, 60, 100, 0.22);
    --ink: #17213a;
    --text: #2b3652;
    --muted: #525e7a;
    --accent: #1a667a;
    --accent-2: #5b4bc4;
    --on-accent: #ffffff;
    --focus: #b85f00;
    --tint: rgba(29, 111, 130, 0.08);
    --tint-strong: rgba(29, 111, 130, 0.14);
    --tint-2: rgba(91, 75, 196, 0.1);
    --orb-1: rgba(80, 170, 195, 0.16);
    --orb-2: rgba(140, 120, 230, 0.13);
    --orb-3: rgba(90, 150, 230, 0.1);
    --floater: rgba(29, 111, 130, 0.12);
    --fig-bg: #ffffff;
    --fig-dim: 1;
    --shadow: 0 18px 40px -26px rgba(30, 50, 90, 0.3);
    --shadow-lift: 0 28px 56px -26px rgba(30, 50, 90, 0.38);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eef2f9;
  --bg-2: #e4eaf5;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #fbfcfe;
  --glass: rgba(250, 251, 254, 0.8);
  --line: rgba(40, 60, 100, 0.12);
  --line-strong: rgba(40, 60, 100, 0.22);
  --ink: #17213a;
  --text: #2b3652;
  --muted: #525e7a;
  --accent: #1a667a;
  --accent-2: #5b4bc4;
  --on-accent: #ffffff;
  --focus: #b85f00;
  --tint: rgba(29, 111, 130, 0.08);
  --tint-strong: rgba(29, 111, 130, 0.14);
  --tint-2: rgba(91, 75, 196, 0.1);
  --orb-1: rgba(80, 170, 195, 0.16);
  --orb-2: rgba(140, 120, 230, 0.13);
  --orb-3: rgba(90, 150, 230, 0.1);
  --floater: rgba(29, 111, 130, 0.12);
  --fig-bg: #ffffff;
  --fig-dim: 1;
  --shadow: 0 18px 40px -26px rgba(30, 50, 90, 0.3);
  --shadow-lift: 0 28px 56px -26px rgba(30, 50, 90, 0.38);
  color-scheme: light;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { color: var(--ink); }

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 0.2em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { text-decoration-color: currentColor; }

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

::selection { background: var(--tint-strong); color: var(--ink); }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- ambient background: soft light and floating icons ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.orb {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--orb-1), transparent);
  will-change: transform;
}
.orb-1 { top: -26vmax; left: -22vmax; animation: drift-a 38s ease-in-out infinite alternate; }
.orb-2 { top: 18vh; right: -30vmax; background: radial-gradient(closest-side, var(--orb-2), transparent); animation: drift-b 46s ease-in-out infinite alternate; }
.orb-3 { bottom: -34vmax; left: 12vw; background: radial-gradient(closest-side, var(--orb-3), transparent); animation: drift-c 54s ease-in-out infinite alternate; }

@keyframes drift-a { to { transform: translate(14vw, 12vh) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-16vw, -10vh) scale(0.9); } }
@keyframes drift-c { to { transform: translate(12vw, -14vh) scale(1.1); } }

.floater {
  position: absolute;
  width: var(--s);
  height: var(--s);
  color: var(--floater);
  animation: bob 12s ease-in-out infinite;
}
.floater svg { display: block; width: 100%; height: 100%; }
.f1 { --s: 66px; top: 14%; left: 3.5%; animation-duration: 11s; }
.f2 { --s: 46px; top: 66%; left: 7%; animation-duration: 13s; animation-delay: -4s; }
.f3 { --s: 54px; top: 22%; right: 6%; animation-duration: 9s; animation-delay: -2s; }
.f4 { --s: 84px; top: 74%; right: 9%; animation-duration: 16s; animation-delay: -7s; }
.f5 { --s: 50px; top: 58%; left: 1.5%; animation-duration: 14s; animation-delay: -5s; }
.f6 { --s: 58px; top: 50%; right: 2%; animation-duration: 12s; animation-delay: -9s; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-22px) rotate(4deg); }
}

@media (max-width: 52rem) {
  .ambient .floater { width: calc(var(--s) * 0.62); height: calc(var(--s) * 0.62); }
  .ambient .f2, .ambient .f5 { display: none; }
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: 0.75rem;
}

.header-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.45rem 0.4rem 1.2rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
}

.logo {
  margin-right: auto;
  padding: 0.25rem 0;
  font-family: var(--display);
  font-size: 1.95rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.logo span { color: var(--accent); }
.logo:hover { color: var(--ink); }

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.98rem;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease, filter 0.25s ease;
}
.nav-list a:hover { color: var(--ink); background: var(--tint); }
.nav-list a.is-active,
.nav-list a[aria-current="page"] { color: var(--ink); background: var(--tint-strong); }
.nav-list a.nav-cv {
  margin-left: 0.3rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-weight: 600;
}
.nav-list a.nav-cv:hover { color: var(--on-accent); filter: brightness(1.07); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.icon-btn:hover { background: var(--tint); border-color: var(--line-strong); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }

.icon-sun { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .icon-moon { display: none; }
}

.menu-toggle { display: none; }
html:not(.js) .theme-toggle { display: none; }
.icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }

@media (max-width: 52rem) {
  .logo { font-size: 1.75rem; }
  .js .menu-toggle { display: inline-grid; }
  .js .site-nav {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 0;
    right: 0;
    padding: 0.6rem;
    border-radius: var(--r-lg);
    background: var(--surface-solid);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }
  .js .site-nav.open { opacity: 1; visibility: visible; transform: none; }
  .js .nav-list { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .js .nav-list a { min-height: 3rem; padding: 0.6rem 1rem; font-size: 1.05rem; border-radius: var(--r-md); }
  .js .nav-list a.nav-cv { margin: 0.35rem 0 0; justify-content: center; }

  html:not(.js) .header-bar { flex-wrap: wrap; border-radius: var(--r-lg); padding: 0.6rem 0.8rem; }
  html:not(.js) .site-nav { order: 3; width: 100%; }
  html:not(.js) .nav-list { flex-wrap: wrap; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.65rem 1.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 500 1rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, filter 0.25s ease;
}
.btn svg { width: 1.1rem; height: 1.1rem; flex: none; }
.btn:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: var(--shadow); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-weight: 600;
}
.btn-primary:hover { color: var(--on-accent); border-color: transparent; filter: brightness(1.07); }
.btn[aria-expanded="true"] { border-color: var(--accent); background: var(--tint-strong); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 6rem) clamp(3rem, 7vw, 5.5rem);
}
@media (min-width: 56rem) {
  .hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr); }
}

.name {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.7rem, 8.6vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
.cursor { color: var(--accent); animation: blink 1.1s steps(1, end) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.role {
  margin: 0 0 1.25rem;
  min-height: 1.45em;
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--accent);
}
@media (max-width: 30rem) { .role { min-height: 2.9em; } }
.caret {
  display: inline-block;
  width: 0.5ch;
  height: 1.05em;
  margin-left: 0.12em;
  vertical-align: -0.15em;
  border-radius: 1px;
  background: currentColor;
  animation: blink 1s steps(1, end) infinite;
}

.lede {
  max-width: 38rem;
  margin: 0;
  font-size: clamp(1.06rem, 1.4vw, 1.15rem);
  color: var(--text);
}

.actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.9rem;
}

.email-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  z-index: 30;
  width: min(20rem, 100%);
  padding: 0.55rem;
  border-radius: var(--r-md);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lift);
  animation: pop 0.18s ease-out;
}
.email-menu[hidden] { display: none; }
.email-addr {
  margin: 0.25rem 0.7rem 0.45rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.97rem;
  overflow-wrap: anywhere;
}
.email-menu a,
.email-menu button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.8rem;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.email-menu a:hover,
.email-menu button:hover { background: var(--tint); }
.email-menu svg { width: 1.15rem; height: 1.15rem; flex: none; color: var(--accent); }
.copy-status {
  min-height: 1.4em;
  margin: 0.25rem 0.7rem 0.1rem;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 500;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.facts {
  display: grid;
  margin: 2.4rem 0 0;
  padding: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.facts div { padding: 0.95rem 1.2rem; }
.facts div + div { border-top: 1px solid var(--line); }
@media (min-width: 40rem) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts div + div { border-top: 0; border-left: 1px solid var(--line); }
}
.facts dt { margin-bottom: 0.15rem; color: var(--muted); font-size: 0.88rem; font-weight: 500; }
.facts dd { margin: 0; color: var(--ink); font-size: 0.98rem; font-weight: 500; line-height: 1.45; }

.hero-photo {
  position: relative;
  justify-self: center;
  width: min(100%, 24rem);
  animation: float-photo 8s ease-in-out infinite;
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -6%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--tint-strong), transparent);
}
@media (max-width: 55.99rem) { .hero-photo { width: min(100% - 2.5rem, 19rem); } }

.portrait {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.portrait:focus-visible { outline-offset: 10px; border-radius: 30px; }
.portrait-frame {
  display: block;
  padding: 7px;
  border-radius: 30px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-lift);
  transform: rotate(3deg);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.portrait img {
  width: 100%;
  border-radius: 24px;
  filter: grayscale(1);
  transition: filter 0.7s ease;
}
@media (hover: hover) {
  .portrait:hover .portrait-frame { transform: rotate(0deg) scale(1.025); }
  .portrait:hover img { filter: grayscale(0); }
}
.portrait[aria-pressed="true"] .portrait-frame { transform: rotate(0deg) scale(1.025); }
.portrait[aria-pressed="true"] img { filter: grayscale(0); }

@keyframes float-photo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-head { margin-bottom: 2.25rem; }
@media (min-width: 64rem) {
  .section {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
  }
  .section-head { position: sticky; top: 7rem; margin-bottom: 0; }
}

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.7rem, 5vw, 3.7rem);
  line-height: 1;
}
.section-title .prompt { color: var(--accent); }
.section-title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 4px;
  margin-top: 1rem;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.section-head p { max-width: 22rem; margin: 1rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
@media (min-width: 64rem) {
  .section-title { font-size: 3.3rem; white-space: nowrap; }
}

.card {
  padding: clamp(1.25rem, 2.6vw, 1.85rem);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease,
    opacity 0.7s ease var(--d, 0s), translate 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s);
}
@media (hover: hover) {
  .card.lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
    border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  }
}

.sub {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 3rem 0 1.25rem;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}
.sub::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}
.section-body > .sub:first-child { margin-top: 0; }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15rem; }
.prose p:last-child { margin-bottom: 0; }

/* about */
.about-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 74rem) { .about-grid { grid-template-columns: minmax(0, 1fr) 21.5rem; gap: 3rem; } }

.edu-card h3 { margin: 0 0 1.1rem; font-size: 1.15rem; font-weight: 600; }
.edu { display: grid; gap: 1.05rem; margin: 0; padding: 0; list-style: none; }
.edu li { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 0.85rem; align-items: start; }
.edu .year { padding-top: 0.05rem; font-family: var(--display); font-size: 1.75rem; line-height: 1; color: var(--accent); }
.edu strong { display: block; color: var(--ink); font-weight: 600; line-height: 1.4; }
.edu .school { display: block; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }

.skills { display: grid; gap: 1rem; }
@media (min-width: 44rem) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 82rem) { .skills { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.skill-group h4 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.85rem;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
}
.skill-group h4 svg { width: 1.35rem; height: 1.35rem; flex: none; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: var(--tint);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* experience timeline */
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  top: 1.2rem;
  bottom: 1.2rem;
  left: 0.52rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2) 70%, transparent);
  opacity: 0.6;
}
.tl-item { position: relative; padding-left: 2.35rem; }
.tl-item + .tl-item { margin-top: 1.25rem; }
.tl-item::before {
  content: "";
  position: absolute;
  top: 1.75rem;
  left: 0;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 5px var(--tint);
}
.tl-card h3 { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.4; }
.tl-org { margin: 0.25rem 0 0; color: var(--text); font-size: 0.98rem; line-height: 1.5; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.7rem 0 0; padding: 0; list-style: none; }
.tl-meta li {
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  background: var(--tint-2);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.5;
}
.tl-points { max-width: 46rem; margin: 1rem 0 0; padding-left: 1.15rem; }
.tl-points li { margin-bottom: 0.4rem; }
.tl-points li:last-child { margin-bottom: 0; }
.tl-points li::marker { color: var(--accent); }
@media (min-width: 82rem) {
  .tl-card { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 0 2.25rem; }
  .tl-points { margin-top: 0; }
}

/* research */
.papers { display: grid; gap: 1.25rem; }
.paper-grid { display: grid; gap: 1.25rem; }
@media (min-width: 52rem) { .paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.more-papers { margin-top: 1.25rem; }

.paper h4 { margin: 0 0 0.55rem; font-size: 1.14rem; font-weight: 600; line-height: 1.45; }
.paper .authors { margin: 0; font-size: 0.98rem; }
.paper .authors strong { color: var(--accent); font-weight: 600; }
.status {
  display: inline-block;
  margin: 0.75rem 0 0;
  padding: 0.22rem 0.75rem;
  border-radius: 12px;
  background: var(--tint-2);
  color: var(--ink);
  font-size: 0.87rem;
  font-weight: 500;
  line-height: 1.5;
}

.paper.featured { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 74rem) { .paper.featured { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.25rem; } }

.fig { margin: 0; }
.fig-box {
  padding: 0.7rem;
  border-radius: var(--r-md);
  background: var(--fig-bg);
  border: 1px solid var(--line);
}
.fig-box img { width: 100%; border-radius: 9px; filter: brightness(var(--fig-dim)); }
.fig.tall .fig-box { max-width: 23rem; margin-inline: auto; }
.fig figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

details { margin-top: 1.1rem; }
summary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.6rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.2s ease;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.25s ease;
}
details[open] > summary::before { transform: translateY(2px) rotate(-135deg); }
summary:hover { background: var(--tint); }
details[open] .when-closed,
details:not([open]) .when-open { display: none; }
details > p { max-width: var(--measure); margin: 1rem 0 0; font-size: 0.99rem; }
details[open] > p { animation: fade-in 0.35s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- reveal on scroll (enabled by site.js) ---------- */
.reveal-on .reveal { opacity: 0; translate: 0 18px; }
.reveal-on .reveal.in { opacity: 1; translate: none; }
.reveal:nth-child(2) { --d: 0.07s; }
.reveal:nth-child(3) { --d: 0.14s; }
.reveal:nth-child(4) { --d: 0.21s; }
.reveal:nth-child(5) { --d: 0.28s; }
.reveal:nth-child(6) { --d: 0.35s; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 1rem;
  padding-block: 2.25rem 3rem;
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.footer-line { margin: 0; font-family: var(--display); font-size: 1.55rem; line-height: 1.2; color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.3rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.footer-links a:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); background: var(--tint); }

.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 40;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background-color 0.25s ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--tint-strong); color: var(--ink); }
.to-top svg { width: 1.25rem; height: 1.25rem; }

/* ---------- inner pages (cv, privacy, 404) ---------- */
.page { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5.5rem); }
.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.8rem, 6vw, 4.3rem);
  line-height: 1;
}
.page-head h1 .prompt { color: var(--accent); }
.page-head p { max-width: var(--measure); margin: 0.8rem 0 0; color: var(--muted); }

.cv-bar { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.75rem 0; }
.cv-viewer {
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: #ffffff;
  box-shadow: var(--shadow-lift);
}
.cv-frame { display: block; width: 100%; height: 84vh; min-height: 36rem; border: 0; }
.cv-preview {
  display: none;
  max-width: 34rem;
  color: var(--ink);
  text-decoration: none;
}
.cv-preview img {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lift);
}
.cv-preview span { display: block; margin-top: 0.8rem; color: var(--accent); font-weight: 500; }
@media (max-width: 52rem), (pointer: coarse) {
  .cv-viewer { display: none; }
  .cv-preview { display: block; }
}

.page .prose-card { max-width: 52rem; margin-top: 2rem; }
.prose-card h2 { margin: 1.9rem 0 0.5rem; font-size: 1.2rem; font-weight: 600; }
.prose-card p { margin: 0 0 1rem; }
.prose-card ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.prose-card li { margin-bottom: 0.35rem; }
.prose-card li::marker { color: var(--accent); }

/* ---------- motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal-on .reveal { opacity: 1; translate: none; }
}

@media print {
  .ambient, .site-header, .site-footer, .actions, .skip, .to-top { display: none !important; }
  html, body { background: #ffffff; color: #000000; }
  .reveal-on .reveal { opacity: 1; translate: none; }
  .card { box-shadow: none; border-color: #cccccc; }
}
