/* -------------------------------------------------------------------------- */
/* 1. Design tokens                                                           */
/* -------------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --sage: #829672;
  --sage-mid: #6f8560;
  --sage-deep: #5c6e52;
  --evergreen: #344c3d;
  --evergreen-deep: #243529;
  --baby-pink: #f8b8cc;
  --baby-pink-rich: #f5a0be;
  --baby-pink-panel: #fac8d8;
  --dark-pink: #8b2f50;
  --dark-pink-shadow: #6e2540;
  --text-pink: #ffe8f1;
  --text-pink-soft: #ffd0e3;
  --text-pink-muted: #ffb8d4;
  --shadow-green: var(--evergreen);
  --shadow-pink: var(--dark-pink-shadow);
  --line-pink: rgba(255, 210, 225, 0.35);
  --reading-max: 38rem;
  --page-gutter: clamp(1.75rem, 8vw, 6rem);
  --reading-inset: clamp(0.75rem, 4vw, 2.25rem);
  --project-content-max: 75rem;
  --project-inner-pad-x: clamp(0.15rem, 0.45vw, 0.45rem);
  --hero-void: #1e0b2e;
  --radius: 20px;
  --radius-pill: 999px;
  --header-h: 76px;
  --font-script: "Dancing Script", cursive;
  --font-body: "DM Sans", system-ui, sans-serif;
}

/* -------------------------------------------------------------------------- */
/* 2. Base & page background                                                  */
/* -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-pink-soft);
  background: linear-gradient(180deg, var(--sage-mid) 0%, var(--sage) 38%, var(--sage-deep) 100%);
  overflow-x: hidden;
}

/* Fixed dot grid behind all content */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: radial-gradient(rgba(36, 53, 41, 0.35) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* -------------------------------------------------------------------------- */
/* 3. Site header & navigation                                              */
/* -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  min-height: var(--header-h);
  padding: 0;
  background: linear-gradient(180deg, rgba(30, 11, 46, 0.92) 0%, rgba(30, 11, 46, 0.75) 70%, rgba(30, 11, 46, 0.38) 100%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 3vw, 1.85rem);
  width: 100%;
  max-width: var(--project-content-max);
  margin-inline: auto;
  padding-inline: var(--project-inner-pad-x);
  min-height: var(--header-h);
}

.logo {
  position: relative;
  z-index: 1;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(1.2rem, 3.6vw, 1.85rem);
  color: #f4f1e8;
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: none;
}

.logo__spark {
  color: #c4b0e8;
  margin-right: 0.1em;
  font-size: 1em;
  text-shadow: none;
}

.nav {
  position: relative;
  z-index: 1;
}

.nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__list li {
  display: flex;
  align-items: center;
}

.nav__list li + li::before {
  content: "·";
  margin: 0 clamp(0.85rem, 2.4vw, 1.35rem);
  color: rgba(255, 255, 255, 0.32);
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.nav__list a {
  color: rgba(244, 241, 232, 0.88);
  text-decoration: none;
  font-size: clamp(0.75rem, 1.45vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding-block: 0.2em;
  text-shadow: none;
  transition:
    color 0.22s ease,
    text-shadow 0.28s ease,
    transform 0.15s ease;
}

.nav__list a:hover {
  color: #c8f5a0;
  text-shadow:
    0 0 8px rgba(157, 206, 106, 0.95),
    0 0 20px rgba(137, 195, 74, 0.7),
    0 0 36px rgba(89, 195, 74, 0.4);
  transform: translateY(-1px);
}

.nav__list a:focus-visible {
  outline: 2px solid #9dce6a;
  outline-offset: 4px;
  border-radius: 6px;
}

/* -------------------------------------------------------------------------- */
/* 4. Main column (page sections live here)                                 */
/* -------------------------------------------------------------------------- */

main {
  position: relative;
  z-index: 1;
  padding-inline: var(--page-gutter);
  max-width: 120rem;
  margin-inline: auto;
}

/* -------------------------------------------------------------------------- */
/* 5. About / project section (#lab) — plum band, wave, marquee, copy         */
/* -------------------------------------------------------------------------- */

.section-project {
  /* Dark purple (readable as purple, not black) */
  --project-plum: #3a2652;
  --project-lavender: #b39ddb;
  --project-lavender-soft: rgba(179, 157, 219, 0.55);
  --project-lime: #89c34a;
  --project-card: #2a1a40;
  --project-card-border: rgba(179, 157, 219, 0.35);
  margin: -2px calc(-1 * var(--page-gutter)) 0;
  width: calc(100% + 2 * var(--page-gutter));
  max-width: none;
  position: relative;
  background: var(--hero-void);
}

.section-project__wave {
  display: block;
  width: 100%;
  height: clamp(56px, 10vw, 92px);
  margin-top: 0;
  margin-bottom: -1px;
  /* Same base as hero behind transparent wave top */
  background-color: var(--hero-void);
  /* currentColor → path fill (reliable in SVG across browsers) */
  color: var(--project-plum);
}

.section-project__wave path {
  fill: currentColor;
}

/* Lab (plum) → Tech (hero void): plum band above, void fills the wave */
.section-project__wave--to-void {
  background-color: var(--project-plum);
  color: var(--hero-void);
}

.section-project__plum {
  position: relative;
  background: var(--project-plum);
  margin-top: -1px;
  padding-bottom: clamp(2.75rem, 8vw, 4.5rem);
  overflow: hidden;
}

.section-project__bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.project-bubble--ring {
  position: absolute;
  border: 2px dashed var(--project-lavender-soft);
  border-radius: 50%;
  opacity: 0.85;
}

.project-bubble--1 {
  width: min(48vw, 380px);
  height: min(48vw, 380px);
  top: 6%;
  right: -8%;
}

.project-bubble--2 {
  width: min(28vw, 200px);
  height: min(28vw, 200px);
  bottom: 18%;
  left: -6%;
  opacity: 0.65;
}

.project-spark {
  position: absolute;
  color: var(--project-lavender-soft);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.project-spark--1 {
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(1.2rem, 2.8vw, 1.65rem);
  opacity: 0.95;
}

.project-spark--2 {
  top: 18%;
  left: 14%;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  opacity: 0.65;
  transform: rotate(-12deg);
}

.project-spark--3 {
  top: 22%;
  right: 18%;
  font-size: clamp(0.75rem, 1.8vw, 1rem);
  opacity: 0.55;
  transform: rotate(18deg);
}

.project-spark--4 {
  top: 48%;
  left: 6%;
  font-size: clamp(0.7rem, 1.6vw, 0.95rem);
  opacity: 0.45;
}

.project-spark--5 {
  top: 42%;
  right: 10%;
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  opacity: 0.5;
  transform: rotate(8deg);
}

.project-spark--6 {
  bottom: 28%;
  left: 22%;
  font-size: clamp(0.8rem, 1.9vw, 1.05rem);
  opacity: 0.5;
  transform: rotate(-20deg);
}

/* Horizontal skills ticker under the wave */
.project-skills-marquee {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(0.85rem, 2.2vw, 1.15rem) 0 clamp(1rem, 2.8vw, 1.35rem);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, #000 2.5%, #000 97.5%, transparent 100%);
}

.project-skills-marquee__track {
  display: flex;
  width: max-content;
  animation: project-skills-marquee 48s linear infinite;
}

.project-skills-marquee:hover .project-skills-marquee__track {
  animation-play-state: paused;
}

@keyframes project-skills-marquee {
  to {
    transform: translateX(-50%);
  }
}

.project-skills-marquee__list {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0 clamp(1rem, 2vw, 1.75rem);
  gap: 0;
}

.project-skills-marquee__list li {
  display: flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: clamp(0.65rem, 1.25vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--project-lavender);
  white-space: nowrap;
}

.project-skills-marquee__list li + li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--project-lime);
  /* Wider gap after previous label → dot; fixed gap dot → label */
  margin-left: clamp(1.9rem, 4.5vw, 3rem);
  margin-right: 0.65rem;
  flex-shrink: 0;
}

