/* =============================================================
   Syed Md Mehedi Hasan — Mechanical Engineering Portfolio
   Dark graphite / steel design system
   ============================================================= */

/* ---------------------------- 1. Tokens --------------------- */
:root {
  --bg:            #0e1214;
  --bg-deep:       #0a0d0f;
  --panel:         #141a1e;
  --panel-2:       #182027;
  --line:          #232c33;
  --line-2:        #303c45;

  --text:          #e8edf1;
  --text-2:        #aeb9c1;
  --text-3:        #7e8a93;

  --accent:        #e8963c;
  --accent-2:      #f2a755;
  --accent-ink:    #16100a;
  --accent-soft:   rgba(232, 150, 60, 0.12);

  --steel-line:    rgba(125, 158, 180, 0.075);
  --steel-line-2:  rgba(125, 158, 180, 0.14);

  --font-display: 'Barlow Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --container: 1180px;
  --header-h: 68px;
  --radius: 4px;
  --radius-lg: 8px;

  --ease: cubic-bezier(0.22, 0.68, 0.28, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.68;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }

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

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
}

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

.skip-link {
  position: fixed;
  top: -60px; left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 14px; }

/* ------------------------ 3. Blueprint layers ---------------- */
.blueprint {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background: var(--bg);
}
.blueprint__grid {
  position: absolute;
  inset: -20% 0 -20% 0;
  background-image:
    linear-gradient(var(--steel-line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--steel-line-2) 1px, transparent 1px),
    linear-gradient(var(--steel-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--steel-line) 1px, transparent 1px);
  background-size: 200px 200px, 200px 200px, 40px 40px, 40px 40px;
  transform: translate3d(0, var(--grid-shift, 0px), 0);
  will-change: transform;
}
.blueprint__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(10, 13, 15, 0.55) 100%);
}

