/* ==========================================================================
   Astra Chroma — In Progress
   ========================================================================== */

:root {
  --bg: #090a12;
  --panel: #14162a;
  --text: #f5f2ed;
  --muted: #b9bbca;
  --line: rgba(255, 255, 255, 0.1);
  --purple: #c2acff;
  --peach: #ffb797;
  --glass: rgba(255, 255, 255, 0.04);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { color-scheme: dark; background: var(--bg); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  /* NOTE: no `cursor: none` here. cursor.js adds .custom-cursor-active when safe. */
}

h1, h2, h3 { font-family: 'Space Grotesk', system-ui, sans-serif; }

:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }

/* ==========================================================================
   Deep-space layers
   ========================================================================== */

.nebula { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.nebula span { position: absolute; border-radius: 50%; will-change: transform; }

.nebula .n1 {
  width: 70vmax; height: 70vmax; left: -25vmax; top: -30vmax;
  background: radial-gradient(circle, rgba(194, 172, 255, .30), transparent 65%);
  animation: drift 48s ease-in-out infinite alternate;
}
.nebula .n2 {
  width: 65vmax; height: 65vmax; right: -28vmax; bottom: -32vmax;
  background: radial-gradient(circle, rgba(255, 183, 151, .20), transparent 65%);
  animation: drift 56s ease-in-out infinite alternate-reverse;
}
.nebula .n3 {
  width: 50vmax; height: 50vmax; left: 30%; top: 25%;
  background: radial-gradient(circle, rgba(96, 110, 255, .12), transparent 65%);
  animation: drift 64s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, 3vmax, 0) scale(1.12); }
}

.starfield { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* Fine film grain for a cinematic feel */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Orbits + planet (parallax container) ---------- */

.universe-bg {
  position: fixed;
  inset: -50px;                 /* bleed so parallax never reveals edges */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
}

.planet {
  position: absolute;
  width: 20vmin; height: 20vmin;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, .22), rgba(194, 172, 255, .22) 24%, rgba(28, 26, 58, .92) 60%, #0a0a16);
  box-shadow:
    inset -2.4vmin -2.4vmin 5vmin rgba(0, 0, 0, .65),
    inset 0 0 0 1px rgba(255, 255, 255, .06),
    0 0 9vmin rgba(194, 172, 255, .22);
  opacity: .9;
}

.orbit { position: absolute; border-radius: 50%; }

/* Gradient comet-arc ring + a planet riding it */
.orbit-1 {
  width: 50vmin; height: 50vmin;
  border: 1px solid transparent;
  background: conic-gradient(from 0deg, var(--purple), transparent 38%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: spin 35s linear infinite;
}
.orbit-1::after {
  content: ''; position: absolute; top: -5px; left: 50%;
  width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 18px 5px rgba(194, 172, 255, .55);
}

.orbit-2 {
  width: 85vmin; height: 85vmin;
  border: 1px dashed rgba(255, 183, 151, .28);
  animation: spin 55s linear infinite reverse;
}
.orbit-2::after {
  content: ''; position: absolute; bottom: 14%; right: 6%;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--peach);
  box-shadow: 0 0 14px 4px rgba(255, 183, 151, .5);
}

.orbit-3 { width: 120vmin; height: 120vmin; border: 1px solid rgba(255, 255, 255, .05); }

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

/* ---------- HUD corners ---------- */

.hud {
  position: fixed; z-index: 5;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); opacity: .75;
  pointer-events: none;
}
.hud--tl { top: max(24px, env(safe-area-inset-top)); left: clamp(20px, 3vw, 40px); }
.hud--tr { top: max(24px, env(safe-area-inset-top)); right: clamp(20px, 3vw, 40px); }
.hud__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--peach); box-shadow: 0 0 8px var(--peach); animation: pulse 2.4s infinite; }

/* ==========================================================================
   Center stage
   ========================================================================== */

.content-stage {
  position: relative; z-index: 10;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 24px;
  padding: 24px;
  max-width: 900px;
  will-change: transform;
}

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3em;
  color: var(--muted);
}
.brand__mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: conic-gradient(from 90deg, var(--purple), var(--peach), var(--purple));
  box-shadow: 0 0 14px rgba(194, 172, 255, .55);
}

