/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Ibraheem Taha — portfolio stylesheet
   Brand:  #0077B5 (blue) · #00B4D8 (cyan) · #0A1628 (navy)
   Type:   Inter (UI + reading) · JetBrains Mono (labels, dates)
   Themes: follow the visitor's OS setting by default
           (prefers-color-scheme); the header picker can force light
           or dark (html[data-theme]). The hero, contact band and
           footer stay dark navy in both themes.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --brand: #0077b5;
  --brand-strong: #005f92;
  --brand-soft: rgba(0, 119, 181, 0.1);
  --accent: #00b4d8;
  --navy: #0a1628;
  --navy-deep: #060e1b;
  --on-dark: #e8eef6;
  --on-dark-muted: #9fb0c6;

  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0b1526;
  --text: #37445a;
  --muted: #5f6e84;
  --link: #0068a0;
  --eyebrow: #0070aa;
  --tag-bg: #eef5fb;
  --tag-border: #d5e5f2;
  --tag-text: #16486b;
  --tag-core-bg: #e3f1fb;
  --tag-core-border: #b9d9ef;
  --success-bg: #e8f7ef;
  --success-text: #146c43;
  --success-border: #a7dcc0;
  --error-bg: #fdecec;
  --error-text: #a11d1d;
  --error-border: #f3bcbc;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 12px 28px -8px rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 30px 60px -16px rgba(15, 23, 42, 0.3);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --header-h: 68px;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-soft: rgba(56, 170, 230, 0.14);
    --bg: #0a111e;
    --bg-alt: #0d1626;
    --surface: #111b2d;
    --surface-2: #152137;
    --border: #1f2b42;
    --border-strong: #2c3b58;
    --ink: #f1f5fb;
    --text: #c4cfde;
    --muted: #94a3b8;
    --link: #62c3f2;
    --eyebrow: #5cc0ee;
    --tag-bg: #13233a;
    --tag-border: #213756;
    --tag-text: #bcd9ef;
    --tag-core-bg: #16304f;
    --tag-core-border: #27507a;
    --success-bg: #0f2a1e;
    --success-text: #7ee2ae;
    --success-border: #1f5a3d;
    --error-bg: #2d1414;
    --error-text: #ffa4a4;
    --error-border: #6b2626;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 14px 30px -10px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 30px 60px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --brand-soft: rgba(56, 170, 230, 0.14);
  --bg: #0a111e;
  --bg-alt: #0d1626;
  --surface: #111b2d;
  --surface-2: #152137;
  --border: #1f2b42;
  --border-strong: #2c3b58;
  --ink: #f1f5fb;
  --text: #c4cfde;
  --muted: #94a3b8;
  --link: #62c3f2;
  --eyebrow: #5cc0ee;
  --tag-bg: #13233a;
  --tag-border: #213756;
  --tag-text: #bcd9ef;
  --tag-core-bg: #16304f;
  --tag-core-border: #27507a;
  --success-bg: #0f2a1e;
  --success-text: #7ee2ae;
  --success-border: #1f5a3d;
  --error-bg: #2d1414;
  --error-text: #ffa4a4;
  --error-border: #6b2626;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 30px -10px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 60px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

::selection {
  background: rgba(0, 180, 216, 0.28);
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
  text-decoration: none;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s, border-color 0.18s, color 0.18s;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.btn-lg {
  min-height: 52px;
  padding: 0 24px;
  font-size: 16px;
}

.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #0a8ad0 0%, var(--brand) 55%, var(--brand-strong) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 20px -6px rgba(0, 119, 181, 0.55);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 12px 26px -6px rgba(0, 150, 220, 0.6);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(6px);
}

.btn-glass:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-outline:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.text-link .icon {
  transition: transform 0.2s var(--ease);
}

.text-link:hover {
  text-decoration: none;
}

.text-link:hover .icon {
  transform: translateX(3px);
}

.text-link-light {
  color: #cfe9f7;
  padding: 0 6px;
}

.text-link-light:hover {
  color: #fff;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: #e6eef8;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(7, 15, 29, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.brand:hover {
  text-decoration: none;
  color: #fff;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px -6px rgba(0, 180, 216, 0.7);
}

