/* ============ EnviroMento ============ */

:root {
  --bg: #000;
  --fg: #f3f6f7;
  --muted: #8a959a;
  --dim: #545e63;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(255, 255, 255, 0.035);
  --glass-hi: rgba(255, 255, 255, 0.07);
  --accent: #7ef3d2;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 0.84, 0.24, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.page-open { overflow: hidden; }

a { color: inherit; }
::selection { background: rgba(126, 243, 210, 0.3); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: #000;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}

.hero-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 1.1s var(--ease), filter 0.8s ease;
}
body.flying .hero-title {
  opacity: 0;
  transform: scale(1.12);
  filter: blur(6px);
}

.wordmark {
  margin: 0;
  font-weight: 300;
  font-size: clamp(1.45rem, 5vw, 4.6rem);
  letter-spacing: 0.24em;
  padding-left: 0.24em; /* balance the trailing tracking so it centers optically */
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 14px rgba(225, 245, 255, 0.22);
  animation: rise 1.8s 0.2s var(--ease-out) both;
}

.tagline {
  margin: 1.1rem 0 0;
  font-size: clamp(0.62rem, 0.95vw, 0.78rem);
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
  animation: rise 1.8s 0.55s var(--ease-out) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); letter-spacing: 0.5em; filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(24px, env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
  animation: fade 1.5s 1.6s both;
  transition: opacity 0.5s;
}
body.flying .hint { opacity: 0; }
.hint-touch { display: none; }
@media (hover: none) { .hint-touch { display: inline; } .hint-desktop { display: none; } }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Keyboard / fallback nav */
.fallback-nav {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.fallback-nav:focus-within,
body.no-webgl .fallback-nav {
  opacity: 1;
  pointer-events: auto;
}
.fallback-nav a {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}
.fallback-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.no-webgl .fallback-nav { bottom: auto; top: 62%; }

/* ---------- Shared type ---------- */

.eyebrow {
  margin: 0 0 18px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
}

.display {
  margin: 0 0 28px;
  font-weight: 200;
  font-size: clamp(2.1rem, 5.4vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 16ch;
  outline: none;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 300;
  line-height: 1.55;
  color: #d5dcdf;
  max-width: 46ch;
  margin: 0 0 24px;
}

p { color: #b9c2c6; }
em { font-style: normal; color: var(--fg); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--fg);
  font: 500 0.82rem/1 var(--font);
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.btn:hover { background: var(--glass-hi); border-color: rgba(255, 255, 255, 0.2); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-primary { background: #fff; color: #000; border-color: #fff; }
.btn-primary:hover { background: #dffcf3; border-color: #dffcf3; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; }

/* ---------- About ---------- */

.about {
  position: relative;
  padding: clamp(90px, 14vw, 170px) 0 clamp(70px, 10vw, 120px);
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(126, 243, 210, 0.06), transparent 70%),
    #000;
  border-top: 1px solid var(--line);
}

.about-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-cols p:not(.lede) { margin-top: 6px; }

.steps {
  list-style: none;
  margin: 80px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.steps li {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}
.step-n {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.steps h3 { margin: 10px 0 8px; font-weight: 400; font-size: 1.3rem; }
.steps p { margin: 0; font-size: 0.95rem; }

.about-roots {
  margin-top: 80px;
  max-width: 640px;
}
.about-roots p:last-child { font-size: 1.1rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 56px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  font-size: 0.85rem;
  color: var(--dim);
}
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--fg); }

/* ---------- Page layer (cube transition target) ---------- */

.page-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #000;
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 1s var(--ease);
}
.page-layer.open { clip-path: circle(150% at 50% 50%); }
.page-layer.open.settled { clip-path: none; }
.page-layer[hidden] { display: none; }

.page-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.82);
  color: var(--fg);
  font: 500 0.78rem/1 var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s 0.5s, transform 0.5s 0.5s, background 0.2s;
}
.page-layer.open .page-close { opacity: 1; transform: none; }
.page-close:hover { background: rgba(255, 255, 255, 0.08); }
.page-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  background: radial-gradient(70% 520px at 50% 0%, rgba(126, 243, 210, 0.07), transparent 100%);
  padding: clamp(96px, 12vw, 140px) 24px 100px;
}
.page[hidden] { display: none; }
.page-narrow { max-width: 560px; }

/* Content rises in after the circle opens */
.page > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.page-layer.open .page > * { opacity: 1; transform: none; }
.page-layer.open .page > *:nth-child(1) { transition-delay: 0.35s; }
.page-layer.open .page > *:nth-child(2) { transition-delay: 0.42s; }
.page-layer.open .page > *:nth-child(3) { transition-delay: 0.5s; }
.page-layer.open .page > *:nth-child(4) { transition-delay: 0.58s; }
.page-layer.open .page > *:nth-child(5) { transition-delay: 0.66s; }
.page-layer.open .page > *:nth-child(n+6) { transition-delay: 0.74s; }

.section-title {
  margin: 72px 0 18px;
  font-weight: 300;
  font-size: 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 36px;
}
.section-title + .card-grid { margin-top: 0; }
.card-grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.card:hover { border-color: rgba(255, 255, 255, 0.18); transform: translateY(-2px); }
.card h3, .card h4 { margin: 0 0 10px; font-weight: 400; font-size: 1.2rem; color: var(--fg); }
.card p { margin: 0; font-size: 0.95rem; }
.card ul { margin: 16px 0 0; padding-left: 18px; color: #b9c2c6; font-size: 0.92rem; }
.card li { margin: 4px 0; }
.card li::marker { color: var(--accent); }

.page-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 80px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.page-foot p { margin: 0 12px 0 0; font-size: 1.1rem; color: var(--fg); font-weight: 300; }

/* Scenes */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 40px;
}
.scene-card {
  display: block;
  text-decoration: none;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: transform 0.4s var(--ease-out), border-color 0.3s;
}
.scene-card:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.2); }
.scene-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 50% 55%, rgba(126, 243, 210, 0.22), transparent 55%),
    radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1.4px) 0 0 / 9px 9px,
    #030607;
  -webkit-mask-image: linear-gradient(#000 70%, rgba(0, 0, 0, 0.75));
  mask-image: linear-gradient(#000 70%, rgba(0, 0, 0, 0.75));
}
.scene-thumb.t2 { background-position: center, 3px 2px, 0 0; filter: hue-rotate(40deg); }
.scene-thumb.t3 { background-position: center, 5px 6px, 0 0; filter: hue-rotate(160deg); }
.scene-thumb.t4 { background-position: center, 1px 4px, 0 0; filter: hue-rotate(260deg); }
.scene-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.scene-meta { padding: 18px 20px 20px; }
.scene-meta h3 { margin: 0; font-weight: 400; font-size: 1.05rem; }
.scene-meta p { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); }

