:root {
  color-scheme: dark;
  --bg: #03040a;
  --ink: #f6f8ff;
  --muted: #b7c0d7;
  --soft: rgba(246, 248, 255, 0.74);
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(8, 12, 28, 0.6);
  --panel-strong: rgba(12, 18, 38, 0.84);
  --cyan: #79f2ff;
  --amber: #ffbd66;
  --green: #92f0b8;
  --rose: #ff7aa8;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  position: fixed;
  inset: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 16% 18%, rgba(121, 242, 255, 0.18), transparent 23rem),
    radial-gradient(circle at 86% 74%, rgba(255, 189, 102, 0.13), transparent 26rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: auto, auto, 74px 74px, 74px 74px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 82%);
}

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

button {
  color: inherit;
}

#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: #03040a;
}

/* .loader {
  position: fixed;
  inset: auto 24px 24px auto;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(3, 4, 10, 0.7);
  color: var(--soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.loader span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.loader strong {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.loader.is-hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
} */

.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 520ms ease, visibility 520ms ease;
}

.loader-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 25%, rgba(121, 242, 255, 0.14), transparent 26rem),
    radial-gradient(circle at 82% 78%, rgba(255, 189, 102, 0.12), transparent 28rem);
}

.loader-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(121, 242, 255, 0.5);
  border-radius: 50%;
  background:
    radial-gradient(circle at 66% 36%, var(--amber) 0 5px, transparent 6px),
    radial-gradient(circle at 50% 50%, rgba(121, 242, 255, 0.2), transparent 62%);
  box-shadow: 0 0 32px rgba(121, 242, 255, 0.3);
  animation: loaderSpin 2.6s linear infinite;
}

.loader-label {
  position: relative;
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.loader-track {
  position: relative;
  width: min(220px, 60vw);
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.loader-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--amber));
  animation: loaderFill 900ms cubic-bezier(0.65, 0.05, 0.36, 1) forwards;
}

.loader-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

@keyframes loaderFill {
  0% { width: 0%; }
  55% { width: 68%; }
  100% { width: 100%; }
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 18px clamp(16px, 5vw, 64px);
  pointer-events: none;
}

.brand,
nav {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 850;
  cursor: pointer;
}

.brand-mark {
  width: 27px;
  height: 27px;
  border: 1px solid rgba(121, 242, 255, 0.58);
  border-radius: 50%;
  background:
    radial-gradient(circle at 66% 36%, var(--amber) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 50%, rgba(121, 242, 255, 0.18), transparent 60%);
  box-shadow: 0 0 24px rgba(121, 242, 255, 0.26);
  animation: rotate 3s linear infinite;
  transform-origin: center center;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 8, 18, 0.54);
  backdrop-filter: blur(16px);
}

nav button {
  min-height: 34px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

nav button:hover,
nav button.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

.chapter {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 96px clamp(16px, 5vw, 64px) 58px;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: opacity, transform, filter;
}

.chapter.is-active {
  pointer-events: auto;
}

.content-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 166px);
  max-height: calc(100dvh - 166px);
  overflow: auto;
  padding: clamp(26px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.026)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  scrollbar-width: none;
}

.content-panel::-webkit-scrollbar {
  display: none;
}

.hero-panel {
  text-align: center;
}

.split-panel,
.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: center;
}

.process-panel {
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 20px;
  line-height: 0.98;
  letter-spacing: 0;
}

h1 {
  font-size: 4.5rem;
}

h2 {
  font-size: 3.2rem;
}

p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.lede {
  max-width: 760px;
  margin-inline: auto;
  color: var(--soft);
  font-size: 1.28rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  text-align: left;
}

.metrics div {
  min-height: 96px;
  padding: 18px;
  background: rgba(7, 11, 25, 0.68);
}

.metrics span,
.feature-list span,
.process-steps span {
  display: block;
  margin-bottom: 8px;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.metrics strong,
.feature-list strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
}

