/* ── Tokens ────────────────────────────────────────────────── */

:root {
  /* Brand */
  --color-violet:       #7C5CFF;
  --color-violet-light: #9B82FF;
  --color-violet-dark:  #5B3FD9;
  --color-ink:          #05060A;
  --color-ink-mid:      #0B0D14;
  --color-ink-light:    #141824;

  /* Neutrals — dark theme */
  --color-white:      #FFFFFF;
  --color-off-white:  #F4F5F7;
  --color-surface:    #0B0D14;
  --color-border:     rgba(244, 245, 247, 0.14);
  --color-border-2:   rgba(244, 245, 247, 0.08);
  --color-text:       rgba(244, 245, 247, 0.92);
  --color-text-2:     rgba(244, 245, 247, 0.72);
  --color-text-3:     rgba(244, 245, 247, 0.48);
  --color-text-4:     rgba(244, 245, 247, 0.30);

  /* Translucent surfaces layered over the scene */
  --surface-1:     rgba(244, 245, 247, 0.08);
  --surface-2:     rgba(244, 245, 247, 0.10);
  --surface-hover: rgba(244, 245, 247, 0.20);
  --veil-top:      linear-gradient(180deg, rgba(5, 6, 10, 0.72) 0%, rgba(5, 6, 10, 0) 32%);
  --veil-bottom:   linear-gradient(0deg,   rgba(5, 6, 10, 0.82) 0%, rgba(5, 6, 10, 0) 40%);
  /* Deeper scrims for small screens, where the headline sits closer to the art */
  --veil-top-sm:   linear-gradient(180deg, rgba(5, 6, 10, 0.78) 0%, rgba(5, 6, 10, 0) 26%);
  --veil-bottom-sm: linear-gradient(0deg,
                      rgba(5, 6, 10, 0.96) 0%,
                      rgba(5, 6, 10, 0.88) 22%,
                      rgba(5, 6, 10, 0.62) 42%,
                      rgba(5, 6, 10, 0) 66%);
  --color-error:   #FF9B8A;

  /* Typography */
  --font-primary:   ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --font-secondary: ui-serif, Georgia, "Times New Roman", serif;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;
  --text-8xl:  5.5rem;

  /* Fluid display sizes */
  --text-hero:    clamp(2.125rem, 7vw, 4.25rem);
  --text-section: clamp(1.75rem, 5vw, 2.875rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 999px;

  /* Layout */
  --gutter:       var(--space-5);
  --content-width: 47.5rem;
  --wide-width:    68.75rem;

  /* Motion */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --duration:    0.18s;
  --duration-lg: 0.6s;
}

@media (min-width: 48rem) {
  :root {
    --gutter: var(--space-8);
  }
}

@media (min-width: 75rem) {
  :root {
    --gutter: var(--space-12);
  }
}

/* ── Reset ─────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Scrolling still works; the indicator is simply not painted. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--color-ink);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.1;
}

p {
  margin: 0;
}

img,
iframe,
video {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-violet);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Layout ────────────────────────────────────────────────── */

.site-main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-12) var(--gutter);
}

@media (min-width: 48rem) {
  .site-main {
    padding: var(--space-20) var(--gutter);
  }
}

/* The scene is a locked single screen on its own; the front page adds
   is-scene-scroll so the waitlist can scroll up over the fixed scene. */
body.is-scene {
  overflow: hidden;
}

body.is-scene-scroll {
  overflow: visible;
}

/* ── Typography ────────────────────────────────────────────── */

.t-hero {
  font-size: var(--text-hero);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.t-section {
  font-size: var(--text-section);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.t-lead {
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--color-text-2);
}

@media (min-width: 48rem) {
  .t-lead {
    font-size: var(--text-lg);
  }
}

.t-meta {
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-3);
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--color-text);
  font-size: var(--text-sm);
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    background-color var(--duration) var(--ease),
    transform 0.1s var(--ease);
}

.btn:hover {
  background: var(--surface-hover);
}

.btn:active {
  transform: translateY(1px);
}

