/* ═══════════════════════════════════════════════════════════════════
   KANMITO — Design System & Landing Page Styles
   Aesthetic: Topology VC (dark authority) × ISO Meet (functional glass)
   Approach: Mobile-first, CSS-only animations, no frameworks
   ═══════════════════════════════════════════════════════════════════ */

/* ────────────────────────────────
   0. DESIGN TOKENS
   ──────────────────────────────── */
:root {
  /* Backgrounds — never pure black */
  --bg-void: #050505;
  --bg-surface: #0A0A0C;
  --bg-elevated: #111114;
  --bg-glass: rgba(255, 255, 255, 0.03);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.10);

  /* Text — never pure white */
  --text-primary: #E8E8E8;
  --text-secondary: #888888;
  --text-tertiary: #555555;

  /* Accent — used sparingly, max 3 elements */
  --accent-gold: #D4AF37;
  --accent-gold-dim: rgba(212, 175, 55, 0.15);
  --accent-gold-glow: rgba(212, 175, 55, 0.08);

  /* Spacing — generous = premium */
  --space-section: 120px;
  --space-block: 64px;
  --space-element: 24px;
  --space-inline: 16px;
  --page-margin: 20px;

  /* Typography */
  --font-heading: 'Inter', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

@media (min-width: 768px) {
  :root {
    --space-section: 200px;
    --space-block: 100px;
    --space-element: 32px;
    --space-inline: 20px;
    --page-margin: clamp(40px, 5vw, 120px);
  }
}


/* ────────────────────────────────
   1. RESET & BASE
   ──────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--bg-void);
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}


/* ────────────────────────────────
   2. UTILITY CLASSES
   ──────────────────────────────── */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-element);
}

/* Scroll-triggered reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-smooth), transform 0.8s var(--ease-smooth);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ────────────────────────────────
   2.5 MENU / BRAND
   ──────────────────────────────── */
.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 32px var(--page-margin);
  z-index: 100;
  pointer-events: none;
  /* Let clicks pass through empty space */
}

.header__brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  text-transform: uppercase;
  pointer-events: auto;
  /* Make the logo itself clickable/interactive later */
}


/* ────────────────────────────────
   3. SECTION 1 — THE HERO
   ──────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 600px;
  overflow: hidden;
  background-color: var(--bg-void);
  contain: layout style paint;
}

.hero__image-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__image-container picture {
  width: 100%;
  height: 100%;
  display: block;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 25% center;
  /* Shifts focus slightly left to show mitosis */
  opacity: 1;
  will-change: transform;
  animation: heroBreath 20s ease-in-out infinite alternate;
}

@keyframes heroBreath {
  from {
    transform: scale(1.0);
  }

  to {
    transform: scale(1.03);
  }
}

/* Gradient overlay: fades image into obsidian at bottom and dims for text contrast */
.hero__gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(5, 5, 5, 0.4) 0%,
      rgba(5, 5, 5, 0.1) 30%,
      rgba(5, 5, 5, 0.7) 70%,
      var(--bg-void) 100%);
  pointer-events: none;
}

.hero__content {
  position: absolute;
  bottom: 15vh;
  left: var(--page-margin);
  right: var(--page-margin);
  z-index: 2;
}

.hero__title {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(2.8rem, 10vw, 6rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 400px;
}

.hero__mono-subtext {
  font-family: var(--font-heading), monospace;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--text-tertiary);
  margin-top: 24px;
  text-transform: uppercase;
}

/* Scroll prompt */
.hero__scroll-prompt {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  opacity: 0.5;
  transition: opacity 0.6s var(--ease-out);
}

.hero__scroll-text {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.hero__scroll-arrow {
  color: var(--accent-gold);
  animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {

  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

/* Fade hero elements on scroll */
.hero.is-scrolled .hero__content,
.hero.is-scrolled .hero__scroll-prompt {
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}


/* ────────────────────────────────
   4. SECTION 2 — SCROLL VIDEO
   ──────────────────────────────── */
.video-section {
  position: relative;
  background: var(--bg-void);
}

.video-section__scroll-track {
  height: 350vh;
  position: relative;
}

.video-section__sticky {
  position: sticky;
  top: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  /* Allow the container to grow if content demands it, preventing cutoffs */
}

.video-section__media {
  position: relative;
  flex: 1 1 60%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-void);
}

.video-section__canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Shows 100% of the frame, letterboxing blends smoothly into black bg */
  will-change: transform;
}

.video-section__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
  z-index: 2;
  transition: opacity 0.8s var(--ease-smooth);
}