.ambient-gears {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.ambient-gears .ambient-slot {
  position: absolute;
  opacity: 0.055;
}
.ambient-gears .ambient-slot--a { width: 560px; top: 4%;   right: -170px; }
.ambient-gears .ambient-slot--b { width: 420px; bottom: 6%; left: -140px; }

/* --------------------------- 4. Gears ------------------------ */
.gear-scene {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.gear--spin {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: gear-rotate var(--dur, 24s) linear infinite;
  animation-direction: var(--spin-dir, normal);
  will-change: transform;
}

@keyframes gear-rotate {
  from { transform: rotate(var(--phase, 0deg)); }
  to   { transform: rotate(calc(var(--phase, 0deg) + 360deg)); }
}

.gear-ring, .gear-spoke, .gear-hub { stroke-linejoin: round; }

/* small inline gears (section eyebrows, rules, brand) */
.gear-mini { display: inline-block; vertical-align: middle; }
.gear-mini .gear--spin { animation-duration: 26s; }

.section-rule__gear .gear--spin,
.section__gear .gear--spin { animation-duration: 34s; }

/* --------------------------- 5. Header ----------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.is-scrolled {
  background: #0c0f11;
  border-bottom-color: var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  min-width: 0;
}
.brand__mark { display: flex; width: 34px; height: 34px; flex: none; color: var(--accent); }
.brand__mark .gear--spin { animation-duration: 22s; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand__role {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.brand:hover .brand__name { color: var(--accent-2); }

.primary-nav ul {
  display: flex;
  gap: clamp(4px, 1.4vw, 18px);
  list-style: none;
}
.primary-nav a {
  position: relative;
  display: block;
  padding: 8px 2px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.2s var(--ease);
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.primary-nav a:hover,
.primary-nav a[aria-current="true"] { color: var(--text); }
.primary-nav a:hover::after,
.primary-nav a[aria-current="true"]::after { transform: scaleX(1); }
.primary-nav a[aria-current="true"] { color: var(--accent); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle__bars { display: flex; flex-direction: column; gap: 4px; width: 18px; }
.nav-toggle__bars i {
  height: 2px;
  background: var(--text-2);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --------------------------- 6. Buttons ---------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.22s var(--ease), color 0.22s var(--ease),
              background 0.22s var(--ease), transform 0.22s var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}
.btn--primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--accent-ink);
}

/* ---------------------------- 7. Hero ------------------------ */
.hero {
  position: relative;
  min-height: min(92vh, 880px);
  display: flex;
  align-items: center;
  padding: clamp(48px, 9vh, 96px) 0 clamp(72px, 10vh, 110px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__gear {
  position: absolute;
  top: 50%;
  right: clamp(-140px, -4vw, -40px);
  transform: translateY(-50%);
  width: clamp(460px, 46vw, 660px);
  opacity: 0.9;
  pointer-events: none;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, var(--bg) 26%, rgba(14, 18, 20, 0.82) 46%, rgba(14, 18, 20, 0.1) 72%),
    linear-gradient(to top, rgba(14, 18, 20, 0.9) 0%, transparent 26%);
}

.hero__dimension {
  position: absolute;
  left: 5%;
  bottom: 34px;
  width: min(560px, 56%);
  height: 46px;
  opacity: 0.55;
  pointer-events: none;
}
.dim-line { stroke: var(--steel-line-2); stroke-width: 1; }

.hero__inner { position: relative; z-index: 2; width: 100%; }

.hero__content { max-width: 660px; }

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero__eyebrow .tick {
  width: 34px; height: 1px;
  background: var(--accent);
  position: relative;
}
.hero__eyebrow .tick::after {
  content: "";
  position: absolute;
  right: 0; top: -3px;
  width: 1px; height: 7px;
  background: var(--accent);
}

.hero__name {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.7rem, 6.4vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: 0.005em;
}

.hero__role {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: clamp(0.76rem, 1.4vw, 0.86rem);
  letter-spacing: 0.095em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__affiliation {
  margin: 0 0 22px;
  font-size: 0.95rem;
  color: var(--text-3);
  max-width: 520px;
}

.hero__tagline {
  margin: 0 0 30px;
  font-size: clamp(1.02rem, 1.9vw, 1.18rem);
  line-height: 1.6;
  color: var(--text-2);
  max-width: 560px;
  border-left: 2px solid var(--accent);
  padding-left: 18px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.hero__specs {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 3vw, 40px);
  margin: 0;
  padding-top: 22px;
  border-top: 1px dashed var(--line-2);
}
.hero__specs div { min-width: 0; }
.hero__specs dt {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}
.hero__specs dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-2);
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
}
.hero__scroll-line {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, transparent, var(--line-2));
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  left: 0; top: -50%;
  width: 100%; height: 50%;
  background: var(--accent);
  animation: scroll-drop 2.2s var(--ease) infinite;
}
@keyframes scroll-drop {
  0%   { top: -50%; }
  70%  { top: 110%; }
  100% { top: 110%; }
}
.hero__scroll-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ------------------------- 8. Sections ----------------------- */
.section {
  position: relative;
  padding: clamp(64px, 9vw, 110px) 0;
}
.section + .section-rule + .section { padding-top: clamp(48px, 7vw, 84px); }

.section__head { margin-bottom: clamp(34px, 5vw, 54px); }

.section__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-3);
}
.section__gear {
  display: inline-flex;
  width: 20px; height: 20px;
  color: var(--accent);
}
.section__index {
  color: var(--accent);
  padding-right: 12px;
  border-right: 1px solid var(--line-2);
}

.section__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  max-width: 20ch;
}
.section__head h2::after {
  content: "";
  display: block;
  width: 56px; height: 3px;
  margin-top: 16px;
  background: var(--accent);
}