.brand-name {
  font-size: 16px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: block;
  padding: 8px 12px;
  border-radius: 9px;
  color: rgba(232, 240, 250, 0.78);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.18s, background-color 0.18s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
}

.nav-link.is-active {
  color: #fff;
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--brand));
}

.nav-menu-cv {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme picker: Light / Dark / System. No data-theme attribute = System. */
.theme-picker {
  position: relative;
}

.theme-toggle .icon {
  display: none;
}

:root:not([data-theme]) .theme-toggle .theme-icon-system,
:root[data-theme="light"] .theme-toggle .theme-icon-light,
:root[data-theme="dark"] .theme-toggle .theme-icon-dark {
  display: block;
}

.theme-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  display: grid;
  gap: 2px;
  min-width: 172px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #0d1a2f;
  box-shadow: 0 22px 44px -14px rgba(0, 0, 0, 0.7);
  animation: menu-in 0.16s var(--ease);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.theme-menu [role="menuitemradio"] {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #c9d6e6;
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
}

.theme-menu [role="menuitemradio"]:hover,
.theme-menu [role="menuitemradio"]:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.theme-menu [role="menuitemradio"]:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.theme-menu [aria-checked="true"] {
  color: #fff;
  font-weight: 600;
}

.theme-check {
  margin-left: auto;
  color: #7fdcf2;
  visibility: hidden;
}

.theme-menu [aria-checked="true"] .theme-check {
  visibility: visible;
}

.nav-toggle {
  display: none;
}

.nav-toggle .icon-close,
.site-header.is-open .nav-toggle .icon-open {
  display: none;
}

.site-header.is-open .nav-toggle .icon-close {
  display: block;
}

@media (max-width: 1079px) {
  .nav-toggle {
    display: inline-grid;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - var(--header-h) - env(safe-area-inset-top, 0px));
    height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px));
    background: #070f1d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0.2s;
  }

  .site-header.is-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav-link {
    padding: 13px 12px;
    font-size: 17px;
  }

  .nav-link.is-active {
    background: rgba(255, 255, 255, 0.06);
  }

  .nav-link.is-active::after {
    left: 0;
    right: auto;
    top: 12px;
    bottom: 12px;
    width: 3px;
    height: auto;
  }

  .nav-menu-cv {
    display: inline-flex;
    margin-top: 14px;
  }
}

@media (max-width: 639px) {
  .header-cv {
    display: none;
  }
}

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--header-h) + env(safe-area-inset-top, 0px) + clamp(40px, 7vw, 88px)) 0 clamp(36px, 5vw, 56px);
  background:
    radial-gradient(900px 520px at 88% 8%, rgba(0, 180, 216, 0.2), transparent 62%),
    radial-gradient(820px 520px at 6% 105%, rgba(0, 119, 181, 0.3), transparent 60%),
    linear-gradient(180deg, #071121 0%, var(--navy) 100%);
  color: var(--on-dark);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 65% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 70% at 65% 35%, #000 20%, transparent 75%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 7px 14px 7px 12px;
  border: 1px solid rgba(74, 222, 128, 0.28);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  color: #bbf7d0;
  font-size: 14px;
  font-weight: 500;
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(74, 222, 128, 0.55);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }

  80%,
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.hero-name {
  color: #fff;
  font-size: clamp(44px, 7.2vw, 84px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-role {
  margin: 18px 0 0;
  font-size: clamp(18px, 2.1vw, 23px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #7fdcf2 0%, #56b8ee 55%, #a6c8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role-sep {
  padding: 0 0.3em;
  opacity: 0.6;
}

@media (max-width: 639px) {
  .hero-role-sep {
    display: none;
  }

  .hero-role-alt {
    display: block;
  }
}

.hero-lead {
  max-width: 600px;
  margin: 18px 0 0;
  color: #b9c7d9;
  font-size: clamp(16.5px, 1.5vw, 18.5px);
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin-top: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.social-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #d5e2f0;
  transition: transform 0.18s var(--ease), background-color 0.18s, color 0.18s, border-color 0.18s;
}

.social-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  color: var(--on-dark-muted);
  font-size: 14.5px;
}

.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 400px);
  padding: 28px 0;
}

