* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: 'Rebeqa';
  src: url('Rebeqa-Regular.ttf') format('truetype');
}

body {
  background: #0a0a0a;
  font-family: sans-serif;
}

/* ── Loader ── */
#loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  overflow: hidden;
  will-change: transform, filter;
}

#loader-num {
  position: absolute;
  /* ── Vertical position: adjust this value ── */
  top: 50%;
  left: 0;
  transform: translateY(-50%) translateX(6vw);
  /* ── Font: swap family or size here ── */
  font-family: 'Rebeqa', Georgia, serif;
  font-size: clamp(72px, 15vw, 210px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  opacity: 0;
  animation: loader-num-in 0.35s ease 0.08s forwards;
  user-select: none;
  will-change: transform;
}

@keyframes loader-num-in {
  to { opacity: 1; }
}

/* ── Scene ── */
#scene {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #0a0a0a;
  overflow: hidden;
  cursor: none;
  perspective: 900px;
}

/* ── Hero group (title + icons) ── */
.hero-group {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.7s ease 0.5s, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-group.visible {
  opacity: 1;
  pointer-events: auto;
}

.hero-group.visible:hover {
  transform: translate(-50%, -50%) scale(1.07);
}

/* ── Hero text ── */
.hero-text {
  font-family: 'Rebeqa', Georgia, serif;
  font-size: clamp(120px, 16vw, 220px);
  font-weight: 700;
  color: white;
  white-space: nowrap;
  letter-spacing: 0px;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.hero-icons {
  display: flex;
  gap: 22px;
  margin-top: 18px;
}

/* ── Cards ── */
.card {
  position: absolute;
  border-radius: 10px;
  will-change: transform;
  left: 0;
  top: 0;
  cursor: none;
  z-index: 3;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* ── Custom cursor ── */
.cursor-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  pointer-events: none;
  z-index: 200;
  transform: translate(-50%, -50%);
}

.cursor-ring {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  pointer-events: none;
  z-index: 200;
  transform: translate(-50%, -50%);
  transition:
    left 0.16s ease-out,
    top 0.16s ease-out,
    width 0.22s ease,
    height 0.22s ease,
    border-color 0.22s ease;
}

.cursor-ring.hovering {
  width: 56px;
  height: 56px;
  border-color: rgba(255, 255, 255, 0.95);
}

.cursor-label {
  position: absolute;
  font-size: 9px;
  font-family: monospace;
  color: white;
  letter-spacing: 1px;
  pointer-events: none;
  z-index: 200;
  transform: translate(-50%, 24px);
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.cursor-label.visible {
  opacity: 1;
}

/* ── Modal overlay ── */
#modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 150;
  display: none;
  transition: background 0.35s ease;
}

#modal-overlay.open {
  display: block;
  background: rgba(0, 0, 0, 0.75);
}

/* ── Modal ── */
#modal {
  position: absolute;
  border-radius: 14px;
  overflow: hidden;
  z-index: 160;
  display: none;
  flex-direction: column;
  cursor: default;
}

#modal.animating,
#modal.open {
  display: flex;
}

#modal-color {
  width: 100%;
  flex: 1;
  min-height: 0;
}

#modal-body {
  background: #111;
  padding: 20px 24px 24px;
  flex-shrink: 0;
}

#modal-title {
  font-family: 'Rebeqa', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin: 0 0 6px;
}

#modal-sub {
  font-size: 12px;
  font-family: monospace;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 16px;
}

#modal-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 20px;
}

#modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 18px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  z-index: 170;
  padding: 0;
  transition: background 0.2s;
}

#modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

#modal-cta {
  display: inline-block;
  padding: 9px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
  letter-spacing: 1px;
  color: white;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

#modal-cta:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

/* ── Hint label ── */
.hint-label {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  font-family: monospace;
  letter-spacing: 1px;
  pointer-events: none;
  z-index: 10;
}

/* ── Scroll sections ─────────────────────────────────────── */
section {
  padding: 120px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 48px;
}

.section-label {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 32px;
}

.section-heading {
  font-family: 'Rebeqa', Georgia, serif;
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  color: white;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 32px;
}

.section-body {
  font-size: 18px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.55);
  max-width: 600px;
}

/* ── Process grid ── */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 48px 32px;
  margin-top: 8px;
}

.process-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.process-num {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.25);
}

.process-item h3 {
  font-family: 'Rebeqa', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.process-item p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}

/* ── Contact ── */
#contact {
  padding-bottom: 60px;
}

.contact-email {
  display: block;
  font-family: 'Rebeqa', Georgia, serif;
  font-size: clamp(24px, 4vw, 48px);
  color: white;
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s;
}