.project-skills-marquee__list + .project-skills-marquee__list li:first-child::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--project-lime);
  margin-left: clamp(1.9rem, 4.5vw, 3rem);
  margin-right: 0.65rem;
  flex-shrink: 0;
}

.section-project__inner {
  position: relative;
  z-index: 1;
  max-width: var(--project-content-max);
  margin: 0 auto;
  padding-inline: var(--project-inner-pad-x);
  padding-top: clamp(2.25rem, 5.5vw, 3.5rem);
}

.section-project__grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

.section-project__copy {
  max-width: 31rem;
}

@media (min-width: 900px) {
  .section-project__grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.75rem, 5.5vw, 4.5rem);
    align-items: center;
  }
}

.section-project__eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--project-lavender);
}

.section-project__title {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: clamp(2.5rem, 6.2vw, 3.5rem);
  line-height: 1.22;
  margin: 0 0 1.65rem;
  text-shadow: none;
}

.section-project__title-line {
  display: block;
}

.section-project__title-line--white {
  color: #f5f0ff;
}

.section-project__title-line--lime {
  color: var(--project-lime);
}

.section-project__body {
  margin: 0 0 1.35rem;
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--project-lavender);
  text-shadow: none;
}

.section-project__body:last-of-type {
  margin-bottom: 0;
}

