@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap");

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

:root {
  /* HSL Design Tokens for more control */
  --h-accent: 161;
  --s-accent: 84%;
  --l-accent: 45%;
  
  --h-cool: 171;
  --s-cool: 60%;
  --l-cool: 60%;

  --bg: hsl(210, 54%, 6%);
  --bg-alt: hsl(210, 46%, 10%);
  --surface: hsla(210, 50%, 9%, 0.82);
  --surface-strong: hsla(210, 50%, 7%, 0.96);
  --surface-soft: hsla(0, 0%, 100%, 0.05);
  --text: hsl(40, 30%, 94%);
  --muted: hsl(210, 20%, 72%);
  --line: hsla(0, 0%, 100%, 0.08);
  --line-strong: hsla(0, 0%, 100%, 0.14);
  
  --accent: hsl(var(--h-accent), var(--s-accent), var(--l-accent));
  --accent-strong: hsl(var(--h-accent), var(--s-accent), 60%);
  --accent-cool: hsl(var(--h-cool), var(--s-cool), var(--l-cool));
  --accent-soft: hsla(var(--h-cool), var(--s-cool), var(--l-cool), 0.12);
  
  --success: hsl(145, 55%, 68%);
  --shadow: 0 32px 84px -12px rgba(0, 0, 0, 0.44);
  
  /* Simplified Theme Tokens */
  --static-green: rgba(0, 255, 122, 0.05);
  --static-green-line: rgba(0, 255, 122, 0.2);
  
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --content: 1200px;
}

body[data-theme="light"] {
  --bg: hsl(36, 30%, 93%);
  --bg-alt: hsl(36, 40%, 97%);
  --surface: hsla(0, 0%, 100%, 0.84);
  --surface-strong: hsla(0, 0%, 100%, 0.94);
  --surface-soft: hsla(210, 50%, 9%, 0.04);
  --text: hsl(210, 36%, 12%);
  --muted: hsl(210, 15%, 41%);
  --line: hsla(210, 50%, 9%, 0.08);
  --line-strong: hsla(210, 50%, 9%, 0.12);
  
  --accent: hsl(161, 84%, 35%);
  --accent-strong: hsl(161, 84%, 28%);
  --accent-cool: hsl(171, 59%, 35%);
  --accent-soft: hsla(171, 59%, 35%, 0.08);
  --shadow: 0 24px 64px -10px rgba(36, 41, 46, 0.14);
}

html {
  scroll-behavior: smooth;
  height: 100%;
  width: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

.mobile-only { display: none !important; }

/* Dynamic background glow blobs */
.glow-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
  animation: float 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(10vw, 5vh) scale(1.1); }
}

.glow-blob--1 {
  top: -10%;
  left: -10%;
  width: 40vw;
  height: 40vw;
  background: var(--accent);
}

.glow-blob--2 {
  bottom: -5%;
  right: -5%;
  width: 35vw;
  height: 35vw;
  background: var(--accent-cool);
  animation-delay: -5s;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, hsla(var(--h-accent), 100%, 50%, 0.03), transparent 40%),
    radial-gradient(circle at 80% 70%, hsla(var(--h-cool), 100%, 50%, 0.03), transparent 40%);
  pointer-events: none;
  z-index: -1;
}

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

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 18px;
  top: -60px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  z-index: 100;
}

.skip-link:focus {
  top: 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: hsla(210, 50%, 4%, 0.72);
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.04);
  transition: background 0.3s ease, border-color 0.3s ease;
}

body[data-theme="light"] .site-header {
  background: hsla(36, 40%, 97%, 0.76);
  border-bottom-color: hsla(210, 50%, 9%, 0.06);
}

.site-header__inner,
.section__inner,
.site-footer__inner {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand__logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-cool));
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand__logo {
  transform: scale(1.06) rotate(-2deg);
}

.brand__copy {
  min-width: 0;
}

.brand__title,
.brand__subtitle {
  display: block;
}

.brand__title {
  font-family: "Playfair Display", serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand__subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

body:not([data-page="home"]) .nav-toggle,
body:not([data-page="home"]) .theme-toggle {
  display: none !important;
}

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

.site-nav--simple {
  display: flex;
}

.site-nav__link,
.nav-toggle,
.theme-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.header-back-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.header-back-link:hover,
.header-back-link:focus-visible {
  color: #fff;
  background: #ff7a00;
  border-color: #ff7a00;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
  outline: none;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
  outline: none;
}

.site-nav__link.is-active {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--line);
}

