:root {
  --bg: #030014;
  --fg: #f2f5ff;
  --muted: rgba(226, 232, 255, 0.55);
  --line: rgba(226, 232, 255, 0.14);
  --accent: #ff4d6d;   /* DIJA rose */
  --accent2: #ff9d3d;  /* DIJA orange */
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --pill: rgba(14, 10, 26, 0.55);
  --display: "Orbitron", "Space Grotesk", sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  cursor: default;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
  touch-action: none; /* let pointer-drag spin the carousel on touch (no native scroll) */
}

/* ---------- Loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 50% 40%, #0b0a16 0%, #05060a 60%, #000 100%);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-mark {
  font-family: var(--display);
  font-size: clamp(34px, 8vw, 72px);
  font-weight: 900;
  letter-spacing: 0.14em;
  background: linear-gradient(90deg, var(--cyan), var(--accent), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pulse 2.4s ease-in-out infinite;
}
.loader-mark span {
  display: block;
  margin-top: 8px;
  font-size: 0.2em;
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  font-weight: 500;
  -webkit-text-fill-color: var(--muted);
}
.loader-bar {
  width: 220px;
  height: 2px;
  margin: 26px auto 12px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.3s ease;
}
.loader-pct {
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--muted);
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* Enter gate — revealed once loading completes (#loader.loaded) */
.loader-enter {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  height: 0;
  overflow: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#loader.loaded .loader-bar,
#loader.loaded .loader-pct { display: none; }
#loader.loaded .loader-enter {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  height: auto;
  margin-top: 30px;
}
.enter-hint {
  font-size: 12px; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 18px;
}
.enter-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.enter-btn {
  font-family: var(--display);
  font-size: 13px; letter-spacing: 0.2em; font-weight: 500;
  padding: 15px 30px; border-radius: 40px; cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04); color: var(--fg);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.enter-btn:hover { transform: translateY(-2px); }
.enter-primary {
  border: none; color: #fff;
  background: linear-gradient(90deg, #ff7a5c, #ff1e1e 55%, #c20014);
  box-shadow: 0 10px 30px rgba(255, 30, 30, 0.35);
}
.enter-primary em { font-style: normal; margin-left: 6px; }
.enter-primary:hover { box-shadow: 0 14px 42px rgba(255, 30, 30, 0.5); }
.enter-ghost:hover { border-color: rgba(0, 240, 255, 0.5); background: rgba(0, 240, 255, 0.06); }

/* ---------- UI overlay ---------- */
#ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease 0.2s;
}
#ui.ready { opacity: 1; }
#ui a, #ui button, #ui input { pointer-events: auto; }