h1 {
  font-size: clamp(34px, 6.4vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 40px rgba(9, 10, 18, .8);
}

h1 em {
  font-style: normal;
  background: linear-gradient(110deg, var(--purple), var(--peach), var(--purple));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 8s ease-in-out infinite alternate;
}
@keyframes shimmer { to { background-position: 100% 0; } }

.status-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 22px; margin-top: 12px;
  background: var(--glass);
  border-radius: 100px;
  font-size: 14px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
/* gradient hairline border */
.status-pill::before, .modal-content::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(194, 172, 255, .55), rgba(255, 255, 255, .06) 40%, rgba(255, 183, 151, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
          mask-composite: exclude;
}

.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--purple); box-shadow: 0 0 10px var(--purple);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } }

/* ---------- Contact button ---------- */

.contact-btn {
  position: fixed; z-index: 20;
  left: 50%; bottom: max(32px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--text);
  font: 500 13px/1 'DM Sans', sans-serif;
  letter-spacing: .14em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: color .3s, border-color .3s, background .3s, box-shadow .3s;
}
.contact-btn svg { transition: transform .3s var(--ease-out); }
.contact-btn:hover { color: var(--peach); border-color: rgba(255, 183, 151, .5); background: rgba(255, 183, 151, .07); box-shadow: 0 0 32px rgba(255, 183, 151, .18); }
.contact-btn:hover svg { transform: translateX(4px); }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(9, 10, 18, .72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .4s ease, visibility 0s .4s;
}
.modal-overlay.active { opacity: 1; visibility: visible; pointer-events: all; transition-delay: 0s; }

.modal-content {
  position: relative;
  width: 100%; max-width: 460px;
  max-height: calc(100dvh - 48px); overflow-y: auto;
  padding: clamp(28px, 5vw, 44px);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(30, 32, 52, .9), rgba(18, 19, 33, .92));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 80px rgba(194, 172, 255, .08);
  transform: translateY(20px) scale(.95);
  transition: transform .5s var(--ease-out);
}
.modal-overlay.active .modal-content { transform: none; }

.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.modal-header h2 { font-size: 28px; letter-spacing: -.02em; }
.modal-subtitle { color: var(--muted); margin-top: 6px; font-size: 14px; }

.close-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; margin: -6px -8px 0 0;
  background: none; border: 1px solid transparent; border-radius: 50%;
  color: var(--muted); font-size: 26px; line-height: 1;
  transition: color .2s, border-color .2s;
}
.close-btn:hover { color: var(--peach); border-color: var(--line); }

.input-group { margin-bottom: 18px; }
.input-group label {
  display: block; margin-bottom: 8px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.input-group input, .input-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--text);
  font: 16px/1.4 'DM Sans', sans-serif;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.input-group input::placeholder, .input-group textarea::placeholder { color: #7c7f99; }
.input-group input:focus, .input-group textarea:focus {
  outline: none; background: rgba(194, 172, 255, .06);
  border-color: var(--purple); box-shadow: 0 0 0 3px rgba(194, 172, 255, .18);
}
.input-group textarea { resize: none; height: 110px; }

.submit-btn {
  width: 100%; padding: 16px; margin-top: 6px;
  background: linear-gradient(110deg, var(--purple), var(--peach));
  color: #14122a; border: none; border-radius: 14px;
  font: 700 16px/1 'Space Grotesk', sans-serif;
  transition: transform .2s, box-shadow .3s, filter .3s;
}
.submit-btn:hover { box-shadow: 0 10px 36px rgba(194, 172, 255, .35); filter: brightness(1.05); }
.submit-btn:active { transform: scale(.98); }
.submit-btn:disabled { opacity: .6; }

.form-status { min-height: 1.5em; margin-top: 14px; font-size: 14px; color: var(--peach); text-align: center; }

/* ==========================================================================
   CUSTOM CURSOR
   Inert until cursor.js adds .custom-cursor-active. There is NO unconditional
   `cursor: none` anywhere in this file.
   ========================================================================== */

.cursor-dot,
.cursor-orb {
  position: fixed;               /* viewport-relative, never creates scrollbars */
  top: 0; left: 0;
  z-index: 99999;                /* above the modal (100) */
  width: 0; height: 0; margin: 0; padding: 0;
  pointer-events: none;
  opacity: 0;                    /* hidden until JS confirms it works */
  transform: translate3d(-100px, -100px, 0);
  will-change: transform, opacity;
  contain: layout style;
  transition: opacity .25s ease; /* graceful fade-out when leaving the window */
  --glow: 194, 172, 255;         /* purple */
}

/* Instant snap on re-entry (class toggled for one frame by JS) */
.cursor-dot.is-snapping, .cursor-orb.is-snapping,
.cursor-dot.is-snapping *, .cursor-orb.is-snapping * { transition: none !important; }

.cursor-dot.is-visible, .cursor-orb.is-visible { opacity: 1; }

/* Native cursor hidden ONLY after JS verified the custom one is alive.
   The universal selector beats buttons/links that set cursor: pointer. */
body.custom-cursor-active,
body.custom-cursor-active * { cursor: none !important; }

.cursor-dot__core {
  position: absolute; left: -2px; top: -2px; width: 4px; height: 4px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, .9);
  transition: transform .2s ease, background-color .2s ease;
}