.site-nav__link.is-active:hover,
.site-nav__link.is-active:focus-visible {
  color: #fff;
  background: #FF7A00;
  border-color: #FF7A00;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
  outline: none;
}

.nav-toggle:hover,
.nav-toggle:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--line);
  outline: none;
}

.nav-toggle {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.button:hover,
.button:focus-visible {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.28) !important;
  transform: translateY(-2px);
  outline: none;
}

.button--primary {
  color: #071018;
  background: linear-gradient(135deg, var(--accent), var(--accent-cool));
  box-shadow: 0 16px 34px rgba(7, 16, 24, 0.24);
}

.button--secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button.is-loading,
.button[aria-busy="true"] {
  opacity: 0.82;
  pointer-events: none;
}

.button.is-loading::after,
.button[aria-busy="true"]::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}

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

.section {
  padding: 40px 0;
}

.section--alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.hero,
.page-hero {
  position: relative;
  overflow: hidden;
  padding-top: 52px;
}

.hero__grid,
.page-hero__grid,
.contact-layout,
.card-grid,
.stats-grid,
.process-grid,
.site-footer__inner {
  display: grid;
  gap: 22px;
}

.hero__grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  align-items: stretch;
}

.page-hero__grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: stretch;
}

.hero__copy,
.panel,
.card,
.project-card,
.project-detail,
.stat-card,
.process-card,
.cta-band,
.callout-box {
  padding: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.hero__copy:hover,
.panel:hover,
.card:hover,
.project-card:hover,
.project-detail:hover,
.stat-card:hover,
.process-card:hover,
.cta-band:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

/* Maintain original styling for top project cards to exclude from new behavior */
.project-card {
  padding: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.08;
}

h1,
h2 {
  font-family: "Playfair Display", serif;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(3.2rem, 7vw, 5.2rem);
  max-width: 12ch;
  font-weight: 800;
  color: var(--text);
  line-height: 1.02;
  margin-bottom: 0.4em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0;
  color: var(--muted);
}

.hero__lead {
  margin-top: 18px;
  max-width: 58ch;
  font-size: 1.06rem;
}

.eyebrow,
.card__eyebrow,
.panel__label {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.panel__label,
.card__eyebrow {
  margin-bottom: 14px;
}

.button-row,
.contact-links,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row {
  margin-top: 22px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
}

.stat-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.stat-card:hover {
  background: linear-gradient(135deg, rgba(0, 255, 122, 0.04), rgba(0, 255, 122, 0.01)), var(--surface) !important;
  border-color: rgba(0, 255, 122, 0.45) !important;
  box-shadow: 0 16px 40px rgba(0, 255, 122, 0.12) !important;
  transform: translateY(-2px);
  cursor: pointer;
}

.stat-card:hover strong {
  color: var(--accent);
  transition: color 0.3s ease;
}

.stat-card strong {
  display: block;
  font-size: 1.55rem;
  margin-bottom: 8px;
}

.proof-list,
.bullet-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.proof-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.proof-list li {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--static-green-line);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 10px var(--static-green);
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.proof-list li.is-glow-focus,
.proof-list li:active {
  border-color: var(--bright-orange);
  box-shadow: 0 0 25px rgba(255, 122, 0, 0.5);
}

.proof-list li:hover {
  background: linear-gradient(135deg, rgba(0, 255, 122, 0.04), rgba(0, 255, 122, 0.01)), var(--surface) !important;
  border-color: rgba(0, 255, 122, 0.45) !important;
  box-shadow: 0 16px 40px rgba(0, 255, 122, 0.12) !important;
  transform: translateY(-2px);
  cursor: pointer;
}

.proof-list li:hover strong {
  color: var(--accent);
  transition: color 0.3s ease;
}

.proof-list strong {
  font-size: 0.98rem;
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section__head--compact {
  margin-bottom: 18px;
}

.section__head p {
  max-width: 56ch;
}

.card-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.project-card,
.project-detail {
  display: grid;
  gap: 14px;
}

.project-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(95, 212, 193, 0.28);
  background: rgba(95, 212, 193, 0.1);
  color: var(--accent-cool);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-card--featured,
.project-detail--featured {
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(95, 212, 193, 0.12), transparent 34%),
    radial-gradient(circle at left center, rgba(241, 180, 91, 0.12), transparent 28%),
    var(--surface);
  border-color: rgba(241, 180, 91, 0.26);
}

.project-card {
  position: relative;
}

.project-card::before,
.project-card--featured::before,
.project-detail--featured::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-cool));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.project-card--featured {
  grid-column: span 2;
}

