/* ==========================================================================
   Utkarsh Tiwari — Portfolio
   Cinematic live-wallpaper background + glassmorphic UI
   The looping video sits behind every page; all panels are dark frosted glass.
   ========================================================================== */

@font-face {
  font-family: "Chinese Rocks";
  src: url("../fonts/chinese-rocks.ttf") format("truetype"),
       url("../../chinese rocks rg.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------- 1. Tokens ---------- */
:root {
  /* Accents (Design Document palette) */
  --twilight-slate: #2e5266;
  --twilight-hi: #4a7d96;
  --misty-sage: #6e8c7b;
  --sage-light: #9dbfad;
  --warm-sand: #c9bba8;
  --fog-glass: #f4f1ec;
  --ink: #1b1f23;
  --white: #ffffff;

  /* Text on the dark video backdrop */
  --text: rgba(255, 255, 255, 0.9);
  --text-dim: rgba(255, 255, 255, 0.66);
  --text-faint: rgba(255, 255, 255, 0.5);

  /* Glass surfaces */
  --panel: rgba(18, 24, 28, 0.52);
  --panel-strong: rgba(18, 24, 28, 0.68);
  --panel-solid: rgba(16, 21, 25, 0.9);
  --hairline: rgba(255, 255, 255, 0.14);
  --hairline-strong: rgba(255, 255, 255, 0.26);

  /* Type */
  --font-display: "Consolas", "Courier New", Courier, monospace;
  --font-body: "Consolas", "Courier New", Courier, monospace;

  /* Spacing — 8px base */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 40px;
  --s6: 48px;
  --s8: 64px;
  --s12: 96px;

  /* Radii */
  --r-lg: 32px;
  --r-md: 24px;
  --r-sm: 16px;
  --r-pill: 999px;

  /* Effects */
  --blur: 22px;
  --shadow-glass: 0 20px 60px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.25);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --maxw: 1280px;
  --nav-h: 68px;
}

/* ---------- 2. Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: #0e1417;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

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

a {
  color: var(--sage-light);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--white);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s2);
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 600;
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 600;
}

p {
  margin: 0 0 var(--s2);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

strong {
  color: var(--white);
  font-weight: 600;
}

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--twilight-slate);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 0 0 var(--r-sm) 0;
}

.skip-link:focus {
  left: 0;
  color: var(--white);
}

/* ---------- 3. Site-wide live background ---------- */
.site-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  /* 100vh == the LARGE viewport: it does not change when the mobile browser
     chrome collapses, so the backdrop stays rock-still while scrolling. */
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  background: linear-gradient(160deg, #35505c 0%, #4a6357 45%, #243138 100%);
  /* Own compositor layer: keeps the backdrop off the scrolling paint path. */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
  pointer-events: none;
}

.site-bg video,
.site-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* Scrim: keeps text legible over any frame of the footage */
.site-bg__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
      180deg,
      rgba(10, 15, 18, 0.55) 0%,
      rgba(10, 15, 18, 0.32) 26%,
      rgba(10, 15, 18, 0.5) 62%,
      rgba(10, 15, 18, 0.78) 100%
    ),
    linear-gradient(90deg, rgba(10, 15, 18, 0.5) 0%, transparent 60%);
}

/* ---------- 4. Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s3);
}

.section {
  padding: var(--s12) 0;
}

.section-head {
  max-width: 680px;
  margin-bottom: var(--s6);
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage-light);
  margin-bottom: var(--s1);
  display: block;
}

.lede {
  font-size: 1.15rem;
  color: var(--text-dim);
}

.caption {
  font-size: 13px;
  color: var(--text-faint);
}

.page-head {
  padding: calc(var(--nav-h) + var(--s12)) 0 var(--s6);
}

.page-head h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  margin-bottom: var(--s2);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.45);
}

.page-head .lede {
  max-width: 640px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

/* ---------- 5. Glass primitives ---------- */
.glass,
.card {
  background: var(--panel);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(130%);
  backdrop-filter: blur(var(--blur)) saturate(130%);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-glass);
}

.card {
  padding: var(--s4);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  background: var(--panel-strong);
  border-color: var(--hairline-strong);
}