.cursor-orb__ring {
  position: absolute; left: -16px; top: -16px; width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(var(--glow), .75);
  background: radial-gradient(circle, rgba(var(--glow), .32), rgba(var(--glow), 0) 70%);
  box-shadow: 0 0 22px rgba(var(--glow), .5);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

/* Interactive states: expand and warm to peach */
.cursor-orb.is-hovering { --glow: 255, 183, 151; }
.cursor-orb.is-hovering .cursor-orb__ring { transform: scale(2); }
.cursor-dot.is-hovering .cursor-dot__core { transform: scale(.6); background: var(--peach); }

.cursor-orb.is-text .cursor-orb__ring { transform: scale(1.5); background: none; }

.cursor-orb.is-pressed .cursor-orb__ring { transform: scale(.75); }
.cursor-orb.is-hovering.is-pressed .cursor-orb__ring { transform: scale(1.4); }
.cursor-dot.is-pressed .cursor-dot__core { transform: scale(1.6); }

/* ==========================================================================
   Graceful degradation
   ========================================================================== */

/* Touch-only devices: no custom cursor, native interactions untouched */
@media (hover: none) and (pointer: coarse) {
  .cursor-dot, .cursor-orb { display: none !important; }
  body.custom-cursor-active, body.custom-cursor-active * { cursor: auto !important; }
}

@media (max-width: 520px) {
  .hud { display: none; }
  .orbit-3 { display: none; }
}

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

/* ==========================================================================
   Contact form UX
   ========================================================================== */

[hidden] { display: none !important; }

.topics { border: 0; margin: 0 0 22px; min-width: 0; }
.topics legend {
  margin-bottom: 10px; padding: 0;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.optional { text-transform: none; letter-spacing: 0; opacity: .7; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; pointer-events: none; }
.chip label {
  display: inline-block; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 100px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted); font-size: 13px;
  transition: color .2s, border-color .2s, background .2s;
}
.chip label:hover { color: var(--text); border-color: rgba(255, 255, 255, .25); }
.chip input:checked + label {
  color: #14122a; border-color: transparent;
  background: linear-gradient(110deg, var(--purple), var(--peach));
  font-weight: 500;
}
.chip input:focus-visible + label { outline: 2px solid var(--purple); outline-offset: 3px; }

.field-error { margin-top: 6px; font-size: 13px; color: #ffb3a3; }
.input-group input[aria-invalid="true"],
.input-group textarea[aria-invalid="true"] { border-color: #ff9d85; }

/* Honeypot: off-screen, not display:none (bots skip display:none fields) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-success { display: grid; gap: 12px; justify-items: start; padding: 8px 0 4px; outline: none; }
.form-success h3 { font-size: 24px; letter-spacing: -.02em; }
.form-success p { color: var(--muted); font-size: 15px; margin-bottom: 8px; }
.form-success__icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font-size: 20px; color: #14122a;
  background: linear-gradient(110deg, var(--purple), var(--peach));
  box-shadow: 0 0 28px rgba(194, 172, 255, .4);
}