/* thin technical rule with a gear at centre */
.section-rule {
  position: relative;
  height: 1px;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
  background:
    linear-gradient(to right, transparent, var(--line) 12%, var(--line) 88%, transparent);
}
.section-rule::before, .section-rule::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px; height: 9px;
  background: var(--line-2);
}
.section-rule::before { left: 12%; }
.section-rule::after  { right: 12%; }
.section-rule__gear {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 26px; height: 26px;
  background: var(--bg);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--line-2);
}

/* panel / card base */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* --------------------------- 9. About ------------------------ */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.about__lead {
  font-size: clamp(1.08rem, 2vw, 1.24rem);
  line-height: 1.62;
  color: var(--text);
  margin-bottom: 1.5em;
}
.about__lead::first-letter { /* keep it clean, no drop cap */ }

.about__body p:not(.about__lead) { color: var(--text-2); }

.about__card {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: clamp(20px, 2.6vw, 28px);
  display: grid;
  gap: 22px;
}

/* engineering nameplate placeholder (no photo in source document) */
.profile-plate { border-radius: var(--radius); overflow: hidden; }
.profile-plate svg { display: block; width: 100%; height: auto; }
.profile-plate img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  filter: grayscale(0.25) contrast(1.02);
}

.fact-list { margin: 0; display: grid; gap: 13px; }
.fact-list > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.fact-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.fact-list dt {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-top: 3px;
}
.fact-list dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.fact-list a { color: var(--accent); }
.fact-list a:hover { text-decoration: underline; }

.chip-block__title {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.chips li {
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-2);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chips li:hover { border-color: var(--accent); color: var(--accent); }
.chips--members li { border-style: dashed; }

/* ------------------------ 10. Timeline ----------------------- */
.timeline {
  list-style: none;
  position: relative;
  display: grid;
  gap: clamp(26px, 4vw, 44px);
  padding-left: 42px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 11px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--line-2) 22%, var(--line-2) 78%, transparent);
}
.timeline__item { position: relative; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -38px; top: 8px;
  width: 15px; height: 15px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}
.timeline__item::after {
  content: "";
  position: absolute;
  left: -32px; top: 14px;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.timeline__degree {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.22rem, 2.4vw, 1.5rem);
  line-height: 1.2;
}
.timeline__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.timeline__meta span:not(:last-child)::after {
  content: "／";
  margin-left: 16px;
  color: var(--line-2);
}
.timeline__detail { margin: 0; color: var(--text-2); max-width: 72ch; }

/* -------------------------- 11. Skills ----------------------- */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 26px);
}
.skill-card {
  position: relative;
  padding: clamp(22px, 3vw, 30px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.skill-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.skill-card:hover { transform: translateY(-5px); border-color: var(--line-2); }
.skill-card:hover::before { transform: scaleX(1); }

.skill-card__index {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
}
.skill-card__title {
  margin: 8px 0 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: 0.01em;
}
.skill-card ul { list-style: none; display: grid; gap: 9px; }
.skill-card li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.94rem;
  color: var(--text-2);
}
.skill-card li::before {
  content: "";
  flex: none;
  width: 6px; height: 6px;
  border: 1px solid var(--accent);
  transform: rotate(45deg) translateY(-1px);
}

/* ------------------------ 12. Experience --------------------- */
.experience { padding: clamp(24px, 3.4vw, 40px); }

.experience__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 24px;
  align-items: baseline;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.experience__role {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 1.66rem);
  line-height: 1.18;
}
.experience__org {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
}
.experience__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

.experience__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 6px;
}
.stat {
  padding: 16px 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.stat__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1;
  color: var(--accent);
  margin-bottom: 6px;
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.5;
  display: block;
}

.experience__body { margin-top: 20px; color: var(--text-2); max-width: 78ch; }