/* ---------- 6. Buttons & pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
  transform: scale(1.03);
}

.btn:active {
  transform: scale(0.99);
}

.btn--primary {
  background: linear-gradient(160deg, var(--twilight-hi), var(--twilight-slate));
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.btn--primary:hover {
  background: linear-gradient(160deg, #5890ab, #35617a);
  color: var(--white);
}

.btn--ghost,
.btn--outline {
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: rgba(255, 255, 255, 0.38);
  color: var(--white);
}

.btn--ghost:hover,
.btn--outline:hover {
  background: var(--white);
  color: var(--ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--white);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    color 0.2s var(--ease);
}

.icon-btn:hover {
  transform: scale(1.06);
  background: var(--white);
  color: var(--ink);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.tag:hover {
  transform: translateY(-2px);
  border-color: var(--sage-light);
  background: rgba(255, 255, 255, 0.14);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 7. Navigation ---------- */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: var(--maxw);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  height: var(--nav-h);
  padding: 0 10px 0 20px;
  border-radius: var(--r-pill);
  background: rgba(18, 24, 28, 0.46);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--hairline);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.nav.is-scrolled {
  background: rgba(14, 19, 23, 0.82);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.42);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--white);
}

.nav__brand:hover {
  color: var(--white);
}

.nav__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  background: linear-gradient(150deg, var(--twilight-hi), var(--twilight-slate));
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav__links a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.nav__links a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__actions .btn {
  min-height: 44px;
  padding: 0 20px;
}

.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  cursor: pointer;
}

.nav__toggle svg {
  width: 20px;
  height: 20px;
}

.nav__panel {
  position: fixed;
  top: calc(var(--nav-h) + 26px);
  left: 16px;
  right: 16px;
  z-index: 99;
  padding: var(--s2);
  border-radius: var(--r-md);
  background: rgba(14, 19, 23, 0.92);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-glass);
  display: none;
}

.nav__panel.is-open {
  display: block;
  animation: dropIn 0.24s var(--ease);
}

.nav__panel a {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 var(--s2);
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
}

.nav__panel a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 8. Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: calc(var(--nav-h) + var(--s6));
  padding-bottom: var(--s4);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--s8);
  align-items: center;
}

.hero__content {
  max-width: 720px;
  color: var(--white);
}

.hero__role {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  margin-bottom: var(--s3);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
}

.hero__name {
  color: var(--white);
  font-size: clamp(3rem, 7.5vw, 5rem);
  font-weight: 700;
  line-height: 1.02;
  margin-bottom: var(--s4);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}

.hero__quote {
  font-size: clamp(1.1rem, 2.1vw, 1.5rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.94);
  max-width: 620px;
  margin-bottom: var(--s5);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero__intro {
  font-size: 1.02rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 560px;
  margin-bottom: var(--s4);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s4);
}

.hero__socials {
  display: flex;
  gap: 10px;
}

/* Portrait framed in glass, right side of the hero */
.hero__portrait {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-glass);
  background: linear-gradient(150deg, #6e8c7b, #2e5266);
}

.hero__portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sits underneath the photo; only visible if the photo is missing. */
.portrait-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

/* Intro strip — echoes the reference layout's bottom bar */
.strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s6);
  padding: 12px 14px;
  border-radius: var(--r-pill);
  background: rgba(14, 19, 23, 0.42);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--hairline-strong);
  color: var(--white);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

.strip:hover {
  background: rgba(14, 19, 23, 0.6);
  transform: translateY(-2px);
  color: var(--white);
}

.strip__thumb {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(145deg, #6e8c7b, #2e5266);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  overflow: hidden;
}

.strip__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.strip__text {
  flex: 1;
  min-width: 0;
}

.strip__title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.strip__meta {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 4px;
}

.strip__arrow {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.strip:hover .strip__arrow {
  background: var(--white);
  color: var(--ink);
}

.scroll-cue {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: var(--s3) auto 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}

.scroll-cue.is-visible {
  opacity: 1;
}

.scroll-cue__line {
  width: 1px;
  height: 30px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.7),
    rgba(255, 255, 255, 0)
  );
  animation: cue 2.2s var(--ease) infinite;
}

@keyframes cue {
  0%,
  100% {
    transform: scaleY(0.4);
    transform-origin: top;
    opacity: 0.4;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 1;
  }
}

/* Only genuinely short viewports (phone in landscape) trim the hero copy. */
@media (max-height: 620px) and (orientation: landscape) {
  .hero__intro {
    display: none;
  }
}

/* ---------- 9. Content blocks ---------- */
.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--s8);
  align-items: start;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: var(--s2);
}

.stat {
  padding: var(--s3);
  border-radius: var(--r-md);
  background: var(--panel);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--hairline);
}

.stat__value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.stat__label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

.quote-band {
  padding: var(--s12) 0;
  text-align: center;
}

