/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --dark:         #1c1e2a;
  --accent:       #d4a843;
  --accent-dim:   #b8922e;
  --accent-glow:  rgba(212, 168, 67, 0.30);
  --white:        #ffffff;
  --text-main:    rgba(255, 255, 255, 0.88);
  --text-muted:   rgba(255, 255, 255, 0.50);
  --glass-bg:     rgba(10, 10, 10, 0.97);
  --glass-alt:    rgba(15, 15, 15, 0.97);
  --glass-card:   rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.10);
  --radius:       0.75rem;
  --radius-sm:    0.45rem;
}

/* ── UTOPICS wordmark fonts (URW Gothic Demi / Nimbus Sans — free, GPL) ── */
@font-face {
  font-family: 'URW Gothic Demi';
  src: url('fonts/URWGothic-Demi.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nimbus Sans';
  src: url('fonts/NimbusSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── UTOPICS wordmark: "O" = add-drop ring resonator ─────────── */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: 'URW Gothic Demi', sans-serif;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.012em;
  white-space: nowrap;
  color: var(--white);
}
.wordmark .o-slot {
  display: inline-block;
  width: 0.715em;
  height: 0.715em;
  margin: 0 0.006em;
  position: relative;
}
.wordmark .o-slot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.o-ring circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 11;
}
.o-ring line {
  stroke: currentColor;
  stroke-width: 11;
  stroke-linecap: round;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #0a0a0a;
  color: var(--text-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Raleway', sans-serif;
}

a { color: var(--accent); text-decoration: none; }

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

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  transition: background .3s, box-shadow .3s;
}

.navbar.scrolled {
  background: rgba(15, 15, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, .45);
}

.nav-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.2rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}

.nav-links a {
  color: rgba(255, 255, 255, .70);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .2s;
}

.nav-links a:hover { color: var(--accent); }

/* ── Nav dropdown ─────────────────────────────────────────────── */
.nav-item-dropdown { position: relative; }

/* Invisible bridge that fills the gap so the mouse doesn't lose hover */
.nav-item-dropdown::after {
  content: '';
  position: absolute;
  bottom: -.65rem;
  left: 0; right: 0;
  height: .65rem;
}

.nav-link--has-dropdown { display: inline-flex; align-items: center; gap: .28rem; }

.dropdown-chevron {
  width: 10px; height: 10px;
  transition: transform .2s;
  flex-shrink: 0;
}

.nav-item-dropdown:hover .dropdown-chevron,
.nav-item-dropdown:focus-within .dropdown-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: calc(100% + .6rem); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 220px; list-style: none;
  background: rgba(15,15,15,.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: .4rem 0;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  z-index: 300;
}