.project-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.project-card__actions--detail {
  margin-top: 10px;
}

.project-video-block {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding: 30px;
  border-radius: 30px;
  border: 1px solid var(--static-green-line);
  background:
    radial-gradient(circle at top right, rgba(241, 180, 91, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.2), 0 0 15px var(--static-green);
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.project-video-block.is-glow-focus,
.project-video-block:active {
  border-color: var(--bright-orange);
  box-shadow: var(--orange-ring-glow);
  animation: lit-up-pulse 1.8s infinite alternate;
}

.project-video__copy {
  display: grid;
  gap: 10px;
}

.project-video {
  display: grid;
  gap: 20px;
}

.project-video video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  min-height: clamp(360px, 54vw, 620px);
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid rgba(241, 180, 91, 0.3);
  background: #08111a;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.project-gallery-block {
  display: grid;
  gap: 20px;
  margin-top: 32px;
  padding: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  transition: transform 0.4s ease, border-color 0.4s ease;
}

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

.gallery-item {
  margin: 0;
  display: grid;
  gap: 12px;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--orange-line);
  box-shadow: 0 4px 18px var(--orange-glow);
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), border-color 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.03) translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.gallery-item figcaption {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  transition: color 0.3s ease;
}

.gallery-item:hover figcaption {
  color: var(--accent);
}

.video-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button--file {
  justify-content: flex-start;
  min-width: 190px;
  padding-right: 24px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--orange-line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14), 0 4px 12px var(--orange-glow);
}

.button--file:hover,
.button--file:focus-visible {
  border-color: rgba(241, 180, 91, 0.42);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(241, 180, 91, 0.28), rgba(95, 212, 193, 0.24));
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tag {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.9rem;
}

.bullet-list {
  display: grid;
  gap: 10px;
}

.bullet-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
}

.bullet-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-cool));
}

.process-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.process-card__index {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-cool));
  color: #071018;
  font-weight: 800;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.detail-stack,
.side-stack,
.narrow-stack {
  display: grid;
  gap: 20px;
}

.project-detail__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.contact-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 18px;
}

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

.field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--orange-line);
  background: rgba(255, 122, 0, 0.03);
  color: var(--text);
  padding: 14px 16px;
  resize: vertical;
  box-shadow: 0 0 0 0 rgba(255, 122, 0, 0), 0 2px 8px var(--glow-orange);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.field input:hover,
.field textarea:hover {
  border-color: rgba(255, 122, 0, 0.65);
  background: rgba(255, 122, 0, 0.05);
}

body[data-theme="light"] .field input,
body[data-theme="light"] .field textarea {
  background: rgba(12, 21, 30, 0.03);
}

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

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22), 0 8px 24px rgba(16, 185, 129, 0.12);
  background: rgba(16, 185, 129, 0.05);
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.form-note {
  font-size: 0.92rem;
}

.form-status {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(128, 217, 163, 0.26);
  background: rgba(128, 217, 163, 0.08);
  color: var(--success);
}

.callout-box {
  display: grid;
  gap: 6px;
  margin-top: 22px;
}

.site-footer {
  padding: 30px 0 44px;
}

.site-footer__inner {
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.7fr);
  align-items: start;
  padding-top: 10px;
}

.site-footer__links {
  display: grid;
  gap: 10px;
}

.site-footer__links a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
  color: var(--text);
  outline: none;
}

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

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  will-change: transform, opacity;
  transition: opacity 620ms cubic-bezier(0.2, 1, 0.3, 1), transform 620ms cubic-bezier(0.2, 1, 0.3, 1);
  transition-delay: var(--delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 800ms cubic-bezier(0.2, 1, 0.3, 1), transform 800ms cubic-bezier(0.2, 1, 0.3, 1);
  will-change: auto;
}

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

