/* ============================================================
   VARIABLES & RESET
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:             #0a0a0a;
  --bg-surface:     #111111;
  --bg-surface2:    #171717;
  --bg-inquiry:     #0f0f0f;
  --text:           #ffffff;
  --text-sub:       rgba(255, 255, 255, 0.6);  /* #ffffff99 */
  --text-muted:     rgba(255, 255, 255, 0.38);
  --border:         rgba(255, 255, 255, 0.08);
  --border-strong:  rgba(255, 255, 255, 0.18);
  --header-h:       64px;
  --page-pad:       36px;
  --ease:           cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:    cubic-bezier(0.16, 1, 0.3, 1);
  --radius:         4px;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

sup {
  font-size: 0.55em;
  vertical-align: super;
  line-height: 0;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============================================================
   ANIMATIONS
   ============================================================ */

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

@keyframes cardReveal {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-spring) forwards;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s var(--ease);
}

.site-header.is-scrolled { border-bottom-color: rgba(255,255,255,0.13); }

.header-inner {
  max-width: 1900px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo { display: flex; align-items: center; }
.header-logo img { height: 20px; width: auto; }

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

.nav-link {
  padding: 7px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-sub);
  border-radius: 999px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-link:not(.is-active) { color: rgba(255, 255, 255, 0.50); }
.nav-link:hover  { background: rgba(255,255,255,0.06); }
.nav-link.is-active { color: #f57cc8; }
/* Projects link is always pink regardless of active page */
.header-nav .nav-link:first-child { color: rgba(255, 255, 255, 0.50); }

.header-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
  width: 38px;
  height: 38px;
}

.toggle-icon {
  position: absolute;
  width: 22px;
  height: 22px;
  object-fit: contain;
  transition: opacity 0.22s var(--ease);
}

.toggle-icon--open  { opacity: 1; }
.toggle-icon--close { opacity: 0; }

.header-toggle.is-open .toggle-icon--open  { opacity: 0; }
.header-toggle.is-open .toggle-icon--close { opacity: 1; }

/* ============================================================
   MAIN
   ============================================================ */

.main-content {
  padding-top: var(--header-h);
}


/* ============================================================
   PROJECTS SECTION
   ============================================================ */

.projects-section {
  max-width: 1900px;
  margin: 0 auto;
  padding: 52px var(--page-pad) 72px;
}

/* Section heading */
.section-title {
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.06;
  margin-bottom: 14px;
}

/* Subtitle + sort row */
.section-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.section-subtitle {
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: var(--text);
  max-width: 600px;
}

/* ── Sort dropdown ─────────────────────────────────────── */

.sort-wrap {
  position: relative;
  flex-shrink: 0;
}

.sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-sub);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
  padding: 4px 0;
}

.sort-toggle:hover { color: var(--text); }

.sort-toggle svg {
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
}

.sort-wrap .sort-menu.is-open ~ .sort-toggle svg,
.sort-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.sort-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 130px;
  background: #1c1c1c;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.sort-menu.is-open { display: block; }

.sort-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--text-sub);
  text-align: left;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}

.sort-option:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.sort-option.is-active { color: var(--text); }

/* ── Filter bar ────────────────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-sub);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.05);
  cursor: pointer;
  white-space: nowrap;
  transition-property: transform, color, background, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.filter-btn:hover {
  background: rgb(255 255 255 / 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.filter-btn.is-active {
  color: #8b96ea;
  background: rgb(255 255 255 / 0.08);
  border-color: rgba(255, 255, 255, 0.75);
}

/* ============================================================
   PROJECTS GRID
   ============================================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 52px;
  padding: 0 10%;
}

/* ============================================================
   PROJECT CARD
   ============================================================ */

.project-card {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  animation: cardReveal 0.45s var(--ease-spring) both;
}

.card-thumb {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  background: var(--bg-surface);
  overflow: hidden;
}

.card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: transform 0.55s var(--ease);
  will-change: transform;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background-color: transparent;
  transition: background-color 0.4s var(--ease);
}

.card-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / 0.2) 0%, rgb(0 0 0 / 0.08) 25%, transparent 45%);
  pointer-events: none;
}

.card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 16px 6px;
  pointer-events: none;
  transform: translateY(0);
  transition: transform 0.35s var(--ease);
  will-change: transform;
}

/* Project title — always visible */
.project-title {
  font-size: 1.1rem;
  line-height: 2.25rem;
  font-weight: 700;
  color: #ffffff;
}