.section-project__body strong {
  color: #e8ddff;
  font-weight: 700;
}

.project-glance-card {
  justify-self: center;
  width: 100%;
  max-width: 20.5rem;
  background: var(--project-card);
  border: 1px solid var(--project-card-border);
  border-radius: 16px;
  padding: 1.55rem 1.5rem 1.35rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.project-glance-card__title {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: clamp(1.85rem, 3.4vw, 2.1rem);
  color: #f5f0ff;
  margin: 0 0 1.25rem;
  text-shadow: none;
}

.project-glance-card__list {
  margin: 0;
  padding: 0;
}

.project-glance-card__row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.85rem 1.15rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(179, 157, 219, 0.2);
  align-items: baseline;
}

.project-glance-card__row:first-of-type {
  padding-top: 0;
}

.project-glance-card__row:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.project-glance-card__row dt {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--project-lavender);
}

.project-glance-card__row dd {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: #f5f0ff;
  text-align: right;
}

@media (max-width: 520px) {
  .project-glance-card__row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .project-glance-card__row dd {
    text-align: left;
  }
}

/* Circular ↓ links (About, Tech, Models) */
.section-project__scroll-down {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: clamp(2.75rem, 7vw, 4rem) auto 0;
  border: 2px solid var(--project-lavender-soft);
  border-radius: 50%;
  color: var(--project-lavender);
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.section-project__scroll-down:hover {
  color: var(--project-lime);
  border-color: var(--project-lime);
  transform: translateY(3px);
}

.section-project__scroll-down--hero:hover {
  transform: translate(-50%, 3px);
}

.section-project__scroll-down:focus-visible {
  outline: 2px solid var(--project-lime);
  outline-offset: 4px;
}

/* -------------------------------------------------------------------------- */
/* 6. Shared section UI — circular scroll control + hero variant              */
/* -------------------------------------------------------------------------- */

/* Fixed at bottom of hero (desktop); same ring treatment as About */
.section-project__scroll-down--hero {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
}

@media (max-width: 899px) {
  .section-project__scroll-down--hero {
    display: none;
  }
}

/* -------------------------------------------------------------------------- */
/* 7. 3D Models (#models)                                                     */
/* -------------------------------------------------------------------------- */

.section-project--models .models-section__inner {
  padding-bottom: clamp(2.5rem, 6vw, 3.5rem);
}

.models-section__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 1.5rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.models-section__header-copy {
  min-width: 0;
  flex: 1;
}

.models-section__title {
  margin-bottom: 0;
}

.models-section__title-serif {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  font-size: clamp(1.85rem, 4.5vw, 2.85rem);
  line-height: 1.18;
  color: #f5f0ff;
}

.models-section__title .section-project__title-line--lime {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: clamp(2.2rem, 5.2vw, 3.25rem);
}

.models-section__header-spark {
  flex-shrink: 0;
  color: var(--project-lavender-soft);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  line-height: 1;
  margin-top: 0.1rem;
  opacity: 0.95;
  user-select: none;
}

.models-section__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

@media (max-width: 720px) {
  .models-section__grid {
    grid-template-columns: 1fr;
  }
}

.models-card {
  display: flex;
  flex-direction: column;
  background: var(--project-card);
  border: 1px solid var(--project-card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.3);
}

.models-card__viewport {
  height: clamp(200px, 36vw, 280px);
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, rgba(179, 157, 219, 0.14), transparent 62%),
    linear-gradient(165deg, rgba(42, 26, 64, 0.92) 0%, rgba(26, 18, 40, 0.96) 100%);
}

.models-card__viewport canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.models-card__viewport--interactive {
  cursor: grab;
  touch-action: none;
}

.models-card__viewport--interactive:active {
  cursor: grabbing;
}

.models-card__label {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  color: var(--project-lavender);
}

.models-section__scroll-down {
  margin-top: clamp(2.75rem, 7vw, 4rem);
}

/* -------------------------------------------------------------------------- */
/* 8. Tech showcase (#tech) — void band, stars, cards                         */
/* -------------------------------------------------------------------------- */