.video-section__loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.video-section__loading-content {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-family: var(--font-body);
}

.video-section__loading-ring {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 1s linear infinite;
}

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

/* Text strip below video */
.video-section__text-strip {
  flex: 0 0 auto;
  position: relative;
  padding: 28px var(--page-margin) 36px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  align-items: start;
}

.video-section__phase {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-smooth), transform 0.5s var(--ease-smooth);
  pointer-events: none;
}

.video-section__phase.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.video-section__phase-number {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.video-section__phase-title {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.video-section__phase-body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 420px;
}

.video-section__phase-bullets {
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
}

.video-section__phase-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.video-section__phase-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-gold);
  opacity: 0.7;
}


/* ────────────────────────────────
   5. SECTION 3 — DUAL MARKETPLACE
   ──────────────────────────────── */
.marketplace {
  padding: var(--space-section) 0;
  background: var(--bg-void);
}

.marketplace__container {
  padding: 0 var(--page-margin);
  max-width: 1100px;
  margin: 0 auto;
}

.marketplace__header {
  margin-bottom: var(--space-block);
}

.marketplace__heading {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-primary);
}

.marketplace__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .marketplace__cards {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* Glassmorphism Card */
.card-glass {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  backdrop-filter: blur(40px) saturate(120%);
  -webkit-backdrop-filter: blur(40px) saturate(120%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 36px 28px;
  transition: border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.card-glass:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 24px 80px rgba(0, 0, 0, 0.5);
}

/* Backdrop-filter fallback */
@supports not (backdrop-filter: blur(1px)) {
  .card-glass {
    background: rgba(17, 17, 20, 0.95);
  }
}

.card-glass__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.card-glass__title {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.card-glass__list {
  margin-bottom: 28px;
}

.card-glass__list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.card-glass__list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.card-glass__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  padding: 10px 20px;
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  transition: all 0.35s var(--ease-out);
  background: transparent;
}

.card-glass__cta:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-glass__cta svg {
  transition: transform 0.3s var(--ease-out);
}

.card-glass__cta:hover svg {
  transform: translateX(3px);
}


/* ────────────────────────────────
   6. SECTION 4 — WAITLIST CTA (Command Center)
   ──────────────────────────────── */
.waitlist {
  position: relative;
  background: var(--bg-void);
  z-index: 10;
}

.waitlist__container {
  padding: 120px var(--page-margin);
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.waitlist__heading {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  /* Massive typography */
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-align: left;
  /* Terminal aesthetic */
}

.waitlist__sub {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 48px;
  max-width: 500px;
  text-align: left;
}

.waitlist__form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
}

.waitlist__inline-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* Segmented Toggle (Command Center block) */
.waitlist__toggle {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  padding: 6px;
  width: 100%;
  max-width: 400px;
}

.waitlist__toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.waitlist__toggle-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.3s var(--ease-out);
  z-index: 1;
  position: relative;
  user-select: none;
}

.waitlist__toggle-input:checked+.waitlist__toggle-label {
  color: var(--bg-void);
}

/* ────────────────────────────────
   UI FLOURISH: TOPOLOGY-STYLE CORNERS
   ──────────────────────────────── */
.corner-brackets {
  position: relative;
}

.corner-brackets::before,
.corner-brackets::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 5;
}

.corner-brackets::before {
  top: -4px;
  left: -4px;
  border-top: 1px solid var(--text-tertiary);
  border-left: 1px solid var(--text-tertiary);
}

.corner-brackets::after {
  bottom: -4px;
  right: -4px;
  border-bottom: 1px solid var(--text-tertiary);
  border-right: 1px solid var(--text-tertiary);
}

.waitlist__toggle-slider {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  background: var(--text-primary);
  border-radius: 4px;
  transition: transform 0.35s var(--ease-smooth);
  z-index: 0;
}

.waitlist__toggle[data-active="clipper"] .waitlist__toggle-slider {
  transform: translateX(100%);
}

/* Email Input */
.waitlist__input-wrap {
  width: 100%;
  flex: 1;
}

.waitlist__input {
  width: 100%;
  padding: 18px 24px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-bottom: 1px solid var(--border-glass);
  border-radius: 4px;
  /* Flatter, terminal feel */
  outline: none;
  caret-color: var(--accent-gold);
  /* Gold native caret that tracks text */
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.waitlist__input::placeholder {
  color: var(--text-tertiary);
}

.waitlist__input:focus {
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: var(--accent-gold);
}

/* Submit Button */
.waitlist__submit {
  width: 100%;
  padding: 18px 32px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--bg-void);
  background: var(--text-primary);
  /* Striking white */
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), opacity 0.2s var(--ease-out);
  white-space: nowrap;
}