.contact-email:hover {
  color: rgba(255, 255, 255, 0.55);
}

.contact-links {
  display: flex;
  gap: 32px;
}

.contact-links a {
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}

.contact-links a:hover {
  color: white;
}

.footer-note {
  font-family: monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.2);
  text-align: center;
  padding: 60px 48px 40px;
}

/* ── Nav ── */
#topnav {
  position: fixed;
  top: 28px;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 36px;
  z-index: 500;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

#topnav.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.nav-link {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: color 0.2s;
}

.nav-link:hover {
  color: white;
}

/* Wiggle runs once on hover via JS adding .wiggle class */
@keyframes navwiggle {
  0%   { transform: scale(1.08) translateX(0);    }
  25%  { transform: scale(1.08) translateX(-3px); }
  75%  { transform: scale(1.08) translateX(3px);  }
  100% { transform: scale(1.08) translateX(0);    }
}

.nav-link.wiggle {
  animation: navwiggle 0.35s ease forwards;
  color: white;
}

/* ── Works dropdown ── */
.nav-dropdown {
  position: relative;
  display: flex;       
  align-items: center;
}

.nav-dropdown > .nav-link {
  display: flex;
  align-items: center;
}

.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px 20px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dropdown-menu a {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  color: white;
}


.social-icon-btn {
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  cursor: none;
}

.social-icon-btn:hover {
  opacity: 1;
}

.social-icon-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* ── Cursor glow — disabled ── */
#cursor-glow { display: none; }

/* ── Nebula blobs ── */
.nebula-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(50px);
  z-index: 0;
}

#nb1 {
  width: 780px;
  height: 780px;
  top: 5%;
  left: 5%;
  background: radial-gradient(circle, rgba(60, 30, 200, 0.22) 0%, transparent 65%);
  animation: nb-drift1 22s ease-in-out infinite alternate;
}

#nb2 {
  width: 660px;
  height: 660px;
  top: 25%;
  right: 5%;
  background: radial-gradient(circle, rgba(0, 70, 140, 0.18) 0%, transparent 65%);
  animation: nb-drift2 28s ease-in-out infinite alternate;
}

#nb3 {
  width: 560px;
  height: 560px;
  bottom: 5%;
  left: 30%;
  background: radial-gradient(circle, rgba(0, 110, 120, 0.16) 0%, transparent 65%);
  animation: nb-drift3 19s ease-in-out infinite alternate;
}

@keyframes nb-drift1 {
  0%   { transform: translate(  0px,   0px); }
  40%  { transform: translate( 70px,  55px); }
  100% { transform: translate(-50px,  80px); }
}

@keyframes nb-drift2 {
  0%   { transform: translate(  0px,   0px); }
  50%  { transform: translate(-80px,  40px); }
  100% { transform: translate( 40px, -65px); }
}

@keyframes nb-drift3 {
  0%   { transform: translate(  0px,  0px); }
  45%  { transform: translate( 55px, -50px); }
  100% { transform: translate(-65px,  40px); }
}

/* ── Featured work ── */
#featured {
  padding: 80px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

#featured .section-inner {
  max-width: 1100px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 48px;
}

.feat-card {
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  opacity: 0;
  transform: translateY(52px);
  transition:
    opacity   0.75s ease,
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.feat-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

.feat-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transition:
    opacity      0.75s ease,
    transform    0.75s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s  ease;
}

.feat-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
}

.feat-info {
  padding: 14px 20px 16px;
}

.feat-role {
  display: block;
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.feat-name {
  font-family: 'Rebeqa', Georgia, serif;
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 700;
  color: white;
  margin-top: 8px;
  letter-spacing: -0.3px;
}

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

/* ── About physics ── */
#about-physics {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none; /* lets text stay selectable */
}

#about-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: all; /* but canvas still catches mouse for physics */
}

/* Section needs relative so the canvas can absolute inside it */
#about {
  position: relative;
}

/* Text sits above canvas */
#about .section-inner {
  position: relative;
  z-index: 2;
}

#car-canvas {
  display: block;
  width: 100%;
  height: 120px;
}

.car-hint {
  position: absolute;
  bottom: 12px;
  left: 48px;
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

#process {
  position: relative;
  padding-bottom: 0;
  overflow: visible;
}

/* ── Inner pages ── */
body.page {
  min-height: 100vh;
}

body.page #topnav {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  left: 40px;
  right: 40px;
  justify-content: flex-end;
}

.nav-home {
  margin-right: auto;
  color: white;
  letter-spacing: 3px;
}

.nav-active {
  color: white !important;
}

.dropdown-active {
  color: white !important;
}

.page-section {
  padding-top: 160px;
}