.section.section--tech-showcase {
  padding: 0;
}

.section--tech-showcase {
  --project-plum: #3a2652;
  --project-lavender: #b39ddb;
  --project-lavender-soft: rgba(179, 157, 219, 0.55);
  --project-lime: #89c34a;
  --hero-outline-green: rgba(141, 206, 106, 0.92);
  --hero-outline-purple: rgba(196, 176, 232, 0.95);
  position: relative;
  isolation: isolate;
  margin-left: calc(-1 * var(--page-gutter));
  margin-right: calc(-1 * var(--page-gutter));
  width: calc(100% + 2 * var(--page-gutter));
  max-width: none;
  background: var(--hero-void);
  overflow: hidden;
}

.section--tech-showcase .tech-showcase__body {
  position: relative;
  padding: clamp(3rem, 9vw, 5.25rem) 0 clamp(3rem, 8vw, 4.75rem);
  background: var(--hero-void);
}

.section--tech-showcase .tech-showcase__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.tech-showcase__stars {
  color: var(--hero-outline-green);
}

.tech-showcase__deco--rings {
  position: absolute;
  top: 6%;
  left: 4%;
  width: min(260px, 42vw);
  height: min(260px, 42vw);
  border: 1px solid rgba(141, 206, 106, 0.14);
  border-radius: 50%;
}

.tech-showcase__deco--rings::before,
.tech-showcase__deco--rings::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(141, 206, 106, 0.09);
}

.tech-showcase__deco--rings::before {
  inset: 11%;
}

.tech-showcase__deco--rings::after {
  inset: 22%;
  border-color: rgba(196, 176, 232, 0.12);
}

.tech-showcase__deco--triangle {
  position: absolute;
  bottom: 10%;
  right: 5%;
  width: min(120px, 22vw);
  height: auto;
  opacity: 0.85;
}

.tech-showcase__inner {
  position: relative;
  z-index: 1;
  max-width: var(--project-content-max);
  margin-inline: auto;
  padding-inline: var(--project-inner-pad-x);
}

.tech-showcase__intro {
  text-align: left;
  max-width: none;
  width: 100%;
  margin-inline: 0;
  margin-bottom: clamp(2rem, 5vw, 3rem);
  padding-inline: 0;
}

.section--tech-showcase .tech-showcase__intro .section-project__eyebrow {
  margin-bottom: 0.85rem;
  color: var(--project-lavender);
  text-shadow: none;
}

.section--tech-showcase h2.section-project__title {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: clamp(2.5rem, 6.2vw, 3.5rem);
  line-height: 1.22;
  margin: 0 0 1.65rem;
  text-shadow: none;
  color: #f5f0ff;
}

.section--tech-showcase .tech-showcase__intro .section-project__title {
  margin-bottom: 0;
}

.tech-showcase__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.45rem);
  width: 100%;
  margin-inline: 0;
  padding-inline: 0;
  justify-items: stretch;
}

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

.tech-card {
  position: relative;
  padding: 1.25rem 1.4rem 1.45rem;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(42, 32, 58, 0.88) 0%, rgba(26, 18, 40, 0.94) 100%);
  border: 1px solid rgba(196, 176, 232, 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    transform 0.22s ease,
    border-color 0.25s ease,
    box-shadow 0.28s ease;
}

.tech-card:hover {
  transform: translateY(-5px);
  border-color: rgba(157, 206, 106, 0.55);
  box-shadow:
    0 0 22px rgba(137, 195, 74, 0.35),
    0 0 44px rgba(157, 206, 106, 0.18),
    0 16px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tech-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.tech-card__logo {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tech-card__logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 2.35rem;
  max-height: 2.35rem;
  object-fit: contain;
}

.tech-card__title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f5f0ff;
  text-shadow: none;
}

.tech-card__text {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--project-lavender);
  text-shadow: none;
}

.section--tech-showcase .tech-showcase__scroll-down {
  margin-top: clamp(3.25rem, 8vw, 6.5rem);
}

/* Beat `.section p` (pink) — cards sit inside `.section` */
.section--tech-showcase .tech-card__title {
  color: #f5f0ff;
  text-shadow: none;
}

.section--tech-showcase .tech-card__text {
  color: var(--project-lavender);
  text-shadow: none;
}

/* -------------------------------------------------------------------------- */
/* 9. Gallery (#gallery) — void band, same deco as Tech                       */
/* -------------------------------------------------------------------------- */

.section.section--gallery {
  padding: 0;
}