/* ── Brand ─────────────────────────────────────────────────── */

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  /* Matches the hero headline's treatment so the wordmark and the h1 read as
     one voice: same family, same weight, same tight tracking. */
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  text-decoration: none;
}

.brand__suffix {
  color: var(--color-text-2);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.brand img {
  display: block;
  width: auto;
  height: 28px;
}

/* ── Navigation ────────────────────────────────────────────── */

.nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  color: var(--color-text-2);
  font-size: var(--text-sm);
  text-decoration: none;
  transition:
    color var(--duration) var(--ease),
    background-color var(--duration) var(--ease);
}

.nav a:hover {
  background: var(--surface-1);
  color: var(--color-text);
}

.nav .current-menu-item > a {
  color: var(--color-text);
}

/* Secondary links are hidden on small screens; the CTA always shows. */
.nav .menu-item:not(.menu-item--cta) {
  display: none;
}

@media (min-width: 48rem) {
  .nav .menu-item:not(.menu-item--cta) {
    display: block;
  }
}

/* ── Site Header ───────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-header--flow {
  padding: var(--gutter);
  border-bottom: 1px solid var(--color-border);
}

/* ── Site Footer ───────────────────────────────────────────── */

.site-footer--flow {
  padding: var(--space-8) var(--gutter) max(var(--space-8), env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  color: var(--color-text-3);
  font-size: var(--text-sm);
  text-align: center;
}

/* ── Scene ─────────────────────────────────────────────────── */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  /* Clips the oversized iframe below. */
  overflow: hidden;
}

/* The embed is cross-origin, so its bottom-right badge cannot be styled. The
   iframe is instead run past the bottom edge and clipped, which drops that
   corner out of view.

   Width stays at exactly 100%: widening it lets the scene's own background
   show down the left and right sides as dark bands. Only the height grows. */
.scene iframe {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% + 5rem);
  border: 0;
  opacity: 0;
  transition: opacity var(--duration-lg) var(--ease);
}

.scene.is-ready iframe {
  opacity: 1;
}

/* Vignette keeps overlay text legible over whatever the scene renders. */
.scene-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--veil-top), var(--veil-bottom);
}

@media (max-width: 47.99rem) {
  /* The scene is rendered into a larger viewport and scaled down, which pushes
     the subject further away and clears the top of the frame for the wordmark. */
  /* A deeper, longer scrim so the headline stays readable on small screens. */
  .scene-veil {
    background: var(--veil-top-sm), var(--veil-bottom-sm);
  }
}

/* ── Loader ────────────────────────────────────────────────── */

.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-5);
  background: var(--color-ink);
  transition:
    opacity var(--duration-lg) var(--ease),
    visibility var(--duration-lg) var(--ease);
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader__mark {
  font-size: var(--text-xs);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--color-text-3);
}

.loader__icon {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--color-violet);
}

/* ── Overlay ───────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    max(var(--gutter), env(safe-area-inset-top))
    var(--gutter)
    max(var(--gutter), env(safe-area-inset-bottom));
  pointer-events: none;
}

.overlay a,
.overlay button {
  pointer-events: auto;
}

/* In scroll mode the overlay claims the first viewport and scrolls away. */
.is-scene-scroll .overlay {
  position: relative;
  inset: auto;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Hero ──────────────────────────────────────────────────── */

.hero-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
}

@media (min-width: 48rem) {
  .hero-row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-6);
  }
}

/* Sized in rem, not ch. A ch here resolves against .hero's own 1rem font
   rather than the headline's, which capped the column at roughly 240px and
   shredded the h1 across five lines. */
.hero {
  max-width: 28rem;
}

@media (min-width: 48rem) {
  .hero {
    max-width: 40rem;
  }
}

.hero__title {
  margin-bottom: var(--space-3);
  text-wrap: balance;
}

.hero__text {
  max-width: 42ch;
}

/* A newline in the heading field becomes this break. It only applies from the
   tablet breakpoint up, so narrow screens wrap on their own. */
.brk {
  display: none;
}