.nav-item-dropdown:hover .nav-dropdown,
.nav-item-dropdown:focus-within .nav-dropdown,
.nav-dropdown.open {
  opacity: 1; pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-link {
  display: block;
  padding: .52rem 1.1rem;
  font-size: .82rem;
  color: rgba(255,255,255,.70);
  white-space: nowrap;
  transition: color .2s, background .2s;
}

.nav-dropdown-link:hover {
  color: var(--accent);
  background: rgba(212,168,67,.08);
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: .35rem 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  -webkit-mask-image:
    linear-gradient(to right,  transparent 0%,  black 35%),
    linear-gradient(to bottom, transparent 0%,  black 8%, black 74%, transparent 100%);
  mask-image:
    linear-gradient(to right,  transparent 0%,  black 35%),
    linear-gradient(to bottom, transparent 0%,  black 8%, black 74%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.hero-bg-img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: right bottom;
  transform-origin: right bottom;
  animation: hero-zoom 12s ease-out forwards;
}

@keyframes hero-zoom {
  from { transform: scale(1.0); }
  to   { transform: scale(1.05); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to right,
    rgba(10,10,10,0.88) 0%,
    rgba(10,10,10,0.55) 28%,
    rgba(10,10,10,0.10) 48%,
    rgba(10,10,10,0.00) 62%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 7rem 2rem 5rem 8%;
  max-width: 800px;
}

@keyframes hero-slide-up {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.hero-eyebrow {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: .75rem;
  opacity: 0;
  min-height: 1.2em;
}

.hero-eyebrow.is-typing::after,
.hero-name.is-typing::after {
  content: '|';
  color: var(--accent);
  animation: cursor-blink .65s step-end infinite;
  margin-left: 1px;
}

.hero-name {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 200;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.75rem;
  opacity: 0;
  min-height: 1.2em;
  white-space: nowrap;
}

.hero-name-logo-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.hero-logo-sub-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-basis: 100%;
  width: 100%;
  text-align: center;
}

/* .hero-content's padding is asymmetric (8% left vs 2rem right) above 960px
   to make room for the photo, which shifts a naive centered block off-center
   from the readable text column; below 960px the padding is already
   symmetric, so no correction is needed there. */
@media (min-width: 961px) {
  .hero-logo-sub-block {
    margin-left: calc(-4vw + 1rem);
  }
}

.hero-logo-img {
  font-size: 4.2rem;
  display: block;
  opacity: 0;
}

.hero-logo-img.hero-logo--reveal {
  opacity: 0.92;
  transition: opacity 2.2s ease;
}

.hero-subtitle {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 200;
  color: rgba(255, 255, 255, .58);
  margin-top: 0.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.hero-subtitle.hero-subtitle--visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--dark);
  padding: .75rem 1.8rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: .95rem;
  transition: background .2s, transform .15s;
}

.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-2px);
  color: var(--dark);
}

.btn-outline {
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, .28);
  color: rgba(255, 255, 255, .78);
  padding: .73rem 1.8rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: .95rem;
  transition: border-color .2s, color .2s, transform .15s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ── Sections (shared) ───────────────────────────────────────── */