.portrait {
  position: relative;
  width: min(100%, 340px);
  margin-inline: auto;
  aspect-ratio: 1;
  padding: 5px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #00b4d8, #0077b5, #3a5bd9, #00b4d8);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.03), 0 30px 80px -20px rgba(0, 180, 216, 0.45);
}

.portrait::before {
  content: "";
  position: absolute;
  inset: -34px;
  z-index: -1;
  border-radius: 50%;
  border: 1px dashed rgba(127, 220, 242, 0.22);
}

.portrait img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0f2140;
  /* The source image carries its own decorative ring; zoom past it. */
  transform: scale(1.17);
  clip-path: circle(42.7% at 50% 50%);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(40px, 6vw, 72px) 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px;
}

.stat+.stat {
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.stat-value {
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #7fdcf2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  color: var(--on-dark-muted);
  font-size: 14px;
  line-height: 1.35;
}

@media (max-width: 859px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-visual {
    order: -1;
    justify-self: start;
    width: auto;
    padding: 0 0 0 14px;
  }

  .portrait {
    width: 168px;
    padding: 4px;
  }

  .portrait::before {
    inset: -14px;
  }

  .hero-status {
    margin-bottom: 18px;
  }
}

@media (max-width: 639px) {
  .hero {
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 32px);
  }

  .hero-grid {
    gap: 22px;
  }

  .hero-visual {
    padding-left: 8px;
  }

  .portrait {
    width: 112px;
    padding: 3px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.03), 0 16px 40px -12px rgba(0, 180, 216, 0.5);
  }

  .portrait::before {
    inset: -9px;
  }
}

@media (max-width: 719px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    padding: 18px;
  }

  .stat+.stat {
    border-left: 0;
  }

  .stat:nth-child(even) {
    border-left: 1px solid rgba(255, 255, 255, 0.09);
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.09);
  }
}

@media (max-width: 479px) {
  .hero-cta .btn {
    flex: 1 1 100%;
  }

  .hero-cta .text-link {
    margin-inline: auto;
  }

  .hero-location {
    margin-left: 4px;
  }
}

/* ── Organizations strip ────────────────────────────────────────── */
.orgs {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.orgs-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  padding-block: 22px;
}

.orgs-label {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.orgs-list {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 520px;
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.orgs-list li {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  opacity: 0.72;
}

@media (max-width: 639px) {
  .orgs-inner {
    gap: 10px;
    padding-block: 20px;
  }

  .orgs-list {
    gap: 6px 18px;
  }

  .orgs-list li {
    font-size: 14px;
  }
}

/* ── Sections ───────────────────────────────────────────────────── */
.section {
  position: relative;
  padding-block: clamp(72px, 9vw, 112px);
}

.section-alt {
  background: var(--bg-alt);
}

.section-flush {
  padding-top: 0;
}

.section-head {
  max-width: 740px;
  margin-bottom: clamp(32px, 4.5vw, 52px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--eyebrow);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--brand));
}

.eyebrow-light {
  color: #7fdcf2;
}

.section-title {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.section-sub {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(16.5px, 1.4vw, 18px);
  line-height: 1.6;
}

.subsection-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 700;
}

.subsection-title .icon {
  color: var(--brand);
}

/* ── Cards, tags, entries ───────────────────────────────────────── */
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
}