.section--gallery {
  --project-plum: #3a2652;
  --project-lavender: #b39ddb;
  --project-lavender-soft: rgba(179, 157, 219, 0.55);
  --project-lime: #89c34a;
  --hero-outline-green: rgba(141, 206, 106, 0.92);
  --hero-outline-purple: rgba(196, 176, 232, 0.95);
  --hero-lilac: #c9b6eb;
  position: relative;
  isolation: isolate;
  margin-left: calc(-1 * var(--page-gutter));
  margin-right: calc(-1 * var(--page-gutter));
  width: calc(100% + 2 * var(--page-gutter));
  max-width: none;
  background: var(--hero-void);
  overflow: hidden;
}

.section--gallery .gallery__body {
  position: relative;
  padding: clamp(3rem, 9vw, 5.25rem) 0 clamp(3rem, 8vw, 4.75rem);
  background: var(--hero-void);
}

.section--gallery .gallery__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.gallery__inner {
  position: relative;
  z-index: 1;
  max-width: var(--project-content-max);
  margin-inline: auto;
  padding-inline: var(--project-inner-pad-x);
}

.gallery__intro {
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section--gallery .gallery__eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--project-lavender);
  text-shadow: none;
}

.gallery__title {
  margin: 0;
  line-height: 1.18;
  text-shadow: none;
}

.gallery__title-line {
  display: block;
}

.gallery__title-line--serif {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  color: #f5f0ff;
}

.gallery__title-line--script {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: clamp(2.35rem, 5.8vw, 3.35rem);
  color: var(--hero-lilac);
}

.gallery__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-rows: 1fr 1fr;
  gap: clamp(1rem, 2.2vw, 1.45rem);
  min-height: clamp(300px, 50vw, 520px);
}

.gallery__feature {
  grid-column: 1;
  grid-row: 1 / -1;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(42, 32, 58, 0.88) 0%, rgba(26, 18, 40, 0.94) 100%);
  border: 1px solid rgba(196, 176, 232, 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 1.75rem);
  min-height: 0;
  transition: border-color 0.22s ease, box-shadow 0.25s ease;
}

.gallery__feature--media {
  padding: 0;
  overflow: hidden;
}

.gallery__quad {
  grid-column: 2;
  grid-row: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(1rem, 2.2vw, 1.45rem);
  min-height: 0;
}

.gallery__tile {
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(42, 32, 58, 0.88) 0%, rgba(26, 18, 40, 0.94) 100%);
  border: 1px solid rgba(196, 176, 232, 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.25s ease;
}

.gallery__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery__placeholder {
  font-family: var(--font-body);
  font-size: clamp(0.62rem, 1.3vw, 0.76rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(179, 157, 219, 0.5);
  line-height: 1.35;
}

.gallery__feature:hover,
.gallery__tile:hover {
  border-color: rgba(157, 206, 106, 0.45);
  box-shadow:
    0 0 18px rgba(137, 195, 74, 0.22),
    0 12px 36px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.gallery__feature--media,
.gallery__tile {
  cursor: pointer;
  touch-action: manipulation;
}

.gallery__feature--media:focus-visible,
.gallery__tile:focus-visible {
  outline: 2px solid rgba(157, 206, 106, 0.85);
  outline-offset: 3px;
  z-index: 1;
}

.gallery-lightbox {
  margin: auto;
  padding: 0;
  max-width: none;
  max-height: none;
  width: min(100vw, 1120px);
  border: none;
  background: transparent;
  color: inherit;
}

.gallery-lightbox::backdrop {
  background: rgba(12, 8, 22, 0.88);
  backdrop-filter: blur(6px);
}

.gallery-lightbox__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2.75rem, 8vw, 3.5rem) clamp(1rem, 4vw, 2rem) clamp(1.25rem, 4vw, 2rem);
}