.section {
  padding: 5.5rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

/* First content section joins seamlessly with the hero fade */
#about { border-top: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Section title — typing animation ─────────────────────── */
.section-title {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(1.7rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.45rem; /* tight because .section-tag follows */
  position: relative;
  padding-bottom: .85rem;
  min-height: 1.3em;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 2.8rem; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-title.is-typing::before {
  content: '|';
  color: var(--accent);
  animation: cursor-blink .65s step-end infinite;
  margin-left: 2px;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Section tag (parenthetical) ─────────────────────────── */
.section-tag {
  font-size: .82rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: .04em;
  margin-bottom: 2.25rem;
}

/* ── Section intro (lead copy) ────────────────────────────── */
.section-intro {
  max-width: 680px;
  color: var(--text-muted);
  margin-bottom: 2.75rem;
  font-size: .97rem;
}

/* ── About ───────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.about-lead {
  font-size: 1.12rem;
  color: var(--white);
  font-weight: 500;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.about-text p {
  margin-bottom: 1rem;
  color: var(--text-main);
}

.about-list {
  list-style: none;
  margin: .75rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.about-list li {
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-main);
}

.about-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sidebar-card h3 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: .85rem;
  font-weight: 700;
}

.sidebar-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.sidebar-card li {
  font-size: .9rem;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Quick facts: left-aligned single-column items */
.facts-list li {
  justify-content: flex-start;
  gap: .5rem;
}

.lang-level {
  font-size: .76rem;
  color: var(--text-muted);
}

/* ── Text highlight ──────────────────────────────────────────── */
.text-highlight {
  color: var(--accent);
  font-weight: 600;
}

/* ── Timeline ────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2.25rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: .6rem; top: .4rem; bottom: .4rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(255,255,255,.10));
  border-radius: 2px;
}

.timeline-group-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1.4rem;
  padding-left: 0;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: none;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -2.25rem; top: 1.35rem;
  width: 13px; height: 13px;
  background: var(--accent);
  border: 3px solid rgba(15, 15, 15, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent);
}

/* Education entries: softer marker */
.timeline-marker--edu {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(15, 15, 15, 0.8);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.timeline-content {
  position: relative;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .25s, border-color .25s, box-shadow .25s;
}

.timeline-content:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(212, 168, 67, 0.35);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .3);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .85rem;
}

.job-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .15rem;
}

.job-company {
  display: block;
  font-size: .88rem;
  color: var(--accent);
  font-weight: 600;
}

.job-period {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: .15rem;
  flex-shrink: 0;
}

.timeline-content p {
  font-size: .93rem;
  color: var(--text-main);
}

/* ── Multiple roles within one company card ───────────────────── */
.role-entry {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.role-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .55rem;
}

/* ── Company logos in timeline cards ─────────────────────────── */
.job-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.company-logo {
  height: 46px;
  width: auto;
  max-width: 84px;
  object-fit: contain;
  flex-shrink: 0;
  filter: grayscale(1) invert(1);
  mix-blend-mode: screen;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.25s;
}

.timeline-content:hover .company-logo {
  opacity: 0.70;
}

/* ── Projects grid ────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── Project cards (shared) ───────────────────────────────────── */
.project-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease, box-shadow .25s, border-color .25s;
}

.project-card.visible {
  opacity: 1;
  transform: none;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
}

/* Clickable card (rendered as <a>) */
.project-card--clickable {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.project-card--clickable:hover {
  border-color: rgba(212, 168, 67, 0.35);
}

/* ── Card hover overlay ───────────────────────────────────────── */
.card-preview-overlay {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: .75rem; padding: 1.5rem; text-align: center;
  opacity: 0;
  transition: opacity .3s ease;
}

.project-card--clickable:hover .card-preview-overlay { opacity: 1; }

.preview-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  font-weight: 700;
}

.preview-text {
  font-size: .88rem;
  color: var(--text-main);
  line-height: 1.5;
}

.preview-cta {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: .35rem .9rem;
  border-radius: 2rem;
  margin-top: .25rem;
}

.project-card-header {
  padding: .65rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--glass-border);
}

.project-type-badge {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--accent);
}

/* ── GDSII visual ─────────────────────────────────────────────── */
.project-card--gdsii { background: #050508; }

.project-card--gdsii .project-card-visual {
  height: 175px;
  position: relative;
  overflow: hidden;
  background: #040406;
}

.gdsii-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212, 168, 67, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 168, 67, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
}

.gdsii-chip {
  position: absolute;
  inset: 18%;
  border: 1.5px solid rgba(212, 168, 67, 0.55);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gdsii-bus {
  position: absolute;
  background: rgba(212, 168, 67, 0.38);
}

.gdsii-bus--h { left: 0; right: 0; height: 1.5px; }
.gdsii-bus--v { top: 0;  bottom: 0; width: 1.5px; }

.gdsii-chip-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .58rem;
  color: rgba(212, 168, 67, 0.55);
  letter-spacing: .1em;
}

/* ── FDTD visual ──────────────────────────────────────────────── */
.project-card--fdtd { background: #020210; }

.fdtd-visual {
  height: 175px;
  display: flex;
  flex-direction: column;
  background: #020210;
}

.fdtd-field {
  flex: 1;
  background:
    radial-gradient(ellipse 55% 38% at 28% 50%, rgba(80, 155, 255, 0.75) 0%, transparent 70%),
    radial-gradient(ellipse 38% 28% at 72% 48%, rgba(255, 90, 70, 0.65)  0%, transparent 60%),
    radial-gradient(ellipse 30% 55% at 50% 18%, rgba(140, 70, 255, 0.40) 0%, transparent 60%),
    radial-gradient(ellipse 25% 25% at 80% 75%, rgba(60,  220, 180, 0.35) 0%, transparent 60%),
    #020210;
}

.fdtd-img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.fdtd-legend {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .75rem;
  background: rgba(0, 0, 0, 0.55);
}

.fdtd-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .55rem;
  color: var(--text-muted);
}