.card-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag,
.skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.tag-core {
  background: var(--tag-core-bg);
  border-color: var(--tag-core-border);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.badge-live {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.badge-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.entry-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.entry-org {
  margin: 4px 0 0;
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
}

:root[data-theme="dark"] .entry-org {
  color: var(--link);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .entry-org {
    color: var(--link);
  }
}

.entry-period {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.entry-summary {
  margin: 14px 0 0;
  color: var(--text);
}

/* Keep long timeline cards at a comfortable reading measure. */
.timeline .entry-summary,
.timeline .entry-bullets {
  max-width: 78ch;
}

.entry-bullets {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.entry-bullets li {
  position: relative;
  padding-left: 22px;
  line-height: 1.6;
}

.entry-bullets li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  transform: rotate(45deg);
}

.entry-bullets strong,
.entry-summary strong {
  color: var(--ink);
  font-weight: 650;
}

.entry .tags {
  margin-top: 18px;
}

/* ── About ──────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.about-main .section-title {
  max-width: 560px;
}

.prose {
  margin-top: 28px;
  font-size: 17px;
}

.prose p {
  line-height: 1.75;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose .lead {
  color: var(--ink);
  font-size: clamp(19px, 1.8vw, 22px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.about-side {
  display: grid;
  gap: 20px;
}

.info-card,
.interests-card {
  padding: 24px;
}

.info-list {
  display: grid;
  gap: 4px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.info-item+.info-item {
  border-top: 1px solid var(--border);
}

.info-icon,
.skill-icon,
.method-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
}

:root[data-theme="dark"] .info-icon,
:root[data-theme="dark"] .skill-icon {
  color: var(--link);
}

@media (prefers-color-scheme: dark) {

  :root:not([data-theme="light"]) .info-icon,
  :root:not([data-theme="light"]) .skill-icon {
    color: var(--link);
  }
}

.info-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
  line-height: 1.4;
}

.info-body a {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.info-body a:hover {
  color: var(--link);
}

.info-label,
.method-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  transition: color 0.18s, border-color 0.18s, background-color 0.18s;
}

.copy-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.copy-btn.is-copied {
  color: var(--success-text);
  border-color: var(--success-border);
  background: var(--success-bg);
}

.interest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.interest-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
}

.interest-list .icon {
  color: var(--brand);
}

:root[data-theme="dark"] .interest-list .icon {
  color: var(--link);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .interest-list .icon {
    color: var(--link);
  }
}

@media (max-width: 899px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Experience timeline ────────────────────────────────────────── */
.timeline {
  position: relative;
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 11px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--accent) 35%, var(--border-strong) 100%);
}

.tl-item {
  position: relative;
  padding-left: 44px;
}

.tl-item::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 4px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--brand);
  border-radius: 50%;
  background: var(--bg-alt);
}

.tl-item.is-current::before {
  background: var(--accent);
  border-color: var(--brand);
  box-shadow: 0 0 0 5px rgba(0, 180, 216, 0.2);
}

.entry {
  padding: clamp(20px, 2.6vw, 30px);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}

.entry:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 24px;
}

.entry-when {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 3px;
}

.entry-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--tag-core-border);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 15px;
}

.entry-callout:hover {
  text-decoration: none;
  border-color: var(--brand);
}

.entry-callout .icon {
  color: var(--brand);
}

.entry-callout .icon-end {
  margin-left: auto;
  transition: transform 0.2s var(--ease);
}

.entry-callout:hover .icon-end {
  transform: translateX(3px);
}

@media (max-width: 639px) {
  .timeline::before {
    left: 7px;
  }

  .tl-item {
    padding-left: 28px;
  }

  .tl-item::before {
    left: 0;
    width: 16px;
    height: 16px;
  }

  .entry-head {
    flex-direction: column-reverse;
  }

  .entry-when {
    padding-top: 0;
  }
}

