:root {
  --bg: #07080f;
  --bg-2: #0c0e1c;
  --ink: #eef1ff;
  --ink-2: #a8afd1;
  --ink-3: #6d7398;
  --line: rgb(140 160 255 / 0.14);
  --line-2: rgb(140 160 255 / 0.26);
  --cyan: #7be3ff;
  --blue: #4fa6ff;
  --indigo: #4c6bf7;
  --amber: #ffb547;
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 48px);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
}

/* Fit one screen: let the page scroll only if it truly cannot fit
   (tiny landscape phones or large text zoom), rather than clipping. */
@media (min-height: 560px) and (min-width: 320px) {
  body { height: 100dvh; overflow: hidden; }
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vmax 50vmax at 78% 40%, rgb(76 107 247 / 0.22), transparent 60%),
    radial-gradient(40vmax 40vmax at 90% 90%, rgb(123 227 255 / 0.10), transparent 60%),
    radial-gradient(50vmax 40vmax at 0% 0%, rgb(61 69 214 / 0.16), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 70% at 70% 45%, #000 20%, transparent 75%);
  opacity: 0.55;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 2.4vh, 28px) var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand b { font-weight: 650; color: var(--cyan); }

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.55em 1.15em;
  font: 600 0.92rem/1 var(--font);
  color: var(--ink);
  background: rgb(255 255 255 / 0.03);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
}
.btn:hover { border-color: var(--cyan); background: rgb(123 227 255 / 0.08); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  color: #050611;
}
.btn-primary:hover { background: linear-gradient(135deg, #b8fbff, var(--blue)); }

/* Stage */
.stage {
  min-height: 0;
  display: grid;
  gap: clamp(10px, 2.2vh, 28px) clamp(24px, 4vw, 64px);
  padding: 0 var(--gutter);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas: "mark" "intro" "apps";
  align-content: center;
}

.intro { grid-area: intro; }
.mark { grid-area: mark; }
.apps { grid-area: apps; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(6px, 1.4vh, 16px);
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgb(255 181 71 / 0.6);
  animation: pulse 2.4s infinite;
}

h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.9rem, min(7.4vw, 6.2vh), 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.grad {
  background: linear-gradient(100deg, var(--cyan) 0%, var(--blue) 45%, var(--indigo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  margin: clamp(8px, 1.6vh, 20px) 0 0;
  max-width: 34rem;
  color: var(--ink-2);
  font-size: clamp(0.95rem, min(2.4vw, 2.1vh), 1.15rem);
}

/* Mark */
.mark {
  position: relative;
  margin: 0;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
}
.mark-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}
.facets { stroke: var(--bg); stroke-width: 3; stroke-linejoin: round; }
.f0 { fill: #b8fbff; } .f1 { fill: #7be3ff; } .f2 { fill: #4fa6ff; } .f3 { fill: #4c6bf7; }
.f4 { fill: #3d45d6; } .f5 { fill: #2b2e9a; } .f6 { fill: #1c1d63; } .f7 { fill: #10113a; }
.facets polygon { transition: filter 0.4s; }
.mark:hover .facets polygon:hover { filter: brightness(1.35); }
.eye {
  fill: var(--amber);
  filter: drop-shadow(0 0 6px rgb(255 181 71 / 0.95)) drop-shadow(0 0 18px rgb(255 181 71 / 0.6));
  animation: glow 4s ease-in-out infinite;
}
.halo {
  position: absolute;
  aspect-ratio: 1;
  width: min(96cqh, 96cqw);
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 70%, rgb(123 227 255 / 0.5) 80%, transparent 90%);
  mask: radial-gradient(closest-side, transparent 96%, #000 97%, #000 99%, transparent 100%);
  animation: spin 9s linear infinite;
  opacity: 0.8;
}
.halo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
}

/* Apps */
.label {
  margin: 0 0 10px;
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.app-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.app {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icon body" "icon status";
  align-items: center;
  gap: 2px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.045), rgb(255 255 255 / 0.015));
  backdrop-filter: blur(10px);
}
.app-icon {
  grid-area: icon;
  width: 48px;
  height: 48px;
  border-radius: 12px;
}
.app-icon-next {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-2);
  color: var(--ink-3);
  font-size: 1.4rem;
}
.app-body { grid-area: body; min-width: 0; }
.app h3 { margin: 0; font-size: 1rem; letter-spacing: -0.01em; }
.app p { margin: 2px 0 0; color: var(--ink-2); font-size: 0.86rem; line-height: 1.35; }
.status {
  grid-area: status;
  justify-self: start;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font: 500 0.7rem/1.2 var(--mono);
  letter-spacing: 0.04em;
  color: var(--amber);
  background: rgb(255 181 71 / 0.1);
  border: 1px solid rgb(255 181 71 / 0.25);
}
.status-muted { color: var(--ink-3); background: transparent; border-color: var(--line); }
.app-next { opacity: 0.8; }

/* Footer */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(10px, 2vh, 22px) var(--gutter);
  color: var(--ink-3);
  font: 400 0.76rem/1.2 var(--mono);
}

/* Contact dialog */
.contact {
  width: min(calc(100vw - 24px), 480px);
  padding: 28px 24px 24px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: rgb(12 14 28 / 0.92);
  color: var(--ink);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.6);
}
.contact::backdrop { background: rgb(3 4 10 / 0.7); backdrop-filter: blur(4px); }
.contact h2 { margin: 0 0 14px; font-size: 1.2rem; letter-spacing: -0.02em; }
.contact-close-form { position: absolute; top: 10px; right: 10px; margin: 0; }
.icon-btn {
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: rgb(255 255 255 / 0.06); color: var(--ink); }
.contact { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.contact-form { display: grid; gap: 10px; }
.field-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 4px; font-size: 0.82rem; color: var(--ink-2); }
.field > span { display: flex; justify-content: space-between; align-items: baseline; }
.field small { color: var(--ink-3); font: 400 0.7rem/1.2 var(--mono); }
.field input, .field select, .field textarea {
  width: 100%;
  font: 400 16px/1.35 var(--font);
  color: var(--ink);
  background: rgb(255 255 255 / 0.04);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 9px 12px;
}
.field textarea { resize: vertical; min-height: 88px; max-height: 40dvh; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: var(--bg-2); color: var(--ink); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: #ff8a8a; }
.hint { font-size: 0.72rem; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.82rem; color: var(--ink-2); }
.consent input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--cyan); flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile { min-height: 65px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.contact-state { min-height: 1.3em; margin: 0; font-size: 0.85rem; color: var(--ink-2); }
.contact-state[data-tone="error"] { color: #ff8a8a; }
.contact-done { text-align: center; padding: 8px 0 4px; color: var(--ink-2); }
.done-mark { width: 48px; height: 48px; margin: 4px auto 8px; display: grid; place-items: center; border-radius: 50%; background: rgb(123 227 255 / 0.12); color: var(--cyan); font-size: 1.4rem; }
.noscript { position: fixed; bottom: 8px; left: 0; right: 0; text-align: center; color: var(--ink-3); font-size: 0.8rem; }

/* Desktop and tablet landscape: two columns, mark on the right */
@media (min-width: 900px) and (min-height: 560px) {
  .stage {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "intro mark" "apps mark";
  }
  .intro { align-self: end; }
  .apps { align-self: start; padding-top: 2vh; }
  .mark { margin: 2vh 0; }
  .mark { align-self: stretch; }
  .app-list { grid-template-columns: 1fr 1fr; }
}

/* Short screens: drop the least important lines first */
@media (max-height: 700px) {
  .app-next { display: none; }
}
@media (max-height: 640px) and (max-width: 899px) {
  .lede { display: none; }
}
@media (max-height: 560px) and (min-width: 600px) {
  /* Landscape phones: side by side */
  .stage {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    grid-template-rows: auto auto;
    grid-template-areas: "mark intro" "mark apps";
  }
  .lede { display: none; }
}
@media (max-width: 560px) {
  .eyebrow { font-size: 0.66rem; letter-spacing: 0.05em; gap: 8px; white-space: nowrap; }
}
@media (max-width: 380px) {
  .foot-meta { display: none; }
  .eyebrow { font-size: 0.6rem; letter-spacing: 0.02em; }
}

/* Motion */
@keyframes rise { from { transform: translateY(12px) scale(0.97); } to { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(255 181 71 / 0.55); }
  70% { box-shadow: 0 0 0 10px rgb(255 181 71 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(255 181 71 / 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