/* ------------------------- 13. Research ---------------------- */
.research__head {
  position: relative;
  padding: clamp(24px, 3.4vw, 38px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: clamp(24px, 3vw, 34px);
  overflow: hidden;
}
.research__head::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 210px; height: 210px;
  border: 1px dashed var(--line-2);
  border-radius: 50%;
  pointer-events: none;
}
.research__label {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.research__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.55rem, 3.4vw, 2.3rem);
  line-height: 1.12;
  max-width: 26ch;
}
.research__subtitle {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 1.02rem;
  max-width: 60ch;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tag-row li {
  padding: 4px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.research__grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 40px);
  align-items: start;
  margin-bottom: clamp(28px, 4vw, 40px);
}
.research__meta {
  margin: 0;
  padding: clamp(20px, 2.6vw, 26px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 15px;
}
.research__meta > div {
  display: grid;
  gap: 4px;
  padding-bottom: 13px;
  border-bottom: 1px dashed var(--line);
}
.research__meta > div:last-child { border-bottom: 0; padding-bottom: 0; }
.research__meta dt {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
}
.research__meta dd {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.block-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}
.block-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.prose { color: var(--text-2); max-width: 76ch; }
.prose p:last-child { margin-bottom: 0; }
.research__abstract .prose { font-size: 0.99rem; }

.key-results { margin-bottom: clamp(30px, 4vw, 44px); }
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}
.metric {
  padding: 18px 18px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.metric:hover { border-color: var(--accent); transform: translateY(-3px); }
.metric__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
  line-height: 1.5;
}
.metric__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.22rem, 2.3vw, 1.52rem);
  line-height: 1.12;
  color: var(--text);
  overflow-wrap: anywhere;
}
.metric__value em {
  font-style: normal;
  color: var(--accent);
}

/* ------------------------- 14. Projects ---------------------- */
.projects { display: grid; gap: clamp(44px, 6vw, 76px); }

.project {
  position: relative;
  padding-top: 8px;
}
.project__head {
  position: relative;
  padding-bottom: 22px;
  margin-bottom: clamp(24px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
}
.project__index {
  position: absolute;
  right: 0; top: -28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.6rem, 11vw, 7.5rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
  pointer-events: none;
  user-select: none;
}
.project__type {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}
.project__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.62rem, 3.6vw, 2.5rem);
  line-height: 1.1;
  max-width: 24ch;
}
.project__subtitle {
  margin: 0 0 16px;
  color: var(--text-2);
  max-width: 70ch;
}

.project__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: clamp(26px, 4vw, 46px);
  align-items: start;
}
.project__body { display: grid; gap: clamp(24px, 3vw, 34px); min-width: 0; }
/* Grid items default to min-width:auto — the 520px-wide data table would
   otherwise blow out the column instead of scrolling inside .data-table-wrap. */
.project__block { min-width: 0; }

.project__block h4 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.project__block h4::after {
  content: "";
  display: block;
  width: 34px; height: 2px;
  margin-top: 8px;
  background: var(--accent);
  opacity: 0.55;
}
.project__block .prose,
.project__block li { font-size: 0.97rem; }