/* Forms */
.quote-form,
.login-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  margin-top: 40px;
  padding: clamp(22px, 4vw, 40px);
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}
.login-form { grid-template-columns: 1fr; }
.field { display: grid; gap: 8px; }
.field.full, .form-foot.full { grid-column: 1 / -1; }
.field label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
  color: var(--fg);
  font: 400 1rem/1.4 var(--font);
  transition: border-color 0.2s, background 0.2s;
}
.field textarea { resize: vertical; min-height: 120px; }
/* The open list is drawn by the browser; give its options solid dark colours to match. */
select option,
select optgroup { background: #0d1110; color: #e9efed; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(126, 243, 210, 0.04);
}
.field input[aria-invalid="true"] { border-color: #ff7b7b; }
.field input:disabled { opacity: 0.5; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 6px; }
.form-note { margin: 0; font-size: 0.85rem; color: var(--muted); }
.form-note a { color: var(--fg); }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .about-cols { grid-template-columns: 1fr; gap: 8px; }
  .steps { grid-template-columns: 1fr; margin-top: 48px; }
  .quote-form { grid-template-columns: 1fr; }
  .page-foot p { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  /* No zooming circle or sliding text: a gentle cross-fade instead of an abrupt cut. */
  body:not(.force-motion) .page-layer { clip-path: none; opacity: 0; transition: opacity 0.45s ease; }
  body:not(.force-motion) .page-layer.open { opacity: 1; }
  body:not(.force-motion) .page > * { transform: none; transition: opacity 0.4s ease 0.15s; }
  body:not(.force-motion) :is(.wordmark, .tagline, .hint) { animation: none; }
}

body.no-webgl .hint { display: none; }
.login-form[hidden], .quote-form[hidden] { display: none; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.scene-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene-thumb.has-img { background: #050708; -webkit-mask-image: none; mask-image: none; }

/* ---------- Scene viewer (view-only embed) ---------- */
.scene-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* The visible screen height: on iPhones 100vh reaches behind the browser's toolbar and
     hides the viewer's bottom controls; dvh is what's actually visible. */
  height: 100vh;
  height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 70;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #000;
  animation: fade 0.35s ease both;
}
.scene-viewer[hidden] { display: none; }
.scene-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(12px, env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid var(--line);
}
.scene-viewer-bar h2 { margin: 0; font-weight: 300; font-size: 1.05rem; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-viewer-bar .btn { padding: 9px 16px; font-size: 0.75rem; }
.scene-viewer iframe { width: 100%; height: 100%; border: 0; background: #000; }

/* Spam trap: off-screen, never seen by people. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Phones draw a translucent highlight over whatever is tapped; on the full-screen 3D canvas
   that flashes the whole screen. Switch it off (buttons still show their own pressed state). */
html { -webkit-tap-highlight-color: transparent; }
.scene-viewer-actions { display: flex; gap: 6px; flex: none; }