/* Topbar */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 34px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #ff1e1e);
  box-shadow: 0 0 14px rgba(255, 30, 30, 0.75);
}
.brand-name {
  /* Match the 3D centre wordmark: red Audiowide, top-lit gradient */
  font-family: "Audiowide", var(--display);
  font-weight: 400; font-size: 19px; letter-spacing: 0.16em;
  background: linear-gradient(180deg, #ff7a5c 0%, #ff1e1e 55%, #c20014 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 9px rgba(255, 30, 30, 0.35));
}
.brand-sub {
  font-size: 10px; letter-spacing: 0.3em; color: var(--muted);
  padding-left: 12px; border-left: 1px solid var(--line); margin-left: 2px;
}
.nav { display: flex; gap: 26px; }
.nav-link {
  position: relative;
  color: var(--fg);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.28em;
  font-weight: 500;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 1px; background: var(--fg);
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
.nav-link:hover, .nav-link.is-active { opacity: 1; }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

/* Left menu */
.menu {
  position: absolute;
  left: 34px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 340px;
}
.menu-title {
  font-family: var(--display);
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-bottom: 26px;
  text-transform: uppercase;
}
.menu-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.menu-item {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  padding: 9px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: color 0.3s ease, gap 0.3s ease, transform 0.3s ease;
}
.menu-item .arrow {
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.menu-item:hover, .menu-item.active { color: var(--fg); gap: 16px; }
.menu-item:hover .arrow, .menu-item.active .arrow { opacity: 1; transform: translateX(0); }

/* Ask bar */
.ask {
  position: absolute;
  left: 34px;
  bottom: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, 60vw);
  padding: 13px 16px;
  background: var(--pill);
  border: 1px solid var(--line);
  border-radius: 40px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.ask:focus-within {
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(0, 240, 255, 0.08), 0 10px 40px rgba(0,0,0,0.4);
}
.ask-glyph { color: var(--accent); font-size: 14px; }
.ask-input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.ask-input::placeholder { color: var(--muted); }
.ask-send {
  background: none; border: none; cursor: pointer;
  color: var(--fg); font-size: 16px; opacity: 0.6;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.ask-send:hover { opacity: 1; transform: translateX(3px); }
.ask-answer {
  position: absolute;
  left: 34px;
  bottom: 96px;
  max-width: min(360px, 60vw);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.ask-answer.show { opacity: 1; transform: translateY(0); }
.ask-answer b { color: var(--fg); font-weight: 500; }

/* Hints */
.hint {
  position: absolute;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--muted);
}
.hint-scroll { right: 34px; bottom: 42px; }
.hint-count { right: 34px; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; }

/* ---------- Cinematic overlays ---------- */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}
.grain {
  position: fixed;
  inset: -50%;
  z-index: 6;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.5s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-4%, 3%); }
  66% { transform: translate(3%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Custom cursor ---------- */
@media (hover: hover) and (pointer: fine) {
  * { cursor: none !important; }
  #cursor {
    position: fixed;
    top: 0; left: 0;
    width: 26px; height: 26px;
    margin: -13px 0 0 -13px;
    border-radius: 50%;
    z-index: 60;
    pointer-events: none;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.9) 0%, rgba(255, 43, 214, 0.25) 45%, transparent 70%);
    mix-blend-mode: screen;
    transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease;
  }
  #cursor.hot { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
}

/* ---------- Hover label ---------- */
#hoverLabel {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  padding: 5px 12px;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--fg);
  background: rgba(10, 8, 18, 0.65);
  border: 1px solid var(--line);
  border-radius: 30px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: translate(-50%, -160%) scale(0.9);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
#hoverLabel.show { opacity: 1; transform: translate(-50%, -160%) scale(1); }

/* ---------- Project overlay ---------- */
.project {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.project.open { pointer-events: auto; opacity: 1; }
.project-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 8, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.project-card {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(460px, 92vw);
  padding: 60px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(180deg, rgba(16, 12, 28, 0.92), rgba(8, 6, 14, 0.96));
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.project.open .project-card { transform: translateX(0); }
.project-close {
  position: absolute;
  top: 26px; right: 30px;
  background: none; border: none;
  color: var(--muted); font-size: 26px; line-height: 1;
  cursor: pointer; transition: color 0.3s ease, transform 0.3s ease;
}
.project-close:hover { color: var(--fg); transform: rotate(90deg); }
.project-cat {
  font-size: 11px; letter-spacing: 0.3em;
  color: var(--accent);
}
.project-title {
  font-family: var(--display);
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.02em;
}
.project-desc {
  font-size: 14px; line-height: 1.65; color: var(--muted);
}
.project-meta {
  display: flex; justify-content: space-between;
  font-size: 10px; letter-spacing: 0.28em; color: var(--muted);
  padding: 16px 0; margin-top: 6px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.project-cta {
  align-self: flex-start;
  margin-top: 12px;
  padding: 14px 26px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border: none; border-radius: 40px;
  color: #0a0710; font-family: inherit;
  font-size: 12px; font-weight: 600; letter-spacing: 0.18em;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: gap 0.3s ease, box-shadow 0.3s ease;
}
.project-cta:hover { gap: 16px; box-shadow: 0 10px 40px rgba(255, 77, 109, 0.4); }

/* tags */
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.project-tags:empty { display: none; }
.project-tags span {
  font-size: 10px; letter-spacing: 0.18em;
  padding: 5px 12px; border-radius: 30px;
  border: 1px solid var(--line); color: var(--muted);
}
/* features */
.project-features { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.project-features:empty { display: none; }
.project-features li {
  position: relative; padding-left: 20px;
  font-size: 13px; line-height: 1.4; color: var(--muted);
}
.project-features li::before {
  content: "◆"; position: absolute; left: 0; top: 1px;
  color: var(--cyan); font-size: 9px;
}
/* actions */
.project-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.project-actions:empty { display: none; }
.email-link {
  font-family: "Space Grotesk", monospace;
  font-size: 14px; color: var(--accent2); text-decoration: none;
  letter-spacing: 0.04em; transition: color 0.3s ease;
}
.email-link:hover { color: var(--accent); }
/* contact form */
.cform { display: grid; gap: 10px; }
.cform input, .cform textarea {
  width: 100%; font-family: inherit; font-size: 13px;
  color: var(--fg); background: rgba(0,0,0,0.35);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; outline: none; resize: none;
  transition: border-color 0.3s ease;
}
.cform input:focus, .cform textarea:focus { border-color: rgba(0,240,255,0.55); }
.cform input::placeholder, .cform textarea::placeholder { color: rgba(226,232,255,0.4); }
.cform-status { font-size: 12px; color: var(--cyan); letter-spacing: 0.05em; }

/* ---------- Sound toggle ---------- */
.sound {
  position: absolute;
  right: 34px;
  bottom: 78px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--pill);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s ease;
}
.sound:hover { border-color: rgba(0, 240, 255, 0.6); }
.sound-bars { display: flex; align-items: center; gap: 2px; height: 13px; }
.sound-bars i {
  width: 2px;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transform-origin: center;
  animation: eq 1s ease-in-out infinite;
}
.sound-bars i:nth-child(2) { animation-delay: 0.25s; }
.sound-bars i:nth-child(3) { animation-delay: 0.5s; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}
.sound.muted .sound-bars i {
  animation-play-state: paused;
  transform: scaleY(0.3);
  opacity: 0.45;
  background: var(--muted);
}

/* ---------- Music credit (CC BY attribution) ---------- */
.credit {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
  opacity: 0.5;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Carousel controls (prev / clickable progress / next) ---------- */
.carousel-ctrl {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: var(--pill);
  border: 1px solid var(--line);
  border-radius: 40px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.cc-arrow {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: none; border: none; cursor: pointer;
  color: var(--fg); font-size: 22px; line-height: 1;
  opacity: 0.7; border-radius: 50%;
  transition: opacity 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.cc-arrow:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }
.cc-arrow:active { transform: scale(0.9); }
.progress { display: flex; align-items: center; gap: 7px; }
.pdot {
  width: 7px; height: 7px; padding: 0;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(226, 232, 255, 0.28);
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.pdot:hover { background: rgba(226, 232, 255, 0.6); transform: scale(1.25); }
.pdot.on {
  background: var(--accent);
  transform: scale(1.4);
  box-shadow: 0 0 10px rgba(255, 30, 30, 0.7);
}

/* ---------- Animated drag cue (auto-hides after first interaction) ---------- */
.drag-cue {
  display: inline-block; position: relative;
  width: 30px; height: 16px;
  border: 1px solid rgba(226, 232, 255, 0.5);
  border-radius: 10px; vertical-align: middle; margin-right: 8px;
}
.drag-cue i {
  position: absolute; top: 50%; left: 6px;
  width: 4px; height: 4px; margin-top: -2px;
  border-radius: 50%; background: var(--accent);
  animation: dragcue 1.6s ease-in-out infinite;
}
@keyframes dragcue {
  0%, 100% { left: 6px; opacity: 0.4; }
  50% { left: 20px; opacity: 1; }
}
.hint-scroll { transition: opacity 0.6s ease; }
.hint-scroll.gone { opacity: 0; pointer-events: none; }

/* ---------- Mobile menu toggle (hidden on desktop) ---------- */
.menu-toggle {
  display: none;
  position: absolute;
  left: 22px; top: 64px;
  width: 44px; height: 44px;
  background: var(--pill);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer; z-index: 12;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.menu-toggle span {
  display: block; width: 20px; height: 2px; border-radius: 2px;
  background: var(--fg); transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Responsive */
@media (max-width: 720px) {
  .brand-sub { display: none; }
  .brand-name { font-size: 14px; letter-spacing: 0.12em; } /* DIJA TECHNOLOGIES fits small screens */
  .menu-toggle { display: flex; }

  /* left menu becomes a slide-in sheet toggled by the hamburger */
  .menu {
    top: 0; left: 0; bottom: 0;
    width: min(82vw, 320px); max-width: none;
    padding: 100px 30px 30px;
    background: linear-gradient(180deg, rgba(10, 8, 18, 0.97), rgba(6, 5, 12, 0.98));
    border-right: 1px solid var(--line);
    transform: translateX(-105%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 11;
    display: flex; flex-direction: column; justify-content: center;
  }
  .menu.open { transform: translateX(0); }
  .menu-title { font-size: 20px; margin-bottom: 20px; }

  .hint-count, .hint-scroll { display: none; }
  .ask, .ask-answer { display: none; } /* declutter on small screens */

  .carousel-ctrl { bottom: 30px; gap: 10px; }
  .cc-arrow { width: 40px; height: 40px; font-size: 26px; opacity: 0.95; }
  .progress { gap: 5px; }
  .pdot { width: 6px; height: 6px; }

  .topbar { padding: 20px 22px; }
  .nav { gap: 16px; }
  .sound { bottom: 88px; }
  .credit { bottom: 10px; font-size: 8px; }
  .project-card { width: 100vw; padding: 80px 26px 40px; }
}
