/* Venturekaki pre-launch. Dark by design: the page is a night sky for the fireflies. */
:root {
  color-scheme: dark;

  /* Colour tokens */
  --bg: #06100d;
  --bg-raise: #0c1915;
  --bg-field: #0f201b;
  --ink: #eef2e9;
  --ink-muted: #a9b8ae;
  --line: rgba(238, 242, 233, 0.16);
  --line-strong: rgba(238, 242, 233, 0.42);
  --firefly: #d9f35b;
  --firefly-ink: #0a1408;
  --danger: #ffab9c;

  /* Type: system fonts until brand fonts arrive (no font request in the critical path) */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --step-display: clamp(2.4rem, 1.4rem + 5vw, 5.25rem);
  --step-title: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem);
  --step-lede: clamp(1.1rem, 1rem + 0.45vw, 1.35rem);
  --step-body: 1rem;
  --step-small: 0.875rem;

  /* Space and motion */
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 40rem;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 160ms;
  --dur-base: 280ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-body)/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg, canvas { display: block; }
a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--firefly); }
:focus-visible { outline: 3px solid var(--firefly); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--firefly); color: var(--firefly-ink); padding: 0.6rem 1rem; border-radius: 999px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* Background */
.sky, .sky-fallback { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.sky { opacity: 0; transition: opacity 1.2s var(--ease-out); }
.sky.is-on { opacity: 1; }
.sky-fallback {
  background:
    radial-gradient(2px 2px at 18% 32%, rgba(217, 243, 91, 0.55), transparent 60%),
    radial-gradient(2px 2px at 72% 22%, rgba(217, 243, 91, 0.4), transparent 60%),
    radial-gradient(3px 3px at 64% 58%, rgba(217, 243, 91, 0.5), transparent 60%),
    radial-gradient(2px 2px at 30% 74%, rgba(217, 243, 91, 0.35), transparent 60%),
    radial-gradient(2px 2px at 86% 80%, rgba(217, 243, 91, 0.45), transparent 60%),
    radial-gradient(120% 70% at 50% 110%, #0d241c 0%, transparent 70%);
}
.has-sky .sky-fallback { display: none; }

.site-head, main, .site-foot { position: relative; z-index: 1; }

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 14px var(--gutter);
  background: rgba(6, 16, 13, 0.8);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(238, 242, 233, 0.06);
}
.wordmark { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; font-size: 1.05rem; }
.wordmark svg { color: var(--firefly); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.75rem 1.5rem;
  border: 0; border-radius: 999px;
  background: var(--firefly); color: var(--firefly-ink);
  font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.btn:hover { color: var(--firefly-ink); box-shadow: 0 0 0 6px rgba(217, 243, 91, 0.16), 0 0 32px rgba(217, 243, 91, 0.35); }
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 40px; padding: 0.5rem 1.1rem; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.7; cursor: progress; }

/* Sections */
main > section { padding: clamp(64px, 12vh, 140px) var(--gutter); max-width: 76rem; margin: 0 auto; }
.section-title { font-size: var(--step-title); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 1.25rem; font-weight: 700; text-wrap: balance; }

.hero { min-height: calc(100svh - 72px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding-top: 24px; }
.eyebrow { margin: 0 0 1.25rem; color: var(--firefly); font-size: var(--step-small); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.hero h1 { font-size: var(--step-display); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 1.5rem; max-width: 14ch; font-weight: 750; text-wrap: balance; }
.lede { font-size: var(--step-lede); color: var(--ink-muted); max-width: var(--measure); margin: 0 0 2rem; }
.hero h1, .lede, .kaki-text, .join-intro, .offer .section-title, .note { text-shadow: 0 0 24px var(--bg), 0 0 8px var(--bg); }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.card { background: rgba(12, 25, 21, 0.86); border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card h3 { margin: 0 0 0.5rem; font-size: 1.25rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--ink-muted); }
.card .card-step { color: var(--firefly); font-size: var(--step-small); font-weight: 600; margin-bottom: 0.75rem; }
.note { color: var(--ink-muted); font-size: var(--step-small); margin: 1.25rem 0 0; }

.kaki { min-height: 80svh; display: flex; flex-direction: column; justify-content: center; }
.kaki-text { font-size: clamp(1.35rem, 1rem + 1.6vw, 2.25rem); line-height: 1.35; letter-spacing: -0.015em; max-width: 30ch; margin: 0; text-wrap: pretty; }
.kaki-text em { color: var(--firefly); font-style: normal; }

/* Waitlist */
.join { display: grid; gap: clamp(24px, 5vw, 64px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; scroll-margin-top: 72px; }
.join:focus { outline: none; }
.join-intro p { color: var(--ink-muted); max-width: 32rem; margin: 0; }
.form, .done { background: rgba(12, 25, 21, 0.94); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 4vw, 36px); }

.field { margin: 0 0 1.4rem; border: 0; padding: 0; min-width: 0; }
.field > label, legend { display: block; font-weight: 600; margin-bottom: 0.4rem; padding: 0; }
.optional { color: var(--ink-muted); font-weight: 400; }
.hint, .count { color: var(--ink-muted); font-size: var(--step-small); margin: -0.15rem 0 0.5rem; }
.count { margin: 0.35rem 0 0; text-align: right; }

input[type="text"], input[type="email"], textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.9rem;
  background: var(--bg-field); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 12px;
  font: inherit; font-size: 1rem; /* 16px avoids iOS zoom on focus */
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
input:focus-visible, textarea:focus-visible { outline: none; border-color: var(--firefly); box-shadow: 0 0 0 3px rgba(217, 243, 91, 0.35); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.error { color: var(--danger); font-size: var(--step-small); font-weight: 600; margin: 0.4rem 0 0; }
.error::before { content: "⚠ "; }

.role-options { display: grid; gap: 8px; }
.role { display: flex; align-items: center; gap: 0.75rem; min-height: 48px; padding: 0.6rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; background: var(--bg-field); }
.role:has(input:checked) { border-color: var(--firefly); box-shadow: inset 0 0 0 1px var(--firefly); }
.role:has(input:focus-visible) { outline: 3px solid var(--firefly); outline-offset: 2px; }
.role input, .check input { accent-color: var(--firefly); width: 20px; height: 20px; flex: none; margin: 0; }
.role input:focus-visible, .check input:focus-visible { outline: none; }

input[type="file"] { width: 100%; color: var(--ink-muted); font: inherit; font-size: var(--step-small); padding: 0.5rem 0; }
input[type="file"]::file-selector-button {
  min-height: 44px; margin-right: 0.9rem; padding: 0.5rem 1rem; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px; font: 600 0.9rem var(--font);
}
input[type="file"]::file-selector-button:hover { border-color: var(--firefly); }
input[type="file"]:focus-visible { outline: 3px solid var(--firefly); outline-offset: 3px; }

.check { display: flex; gap: 0.75rem; align-items: flex-start; font-weight: 400 !important; font-size: var(--step-small); color: var(--ink-muted); cursor: pointer; }
.check input { margin-top: 2px; }
.check:has(input:focus-visible) { outline: 3px solid var(--firefly); outline-offset: 4px; border-radius: 6px; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.progress { margin: 0; color: var(--ink-muted); font-size: var(--step-small); }

.error-summary { border: 2px solid var(--danger); border-radius: 14px; padding: 1rem 1.2rem; margin-bottom: 1.5rem; }
.error-summary:focus { outline: 3px solid var(--firefly); outline-offset: 3px; }
.error-summary h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--danger); }

.done h3 { font-size: var(--step-title); letter-spacing: -0.02em; margin: 0 0 0.5rem; color: var(--firefly); }
.done p { margin: 0; color: var(--ink-muted); }
.done:focus { outline: none; }

/* Footer */
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding: 32px var(--gutter) 40px; color: var(--ink-muted); font-size: var(--step-small); border-top: 1px solid var(--line); }
.site-foot p { margin: 0; }

/* Plain pages (privacy, thanks, 404) */
.page { position: relative; z-index: 1; max-width: 44rem; margin: 0 auto; padding: 48px var(--gutter) 96px; }
.page h1 { font-size: var(--step-title); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 1.5rem; }
.page h2 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
.page p, .page li { color: var(--ink-muted); }
.placeholder { background: rgba(255, 171, 156, 0.14); color: var(--danger); border: 1px dashed var(--danger); border-radius: 6px; padding: 0 0.35em; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
@media (forced-colors: active) {
  .btn { border: 2px solid ButtonText; }
  .sky, .sky-fallback { display: none; }
}