.quote-band p {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.4;
  max-width: 820px;
  margin: 0 auto;
  color: var(--white);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.5);
}

/* ---------- 10. About ---------- */
.profile-photo {
  width: 100%;
  /* Beats the height="" presentational hint so aspect-ratio actually wins. */
  height: auto;
  max-width: 460px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-glass);
}

.timeline {
  position: relative;
  padding-left: var(--s5);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--sage-light),
    rgba(255, 255, 255, 0.12)
  );
}

.timeline__item {
  position: relative;
  padding-bottom: var(--s5);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: calc(-1 * var(--s5) + 4px);
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(14, 19, 23, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.timeline__item--current .timeline__dot {
  background: var(--sage-light);
  border-color: var(--sage-light);
  box-shadow: 0 0 0 5px rgba(157, 191, 173, 0.2);
}

.timeline__when {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage-light);
  margin-bottom: 6px;
}

.timeline__title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}

.timeline__sub {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 8px;
}

.badge-current {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--r-pill);
  background: rgba(157, 191, 173, 0.22);
  color: var(--sage-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---------- 11. Achievements ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--s3);
}

.ach-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--s2);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--hairline);
  color: var(--sage-light);
}

.ach-card__icon svg {
  width: 24px;
  height: 24px;
}

.ach-card h3 {
  margin-bottom: 8px;
}

.ach-card p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0;
}

.gallery {
  columns: 3 260px;
  column-gap: var(--s3);
}

.gallery figure {
  break-inside: avoid;
  margin: 0 0 var(--s3);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  background: var(--panel);
}

.gallery img {
  width: 100%;
  height: auto;
  transition: transform 0.5s var(--ease);
}

.gallery figure:hover img {
  transform: scale(1.05);
}

.gallery figcaption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--panel-strong);
}

.gallery-empty {
  padding: var(--s6);
  text-align: center;
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--r-md);
  color: var(--text-dim);
  background: rgba(18, 24, 28, 0.35);
}

/* ---------- 12. Resume ---------- */
.resume-panel {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--s5);
  text-align: center;
}

.resume-frame {
  width: 100%;
  height: 78svh;
  min-height: 520px;
  margin-top: var(--s4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--white);
}

.resume-fallback {
  margin-top: var(--s4);
  padding: var(--s6) var(--s4);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--r-sm);
  color: var(--text-dim);
}

.resume-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--s2);
  margin-top: var(--s6);
  text-align: left;
}

/* ---------- 13. Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s5);
  align-items: start;
}

.form-card {
  padding: var(--s5);
}

.field {
  margin-bottom: var(--s3);
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  color: var(--white);
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

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

.field input:focus,
.field textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--sage-light);
  box-shadow: 0 0 0 4px rgba(157, 191, 173, 0.18);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #ff8a80;
  box-shadow: 0 0 0 4px rgba(255, 138, 128, 0.14);
}

.field-error {
  display: none;
  margin-top: 6px;
  font-size: 13px;
  color: #ffb4ab;
}

.field-error.is-shown {
  display: block;
}

.form-status {
  display: none;
  margin-top: var(--s2);
  padding: 14px 18px;
  border-radius: var(--r-sm);
  font-size: 14px;
}

.form-status.is-shown {
  display: block;
}

.form-status--ok {
  background: rgba(157, 191, 173, 0.18);
  color: #d6ebdf;
  border: 1px solid rgba(157, 191, 173, 0.4);
}

.form-status--err {
  background: rgba(255, 138, 128, 0.14);
  color: #ffd6d1;
  border: 1px solid rgba(255, 138, 128, 0.35);
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--hairline);
}

.contact-list li:last-child {
  border-bottom: 0;
}

.contact-list .label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage-light);
}

.contact-list .value {
  font-weight: 500;
  color: var(--white);
  word-break: break-word;
}

/* ---------- 14. Footer ---------- */
.footer {
  padding: var(--s8) 0 var(--s5);
  background: rgba(10, 14, 16, 0.72);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  border-top: 1px solid var(--hairline);
  color: var(--text-dim);
  font-size: 14px;
}

.footer a {
  color: rgba(255, 255, 255, 0.86);
}