.gallery-lightbox__img {
  display: block;
  max-width: min(96vw, 1080px);
  max-height: min(86vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(196, 176, 232, 0.2);
}

.gallery-lightbox__close {
  position: absolute;
  top: clamp(0.65rem, 2.5vw, 1rem);
  right: clamp(0.65rem, 2.5vw, 1rem);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(196, 176, 232, 0.45);
  border-radius: 50%;
  background: rgba(26, 18, 40, 0.92);
  color: #f5f0ff;
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.gallery-lightbox__close:hover {
  background: rgba(42, 32, 58, 0.96);
  border-color: rgba(157, 206, 106, 0.55);
  color: #fff;
}

.gallery-lightbox__close:focus-visible {
  outline: 2px solid rgba(157, 206, 106, 0.9);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* 10. Hero (first viewport) + WebGL frame                                   */
/* -------------------------------------------------------------------------- */

.hero {
  --hero-bg: var(--hero-void);
  --hero-olive: #9aab8a;
  --hero-cream: #f4f1e8;
  --hero-lilac: #c9b6eb;
  --hero-body: rgba(218, 226, 212, 0.88);
  --hero-outline-green: rgba(141, 206, 106, 0.92);
  --hero-outline-purple: rgba(196, 176, 232, 0.95);
  --project-lavender: #b39ddb;
  --project-lavender-soft: rgba(179, 157, 219, 0.55);
  --project-lime: #89c34a;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  align-content: center;
  margin-left: calc(-1 * var(--page-gutter));
  margin-right: calc(-1 * var(--page-gutter));
  width: calc(100% + 2 * var(--page-gutter));
  padding: calc(var(--header-h) + 2.5rem) max(var(--page-gutter), calc((100vw - min(var(--project-content-max), 100vw)) / 2 + var(--project-inner-pad-x))) 4.5rem;
  background: var(--hero-bg);
  overflow: hidden;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
    grid-template-rows: auto;
    grid-template-areas: "hero-left hero-video";
    gap: clamp(1.25rem, 3.5vw, 2.75rem);
    align-items: center;
  }
}

@media (max-width: 899px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas:
      "hero-intro"
      "hero-video"
      "hero-contact";
  }
}

/* Intro + contact share one column on desktop; on mobile, flatten so grid areas still work */
.hero__left {
  display: contents;
}

@media (min-width: 900px) {
  .hero__left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(1.25rem, 3.5vw, 2.75rem);
    grid-area: hero-left;
    justify-self: center;
    margin-inline: clamp(0.25rem, 2vw, 1.5rem) auto;
    width: min(100%, 28rem);
    max-width: 28rem;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
  }
}

.hero__stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  color: var(--hero-outline-green);
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

.hero__star {
  position: absolute;
  overflow: visible;
  opacity: 0.55;
}

.hero__star--g1 {
  top: 12%;
  right: 18%;
  width: clamp(52px, 7vw, 76px);
  height: clamp(52px, 7vw, 76px);
  color: var(--hero-outline-green);
  opacity: 0.65;
}

.hero__star--p1 {
  bottom: 22%;
  left: 8%;
  width: clamp(44px, 6vw, 64px);
  height: clamp(44px, 6vw, 64px);
  color: var(--hero-outline-purple);
  opacity: 0.55;
}

.hero__star--g2 {
  top: 38%;
  right: 8%;
  width: clamp(32px, 4.5vw, 48px);
  height: clamp(32px, 4.5vw, 48px);
  color: var(--hero-outline-green);
  opacity: 0.45;
}

.hero__star--p2 {
  top: 58%;
  left: 4%;
  width: clamp(36px, 5vw, 52px);
  height: clamp(36px, 5vw, 52px);
  color: var(--hero-outline-purple);
  opacity: 0.4;
}

.hero__star--g3 {
  bottom: 14%;
  right: 42%;
  width: clamp(28px, 4vw, 40px);
  height: clamp(28px, 4vw, 40px);
  color: var(--hero-outline-green);
  opacity: 0.38;
}

.webgl-frame {
  position: relative;
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
}