@media (min-width: 48rem) {
  .brk {
    display: inline;
  }
}

/* ── Waitlist ──────────────────────────────────────────────── */

.waitlist {
  position: relative;
  z-index: 3;
  /* Opaque so it cleanly covers the fixed scene as it scrolls up. */
  padding: var(--space-16) var(--gutter) var(--space-12);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

@media (min-width: 48rem) {
  .waitlist {
    padding: var(--space-24) var(--gutter) var(--space-20);
  }
}

.waitlist__in {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
}

/* The hidden state is applied by JS only, so the section stays visible when
   scripting is unavailable. */
.js-reveal {
  opacity: 0;
  translate: 0 1.25rem;
  transition:
    opacity 0.7s var(--ease),
    translate 0.7s var(--ease);
}

.js-reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

.waitlist__title {
  margin-bottom: var(--space-3);
}

.waitlist__text {
  margin-bottom: var(--space-8);
}

/* ── Form ──────────────────────────────────────────────────── */

.form__row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 34rem) {
  .form__row {
    flex-direction: row;
  }
}

.form__input {
  flex: 1;
  min-width: 0;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-ink);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-base);
  transition: border-color var(--duration) var(--ease);
}

.form__input::placeholder {
  color: var(--color-text-4);
}

.form__input:hover {
  border-color: var(--color-text-3);
}

.form__input:focus {
  outline: none;
  border-color: var(--color-violet);
}

.form__btn {
  flex: none;
  padding: var(--space-3) var(--space-6);
  border-color: transparent;
  background: var(--color-violet);
  color: var(--color-ink);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-base);
}

.form__btn:hover {
  background: var(--color-violet-light);
}

/* Honeypot — off-screen rather than display:none, which some bots detect. */
.form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__note {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

.form__note--ok {
  color: var(--color-violet);
}

.form__note--error {
  color: var(--color-error);
}

.form__fine {
  margin-top: var(--space-4);
  color: var(--color-text-3);
  font-size: var(--text-sm);
}

/* ── Entry ─────────────────────────────────────────────────── */

.entry + .entry {
  margin-top: var(--space-12);
  padding-top: var(--space-12);
  border-top: 1px solid var(--color-border);
}

.entry__title {
  margin-bottom: var(--space-2);
  font-size: var(--text-3xl);
  letter-spacing: -0.025em;
}

@media (min-width: 48rem) {
  .entry__title {
    font-size: var(--text-4xl);
  }
}

.entry__title a {
  text-decoration: none;
}

.entry__title a:hover {
  color: var(--color-violet);
}

.entry__meta {
  margin-bottom: var(--space-5);
}

.entry__content > * + * {
  margin-top: 1.1em;
}

.entry__content a {
  color: var(--color-violet);
}

.entry__content h2 {
  margin-top: 1.8em;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

.entry__content h3 {
  margin-top: 1.6em;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}

.entry__content blockquote {
  margin: 1.6em 0;
  padding: var(--space-1) 0 var(--space-1) var(--space-5);
  border-left: 2px solid var(--color-violet);
  color: var(--color-text-2);
}

.entry__content code {
  padding: 2px var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-ink-mid);
  font-size: 0.9em;
}

.entry__content pre {
  padding: var(--space-5);
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-ink-mid);
}

.entry__content img {
  border-radius: var(--radius-lg);
}

/* ── Pagination ────────────────────────────────────────────── */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.pagination .page-numbers {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-2);
  font-size: var(--text-sm);
  text-decoration: none;
  transition:
    color var(--duration) var(--ease),
    background-color var(--duration) var(--ease);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--surface-2);
  color: var(--color-text);
}

/* ── Utilities ─────────────────────────────────────────────── */

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-violet);
  color: var(--color-white);
  text-decoration: none;
  transition: top var(--duration) var(--ease);
}

.skip-link:focus {
  top: var(--space-3);
}

/* ── Reduced Motion ────────────────────────────────────────── */

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

  .js-reveal {
    opacity: 1;
    translate: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