.footer a:hover {
  color: var(--white);
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--s5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

.footer__socials {
  display: flex;
  gap: 10px;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  justify-content: space-between;
  padding-top: var(--s3);
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- 15. Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

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

/* ---------- 16. Brand mark ---------- */
.nav__brand-text {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  min-width: 0;
}

.nav__brand-tld {
  color: var(--sage-light);
  font-weight: 600;
}

.nav__mark svg {
  width: 18px;
  height: 18px;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer__brand .nav__mark {
  width: 30px;
  height: 30px;
}

.footer__brand .nav__mark svg {
  width: 16px;
  height: 16px;
}

/* ---------- 17. Projects ---------- */
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.project-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s2);
}

.project-card h3 {
  margin: 0;
}

.project-card__badge {
  flex: none;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: rgba(157, 191, 173, 0.2);
  border: 1px solid rgba(157, 191, 173, 0.38);
  color: var(--sage-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-card__body {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0;
}

.project-points {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--text-dim);
  font-size: 14.5px;
}

.project-points li {
  position: relative;
  padding-left: 20px;
}

.project-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage-light);
}

.project-card .tag-row {
  gap: 8px;
}

.project-card .tag {
  min-height: 32px;
  padding: 0 13px;
  font-size: 12.5px;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: var(--s1);
}

.project-card__links .btn {
  min-height: 42px;
  padding: 0 20px;
  font-size: 13px;
}

/* ---------- 18. Coming-soon modal (resume PDF not attached yet) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s3);
  background: rgba(6, 10, 12, 0.72);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s var(--ease), visibility 0.24s var(--ease);
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__box {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100svh - 48px);
  overflow-y: auto;
  padding: var(--s5) var(--s4) var(--s4);
  border-radius: var(--r-md);
  background: rgba(20, 27, 31, 0.97);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-glass);
  text-align: center;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s var(--ease);
}

.modal.is-open .modal__box {
  transform: none;
}

.modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: var(--s2);
  border-radius: var(--r-pill);
  background: rgba(157, 191, 173, 0.16);
  border: 1px solid rgba(157, 191, 173, 0.4);
  color: var(--sage-light);
}

.modal__icon svg {
  width: 26px;
  height: 26px;
}

.modal__box h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.modal__box p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0 0 var(--s3);
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
}

.modal__close svg {
  width: 16px;
  height: 16px;
}

/* About-page portrait placeholder (previously had no styles at all) */
.photo-fallback[hidden] {
  display: none;
}

.photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-glass);
  background: linear-gradient(150deg, #6e8c7b, #2e5266);
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- 19. Hover capability ----------
   Touch screens latch :hover after a tap, which reads as a stuck card.
   Every lift/scale effect is gated behind a real pointer.                  */
@media (hover: none) {
  .card:hover,
  .btn:hover,
  .icon-btn:hover,
  .tag:hover,
  .strip:hover,
  .gallery figure:hover img {
    transform: none;
  }

  .card:hover {
    background: var(--panel);
    border-color: var(--hairline);
  }

  .btn--ghost:hover,
  .btn--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
  }

  .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
  }

  .strip:hover .strip__arrow {
    background: transparent;
    color: var(--white);
  }

  .btn:active,
  .card:active {
    opacity: 0.86;
  }
}

/* ---------- 20. Responsive ---------- */

/* Tablet / small laptop */
@media (max-width: 1024px) {
  .site-bg video,
  .site-bg img {
    object-position: 26% center;
  }

  .split,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }

  /* Portrait moves ABOVE the copy instead of disappearing entirely */
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--s4);
    justify-items: center;
    text-align: center;
  }

  .hero__content {
    order: 2;
    max-width: 640px;
  }

  .hero__portrait {
    order: 1;
    justify-self: center;
    width: 190px;
    max-width: 190px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
  }

  .hero__intro,
  .hero__quote {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__cta,
  .hero__socials {
    justify-content: center;
  }

  .gallery {
    columns: 2 220px;
  }
}

/* Below here there is no room for a full nav bar: the brand plus six links
   plus the Resume pill stops fitting just under 1024px. */