.feature-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.feature-list li,
.service-grid article,
.process-steps article {
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

/* ── Featured projects preview strip: heading + 4-up slider ── */
.projects-panel {
  display: block;
  text-align: left;
}

.projects-head {
  max-width: 720px;
  margin: 0 auto 34px;
  text-align: center;
}

.projects-head .eyebrow {
  text-align: center;
}

.projects-slider {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.slider-viewport {
  overflow: hidden;
}

.slider-track {
  display: flex;
  width: 100%;
  transition: transform 520ms cubic-bezier(0.65, 0.05, 0.36, 1);
  will-change: transform;
}

.project-slide {
  display: grid;
  flex: 0 0 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.project-tile {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.project-tile:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(121, 242, 255, 0.4);
  transform: translateY(-3px);
}

.project-tag {
  display: inline-block;
  width: fit-content;
  margin-bottom: 12px;
  padding: 3px 10px;
  border: 1px solid rgba(121, 242, 255, 0.35);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-tile strong {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 1.04rem;
  line-height: 1.3;
}

.project-tile p {
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.project-tile.is-placeholder {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
}

.project-tile.is-placeholder .project-tag {
  border-color: rgba(255, 189, 102, 0.4);
  color: var(--amber);
}

.project-tile.is-placeholder strong,
.project-tile.is-placeholder p {
  color: var(--muted);
  opacity: 0.72;
}

.slider-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.slider-arrow:hover:not(:disabled) {
  border-color: rgba(121, 242, 255, 0.55);
  background: rgba(121, 242, 255, 0.12);
}

.slider-arrow:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.slider-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.slider-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.slider-dot.is-active {
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transform: scale(1.3);
}

.orbit-stack {
  display: grid;
  gap: 12px;
}

.orbit-stack span {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
  font-weight: 800;
}

.service-grid {
  display: grid;
  gap: 12px;
}

.service-grid strong {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 1.08rem;
}

.service-grid p,
.process-steps p {
  margin-bottom: 0;
  font-size: 0.96rem;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
  text-align: left;
}

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

.contact-form label,
.contact-form .button {
  min-width: 0;
}

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

.contact-form span {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  outline: 0;
  background: rgba(2, 4, 12, 0.64);
  color: var(--ink);
  padding: 12px 13px;
}

.contact-form textarea {
  min-height: 104px;
  resize: none;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: rgba(121, 242, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(121, 242, 255, 0.13);
}

.full {
  grid-column: 1 / -1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid rgba(121, 242, 255, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(121, 242, 255, 0.95), rgba(146, 240, 184, 0.92));
  color: #061018;
  font-weight: 850;
  cursor: pointer;
}

.scroll-hint {
  position: fixed;
  right: 24px;
  bottom: 38px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.scroll-hint span {
  width: 8px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  position: relative;
}

.scroll-hint span::after {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 3px;
  height: 6px;
  border-radius: 999px;
  background: var(--cyan);
  content: "";
  transform: translateX(-50%);
  animation: scrollPulse 1.35s ease-in-out infinite;
}

.progress-shell {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 5;
  width: min(220px, calc(100vw - 48px));
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--amber));
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, 0);
  }

  40% {
    opacity: 1;
  }

  70% {
    opacity: 1;
    transform: translate(-50%, 12px);
  }
}

@media (max-width: 920px) {
  .site-header {
    align-items: flex-start;
    min-height: 70px;
    padding: 14px 16px 0;
  }

  .brand span:last-child {
    max-width: 86px;
    line-height: 1.08;
  }

  nav {
    max-width: min(72vw, 520px);
    overflow-x: auto;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .split-panel,
  .contact-panel {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 22px;
  }

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

  .content-panel {
    max-height: calc(100vh - 138px);
    max-height: calc(100dvh - 138px);
    padding: 32px;
  }

  .process-steps,
  .metrics {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 4.9rem;
  }

  h2 {
    font-size: 3.6rem;
  }

  .metrics div,
  .feature-list li,
  .service-grid article,
  .process-steps article {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .site-header {
    gap: 12px;
  }

  nav {
    gap: 8px;
    max-width: none;
    padding: 8px 10px;
  }

  nav button {
    width: 10px;
    min-width: 10px;
    height: 10px;
    min-height: 10px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.12);
    color: transparent;
    font-size: 0;
  }

  nav button:hover,
  nav button.is-active {
    width: 30px;
    border-color: rgba(121, 242, 255, 0.7);
    background: rgba(121, 242, 255, 0.9);
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 70px;
    padding: 13px 14px 0;
  }

  nav button {
    flex: 0 0 auto;
  }

  .chapter {
    padding: 80px 14px 42px;
  }

  .content-panel {
    max-height: calc(100vh - 112px);
    max-height: calc(100dvh - 112px);
    padding: 20px;
  }

  h1 {
    font-size: 3.15rem;
  }

  h2 {
    font-size: 2.42rem;
  }

  p {
    font-size: 0.96rem;
    line-height: 1.55;
  }

  .lede {
    font-size: 1.02rem;
  }

  .eyebrow {
    margin-bottom: 10px;
  }

  .metrics {
    margin-top: 20px;
  }

  .metrics div,
  .feature-list li,
  .service-grid article,
  .process-steps article {
    padding: 14px;
  }

  .orbit-stack {
    gap: 8px;
  }

  .orbit-stack span {
    min-height: 44px;
    padding: 11px 14px;
  }

  .project-slide {
    grid-template-columns: 1fr;
  }

  .project-tile {
    min-height: 0;
  }

  .slider-arrow {
    width: 36px;
    height: 36px;
  }

  .contact-form {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    min-height: 40px;
    padding: 9px 11px;
  }

  .contact-form textarea {
    min-height: 76px;
  }

  .button {
    min-height: 43px;
  }

  .scroll-hint {
    display: none;
  }
}

@media (max-width: 420px) {
  .brand span:last-child {
    display: none;
  }

  .site-header {
    padding-inline: 12px;
  }

  .chapter {
    padding-inline: 12px;
  }

  .content-panel {
    padding: 18px;
  }

  h1 {
    font-size: 2.72rem;
  }

  h2 {
    font-size: 2.08rem;
  }
}

@media (max-height: 700px) {
  .site-header {
    min-height: 58px;
    padding-top: 10px;
  }

  .brand {
    min-height: 36px;
  }

  .chapter {
    padding-top: 66px;
    padding-bottom: 30px;
  }

  .content-panel {
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    padding-block: 18px;
  }

  h1,
  h2 {
    margin-bottom: 12px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.28rem;
  }

  p {
    font-size: 0.92rem;
    line-height: 1.48;
  }

  .lede {
    font-size: 1rem;
  }

  .metrics {
    margin-top: 14px;
  }

  .metrics div,
  .feature-list li,
  .service-grid article,
  .process-steps article {
    padding-block: 12px;
  }

  .process-steps {
    margin-top: 16px;
  }

  .contact-form {
    gap: 8px;
  }

  .contact-form input,
  .contact-form select {
    min-height: 38px;
  }

  .contact-form textarea {
    min-height: 68px;
  }
}

/* ── Contact form status message ─────────────── */
.cf-status {
  display: none;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  animation: cfStatusIn 0.35s ease;
}

.cf-status.is-visible {
  display: block;
}

.cf-status.is-success {
  background: rgba(146, 240, 184, 0.12);
  border: 1px solid rgba(146, 240, 184, 0.32);
  color: var(--green);
}

.cf-status.is-error {
  background: rgba(255, 122, 168, 0.12);
  border: 1px solid rgba(255, 122, 168, 0.32);
  color: var(--rose);
}

.cf-status.is-sending {
  background: rgba(121, 242, 255, 0.08);
  border: 1px solid rgba(121, 242, 255, 0.22);
  color: var(--cyan);
}

@keyframes cfStatusIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Disabled submit button state */
#cf-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── "View all projects" trigger (ghost variant of .button) ─── */
.gallery-open {
  gap: 10px;
  margin-top: 26px;
  padding-inline: 22px;
  background: transparent;
  border: 1px solid rgba(121, 242, 255, 0.42);
  color: var(--ink);
}

.gallery-open:hover {
  background: rgba(121, 242, 255, 0.1);
}

.gallery-open-arrow {
  flex: none;
  transition: transform 180ms ease;
}

.gallery-open:hover .gallery-open-arrow {
  transform: translateX(3px);
}

/* ── Project gallery overlay ─────────────────── */
body.gallery-active .site-header,
body.gallery-active .scroll-hint,
body.gallery-active .progress-shell {
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.project-gallery {
  position: fixed;
  inset: 0;
  z-index: 22;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transform-origin: 50% 50%;
  background:
    radial-gradient(circle at 18% 18%, rgba(121, 242, 255, 0.12), transparent 30rem),
    radial-gradient(circle at 84% 80%, rgba(255, 189, 102, 0.1), transparent 30rem),
    rgba(3, 4, 10, 0.88);
  backdrop-filter: blur(26px);
  transition: opacity 560ms ease, transform 560ms cubic-bezier(0.65, 0.05, 0.36, 1), visibility 560ms;
}

.project-gallery.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.gallery-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 96px;
  padding: 22px clamp(16px, 5vw, 64px);
}

.gallery-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 18px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 8, 18, 0.6);
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
  backdrop-filter: blur(16px);
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.gallery-back svg {
  flex: none;
}

.gallery-back:hover {
  color: var(--ink);
  border-color: rgba(121, 242, 255, 0.5);
  background: rgba(121, 242, 255, 0.1);
}

.gallery-heading {
  text-align: right;
}

.gallery-heading .eyebrow {
  margin-bottom: 4px;
}

.gallery-heading strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 850;
}

.gallery-viewport {
  position: absolute;
  top: 96px;
  right: 0;
  bottom: 78px;
  left: 0;
  overflow: hidden;
}

.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
  /* Transform is driven by GSAP in main.js (goToGalleryPage), so no
     CSS transition here — a duplicate transition would fight the tween. */
}

.gallery-page {
  display: grid;
  flex: 0 0 100%;
  align-content: center;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  height: 100%;
  padding: 0 clamp(16px, 5vw, 64px);
  overflow-y: auto;
  scrollbar-width: none;
}

.gallery-page::-webkit-scrollbar {
  display: none;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.026)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    radial-gradient(circle at 22% 24%, hsla(var(--thumb-hue), 92%, 68%, 0.55), transparent 60%),
    radial-gradient(circle at 82% 78%, hsla(var(--thumb-hue), 88%, 58%, 0.32), transparent 62%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)),
    #060912;
}