.fdtd-colorbar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #0033ff, #00aaff, #00ffaa, #aaff00, #ffcc00, #ff4400);
}

/* ── Code visual ──────────────────────────────────────────────── */
.project-card--code { background: #0d1117; }

.code-visual {
  height: 175px;
  background: #0d1117;
  padding: .9rem 1.1rem;
  overflow: hidden;
}

.code-block {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  line-height: 1.65;
  color: #c9d1d9;
  white-space: pre;
  overflow: hidden;
}

/* GitHub-style syntax colours */
.c-kw { color: #ff7b72; }  /* keywords   */
.c-fn { color: #d2a8ff; }  /* functions  */
.c-ty { color: #79c0ff; }  /* types      */
.c-nu { color: #79c0ff; }  /* numbers    */

/* ── Project card body ────────────────────────────────────────── */
.project-card-body {
  padding: 1.2rem 1.25rem 1.5rem;
  background: var(--glass-card);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.project-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
}

.project-card-body p {
  font-size: .84rem;
  color: var(--text-main);
  flex: 1;
}

.card-coming-soon-label {
  font-size: .72rem;
  color: var(--text-muted);
  letter-spacing: .05em;
  font-style: italic;
  flex: 1;
}

.project-tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}

.project-tags span {
  font-size: .66rem;
  font-weight: 600;
  padding: .18rem .55rem;
  border-radius: 1rem;
  border: 1px solid rgba(212, 168, 67, 0.35);
  color: var(--accent);
  letter-spacing: .02em;
}

/* ── PDK section ──────────────────────────────────────────────── */
.pdk-groups {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.pdk-group-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1.1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(212, 168, 67, 0.22);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 1rem;
}

/* ── Tool cards ───────────────────────────────────────────────── */
.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.05rem 1.2rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .45s ease, background .25s, border-color .25s;
}

.tool-card.visible {
  opacity: 1;
  transform: none;
}

.tool-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(212, 168, 67, 0.35);
}

.tool-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.tool-logo {
  width: 44px; height: 44px;
  flex-shrink: 0;
  object-fit: contain;
  filter: grayscale(1) invert(1);
  mix-blend-mode: screen;
  opacity: 0.50;
  transition: opacity 0.25s;
}

.tool-card:hover .tool-logo {
  opacity: 0.75;
}

/* Transparent-background SVG logos need a white backing so that
   the grayscale → invert → screen pipeline works identically to
   the JPEG logos (which already have a white background baked in). */
.tool-logo[src$=".svg"] {
  background: white;
  border-radius: var(--radius-sm);
  padding: 3px;
}

/* Pre-baked white line-art logos already match the monochrome
   treatment, so they skip the grayscale → invert → screen pipeline. */
.tool-logo--baked {
  filter: none;
  mix-blend-mode: normal;
}

/* Individual icon colours */
.tool-icon--python { background: rgba(55,  118, 171, .22); color: #4b8bbf; border: 1px solid rgba(55, 118, 171, .40); }
.tool-icon--gds    { background: rgba(212, 168,  67, .15); color: var(--accent); border: 1px solid rgba(212, 168, 67, .38); }
.tool-icon--kl     { background: rgba(100, 210, 140, .15); color: #64d28c; border: 1px solid rgba(100, 210, 140, .38); }
.tool-icon--ipk    { background: rgba(160, 100, 230, .15); color: #a064e6; border: 1px solid rgba(160, 100, 230, .38); }
.tool-icon--lum    { background: rgba(255, 120,  80, .15); color: #ff7850; border: 1px solid rgba(255, 120,  80, .38); }
.tool-icon--meep   { background: rgba( 80, 180, 255, .15); color: #50b4ff; border: 1px solid rgba( 80, 180, 255, .38); }
.tool-icon--t3d    { background: rgba(255,  80, 180, .15); color: #ff50b4; border: 1px solid rgba(255,  80, 180, .38); }
.tool-icon--fem    { background: rgba(255, 200,  60, .15); color: #ffc83c; border: 1px solid rgba(255, 200,  60, .38); }

.tool-info {
  display: flex;
  flex-direction: column;
  gap: .28rem;
}

.tool-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--white);
}

.tool-desc {
  font-size: .81rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Off-Chip hobbies ─────────────────────────────────────────── */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.hobby-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.6rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .45s ease, background .25s, border-color .25s;
}

.hobby-card.visible {
  opacity: 1;
  transform: none;
}

.hobby-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 168, 67, 0.28);
}

.hobby-icon {
  display: block;
  font-size: 1.9rem;
  margin-bottom: .75rem;
  line-height: 1;
}

.hobby-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .45rem;
}

.hobby-card p {
  font-size: .88rem;
  color: var(--text-main);
  line-height: 1.65;
}

a.hobby-card--clickable {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: block;
}

a.hobby-card--clickable:hover {
  border-color: rgba(212, 168, 67, 0.45);
}

.hobby-card-cta {
  display: inline-block;
  margin-top: .75rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s, transform .25s;
}

a.hobby-card--clickable:hover .hobby-card-cta {
  opacity: 1;
  transform: none;
}

/* ── Connect / Phase Match ────────────────────────────────────── */
.contact-container { text-align: center; }

.connect-intro {
  max-width: 600px;
  margin: 0 auto 2.75rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

/* Calendar area */
.calendar-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  margin-bottom: 3rem;
}

/* Book button */
.booking-btn {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  background: var(--accent);
  color: var(--dark);
  padding: 1rem 2.4rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
  box-shadow: 0 4px 22px var(--accent-glow);
  transition: background .2s, transform .15s, box-shadow .2s;
}

.booking-btn:hover {
  background: var(--accent-dim);
  color: var(--dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(212, 168, 67, 0.50);
}

.booking-hint {
  font-size: .8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Social links row */
.social-row {
  display: flex;
  justify-content: center;
  gap: .85rem;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .7rem 1.4rem;
  border: 2px solid rgba(212, 168, 67, 0.45);
  border-radius: 2rem;
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}

.contact-btn:hover {
  background: var(--accent);
  color: var(--dark);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ── CV download ─────────────────────────────────────────────── */
.cv-area {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 2rem;
  background: transparent;
  border: 2px solid rgba(212, 168, 67, 0.55);
  border-radius: 2rem;
  color: var(--accent);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .02em;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}

.cv-btn:hover {
  background: var(--accent);
  color: var(--dark);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.5rem;
  background: rgba(10, 10, 10, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: .83rem;
}

/* ── Project Detail Page ─────────────────────────────────────── */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.project-detail-page { animation: page-fade-in .4s ease; }

/* ── Project hero (like main hero, visual behind title) ──────── */
.project-hero {
  position: relative;
  min-height: 58vh;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--glass-border);
}

/* The CSS-generated visual that fills the right side */
.project-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to left, black 0%, black 28%, transparent 60%);
          mask-image: linear-gradient(to left, black 0%, black 28%, transparent 60%);
}

/* GDSII: golden grid */
.project-hero-bg--gdsii {
  background-image:
    linear-gradient(rgba(212, 168, 67, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 168, 67, 0.13) 1px, transparent 1px);
  background-size: 28px 28px;
  background-color: #040406;
}

/* Abstract ring-resonator chip drawn with pseudo-elements */
.project-hero-bg--gdsii::before {
  content: '';
  position: absolute;
  top: 22%; right: 6%; bottom: 22%; left: 54%;
  border: 1.5px solid rgba(212, 168, 67, 0.35);
  border-radius: 3px;
}

.project-hero-bg--gdsii::after {
  content: '';
  position: absolute;
  /* ring circle in the centre of the chip */
  width: 90px; height: 90px;
  top: 50%; left: 68%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(212, 168, 67, 0.45);
}

/* FDTD: field gradients */
.project-hero-bg--fdtd {
  background:
    radial-gradient(ellipse 45% 42% at 72% 50%, rgba(80, 155, 255, 0.55) 0%, transparent 65%),
    radial-gradient(ellipse 32% 28% at 86% 38%, rgba(255, 90,  70, 0.48) 0%, transparent 55%),
    radial-gradient(ellipse 28% 48% at 78% 15%, rgba(140, 70, 255, 0.38) 0%, transparent 55%),
    radial-gradient(ellipse 22% 32% at 90% 72%, rgba(60, 220, 180, 0.32) 0%, transparent 55%),
    radial-gradient(ellipse 40% 55% at 60% 60%, rgba(80, 155, 255, 0.18) 0%, transparent 70%),
    #020210;
}

/* Code: dark bg + faded code text on right */
.project-hero-bg--code {
  background: #0d1117;
}

/* Real device image — absolutely positioned above the overlay (z-index 2)
   so the dark gradient doesn't smother it; fades in from the left via mask */
.project-hero-device-img {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 62%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  z-index: 2;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 20%);
          mask-image: linear-gradient(to right, transparent 0%, black 20%);
}

/* Full-cover hero image — fills entire hero, no mask so whole area is used */
.project-hero-bg--fullcover {
  background-size: cover;
  background-position: center 42%;
  background-repeat: no-repeat;
  -webkit-mask-image: none !important;
          mask-image: none !important;
}

/* Softer overlay when the hero is a full-cover photograph */
.project-hero--fullcover .project-hero-overlay {
  background: linear-gradient(
    to right,
    rgba(10,10,10,0.85) 0%,
    rgba(10,10,10,0.55) 35%,
    rgba(10,10,10,0.30) 60%,
    rgba(10,10,10,0.20) 100%
  );
}

.code-hero-pre {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 48%;
  padding: 2.5rem 2rem;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  line-height: 1.7;
  color: rgba(201, 209, 217, 0.30);
  white-space: pre;
  pointer-events: none;
  user-select: none;
}

/* Gradient overlay: text side is fully dark, fades to transparent right */
.project-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to right,
    rgba(10,10,10,1.00) 0%,
    rgba(10,10,10,0.96) 30%,
    rgba(10,10,10,0.65) 52%,
    rgba(10,10,10,0.10) 72%,
    rgba(10,10,10,0.00) 85%
  );
  pointer-events: none;
}

.project-hero-content {
  position: relative;
  z-index: 3;
  padding: 7rem 2rem 4rem 8%;
  max-width: 680px;
}

.project-hero-content .project-detail-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .04em;
  transition: color .2s;
  margin-bottom: 1.25rem;
}

.project-hero-content .project-detail-back:hover { color: var(--accent); }

.project-hero-content .project-type-badge {
  display: inline-block;
  margin-bottom: .75rem;
}

.project-hero-title {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.12;
  margin-bottom: 1.2rem;
  min-height: 1.2em;
}

.project-detail {
  padding-top: 3.5rem;
  padding-bottom: 5rem;
}

.project-detail-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .83rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .04em;
  transition: color .2s;
  margin-bottom: 2.25rem;
}