@media (max-width: 1080px) {
  .hero__grid,
  .page-hero__grid,
  .contact-layout,
  .card-grid--three,
  .process-grid,
  .site-footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .project-card--featured {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  /* Mobile/tablet scaling */
  h1 {
    font-size: clamp(2.4rem, 6vw, 3.4rem);
  }

  h2 {
    font-size: clamp(1.7rem, 4.8vw, 2.4rem);
  }

  h3 {
    font-size: 1.12rem;
  }

  .section {
    padding: 32px 0;
  }

  .hero__grid,
  .page-hero__grid,
  .contact-layout,
  .card-grid,
  .stats-grid,
  .process-grid,
  .site-footer__inner {
    gap: 18px;
  }

  .hero__copy,
  .panel,
  .card,
  .project-card,
  .project-detail,
  .cta-band {
    padding: 20px;
  }

  .button {
    min-height: 44px;
    padding: 0 18px;
  }

  .site-header__inner {
    row-gap: 8px;
  }

  .site-nav {
    gap: 6px;
  }

  .site-nav__link,
  .nav-toggle,
  .theme-toggle {
    padding: 0 12px;
    min-height: 40px;
    font-size: 0.93rem;
  }

  .site-header__inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    order: 5;
    flex-direction: column;
    align-items: stretch;
    padding-top: 8px;
  }

  body[data-nav-open="true"] .site-nav {
    display: flex;
  }

  .site-nav--simple {
    display: flex;
    width: auto;
    order: 0;
    flex-direction: row;
    flex-wrap: wrap;
    padding-top: 0;
  }

  .site-nav__link,
  .site-nav .button {
    width: 100%;
  }

  .hero__grid,
  .page-hero__grid,
  .contact-layout,
  .card-grid--three,
  .stats-grid,
  .process-grid,
  .site-footer__inner,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .section__head,
  .cta-band,
  .project-detail__head {
    flex-direction: column;
    align-items: start;
  }

  .project-card--featured {
    grid-column: auto;
  }

  .button--file {
    width: 100%;
    min-width: 0;
  }

  .video-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .project-video-block {
    padding: 22px;
    border-radius: 24px;
  }

  .project-video video {
    min-height: auto;
  }
}