/* Description — visible on hover */
.project-desc {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.82);
  max-width: 240px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease) 0.06s,
              transform 0.3s var(--ease) 0.06s;
  will-change: opacity, transform;
}

/* ── Hover ── */
.project-card:hover .card-thumb img { transform: scale(1.08); }

.project-card:hover .card-overlay {
  background-color: rgba(0,0,0,0.6);
}

.project-card:hover .card-content   { transform: translateY(-54px); }
.project-card:hover .project-desc   { opacity: 1; transform: translateY(0); }

/* Empty state */
.grid-empty {
  grid-column: 1 / -1;
  padding: 80px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ============================================================
   PAGINATION  (circles)
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 16px;
}

.page-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-sub);
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s var(--ease),
              background 0.2s var(--ease),
              border-color 0.2s var(--ease);
}

.page-btn:hover:not([disabled]) {
  color: var(--text);
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
}

.page-btn.is-active {
  color: #000000;
  background: #ffffff;
  border-color: #ffffff;
}

.page-btn[disabled] {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.page-btn.page-arrow { border-color: rgba(255,255,255,0.12); }

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ============================================================
   INQUIRY SECTION  (replaces "Stay in the loop")
   ============================================================ */

.inquiry-section {
  position: relative;
  background: var(--bg-inquiry);
  padding: 96px var(--page-pad);
  overflow: hidden;
}

#ps2-orbs-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.inquiry-inner {
  position: relative;
  z-index: 1;
  max-width: 840px;
  margin: 0 auto;
  text-align: center;
}

.inquiry-title {
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 45%, rgba(255, 255, 255, 0.52));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.inquiry-subtitle {
  font-size: 1.0625rem;
  color: var(--text-sub);
  line-height: 1.65;
  margin-bottom: 52px;
}

.inquiry-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.inquiry-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.inquiry-field { display: flex; flex-direction: column; gap: 7px; }

.inquiry-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.inquiry-label span { color: #ffdf00; margin-left: 1px; }

.inquiry-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 13px 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  resize: none;
}

.inquiry-input:focus {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
}

.inquiry-input::placeholder { color: var(--text-muted); }