.project-detail-back:hover { color: var(--accent); }

.detail-toolstack {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.detail-tool-tag {
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .65rem;
  border-radius: 1rem;
  border: 1px solid rgba(212, 168, 67, 0.35);
  color: var(--accent);
  letter-spacing: .02em;
}

/* Coming-soon banner */
.detail-status-banner {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: rgba(212, 168, 67, 0.10);
  border: 1px solid rgba(212, 168, 67, 0.30);
  border-radius: var(--radius-sm);
  padding: .75rem 1.1rem;
  font-size: .85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 2rem;
}

/* Detail sections */
.detail-section {
  margin-top: 2.75rem;
}

.detail-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: .10em;
  margin-bottom: 1.1rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid rgba(212, 168, 67, 0.22);
}

.detail-section p {
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: .85rem;
  text-align: justify;
  hyphens: none;
  overflow-wrap: break-word;
}

/* Code section — side-by-side layout */
.detail-code-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

/* Code block */
.detail-code-wrap {
  background: #0d1117;
  border-radius: var(--radius);
  overflow: auto;
  max-height: 500px;
  border: 1px solid var(--glass-border);
  position: relative;
}

/* Gradient: decorator + params + docstring (top 76%) stay clear;
   implementation body and helper function fade out below */
.detail-code-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    transparent  0%,
    transparent 74%,
    rgba(13,17,23,0.82) 83%,
    rgba(13,17,23,0.97) 100%
  );
  border-radius: var(--radius);
}