/* Hero trailer (YouTube) — shell matches former hero panel framing */
.hero__video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: linear-gradient(165deg, var(--baby-pink-panel) 0%, var(--baby-pink) 55%, var(--baby-pink-rich) 100%);
  border: 3px solid var(--dark-pink);
  overflow: hidden;
  box-shadow: 0 8px 0 var(--shadow-pink), 0 20px 48px rgba(110, 37, 64, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hero .hero__video-shell {
  background:
    radial-gradient(ellipse 80% 60% at 35% 25%, rgba(196, 176, 232, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 70% 80%, rgba(141, 206, 106, 0.08), transparent 50%),
    linear-gradient(165deg, #2a1538 0%, var(--hero-void) 100%);
  border: 1px solid rgba(196, 176, 232, 0.35);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (min-width: 900px) {
  .hero__video-shell {
    max-height: min(62vh, 520px);
    width: min(100%, calc(min(62vh, 520px) * 16 / 9));
    margin-inline: auto;
  }
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  width: 100%;
  margin-inline: 0;
  padding-inline: 0;
  grid-area: hero-intro;
}

.hero__eyebrow {
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-size: clamp(0.65rem, 1.35vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hero-olive);
}

.hero__title {
  margin: 0 0 1.25rem;
  line-height: 1.02;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(3.35rem, 12vw, 5.75rem);
  letter-spacing: 0.01em;
  text-shadow: none;
}

.hero__title-line {
  display: block;
}

.hero__title-line--cream {
  color: var(--hero-cream);
}

.hero__title-line--lilac {
  color: var(--hero-lilac);
  margin-top: -0.06em;
}

.hero__video-intro {
  margin: 0 0 0.55rem;
  font-family: var(--font-script);
  font-size: clamp(1.65rem, 3.2vw, 2.65rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: none;
}

.hero__webgl-wrap {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  width: 100%;
  margin-inline: auto;
  grid-area: hero-video;
}

@media (min-width: 900px) {
  .hero__webgl-wrap {
    margin-inline: auto 0;
    max-width: min(44rem, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero__video-intro {
    text-align: center;
    align-self: stretch;
  }
}

.lede {
  font-size: 1.125rem;
  color: var(--text-pink-soft);
  margin: 0 0 1rem;
  text-shadow: 1px 1px 0 rgba(110, 37, 64, 0.35);
}

.lede strong {
  color: var(--text-pink);
  font-weight: 700;
}

.hero .lede {
  font-size: 1.0625rem;
  line-height: 1.68;
  color: var(--hero-body);
  text-shadow: none;
  max-width: 26rem;
  margin-bottom: 1.35rem;
}

.hero .lede strong {
  color: #e8eee3;
  font-weight: 600;
}

.hero__contact {
  display: grid;
  gap: 0.2rem;
  margin-top: 0;
  width: fit-content;
  max-width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(196, 176, 232, 0.35);
  background: linear-gradient(165deg, rgba(42, 26, 64, 0.72) 0%, rgba(26, 18, 40, 0.84) 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  grid-area: hero-contact;
  align-self: start;
}

@media (max-width: 899px) {
  .hero__contact {
    justify-self: center;
    margin-top: 2.25rem;
  }
}

.hero__contact-heading {
  margin: 0 0 0.15rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--project-lime);
}

.hero__contact-name {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f5f0ff;
}

.hero__contact-email {
  color: var(--project-lavender);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.hero__contact-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
}

.hero__contact-icon {
  width: 1.45rem;
  height: 1.45rem;
  flex-shrink: 0;
  display: block;
  transform: translateY(-2px);
}

.hero__contact-email:hover {
  color: #c8f5a0;
  text-shadow: 0 0 12px rgba(157, 206, 106, 0.5);
}

.hero__contact-email:focus-visible {
  outline: 2px solid #9dce6a;
  outline-offset: 3px;
  border-radius: 4px;
}

.contact__inner {
  padding-top: clamp(2.25rem, 6vw, 3rem);
  padding-bottom: clamp(2.25rem, 6vw, 3rem);
}

.contact__eyebrow {
  margin: 0 0 0.65rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--project-lime);
}

.contact__title {
  margin: 0 0 1rem;
  font-family: var(--font-script);
  font-size: clamp(2rem, 4.8vw, 3rem);
  color: #f5f0ff;
  line-height: 1.15;
}

.contact__name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f5f0ff;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.25rem;
  row-gap: 0.35rem;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--project-lavender);
  text-decoration: none;
  font-weight: 600;
}

.contact__link span {
  line-height: 1;
}

.contact__link--linkedin {
  align-items: center;
}

.contact__link:hover {
  color: #c8f5a0;
}

.contact__icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  transform: translateY(-2px);
}

/* -------------------------------------------------------------------------- */
/* 11. Generic .section helper + footer                                      */
/*    (.section also on #tech / #gallery for padding reset + p colour)        */
/* -------------------------------------------------------------------------- */

.section {
  padding: clamp(3.25rem, 9vw, 5.5rem) 0;
}

.section p {
  margin: 0 0 1rem;
  color: var(--text-pink-soft);
  max-width: none;
  text-shadow: 1px 1px 0 rgba(110, 37, 64, 0.25);
}

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

.section p strong {
  color: var(--text-pink);
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 2rem var(--page-gutter) 2.75rem;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 500;
  background: #3a2652;
}

.site-footer__tagline {
  margin: 0 auto;
  max-width: min(100%, 58rem);
  padding-inline: var(--reading-inset);
  font-size: 0.98rem;
  color: #8f79b6;
  font-weight: 600;
  text-shadow: 1px 1px 0 rgba(30, 11, 46, 0.45);
}

.site-footer__brand {
  font-family: var(--font-script);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #7f68a5;
  text-shadow: none;
  font-size: 1.5em;
}

/* -------------------------------------------------------------------------- */
/* 12. Mobile / small-tablet responsive refinements                           */
/* -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  :root {
    --header-h: 116px;
    --page-gutter: clamp(1rem, 5vw, 1.5rem);
    --mobile-content-max: 22.5rem;
  }

  .site-header {
    min-height: var(--header-h);
  }

  .site-header__inner {
    min-height: var(--header-h);
    flex-direction: column;
    justify-content: center;
    gap: 0.95rem;
    padding-block: 0.85rem 0.7rem;
  }

  .logo {
    font-size: clamp(1.7rem, 6vw, 2.25rem);
  }

  .nav__list {
    justify-content: center;
    row-gap: 0.25rem;
  }

  .nav__list li + li::before {
    margin: 0 0.6rem;
  }

  .nav__list a {
    letter-spacing: 0.14em;
    font-size: 0.73rem;
  }

  .hero {
    min-height: auto;
    align-content: start;
    padding-top: calc(var(--header-h) + 1.15rem);
    padding-bottom: 2.5rem;
    gap: 1.2rem;
  }

  .hero__content {
    max-width: min(100%, var(--mobile-content-max));
    margin-inline: auto;
  }

  .hero__title {
    font-size: clamp(2.6rem, 13vw, 4.1rem);
  }

  .hero .lede {
    font-size: 0.96rem;
    line-height: 1.6;
    max-width: 100%;
  }

  .hero__video-shell {
    max-height: min(42vh, 360px);
    width: min(100%, calc(min(42vh, 360px) * 16 / 9));
    margin-inline: auto;
  }

  .hero__webgl-wrap {
    max-width: min(100%, var(--mobile-content-max));
    margin-inline: auto;
  }

  .hero__video-intro {
    text-align: center;
  }

  .section-project__inner,
  .tech-showcase__inner,
  .gallery__inner {
    max-width: min(100%, var(--mobile-content-max));
    margin-inline: auto;
    padding-inline: 0;
  }

  .gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: minmax(110px, 30vw);
    gap: clamp(0.55rem, 2.2vw, 0.85rem);
    min-height: 0;
  }

  .gallery__feature {
    grid-column: auto;
    grid-row: auto;
    min-height: min(30vw, 200px);
  }

  .gallery__quad {
    display: contents;
  }

  .gallery__tile {
    min-height: min(30vw, 200px);
  }

  .gallery__grid > .gallery__tile:last-of-type {
    grid-column: 1 / -1;
    min-height: min(38vw, 240px);
  }

  .tech-showcase__grid,
  .models-section__grid {
    max-width: min(100%, var(--mobile-content-max));
    margin-inline: auto;
    padding-inline: 0;
  }

  .section-project__title,
  .section--tech-showcase h2.section-project__title {
    font-size: clamp(2rem, 9vw, 2.8rem);
    line-height: 1.18;
  }

  .models-section__title-serif {
    font-size: clamp(1.5rem, 7vw, 2.1rem);
  }

  .models-section__title .section-project__title-line--lime {
    font-size: clamp(1.85rem, 8vw, 2.55rem);
  }

  .contact__links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .site-footer {
    padding-top: 1.4rem;
    padding-bottom: 2rem;
  }
}

@media (max-width: 640px) {
  .project-spark--4,
  .project-spark--5,
  .project-spark--6,
  .hero__star--g2,
  .hero__star--p2 {
    display: none;
  }

  .section-project__scroll-down {
    width: 2.65rem;
    height: 2.65rem;
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .project-skills-marquee__track {
    animation: none;
    width: 100%;
    justify-content: center;
  }

  .project-skills-marquee__list {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.55rem;
    column-gap: 0.25rem;
    padding-inline: var(--project-inner-pad-x);
  }

  .project-skills-marquee__list[aria-hidden="true"] {
    display: none !important;
  }

  .nav__list a {
    transition: color 0.15s ease;
  }

  .nav__list a:hover {
    transform: none;
    text-shadow: 0 0 12px rgba(157, 206, 106, 0.55);
  }

  .section-project__scroll-down:hover,
  .tech-card:hover {
    transform: none;
  }

  .section-project__scroll-down--hero:hover {
    transform: translateX(-50%);
  }

  .tech-card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .tech-card:hover {
    box-shadow:
      0 0 16px rgba(157, 206, 106, 0.35),
      0 12px 32px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}