.inquiry-submit-row {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.inquiry-submit {
  padding: 13px 40px;
  font-size: 1rem;
  font-weight: 600;
  color: #000;
  background: #ffffff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
  letter-spacing: 0.01em;
}

.inquiry-submit:hover  { background: #e6e6e6; transform: translateY(-1px); }
.inquiry-submit:active { transform: translateY(0); }
.inquiry-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.inquiry-status {
  text-align: center;
  font-size: 0.875rem;
  min-height: 1.25em;
  margin-top: 4px;
}
.inquiry-status--success { color: #6ee7b7; }
.inquiry-status--error   { color: #fca5a5; }

.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4fed98;
  margin-bottom: 0.75rem;
}

/* ============================================================
   LOGOS SECTION
   ============================================================ */

.logos-section {
  overflow: hidden;
  position: relative;
  padding: 64px 0;
  background: #000d1f;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.logos-section::before,
.logos-section::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 160px;
  z-index: 2;
  pointer-events: none;
}

.logos-section::before {
  left: 0;
  background: linear-gradient(to right, #000d1f, transparent);
}

.logos-section::after {
  right: 0;
  background: linear-gradient(to left, #000d1f, transparent);
}

.logos-track-wrapper {
  display: flex;
  width: 100%;
  overflow: hidden;
}

.logos-track {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 0 24px;
  will-change: transform;
}

.logo-scroll-animation {
  animation: logoScroll 40s linear infinite;
}

@keyframes logoScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

.logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.logo-item:hover {
  opacity: 1;
  transform: scale(1.1);
}

.logo-item img,
.logo-item svg {
  height: 50px;
  width: auto;
  max-width: 200px;
}

/* ============================================================
   IMAGE VISUALIZER
   ============================================================ */

/* Shared */
.visualizer {
  border-radius: 12px;
  overflow: hidden;
  margin: 32px 0;
  background: #0a0a0b;
  --visualizer-accent: rgba(255, 255, 255, 0.7);
}

.bonbon-meltdown .visualizer {
  --visualizer-accent: #ffdf00;
}

.visualizer__slide {
  display: none;
}

.visualizer__slide.is-active {
  display: block;
}

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

.visualizer__title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.visualizer__desc {
  font-size: 0.9375rem;
  color: var(--text-sub);
  line-height: 1.7;
}

.visualizer__counter {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--visualizer-accent);
  white-space: nowrap;
}

.visualizer__arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.visualizer__arrow:hover {
  border-color: var(--visualizer-accent);
  background: rgba(255, 255, 255, 0.1);
}

.visualizer__arrows {
  display: flex;
  gap: 8px;
}

/* Indicators (horizontal bars) */
.visualizer__indicators {
  display: flex;
  gap: 6px;
  align-items: center;
}

.visualizer__indicator {
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background 0.2s;
}

.visualizer__indicator.is-active {
  background: var(--visualizer-accent);
}

/* ── Spaceship / Vertical visualizer (image + info side by side) ── */
.visualizer--spaceship {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 380px;
}

.visualizer--spaceship .visualizer__viewport {
  background: #06060a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.visualizer--spaceship .visualizer__slide img {
  object-fit: contain;
  padding: 16px;
}

.visualizer--spaceship .visualizer__info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px;
  overflow: hidden;
}

.visualizer--spaceship .visualizer__desc {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.visualizer--spaceship .visualizer__desc::-webkit-scrollbar {
  width: 6px;
}

.visualizer--spaceship .visualizer__desc::-webkit-scrollbar-track {
  background: transparent;
}

.visualizer--spaceship .visualizer__desc::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.visualizer--spaceship .visualizer__desc::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.visualizer--spaceship .visualizer__controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 16px;
}

/* ── Concept / Horizontal visualizer (full-width image + overlay arrows) ── */
.visualizer--concept {
  display: grid;
}

.visualizer--concept .visualizer__viewport {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.visualizer--concept .visualizer__arrows--overlay {
  grid-row: 1;
  grid-column: 1;
  align-self: end;
  padding: 0 0 16px 16px;
  z-index: 2;
}

.visualizer--concept .visualizer__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 24px;
}

.visualizer--concept .visualizer__counter {
  font-size: 0.8125rem;
}

/* ── Visualizer responsive ── */
@media (max-width: 768px) {
  .visualizer--spaceship {
    grid-template-columns: 1fr;
    height: auto;
  }

  .visualizer--spaceship .visualizer__viewport {
    aspect-ratio: 16 / 10;
  }

  .visualizer--spaceship .visualizer__info {
    padding: 24px;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: var(--page-pad) 60px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
}

/* Brand column */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-tagline {
  font-size: 0.9375rem;
  color: var(--text-sub);
  line-height: 1.65;
  max-width: 300px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: color 0.2s var(--ease),
              border-color 0.2s var(--ease),
              background 0.2s var(--ease);
}

.social-link:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
}

/* Footer columns */
.footer-col {}

.footer-col-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-sub);
  transition: color 0.2s var(--ease);
}

.footer-links a:hover { color: var(--text); }
.footer-links span {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-links strong { font-weight: 600; color: var(--text); }

/* Footer bottom bar */

/* Bottom bar */
.footer-bottom {
  max-width: 1900px;
  margin: 0 auto;
  padding: 20px var(--page-pad);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-legal a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}

.footer-legal a:hover { color: var(--text-sub); }

/* ============================================================
   CONTACT PAGE
   ============================================================ */

.contact-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 60px var(--page-pad) 96px;
}

.contact-title {
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.contact-subtitle {
  font-size: 1rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 48px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.form-input,
.form-textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 12px 16px;
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.form-input:focus,
.form-textarea:focus {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
}

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

.form-textarea { resize: vertical; min-height: 140px; line-height: 1.6; }

.form-submit {
  align-self: flex-start;
  padding: 12px 32px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #000;
  background: #ffffff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}

.form-submit:hover  { background: #e6e6e6; transform: translateY(-1px); }
.form-submit:active { transform: translateY(0); }

/* ============================================================
   PROJECT DETAIL
   ============================================================ */

.project-detail {
  max-width: 872px;
  margin: 40px auto;
  padding: 52px 36px 96px;
  background-color: #0000008c;
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #ffffff8c;
  margin-bottom: 44px;
  transition: color 0.2s var(--ease);
}

.project-back:hover { color: #ffffffcc; }
.project-back img {
  height: 1em;
  width: auto;
  flex-shrink: 0;
  display: block;
  opacity: 0.55;
  transition: opacity 0.2s var(--ease);
}
.project-back:hover img { opacity: 0.8; }

.project-meta-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.project-category-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8b96ea;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(160deg, #1e1e1e 0%, #111111 100%);
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.40),
    0 4px 12px rgba(0, 0, 0, 0.60),
    0 1px 3px rgba(0, 0, 0, 0.45);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1), background 220ms cubic-bezier(0.16, 1, 0.3, 1), color 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.project-category-tag:hover {
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(160deg, #272727 0%, #1a1a1a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.40),
    0 6px 16px rgba(0, 0, 0, 0.65),
    0 2px 4px rgba(0, 0, 0, 0.50);
}

.project-date-tag { font-size: 0.8125rem; color: #ffffff66; }

.project-h1 {
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 28px;
  margin-bottom: 8px;
  color: #b8d4ff;
  text-shadow: none;
}

.project-lead {
  font-size: 1.0625rem;
  color: #8b96ea;
  line-height: 1.65;
  margin-bottom: 40px;
  max-width: 680px;
}

.project-hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 60px;
}

.project-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #00081a;
  margin-bottom: 44px;
  border: 1px solid rgba(0, 80, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 60, 255, 0.2), 0 0 60px rgba(0, 40, 180, 0.1);
}

/* Scanlines on banner */
.project-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.project-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.project-banner img.is-loaded {
  opacity: 1;
}

.project-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-sub);
  margin-bottom: 22px;
}

.project-body h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: #a0d4ff;
  margin-top: 48px;
  margin-bottom: 14px;
}

.project-body h3 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 700;
  color: #ffffff;
  margin-top: 40px;
  margin-bottom: 12px;
}

.project-body ul,
.project-body ol {
  list-style: none;
  padding-left: 0;
  margin-bottom: 22px;
}

.project-body li {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.project-body strong {
  color: var(--text);
}

/* Standalone images and videos in project content —
   fanbox-style: consecutive images stack tight,
   text↔image transitions get breathing room via
   the text element's own margin-bottom + img margin-top. */
.project-body img,
.project-body video {
  display: block;
  margin: 0 auto 8px;   /* tiny gap between consecutive images/videos */
  max-width: 100%;
}

/* Text or heading immediately before an image/video → add top space */
.project-body p + img,
.project-body h2 + img,
.project-body h3 + img,
.project-body ul + img,
.project-body ol + img,
.project-body li + img,
.project-body p + video,
.project-body h2 + video,
.project-body h3 + video,
.project-body ul + video,
.project-body ol + video,
.project-body li + video {
  margin-top: 32px;
}

/* Image/video immediately before text, heading, or list item → add top space */
.project-body img + p,
.project-body img + h2,
.project-body img + h3,
.project-body img + li,
.project-body video + p,
.project-body video + h2,
.project-body video + h3,
.project-body video + li {
  margin-top: 28px;
}

/* Visualizer images manage their own sizing — reset the defaults above */
.project-body .visualizer img {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
}

.project-body figure { margin: 44px 0; }

.project-body figure img {
  padding: 0;
  width: 100%;
  margin: 0 auto;
  border-radius: 6px;
  aspect-ratio: 16/9;
  object-fit: cover;
  object-position: center;
}

.project-body figcaption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
}

.project-body .video-wrap {
  position: relative;
  padding-top: 56.25%;
  margin: 44px 0;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.project-body .video-wrap iframe,
.project-body .video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
}

/* ── Loading & Error states ────────────────────────────── */

.project-loading {
  text-align: center;
  padding: 120px 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.project-error {
  text-align: center;
  padding: 120px 0;
}

.project-error h2 {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.75rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.project-error p {
  color: var(--text-sub);
  margin-bottom: 28px;
}

.project-error-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #000;
  background: #ffffff;
  border-radius: 999px;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}

.project-error-link:hover  { background: #e6e6e6; transform: translateY(-1px); }

/* ── Client tag ───────────────────────────────────────── */

.project-client-tag {
  font-size: 0.8125rem;
  color: #ffffff66;
  margin-left: auto;
}

/* ── Related Projects ─────────────────────────────────── */

.related-section {
  background: #000d1f;
  border-top: 1px solid rgba(0, 80, 255, 0.18);
  padding: 72px 0 80px;
}

.related-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.related-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.related-header h2 {
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #b8d4ff;
  text-shadow: 0 0 20px rgba(0, 100, 255, 0.3);
}

.related-view-all {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(0, 180, 255, 0.5);
  transition: color 0.2s var(--ease);
  white-space: nowrap;
}

.related-view-all:hover { color: #00d4ff; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.related-card {
  display: block;
  background: rgba(0, 8, 28, 0.95);
  border: 1px solid rgba(0, 80, 255, 0.25);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.related-card:hover {
  border-color: rgba(0, 150, 255, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(0, 60, 255, 0.2);
}

.related-card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

.related-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.related-card:hover .related-card-thumb img {
  transform: scale(1.05);
}

.related-card-body {
  padding: 16px 18px 20px;
}

.related-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #b8d4ff;
  line-height: 1.3;
  margin-bottom: 6px;
}

.related-card-desc {
  font-size: 0.8125rem;
  color: #8b96ea;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   MAP SECTION
   ============================================================ */

.map-section {
  background: #000d1f;
  border-top: 1px solid rgba(0,80,255,0.18);
  border-bottom: 1px solid rgba(0,80,255,0.18);
}

.map-section-inner {
  max-width: 1900px;
  margin: 0 auto;
  padding: 72px var(--page-pad) 80px;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 5, 18, 0.75) 100%);
}

.map-section-header {
  margin-bottom: 40px;
  text-align: center;
}

.map-section-title {
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 45%, rgba(255, 255, 255, 0.52));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.map-section-sub {
  font-size: 1.0625rem;
  color: var(--text-sub);
  line-height: 1.65;
  margin-bottom: 52px;
}

/* ── Map container ───────────────────────────────────────── */

.map-outer {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
}

.map-container {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  height: 480px;
  background: #00081a;
  isolation: isolate;
}

/* CRT vignette */
.map-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,5,25,0.65) 100%);
  pointer-events: none;
  z-index: 1000;
  border-radius: inherit;
}