.detail-code-wrap pre {
  margin: 0;
  padding: 1.4rem 1.6rem;
  overflow: visible;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  line-height: 1.7;
}

/* Layout visual panel (GDS-style view) */
.detail-code-visual {
  background: #040406;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  position: relative;
  min-height: 260px;
}

/* Disable gradient when snippet is intentionally complete (no implementation body to hide) */
.detail-code-wrap--no-gradient::after { display: none; }

/* BentDC SVG schematic */
.bentdc-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Straight waveguide top-view illustration */
.swg-wrap {
  position: absolute;
  left: 8%; right: 8%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.swg-port {
  width: 2px;
  height: 22px;
  background: rgba(212, 168, 67, 0.55);
  flex-shrink: 0;
}

.swg-core {
  flex: 1;
  height: 7px;
  background: rgba(212, 168, 67, 0.72);
  border-radius: 1px;
  box-shadow: 0 0 14px rgba(212, 168, 67, 0.25);
}

.swg-label {
  position: absolute;
  bottom: .85rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: .55rem;
  color: rgba(212, 168, 67, 0.50);
  letter-spacing: .10em;
  white-space: nowrap;
}

/* Equations */
.detail-equation {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.4rem;
  margin-bottom: .75rem;
  overflow-x: auto;
  text-align: center;
  font-size: 1.05rem;
}

/* Paper-style: paragraph + figure side by side */
/* Float-right figure alongside paragraph text — no dead vertical space */
.detail-para-group {
  display: flow-root;   /* contains the float without extra markup */
  margin-bottom: 1.8rem;
}

.detail-fig-float {
  float: right;
  width: 36%;
  margin: .15rem 0 1rem 2rem;
  clear: right;
}

.detail-fig-float img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  display: block;
  cursor: zoom-in;
  transition: opacity .2s, box-shadow .2s;
}