/* ── Projects ───────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.4vw, 28px);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.project::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  opacity: 0;
  transition: opacity 0.25s;
}

.project:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.project:hover::before,
.project.is-featured::before {
  opacity: 1;
}

.project-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 12px;
}

.project-type {
  color: var(--eyebrow);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project .entry-title {
  font-size: 19px;
}

.project .entry-org {
  font-size: 14.5px;
}

.project-metric {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 6px 12px;
  border-radius: 9px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 14px;
  font-weight: 650;
}

.project .entry-bullets {
  font-size: 15.5px;
}

.project .entry-tags {
  margin-top: 18px;
}

.project-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 20px;
}

.project .entry-tags+.project-foot {
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

.contributors {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.contributors-label {
  width: 100%;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contributors a {
  color: var(--ink);
  font-weight: 550;
}

.contributors a:hover {
  color: var(--link);
}

@media (min-width: 860px) {
  .project.is-featured {
    grid-column: span 2;
  }
}

@media (min-width: 1080px) {
  .project.is-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-areas:
      "top    top"
      "title  bullets"
      "org    bullets"
      "metric bullets"
      "tags   bullets"
      "foot   foot";
    grid-template-rows: auto auto auto auto 1fr auto;
    column-gap: 48px;
    padding: 32px;
  }

  .project.is-featured .project-top {
    grid-area: top;
  }

  .project.is-featured .entry-title {
    grid-area: title;
    font-size: 26px;
    letter-spacing: -0.025em;
  }

  .project.is-featured .entry-org {
    grid-area: org;
  }

  .project.is-featured .project-metric {
    grid-area: metric;
    justify-self: start;
  }

  .project.is-featured .entry-bullets {
    grid-area: bullets;
    align-self: center;
    margin-top: 0;
    font-size: 16px;
  }

  .project.is-featured .entry-tags {
    grid-area: tags;
    align-self: start;
  }

  .project.is-featured .project-foot {
    grid-area: foot;
  }
}

@media (max-width: 859px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* Archive: the toggle fills the grid's last cell; the list opens below the grid. */
.archive-tile {
  display: flex;
}