/* Scanlines */
.map-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.14) 2px,
    rgba(0,0,0,0.14) 4px
  );
  pointer-events: none;
  z-index: 1001;
  border-radius: inherit;
}

#projects-map {
  width: 100%;
  height: 100%;
}

/* ── Globe canvas ────────────────────────────────────────── */

#projects-map canvas {
  display: block;
}

/* ── Floating card ───────────────────────────────────────── */

.map-card {
  position: absolute;
  z-index: 800;
  width: 224px;
  background: rgba(0,8,28,0.97);
  border: 1px solid rgba(0,100,255,0.38);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.9), 0 0 24px rgba(0,60,255,0.28), 0 4px 16px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  pointer-events: none;
  user-select: none;
}

.map-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.map-card-inner {
  display: block;
  color: inherit;
}

.map-card-inner:hover .map-card-thumb img {
  transform: scale(1.05);
}

.map-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-surface);
}

.map-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}

.map-card-body {
  padding: 12px 14px 14px;
}

.map-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #a0d4ff;
  line-height: 1.3;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-card-place {
  font-size: 0.75rem;
  color: rgba(0,180,255,0.5);
  line-height: 1.4;
}

.map-card-event {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 7px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: rgba(0,200,255,0.7);
  border: 1px solid rgba(0,150,255,0.25);
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.map-card-client {
  font-size: 0.6875rem;
  color: rgba(0,150,255,0.4);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1400px) {
  :root { --page-pad: 32px; }
}

@media (max-width: 1200px) {
  .projects-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 960px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
  .project-title { font-size: 1.25rem; line-height: 1.6rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
  .inquiry-row { grid-template-columns: 1fr; }
  .map-container { height: 420px; }
}

@media (max-width: 640px) {
  :root {
    --header-h: 56px;
    --page-pad: 16px;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(10,10,10,0.98);
    border-bottom: 1px solid var(--border);
    padding: 10px 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .header-nav.is-open { display: flex; }
  .nav-link { width: 100%; border-radius: 6px; padding: 10px 14px; }
  .header-toggle { display: flex; }

  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .project-title { font-size: 1rem; line-height: 1.35rem; }

  .section-title { font-size: 2.25rem; }
  .section-subtitle { font-size: 1rem; }
  .section-meta { flex-direction: column; align-items: center; gap: 12px; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-legal { flex-wrap: wrap; gap: 12px; }

  .map-section-inner { padding: 52px var(--page-pad) 60px; }
  .map-container { height: 300px; border-radius: 10px; }

  .project-detail { padding: 36px 16px 72px; }
  .project-h1 { font-size: clamp(1.25rem, 5vw, 1.75rem); }
  .project-meta-bar { gap: 10px; }
  .project-client-tag { margin-left: 0; }

  .related-section { padding: 52px 0 60px; }
  .related-header { flex-direction: column; gap: 8px; margin-bottom: 28px; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ENHANCEMENTS — Ambient BG, Custom Cursor, Card FX, Reveals
   ============================================================ */


/* ── PS2 animated background canvas ─────────────────────────── */
#ps2-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Keep main content above ambient bg (header keeps its own position:fixed) */
.main-content,
.site-footer { position: relative; z-index: 1; }


/* ── Section subtitle — gradient text ────────────────────────── */
.section-subtitle {
  background: linear-gradient(135deg, #ffffff 45%, rgba(255, 255, 255, 0.52));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Filter buttons — dark glossy pill (neumorphic, per skill) ── */
.filter-btn {
  background: linear-gradient(160deg, #1e1e1e 0%, #111111 100%);
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.40),
    0 4px 12px rgba(0, 0, 0, 0.60),
    0 1px 3px  rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.50);
  transition: box-shadow 220ms cubic-bezier(0.16,1,0.3,1),
              background  220ms cubic-bezier(0.16,1,0.3,1),
              color       220ms cubic-bezier(0.16,1,0.3,1);
}

.filter-btn:hover {
  background: linear-gradient(160deg, #222222 0%, #151515 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.40),
    0 6px 18px rgba(0, 0, 0, 0.65),
    0 1px 3px  rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.82);
  transform: none;
}

.filter-btn.is-active {
  background: linear-gradient(160deg, #0f0f0f 0%, #181818 100%);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.70),
    inset 0 1px 2px rgba(0, 0, 0, 0.50),
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 0 22px rgba(255, 255, 255, 0.04);
  color: #8b96ea;
  transform: none;
}

/* ── Project card enhancements ────────────────────────────────── */

/* Let the card overflow so the 3D perspective isn't clipped flat */
.project-card {
  overflow: visible;
  will-change: transform;
}

/* Maintain rounded corners on the image/overlay layer instead */
.card-thumb {
  border-radius: var(--radius);
}


.card-thumb img {
  filter: saturate(0.88);
  transition: transform 0.55s var(--ease),
              opacity  0.4s  var(--ease),
              filter   0.4s  var(--ease);
}

.project-card:hover .card-thumb img {
  opacity: 1;
  filter: saturate(1.12) brightness(1.04);
}

/* ── Page-entry fade ─────────────────────────────────────────── */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.projects-section {
  /* pageFadeIn removed — staged JS intro handles page reveal */
}

/* ── Scroll reveal ───────────────────────────────────────────── */
.reveal-target {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-target.is-revealed {
  opacity: 1;
  transform: translateY(0);
}



/* ── Inquiry section — transparent so canvas shows through ───── */
.inquiry-section {
  background: transparent;
  position: relative;
  overflow: hidden;
}

.inquiry-section::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(100, 60, 200, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Submit button shine effect ──────────────────────────────── */
.inquiry-submit {
  position: relative;
  overflow: hidden;
  background: #efefef;          /* slightly off-white so shine has contrast */
}

.inquiry-submit:hover { background: #e6e6e6; }

.inquiry-submit::after {
  content: '';
  position: absolute;
  top: -10%;
  left: 0;
  width: 40%;
  height: 120%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.90) 50%,
    transparent 80%
  );
  transform: translateX(-180%) skewX(-15deg);
  transition: transform 0s;    /* no transition at rest */
}

.inquiry-submit:hover::after {
  transform: translateX(400%) skewX(-15deg);
  transition: transform 0.55s ease;
}


/* ── Footer subtle top gradient ──────────────────────────────── */
.site-footer {
  background: linear-gradient(180deg, #0d0d0d 0%, var(--bg-surface) 80px);
}

/* ── Intro text overlay (staged page reveal) ─────────────────── */
.intro-text-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  pointer-events: none;
  margin: 0;
  text-align: center;
  max-width: 600px;
  width: 80%;
  font-size: 1.25rem;
  line-height: 1.75rem;
  /* Match .section-subtitle gradient text */
  background: linear-gradient(135deg, #ffffff 45%, rgba(255, 255, 255, 0.52));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.88s cubic-bezier(0.16, 1, 0.3, 1),
              opacity   0.60s ease;
}

/* ── Scroll-to-top button ──────────────────────────────────────────────── */

.scroll-top-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 90;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.3s var(--ease);
}

.scroll-top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.scroll-top-btn:hover {
  transform: translateY(-4px);
}

@media (max-width: 600px) {
  .scroll-top-btn {
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
  }
}