.detail-fig-float img:hover {
  opacity: .85;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.detail-fig-float figcaption {
  margin-top: .5rem;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}

/* Full-width standalone figure (no adjacent text) */
.detail-fig-full {
  width: 100%;
  margin: 1.5rem 0 2rem;
}

.detail-fig-full img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  display: block;
  cursor: zoom-in;
  transition: opacity .2s, box-shadow .2s;
}

.detail-fig-full img:hover {
  opacity: .85;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.detail-fig-full figcaption {
  margin-top: .5rem;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  cursor: zoom-out;
}

.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .7);
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 1.6rem;
  color: rgba(255, 255, 255, .55);
  line-height: 1;
  cursor: pointer;
  transition: color .2s;
  user-select: none;
}
.lightbox-close:hover { color: var(--white); }

/* Gallery */
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.detail-gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.detail-gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.detail-gallery-item figcaption {
  padding: .5rem .75rem;
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--glass-card);
}

/* ── Characters ──────────────────────────────────────────────── */
.detail-characters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.detail-character {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.4rem;
  transition: border-color .25s;
}

.detail-character:hover {
  border-color: rgba(212, 168, 67, 0.3);
}

.detail-character-name {
  font-family: 'Raleway', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .35rem;
}

.detail-character-role {
  font-size: .85rem;
  color: var(--text-main);
  line-height: 1.55;
}