.archive-toggle {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 20px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.archive-toggle:hover {
  border-color: var(--brand);
  border-style: solid;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.archive-count {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 10px 24px -10px rgba(0, 119, 181, 0.8);
}

.archive-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.archive-kicker {
  color: var(--eyebrow);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.archive-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.archive-hint {
  color: var(--muted);
  font-size: 14px;
}

.archive-arrow {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--brand);
  transition: transform 0.25s var(--ease);
}

.archive-toggle[aria-expanded="true"] .archive-arrow {
  transform: rotate(180deg);
}

.archive-toggle[aria-expanded="true"] {
  border-style: solid;
  border-color: var(--brand);
}

@media (min-width: 860px) {
  .archive-toggle {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: start;
    gap: 18px;
    min-height: 240px;
    padding: 32px;
    overflow: hidden;
    isolation: isolate;
  }

  /* Faint "stack of cards" motif so the tall tile doesn't read as empty. */
  .archive-toggle::before,
  .archive-toggle::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -40px;
    width: 58%;
    height: 34%;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transform: rotate(-8deg);
    transition: transform 0.35s var(--ease);
  }

  .archive-toggle::before {
    bottom: -2%;
    opacity: 0.55;
  }

  .archive-toggle::after {
    bottom: -18%;
    right: -20px;
    transform: rotate(-3deg);
    opacity: 0.8;
  }

  .archive-toggle:hover::before {
    transform: rotate(-11deg) translateY(-6px);
  }

  .archive-toggle:hover::after {
    transform: rotate(-5deg) translateY(-4px);
  }

  .archive-count {
    width: 64px;
    height: 64px;
    font-size: 26px;
  }

  .archive-label {
    font-size: 22px;
  }

  .archive-arrow {
    position: absolute;
    top: 24px;
    right: 24px;
  }
}

.archive-list {
  margin-top: 20px;
}

.archive-list.is-entering {
  animation: archive-in 0.35s var(--ease);
}

@keyframes archive-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project.is-compact {
  padding: 20px;
}

.project.is-compact .entry-title {
  font-size: 16.5px;
}

.project.is-compact .entry-bullets {
  gap: 6px;
  font-size: 14.5px;
}

.project.is-compact .tag {
  font-size: 12px;
  padding: 3px 9px;
}

@media (max-width: 1079px) {
  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .archive-grid {
    grid-template-columns: 1fr;
  }

  .archive-toggle {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .archive-count {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .archive-arrow {
    display: none;
  }

  .archive-label {
    font-size: 16.5px;
  }
}

/* ── Skills ─────────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}

.skill-group {
  grid-column: span 2;
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.skill-group:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.skill-group.skill-wide {
  grid-column: span 3;
}

.skill-group-title {
  margin: 16px 0 14px;
  font-size: 17px;
  font-weight: 700;
}

@media (max-width: 1079px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skill-group,
  .skill-group.skill-wide {
    grid-column: span 1;
  }

  .skill-group:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 639px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skill-group,
  .skill-group.skill-wide,
  .skill-group:last-child {
    grid-column: auto;
  }
}

/* ── Research ───────────────────────────────────────────────────── */
.research-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.research-intro {
  position: sticky;
  top: calc(var(--header-h) + 32px);
}

.research-facts {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.research-facts li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
}

.research-facts .icon {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.pub-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pub {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pub:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.pub-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.pub-year {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.pub-type {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pub-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.pub-authors {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 14.5px;
}

.pub-authors strong {
  color: var(--ink);
}

.pub-venue {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

@media (max-width: 959px) {
  .research-grid {
    grid-template-columns: 1fr;
  }

  .research-intro {
    position: static;
  }
}

@media (max-width: 519px) {
  .pub {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
  }

  .pub-meta {
    flex-direction: row;
    align-items: center;
  }

  .pub-year {
    font-size: 17px;
  }
}

/* ── Education & honors ─────────────────────────────────────────── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.edu-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.entry-degree {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--eyebrow);
  font-size: 12.5px;
  font-weight: 650;
}

.edu .entry-bullets {
  font-size: 15px;
}

.honors-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.honor {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
}

.honor-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #f7c948, #e0a526);
  color: #3d2a00;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 8px 18px -8px rgba(224, 165, 38, 0.8);
}

.honor-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.honor-title {
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.4;
}

.honor-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 959px) {
  .honors-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 859px) {
  .edu-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Contact ────────────────────────────────────────────────────── */
.contact {
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(700px 420px at 10% 0%, rgba(0, 180, 216, 0.16), transparent 60%),
    radial-gradient(700px 480px at 100% 100%, rgba(0, 119, 181, 0.28), transparent 60%),
    var(--navy);
  color: var(--on-dark);
}

.contact-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 20% 40%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 70% at 20% 40%, #000 10%, transparent 70%);
}

.contact .section-title {
  color: #fff;
}

.contact .section-sub {
  color: #b3c2d6;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.contact-methods {
  display: grid;
  gap: 10px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.contact .method-icon {
  background: rgba(0, 180, 216, 0.14);
  color: #7fdcf2;
}

.method-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.contact .method-label {
  color: var(--on-dark-muted);
}

.method-body a {
  color: #fff;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.method-body a:hover {
  color: #7fdcf2;
}

.copy-btn-light {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #c9d6e6;
}

.copy-btn-light:hover {
  color: #fff;
  border-color: rgba(127, 220, 242, 0.6);
  background: rgba(0, 180, 216, 0.14);
}

.map-card {
  position: relative;
  display: block;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  aspect-ratio: 16 / 5;
  background: #13233a;
}

.map-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  filter: saturate(0.6);
  transition: opacity 0.3s, transform 0.6s var(--ease), filter 0.3s;
}

.map-card:hover img {
  opacity: 0.9;
  filter: none;
  transform: scale(1.03);
}

.map-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(7, 15, 29, 0.85);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.map-card:hover {
  text-decoration: none;
}

.form-card {
  padding: clamp(22px, 3vw, 34px);
  box-shadow: var(--shadow-lg);
}

.form-card .card-title {
  font-size: 21px;
}

#contact-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.4;
  transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--muted);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(0, 119, 181, 0.16);
}

.form-feedback {
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 550;
}

.form-feedback.is-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.form-feedback.is-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

@media (max-width: 899px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 519px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  padding: 40px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--navy-deep);
  color: var(--on-dark-muted);
  font-size: 14px;
}

.footer-inner,
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.35;
}

.footer-brand strong {
  display: block;
  color: #fff;
  font-size: 15.5px;
}

.footer-tagline {
  font-size: 13.5px;
}

.footer-links {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  color: #c9d6e6;
  transition: color 0.18s, border-color 0.18s, background-color 0.18s;
}

.footer-links a:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.footer-bottom {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom a {
  color: #7fdcf2;
}

/* ── Floating CV button ─────────────────────────────────────────── */
.cv-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: none;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0a8ad0, var(--brand-strong));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 14px 30px -10px rgba(0, 119, 181, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
}

.cv-fab.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (max-width: 639px) {
  .cv-fab {
    display: inline-flex;
  }
}

/* ── Copy toast ─────────────────────────────────────────────────── */
#copy-toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  max-width: calc(100vw - 32px);
  padding: 11px 20px;
  border-radius: 999px;
  background: #0f2140;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14.5px;
  font-weight: 550;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}

#copy-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── CV dialog ──────────────────────────────────────────────────── */
.cv-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Header and action bar stay put; only the options scroll on short screens. */
.cv-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialog-in 0.25s var(--ease);
}

.cv-dialog::backdrop {
  background: rgba(4, 10, 20, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.cv-dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--border);
}

.cv-dialog-head h2 {
  font-size: 19px;
}

.cv-dialog-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.cv-dialog-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  color: #fff;
}