@media (max-width: 1024px) {
  :root {
    --s12: 64px;
    --s8: 48px;
    --nav-h: 62px;
  }

  /* Links and the Resume pill both live in the dropdown on small screens */
  .nav__links,
  .nav__actions .btn {
    display: none;
  }

  .nav__toggle {
    display: inline-flex;
  }

  .nav {
    padding: 0 8px 0 14px;
  }

  .nav__brand {
    font-size: 15px;
    min-width: 0;
    overflow: hidden;
  }

  .hero {
    justify-content: center;
  }

  .hero__inner {
    padding-top: calc(var(--nav-h) + var(--s5));
    padding-bottom: var(--s5);
  }

  .hero__name {
    font-size: clamp(2.4rem, 11vw, 3.4rem);
  }

  .hero__quote {
    font-size: clamp(1rem, 4.4vw, 1.2rem);
  }

  .hero__intro {
    font-size: 0.97rem;
  }

  .strip {
    border-radius: var(--r-md);
    padding: 14px 16px;
    gap: var(--s2);
    text-align: left;
  }

  .strip__thumb {
    width: 46px;
    height: 46px;
    font-size: 15px;
  }

  .strip__arrow {
    width: 42px;
    height: 42px;
  }

  .strip__title {
    font-size: 1.05rem;
  }

  .strip__meta {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .resume-panel {
    padding: var(--s3);
  }

  .resume-frame {
    height: 60svh;
  }

  .page-head {
    padding: calc(var(--nav-h) + var(--s8)) 0 var(--s5);
  }
}

/* Phones */
@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .wrap {
    padding: 0 var(--s2);
  }

  .section {
    padding: var(--s8) 0;
  }

  .hero__role {
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 7px 14px;
  }

  .hero__portrait {
    width: 168px;
    max-width: 168px;
  }

  /* The cue costs 55px of an 812px screen and says nothing */
  .scroll-cue {
    display: none;
  }

  .hero__cta .btn {
    width: 100%;
  }

  /* Thumb is decoration; the text needs the room more */
  .strip__thumb {
    display: none;
  }

  .strip {
    gap: 12px;
    padding: 14px;
  }

  .card,
  .form-card {
    padding: var(--s3);
  }

  /* iOS Safari zooms the whole page in when a focused field is under 16px,
     and never zooms back out. 16px keeps the viewport put. */
  .field input,
  .field textarea {
    font-size: 16px;
  }

  .gallery {
    columns: 1;
  }

  .footer__top {
    flex-direction: column;
    gap: var(--s3);
  }

  .modal__box {
    padding: var(--s4) var(--s3) var(--s3);
  }

  .modal__actions .btn {
    width: 100%;
  }

  .project-card__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .project-card__links .btn {
    flex: 1 1 auto;
  }
}

/* Very narrow phones (320-360px) */
@media (max-width: 380px) {
  .nav__brand {
    font-size: 13.5px;
    gap: 8px;
  }

  .nav__mark {
    width: 30px;
    height: 30px;
  }

  .hero__name {
    font-size: clamp(2rem, 10.5vw, 2.6rem);
  }

  .contact-list li {
    align-items: flex-start;
  }
}

/* ---------- 21. Blur / compositing budget ----------
   backdrop-filter over a full-screen fixed backdrop is the most expensive
   thing on this page. Anything without a fine pointer (every phone and
   tablet) gets solid panels instead: same look, no scroll jank.            */
@media (max-width: 1024px), (hover: none), (pointer: coarse) {
  .glass,
  .card,
  .stat,
  .nav,
  .nav__panel,
  .strip,
  .footer,
  .btn--ghost,
  .btn--outline,
  .icon-btn,
  .hero__role {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .glass,
  .card,
  .stat {
    background: var(--panel-solid);
  }

  .nav,
  .nav.is-scrolled {
    background: rgba(14, 19, 23, 0.94);
  }

  .strip {
    background: rgba(14, 19, 23, 0.88);
  }

  .footer {
    background: rgba(10, 14, 16, 0.94);
  }

  .hero__role {
    background: rgba(255, 255, 255, 0.16);
  }
}

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

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

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

/* ---------- 23. Dynamic GitHub Repos & Status ---------- */
.github-stats-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 0.9em;
  color: var(--text-dim);
}

.github-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.85em;
  color: var(--text-dim);
}

.github-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.repo-card__stars {
  color: #ffc107;
}

.github-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: var(--panel);
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  color: var(--text-dim);
}

/* Location Mini Google Maps UI */
.location-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 14px;
}

.location-item__header {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.location-map {
  position: relative;
  width: 100%;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  background: rgba(14, 19, 23, 0.6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.location-map iframe {
  display: block;
  width: 100%;
  height: 170px;
  border: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  filter: contrast(0.95) saturate(0.9);
}

.location-map__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 12px;
  background: rgba(18, 24, 28, 0.85);
  border-top: 1px solid var(--hairline);
}

.location-map__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sage-light);
  transition: color 0.2s var(--ease);
}

.location-map__link:hover {
  color: var(--white);
}

/* ---------- 24. Print ---------- */
@media print {
  .nav,
  .nav__panel,
  .footer,
  .scroll-cue,
  .site-bg,
  .modal {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