/* ── Terms of Service ────────────────────────────────────────── */
.detail-tos {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.detail-tos-clause {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  transition: border-color .25s;
}

.detail-tos-clause:hover {
  border-color: rgba(212, 168, 67, 0.3);
}

.detail-tos-title {
  font-family: 'Raleway', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .4rem;
}

.detail-tos-num {
  color: var(--accent);
  margin-right: .25rem;
}

.detail-tos-clause p {
  font-size: .85rem;
  color: var(--text-main);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */

/* ── Tablet ≤ 960px ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  /* Hero: below the desktop split layout, the portrait photo goes
     full-bleed behind centered, bottom-anchored text instead of
     sharing the row with it — avoids both the dead space that
     object-fit:contain left above a portrait image on tall/narrow
     viewports, and the wordmark landing on top of the face when the
     row wrapped at in-between widths. */
  .hero {
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1.5rem;
  }

  .hero-content {
    padding: 2rem 1.5rem 3rem;
    max-width: 100%;
    text-align: center;
  }

  .hero-bg-img {
    object-fit: cover;
    object-position: center;
  }

  .hero-bg {
    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 72%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 72%, transparent 100%);
  }

  .hero-overlay {
    background: linear-gradient(
      to top,
      rgba(10,10,10,0.96) 30%,
      rgba(10,10,10,0.62) 65%,
      rgba(10,10,10,0.22) 100%
    );
  }

  .hero-name-logo-row {
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
  }

  .hero-name {
    white-space: normal;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Tablet narrow ≤ 720px ───────────────────────────────────── */
@media (max-width: 720px) {
  .hero-logo-img {
    font-size: 2.7rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hobbies-grid {
    grid-template-columns: 1fr;
  }

  .detail-code-layout {
    grid-template-columns: 1fr;
  }

  .detail-code-visual { min-height: 180px; }

  .detail-fig-float {
    float: none;
    width: 100%;
    margin: 0 0 1.2rem 0;
  }
}

/* ── Mobile ≤ 640px ──────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Hero: full-bleed cover + stacked text handled in the ≤960px
     block above; nothing mobile-specific needed here right now. */

  /* Nav */
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: rgba(15,15,15,.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: .5rem 0 1rem;
  }

  .nav-links.open { display: flex; }

  .nav-links li a {
    display: block;
    padding: .75rem 2rem;
    font-size: 1rem;
  }

  /* Hide desktop dropdown & chevron on mobile */
  .nav-dropdown   { display: none !important; }
  .dropdown-chevron { display: none; }

  /* Project hero on mobile: full overlay, content centred */
  .project-hero { min-height: 50vh; align-items: flex-end; }
  .project-hero-content { padding: 2rem 1.5rem 3rem; max-width: 100%; }
  .project-hero-bg {
    -webkit-mask-image: linear-gradient(to top, black 0%, black 40%, transparent 80%);
            mask-image: linear-gradient(to top, black 0%, black 40%, transparent 80%);
  }
  .project-hero-overlay {
    background: linear-gradient(
      to top,
      rgba(10,10,10,0.97) 35%,
      rgba(10,10,10,0.72) 65%,
      rgba(10,10,10,0.28) 100%
    );
  }

  /* Sections */
  .section { padding: 4rem 1.25rem; }

  /* Timeline */
  .timeline { padding-left: 1.75rem; }
  .timeline-marker { left: -1.75rem; }

  .job-header {
    flex-direction: column;
    gap: .25rem;
  }

  .job-period { white-space: normal; }
  .timeline-content { padding: 1.2rem 1.25rem; }

  /* Tools */
  .tools-grid { grid-template-columns: 1fr; }

  /* Social row */
  .social-row {
    flex-direction: column;
    align-items: center;
  }

  .contact-btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  /* Booking button */
  .booking-btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
}