.cv-close {
  margin-left: auto;
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.cv-close:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.cv-dialog-body {
  display: grid;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px;
}

.cv-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
  cursor: pointer;
}

.cv-option-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cv-option .icon,
.cv-picker-label .icon {
  color: var(--brand);
}

.cv-option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cv-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cv-picker-actions {
  display: flex;
  gap: 4px;
}

.cv-picker-actions button {
  padding: 4px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--link);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.cv-picker-actions button:hover {
  background: var(--brand-soft);
}

.cv-section-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cv-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.cv-picker-item:hover {
  border-color: var(--brand);
}

.cv-picker-item:has(input:checked) {
  border-color: var(--tag-core-border);
  background: var(--brand-soft);
}

.cv-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.3;
}

.cv-dialog input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.cv-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--error-border);
  border-radius: 10px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 14px;
  font-weight: 550;
}

.cv-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--border);
}

@media (max-width: 479px) {
  .cv-section-picker {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cv-picker-item,
  .cv-option {
    padding-block: 9px;
  }

  .cv-dialog-head,
  .cv-dialog-body,
  .cv-dialog-foot {
    padding-inline: 18px;
  }

  .cv-dialog-head {
    padding-top: 18px;
  }

  .cv-dialog-icon {
    display: none;
  }

  .cv-dialog-foot {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .cv-dialog-foot .btn {
    flex: 1;
  }
}

.spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Scroll reveal ──────────────────────────────────────────────── */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── Privacy policy page ────────────────────────────────────────── */
.page-plain .site-header {
  background: rgba(7, 15, 29, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.page-plain .header-inner .back-link {
  color: #cfe9f7;
  font-size: 14.5px;
}

.page-plain .header-inner .back-link:hover {
  color: #fff;
}

.policy {
  max-width: 780px;
  margin-inline: auto;
  padding: calc(var(--header-h) + 56px) var(--gutter) 96px;
}

.policy h1 {
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.policy .last-updated {
  margin: 10px 0 40px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.policy h2 {
  margin: 40px 0 12px;
  font-size: 20px;
  font-weight: 700;
}

.policy p,
.policy li {
  font-size: 16px;
  line-height: 1.75;
}

.policy ul {
  padding-left: 22px;
}

.policy li {
  margin-bottom: 6px;
}

.policy strong {
  color: var(--ink);
}

.highlight-box {
  margin: 16px 0;
  padding: 18px 20px;
  border: 1px solid var(--tag-core-border);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: var(--brand-soft);
}

.highlight-box p {
  margin: 0;
}

/* ── Print ──────────────────────────────────────────────────────── */
@media print {

  .site-header,
  .cv-fab,
  .hero-cta,
  .hero-visual,
  .archive-toggle,
  .form-card,
  .map-card,
  .copy-btn,
  #copy-toast,
  .skip-link {
    display: none !important;
  }

  .hero,
  .contact,
  .site-footer {
    background: none !important;
    color: #000 !important;
    padding-top: 24px;
  }

  .hero-name,
  .contact .section-title,
  .stat-value,
  .hero-role {
    color: #000 !important;
    background: none !important;
    -webkit-text-fill-color: #000;
  }

  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  #earlier-projects {
    display: block !important;
  }

  .card {
    box-shadow: none !important;
    break-inside: avoid;
  }
}