/* ===========================
   MOBILE RESPONSIVENESS OVERRIDE
   Max-width 768px
=========================== */
@media (max-width: 768px) {
  /* Mobile scroll safety: keep document flow natural on touch devices */
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
  }

  main,
  .section,
  .section__inner,
  .hero,
  .page-hero,
  .hero__grid,
  .page-hero__grid,
  .contact-layout,
  .detail-stack {
    height: auto;
    min-height: 100%;
    overflow-y: visible;
  }

  /* Prevent sticky/fixed layers from interfering with mobile scroll */
  .site-header {
    position: relative;
    top: auto;
  }

  .hero,
  .page-hero {
    overflow: visible;
  }

  /* Restored background blobs for mobile */
  .glow-blob,
  body::before {
    display: block;
    opacity: 0.1; /* Lowered opacity for mobile performance */
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  body {
    font-size: clamp(0.9rem, 0.85rem + 0.4vw, 1rem);
    line-height: 1.5;
  }

  h1 {
    font-size: clamp(1.62rem, 5.6vw, 2.08rem);
    line-height: 1.1;
  }

  h2 {
    font-size: clamp(1.22rem, 4.6vw, 1.56rem);
    line-height: 1.15;
  }

  h3 {
    font-size: clamp(1rem, 3.5vw, 1.14rem);
    line-height: 1.2;
  }

  .brand {
    gap: 10px;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 16px;
  }

  .brand__title {
    font-size: clamp(0.92rem, 0.86rem + 0.2vw, 1rem);
  }

  .brand__subtitle {
    font-size: 0.64rem;
    letter-spacing: 0.12em;
  }

  .section {
    padding: 28px 0;
  }

  .hero__grid,
  .page-hero__grid,
  .contact-layout,
  .card-grid,
  .card-grid--three,
  .stats-grid,
  .process-grid,
  .detail-stack,
  .site-footer__inner,
  .project-gallery,
  .video-buttons {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .hero__copy,
  .panel,
  .card,
  .project-card,
  .project-detail,
  .stat-card,
  .process-card,
  .cta-band,
  .callout-box,
  .project-video-block,
  .project-gallery-block {
    padding: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .section__inner,
  .hero__grid,
  .page-hero__grid,
  .card-grid,
  .card-grid--three,
  .detail-stack {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .site-header__inner {
    padding: 8px 0;
    row-gap: 8px;
  }

  .header-back-link {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .site-nav {
    gap: 8px;
  }

  .site-nav__link,
  .nav-toggle,
  .theme-toggle {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .button,
  .button--file {
    min-height: 44px;
    padding: 0 16px;
    font-size: clamp(0.84rem, 0.8rem + 0.3vw, 0.95rem);
    touch-action: manipulation;
  }

  /* Mobile-only button color cleanup: remove green tint */
  .button--primary {
    background: linear-gradient(135deg, #34d399, #10b981);
    border-color: #10b981;
    color: #071018;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28);
  }

  .button--file {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.45);
  }

  .button__icon {
    background: rgba(16, 185, 129, 0.22);
  }

  .button:active,
  .button--file:active {
    background: #10b981 !important;
    color: #fff !important;
    border-color: #10b981 !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25) !important;
    transform: translateY(0);
  }

  .section__head,
  .cta-band,
  .project-detail__head {
    flex-direction: column;
    gap: 10px;
  }

  .project-card,
  .project-card__actions {
    gap: 12px;
  }

  .project-card h3 {
    margin: 0;
    font-size: clamp(1.05rem, 3.8vw, 1.22rem);
    line-height: 1.24;
  }

  .project-card h3::after,
  .project-card .button::after {
    content: none !important;
    display: none !important;
  }

  .project-card .button {
    width: 100%;
    justify-content: center;
    font-size: clamp(0.84rem, 0.8rem + 0.3vw, 0.95rem);
    white-space: normal;
    text-align: center;
    height: auto;
    padding-block: 10px;
    min-height: 44px;
  }

  /* Restored project media blocks for mobile */
  body[data-page="projects"] .project-detail .project-video-block,
  body[data-page="projects"] .project-detail .project-gallery-block,
  body[data-page="projects"] .project-detail .project-video,
  body[data-page="projects"] .project-detail .project-gallery,
  body[data-page="projects"] .project-detail .video-buttons {
    display: block !important;
  }

  body[data-page="projects"] .page-hero__grid > aside.panel {
    padding: 16px;
  }

  body[data-page="projects"] .section__head > p {
    max-width: none;
  }

  .project-detail {
    scroll-margin-top: 88px;
  }

  .project-video video {
    min-height: auto;
  }

  .gallery-item figcaption {
    font-size: 0.78rem;
  }

  .js .reveal {
    transform: translate3d(0, 8px, 0);
    transition-duration: 320ms;
    transition-timing-function: ease-out;
    will-change: transform, opacity;
  }

  .project-card--dynamic:hover,
  .project-card--dynamic:hover .button--secondary {
    transform: none !important;
  }
}

/* Terminal Snippet Styles */
.terminal-snippet {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.4;
  color: #c9d1d9;
  overflow-x: auto;
  position: relative;
}

.terminal-snippet::before {
  content: "terminal — bash";
  display: block;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #30363d;
  padding-bottom: 0.5rem;
}

.terminal-snippet code {
  color: inherit;
  background: none;
  padding: 0;
}

.terminal-success { color: #3fb950; }
.terminal-warning { color: #d29922; }
.terminal-info { color: #58a6ff; }

/* --- Image Modal Lightbox --- */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 16, 24, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.image-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.image-modal__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 300ms cubic-bezier(0.2, 1, 0.3, 1);
}

.image-modal[aria-hidden="false"] .image-modal__img {
  transform: scale(1);
}

.image-modal__close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms ease;
  z-index: 10000;
}

.image-modal__close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  border-color: var(--accent);
}

/* Dynamic Card Hover Features */
.project-card--dynamic {
  position: relative;
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.project-card--dynamic:hover {
  background: linear-gradient(135deg, rgba(0, 255, 122, 0.04), rgba(0, 255, 122, 0.01)), var(--surface) !important;
  border-color: rgba(0, 255, 122, 0.45) !important;
  box-shadow: 0 16px 40px rgba(0, 255, 122, 0.12) !important;
}

.project-card--dynamic:hover .button--secondary {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.28) !important;
  transform: translateY(-2px);
}

@media (max-width: 560px) {
  /* Small phone refinements */
  html {
    font-size: 15px;
  }

  h1 {
    font-size: clamp(1.75rem, 10vw, 2.15rem);
  }

  h2 {
    font-size: clamp(1.25rem, 7vw, 1.55rem);
  }

  h3 {
    font-size: 0.96rem;
  }

  .section {
    padding: 24px 0;
  }

  .hero__copy,
  .panel,
  .card,
  .project-card,
  .project-detail,
  .stat-card,
  .process-card,
  .cta-band,
  .callout-box {
    padding: 14px;
  }

  .hero__grid,
  .page-hero__grid,
  .contact-layout,
  .card-grid,
  .stats-grid,
  .process-grid,
  .site-footer__inner {
    gap: 12px;
  }

  .button {
    min-height: 42px;
    padding: 0 14px;
  }

  .site-nav__link,
  .nav-toggle,
  .theme-toggle {
    padding: 0 10px;
    min-height: 40px;
    font-size: 0.88rem;
  }

  .stats-grid {
    row-gap: 12px;
  }

  .site-header__inner,
  .section__inner,
  .site-footer__inner {
    width: min(calc(100% - 28px), var(--content));
  }

  .hero,
  .page-hero {
    padding-top: 48px;
  }

  .hero__copy,
  .panel,
  .card,
  .project-card,
  .project-detail,
  .stat-card,
  .process-card,
  .cta-band,
  .callout-box {
    padding: 14px;
  }

}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 1200px) {
  html,
  body,
  main {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  body {
    font-size: clamp(0.9rem, 0.85rem + 0.4vw, 1rem);
    line-height: 1.5;
  }

  h1 {
    font-size: clamp(1.62rem, 5.6vw, 2.08rem);
    line-height: 1.1;
  }

  h2 {
    font-size: clamp(1.22rem, 4.6vw, 1.56rem);
    line-height: 1.15;
  }

  h3 {
    font-size: clamp(1rem, 3.5vw, 1.14rem);
    line-height: 1.2;
  }

  .site-header {
    position: relative;
    top: auto;
  }

  .site-header__inner,
  .section__inner,
  .site-footer__inner {
    width: min(calc(100% - 28px), 100%);
  }

  .hero,
  .page-hero {
    padding-top: 48px;
    overflow: visible;
  }

  .hero__grid,
  .page-hero__grid,
  .contact-layout,
  .card-grid,
  .card-grid--three,
  .stats-grid,
  .process-grid,
  .detail-stack,
  .project-gallery,
  .video-buttons,
  .site-footer__inner {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .site-header__inner {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 8px 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    order: 5;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 8px;
  }

  body[data-nav-open="true"] .site-nav {
    display: flex;
  }

  .site-nav--simple {
    display: flex;
    width: 100%;
    order: 0;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0;
  }

  .hero__copy,
  .panel,
  .card,
  .project-card,
  .project-detail,
  .stat-card,
  .process-card,
  .cta-band,
  .callout-box,
  .project-video-block,
  .project-gallery-block {
    padding: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .site-nav__link,
  .nav-toggle,
  .theme-toggle {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .header-back-link {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .site-nav__link,
  .site-nav .button {
    width: 100%;
  }

  .button,
  .button--file {
    min-height: 44px;
    padding: 0 16px;
    font-size: clamp(0.84rem, 0.8rem + 0.3vw, 0.95rem);
  }

  .desktop-only,
  .glow-blob,
  body::before {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  body[data-page="projects"] .project-detail .project-video-block,
  body[data-page="projects"] .project-detail .project-gallery-block,
  body[data-page="projects"] .project-detail .project-video,
  body[data-page="projects"] .project-detail .project-gallery,
  body[data-page="projects"] .project-detail .video-buttons {
    display: none !important;
  }
}
/* System Engine Status Badges */
.system-engine-status {
  margin: 24px 0;
  padding: 18px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--static-green-line);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.status-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 255, 122, 0.15);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #00FF7A;
  border-radius: 50%;
  box-shadow: 0 0 10px #00FF7A;
  animation: status-pulse 1.5s infinite alternate;
}

@keyframes status-pulse {
  from { opacity: 0.4; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.1); box-shadow: 0 0 15px #00FF7A; }
}