/* Real project screenshot. If missing, the onerror handler in the
   <img> tag hides it and the gradient above shows through instead. */
.project-thumb img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0.9), transparent 75%);
}

.project-thumb-tag {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 14px;
  padding: 5px 10px;
  border: 1px solid hsla(var(--thumb-hue), 80%, 70%, 0.4);
  border-radius: 999px;
  background: rgba(4, 6, 14, 0.55);
  backdrop-filter: blur(6px);
  color: hsl(var(--thumb-hue), 90%, 78%);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-thumb-mark {
  position: absolute;
  z-index: 1;
  right: 14px;
  bottom: -12px;
  color: hsla(var(--thumb-hue), 90%, 72%, 0.18);
  font-size: 4.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}

.project-body h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  line-height: 1.3;
}

.project-body p {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.project-link svg {
  transition: transform 180ms ease;
}

.project-link:hover svg {
  transform: translateX(3px);
}

.gallery-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(16px, 5vw, 64px) 26px;
}

.gallery-pager {
  display: flex;
  gap: 8px;
}

.gallery-pager span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: background 220ms ease, transform 220ms ease;
}

.gallery-pager span.is-active {
  transform: scale(1.35);
  background: var(--cyan);
}

.gallery-progress-shell {
  width: min(220px, calc(100vw - 48px));
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.gallery-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--amber));
  transition: width 500ms ease;
}

.gallery-open:focus-visible,
.gallery-back:focus-visible,
.project-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .gallery-page {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .gallery-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 620px) {
  .gallery-header {
    min-height: 76px;
    padding: 16px 14px 0;
  }

  .gallery-back {
    padding: 8px 14px 8px 10px;
    font-size: 0.78rem;
  }

  .gallery-heading {
    display: none;
  }

  .gallery-viewport {
    top: 70px;
    bottom: 82px;
  }

  .gallery-page {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 14px;
  }

  .project-thumb-mark {
    font-size: 3.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}