.checklist { list-style: none; display: grid; gap: 10px; }
.checklist li {
  position: relative;
  padding-left: 30px;
  color: var(--text-2);
  line-height: 1.6;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 14px; height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* results data table */
.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 520px;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.data-table thead th {
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.18s var(--ease); }
.data-table tbody tr:hover { background: rgba(232, 150, 60, 0.05); }
.data-table td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.data-table td { color: var(--text-2); }

/* snapshot aside */
.project__aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: clamp(20px, 2.6vw, 26px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.project__aside-title {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.project__aside-title::after {
  content: "";
  flex: 1; height: 1px; background: var(--line);
}
.snapshot { margin: 0; display: grid; gap: 14px; }
.snapshot > div {
  display: grid;
  gap: 4px;
  padding-bottom: 13px;
  border-bottom: 1px dashed var(--line);
}
.snapshot > div:last-child { border-bottom: 0; padding-bottom: 0; }
.snapshot dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.snapshot dd {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* figures */
.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(26px, 3.4vw, 38px);
}
.figure { margin: 0; }
.figure__zoom {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  background: #f4f5f6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.figure__zoom img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f4f5f6;
  transition: transform 0.4s var(--ease);
}
.figure__zoom::after {
  content: "";
  position: absolute;
  right: 10px; bottom: 10px;
  width: 26px; height: 26px;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 12px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 2px 12px no-repeat,
    rgba(14, 18, 20, 0.82);
  border-radius: 3px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.figure__zoom:hover { border-color: var(--accent); transform: translateY(-3px); }
.figure__zoom:hover img { transform: scale(1.03); }
.figure__zoom:hover::after { opacity: 1; transform: scale(1); }

.figure figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-3);
}

/* challenges / lessons / future */
.project__notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 28px);
  margin-top: clamp(30px, 4vw, 44px);
  padding-top: clamp(26px, 3.4vw, 36px);
  border-top: 1px solid var(--line);
}
.note-col h4 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.note-col h4::before {
  content: "";
  width: 10px; height: 10px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  flex: none;
}
.note-col ul { list-style: none; display: grid; gap: 11px; }
.note-col li {
  position: relative;
  padding-left: 18px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-2);
}
.note-col li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 7px; height: 1px;
  background: var(--accent);
}

/* -------------------------- 15. Contact ---------------------- */
.section--contact { padding-bottom: clamp(70px, 9vw, 120px); }

.contact__invite {
  position: relative;
  padding: clamp(22px, 3vw, 30px) clamp(24px, 3.4vw, 36px);
  margin-bottom: clamp(26px, 3.4vw, 38px);
  border-left: 3px solid var(--accent);
  color: var(--text-2);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 82ch;
}
.contact__invite p:last-child { margin-bottom: 0; }

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(26px, 4vw, 46px);
  align-items: start;
}
.contact__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.contact-card {
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.contact-card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.contact-card--wide { grid-column: 1 / -1; }
.contact-card__label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}
.contact-card__label::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
  flex: none;
}
.contact-card__value {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.26rem);
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
}
.contact-card__value a { color: var(--text); transition: color 0.2s var(--ease); }
.contact-card__value a:hover { color: var(--accent); }
.contact-card__note {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
}

.contact__subtitle {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-3);
}
.social-list { list-style: none; display: grid; gap: 10px; }
.social-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-2);
  transition: border-color 0.24s var(--ease), color 0.24s var(--ease),
              transform 0.24s var(--ease), background 0.24s var(--ease);
}
.social-list a:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateX(5px);
  background: var(--panel-2);
}
.social-list__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}
.social-list__handle {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.social-list a:hover .social-list__handle { color: var(--accent); }
.social-list__arrow { flex: none; width: 15px; height: 15px; color: var(--text-3); }
.social-list a:hover .social-list__arrow { color: var(--accent); }

/* --------------------------- 16. Footer ---------------------- */
.site-footer {
  position: relative;
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding-top: clamp(46px, 6vw, 66px);
  overflow: hidden;
}
.footer__gears {
  position: absolute;
  right: -40px; top: -30px;
  width: min(420px, 46vw);
  opacity: 0.07;
  pointer-events: none;
}
.footer__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto auto;
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
  padding-bottom: clamp(30px, 4vw, 44px);
}
.footer__name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}
.footer__tag {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
  max-width: 44ch;
  line-height: 1.7;
}
.footer__nav ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px 26px;
}
.footer__nav a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color 0.2s var(--ease);
}
.footer__nav a:hover { color: var(--accent); }