.waitlist__submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.waitlist__submit:active {
  transform: translateY(0);
}

/* Social Proof */
.waitlist__proof {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.waitlist__proof-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34C759;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}


/* ────────────────────────────────
   7. SECTION 5 — PHILOSOPHY
   ──────────────────────────────── */
.philosophy {
  padding: var(--space-section) 0;
  padding-bottom: calc(var(--space-section) * 0.7);
  background: var(--bg-void);
}

.philosophy__container {
  padding: 0 var(--page-margin);
  max-width: 800px;
  margin: 0 auto;
}

.philosophy__word {
  margin-bottom: 12px;
  overflow: hidden;
}

.philosophy__word-main {
  display: block;
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(4rem, 16vw, 9rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--text-primary);
}

.philosophy__word-meaning {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  text-shadow: 0 0 20px var(--accent-gold-glow);
  margin-top: 4px;
  margin-left: 4px;
}

.philosophy__word--mito {
  margin-bottom: var(--space-block);
}

.philosophy__body {
  max-width: 520px;
}

.philosophy__body p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.philosophy__body p:last-child {
  margin-bottom: 0;
}


/* ────────────────────────────────
   8. FOOTER
   ──────────────────────────────── */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-void);
}

.footer__container {
  padding: 0 var(--page-margin);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__brand {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.footer__copy {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

.footer__socials {
  display: flex;
  gap: 16px;
}

/* Premium Topology Link Hover Effect */
.link-hover {
  position: relative;
  display: inline-block;
  overflow: hidden;
  text-decoration: none;
  line-height: 1;
  padding-bottom: 0.1875rem;
  margin-bottom: -0.1875rem;
}

.link-hover::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--text-secondary);
  transform: translate(-101%);
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.link-hover:hover::before,
.link-hover.active::before {
  transform: translate(0);
}

.footer__social-link {
  color: var(--text-tertiary);
  transition: color 0.3s var(--ease-out);
  display: flex;
  align-items: center;
}

.footer__social-link:hover {
  color: var(--text-primary);
}


/* ────────────────────────────────
   9. DESKTOP ENHANCEMENTS
   ──────────────────────────────── */
@media (min-width: 768px) {
  .hero__content {
    bottom: 18vh;
    left: var(--page-margin);
  }

  .hero__title {
    font-size: clamp(3.5rem, 7vw, 7rem);
  }

  .hero__subtitle {
    max-width: 480px;
  }

  .video-section__text-strip {
    padding: 28px var(--page-margin) 36px;
    min-height: 240px;
  }

  .video-section__phase-title {
    font-size: 2.2rem;
  }

  .waitlist__container {
    padding: 160px var(--page-margin);
  }

  .waitlist__inline-group {
    flex-direction: row;
    align-items: stretch;
  }

  .waitlist__submit {
    width: auto;
    padding: 18px 48px;
  }

  .philosophy__word--mito {
    text-align: right;
  }

  .philosophy__word--mito .philosophy__word-meaning {
    margin-left: auto;
    margin-right: 4px;
    text-align: right;
  }

  .philosophy__body {
    margin-left: auto;
  }
}

@media (min-width: 1024px) {
  .video-section__sticky {
    flex-direction: row;
    height: 100dvh;
    /* Reset to strict height on desktop for side-by-side */
    overflow: hidden;
  }

  .video-section__media {
    flex: 1 1 60%;
  }

  .video-section__text-strip {
    flex: 0 0 40%;
    border-top: none;
    border-left: 1px solid var(--border-subtle);
    padding: 0 48px;
    align-items: center;
  }

  .video-section__phase {
    transform: translateY(12px);
  }

  .video-section__phase.is-active {
    transform: translateY(0);
  }

  .video-section__phase-body {
    max-width: 480px;
  }
}

/* ────────────────────────────────
   10. PERFORMANCE: content-visibility
   ──────────────────────────────── */
.marketplace,
.waitlist,
.philosophy,
.footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}


/* ────────────────────────────────
   11. SMOOTH PAGE TRANSITION
   ──────────────────────────────── */
body {
  opacity: 0;
  animation: fadeInPage 0.6s var(--ease-out) 0.1s forwards;
}

@keyframes fadeInPage {
  to {
    opacity: 1;
  }
}