.footer__socials {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 300px;
  justify-content: flex-end;
}
.footer__socials a {
  display: inline-flex;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer__socials a:hover { color: var(--accent); border-color: var(--accent); }

.footer__base {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 24px;
  border-top: 1px solid var(--line);
}
.footer__base p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

/* -------------------------- 17. Lightbox --------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  width: min(1100px, 94vw);
  max-width: none;
  max-height: 92vh;
  padding: clamp(14px, 2.4vw, 26px);
  margin: auto;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  color: var(--text);
}
.lightbox::backdrop { background: rgba(5, 7, 8, 0.88); }
.lightbox__figure { margin: 0; }
.lightbox__figure img {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  background: #f4f5f6;
  border-radius: var(--radius);
}
.lightbox__figure figcaption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-2);
  text-align: center;
}
.lightbox__close {
  position: absolute;
  top: 10px; right: 10px;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: rgba(14, 18, 20, 0.85);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.lightbox__close svg { width: 16px; height: 16px; }
.lightbox__close:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------ 18. Reveal states ------------------ */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--rd, 0s);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* -------------------------- 19. No-script -------------------- */
.noscript-note {
  position: relative;
  z-index: 5;
  max-width: 720px;
  margin: 110px auto 40px;
  padding: 26px 30px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
}
.noscript-note p { margin: 0 0 10px; color: var(--text-2); }

/* ------------------------ 20. Responsive --------------------- */
@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project__layout { grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); }
}

@media (max-width: 960px) {
  .hero__gear {
    width: clamp(380px, 62vw, 560px);
    right: -110px;
    opacity: 0.5;
  }
  .about__grid { grid-template-columns: 1fr; }
  .about__card { position: static; }
  .research__grid { grid-template-columns: 1fr; }
  .project__layout { grid-template-columns: 1fr; }
  .project__aside { position: static; order: -1; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project__notes { grid-template-columns: 1fr; gap: 26px; }
  .contact__grid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__socials { justify-content: flex-start; max-width: none; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #0c0f11;
    border-bottom: 1px solid var(--line);
    padding: 6px 0 14px;
    display: none;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0 clamp(20px, 4vw, 32px);
  }
  .primary-nav a {
    padding: 13px 4px;
    font-size: 0.84rem;
    border-bottom: 1px dashed var(--line);
  }
  .primary-nav li:last-child a { border-bottom: 0; }
  .primary-nav a::after { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero {
    min-height: 0;
    padding-top: clamp(40px, 8vh, 64px);
    padding-bottom: clamp(56px, 9vh, 84px);
  }
  .hero__gear {
    right: -34%;
    top: 42%;
    width: clamp(430px, 108vw, 620px);
    opacity: 0.34;
  }
  .hero__scrim {
    background:
      linear-gradient(105deg, rgba(14, 18, 20, 0.94) 40%, rgba(14, 18, 20, 0.55) 78%),
      linear-gradient(to top, rgba(14, 18, 20, 0.92) 0%, transparent 30%);
  }
  .hero__dimension { display: none; }
  .hero__scroll { display: none; }
  .hero__specs { gap: 16px 26px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills__grid { grid-template-columns: 1fr; }
  .experience__stats { grid-template-columns: 1fr; }
  .experience__top { flex-direction: column; }
  .experience__meta { text-align: left; flex-direction: row; gap: 14px; flex-wrap: wrap; }
  .contact__details { grid-template-columns: 1fr; }
  .timeline { padding-left: 34px; }
  .timeline__item::before { left: -30px; }
  .timeline__item::after { left: -24px; }
  .timeline::before { left: 7px; }
  .section__head h2::after { width: 44px; }
}

@media (max-width: 560px) {
  .figures { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .brand__role { display: none; }
  .project__index { top: -18px; }
  .footer__nav ul { grid-template-columns: 1fr; }
}

/* ------------------- 21. Reduced motion ---------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .gear--spin { animation: none !important; transform: none !important; }
  .hero__scroll-line::after { animation: none; top: 0; height: 100%; opacity: 0.4; }

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

/* --------------------- 22. Print ----------------------------- */
@media print {
  .site-header, .hero__gear, .ambient-gears, .blueprint,
  .hero__scroll, .section__gear, .section-rule, .lightbox { display: none !important; }
  body { background: #fff; color: #111; }
}
