/* =========================================
   Habie Web — Landing Page (Bridge LP v1)
   Pure-white "Loom" aesthetic + restrained violet accent.
   Independent of main.css (Privacy/Terms keep their own system).
   ========================================= */

:root {
  /* Force light rendering — the LP is pure-white only (Phase 1.5). */
  color-scheme: light;

  /* ---- Surfaces ---- */
  --lp-bg-primary: #FFFFFF;
  --lp-bg-secondary: #FAFAFA;
  --lp-bg-tile: #F5F2EB;
  --lp-header-bg: rgba(255, 255, 255, 0.82);

  /* ---- Text (warm neutral) ---- */
  --lp-text-primary: #2C2C2A;
  --lp-text-secondary: #5F5E5A;
  --lp-text-muted: #888780;
  --lp-text-tertiary: #B4B2A9;

  /* ---- Lines ---- */
  --lp-border: #EFEDE7;
  --lp-border-strong: #D3D1C7;

  /* ---- Accent (matches iOS HabieColors) ---- */
  --lp-accent: #5230A8;
  --lp-accent-hover: #7848CC;
  --lp-accent-light: #C8AEFF;
  --lp-accent-bg: #EEEDFE;

  /* ---- Radius ---- */
  --lp-radius-sm: 6px;
  --lp-radius-md: 8px;
  --lp-radius-lg: 12px;
  --lp-radius-xl: 18px;

  /* ---- Rhythm ---- */
  --lp-section-gap: 80px;
  --lp-section-gap-lg: 120px;

  /* ---- Type ---- */
  --lp-font-display: ui-serif, "New York", Georgia, "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Times New Roman", serif;
  --lp-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --lp-font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* ---- Motion ---- */
  --lp-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lp-dur-fast: 180ms;
  --lp-dur-base: 320ms;

  /* =========================================
     Compatibility shim for lang-switcher.css
     (the language modal is reused from Privacy/Terms but those
      tokens live in main.css, which the LP intentionally does NOT load).
     ========================================= */
  --color-violet-50:  #F4EEFF;
  --color-violet-100: #E5D6FF;
  --color-violet-200: #C8AEFF;
  --color-violet-300: #A57DEE;
  --color-violet-400: #8A5CDD;
  --color-violet-500: #7848CC;
  --color-violet-600: #5230A8;
  --color-ink:        var(--lp-text-primary);
  --color-ink-soft:   var(--lp-text-secondary);
  --color-ink-muted:  var(--lp-text-muted);
  --color-line:       var(--lp-border);
  --color-line-strong: var(--lp-border-strong);
  --surface-card-strong: #FFFFFF;
  --radius-sm: var(--lp-radius-sm);
  --radius-lg: var(--lp-radius-xl);
  --font-display: var(--lp-font-display);
  --duration-fast: var(--lp-dur-fast);
  --ease-out: var(--lp-ease);
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
}

/* =========================================
   Reset & base
   ========================================= */

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

html {
  background-color: var(--lp-bg-primary);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body.lp-page {
  margin: 0;
  font-family: var(--lp-font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--lp-text-primary);
  background-color: var(--lp-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt" 1;
  letter-spacing: 0.01em;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

::selection {
  background: var(--lp-accent-light);
  color: var(--lp-text-primary);
}

a {
  color: var(--lp-accent);
  text-decoration: none;
  transition: color var(--lp-dur-fast) var(--lp-ease);
}

a:hover { color: var(--lp-accent-hover); }

:focus-visible {
  outline: 2px solid var(--lp-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

button { font-family: inherit; }

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

/* =========================================
   Layout container
   ========================================= */

.lp-container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 32px;
}

@media (max-width: 640px) {
  .lp-container { padding-inline: 20px; }
}

.lp-text-center { text-align: center; }

/* =========================================
   Header
   ========================================= */

.lp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin-inline: auto;
  padding: 18px 32px;
  background: var(--lp-header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--lp-dur-base) var(--lp-ease);
}

.lp-header.is-scrolled { border-bottom-color: var(--lp-border); }

.lp-logo {
  font-family: var(--lp-font-display);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--lp-text-primary);
}

.lp-logo:hover { color: var(--lp-accent); }

.lp-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.86rem;
}

.lp-nav a {
  color: var(--lp-text-secondary);
  font-weight: 450;
}

.lp-nav a:hover { color: var(--lp-accent); }

.lp-nav a[aria-disabled="true"] {
  color: var(--lp-text-tertiary);
  pointer-events: none;
  cursor: default;
}

.lp-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid var(--lp-border);
  border-radius: 999px;
  background: transparent;
  color: var(--lp-text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color var(--lp-dur-fast) var(--lp-ease),
              color var(--lp-dur-fast) var(--lp-ease);
}

.lp-lang-btn:hover {
  border-color: var(--lp-accent-light);
  color: var(--lp-accent);
}

@media (max-width: 640px) {
  .lp-header { padding: 14px 20px; }
  .lp-nav { gap: 14px; }
  .lp-nav a[href="/help/"], .lp-nav a[aria-disabled="true"] { display: none; }
}

/* =========================================
   Shared section primitives
   ========================================= */

.lp-section-header {
  max-width: 640px;
  margin: 0 auto 44px;
  text-align: center;
}

.lp-eyebrow {
  margin: 0 0 12px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lp-accent);
}

.lp-section-h {
  margin: 0;
  font-family: var(--lp-font-display);
  font-size: clamp(1.5rem, 3.4vw, 1.75rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--lp-text-primary);
}

.lp-section-h-lg {
  margin: 0;
  font-family: var(--lp-font-display);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--lp-text-primary);
}

.lp-lead {
  margin: 22px auto 0;
  max-width: 540px;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--lp-text-secondary);
}

/* =========================================
   Footer
   ========================================= */

.lp-footer {
  margin-top: var(--lp-section-gap-lg);
  padding: 48px 0;
  border-top: 1px solid var(--lp-border);
  background: var(--lp-bg-secondary);
}

.lp-footer .lp-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lp-footer p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--lp-text-muted);
}

.lp-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.82rem;
}

.lp-footer nav a { color: var(--lp-text-secondary); }
.lp-footer nav a:hover { color: var(--lp-accent); }
.lp-footer nav a[aria-disabled="true"] {
  color: var(--lp-text-tertiary);
  pointer-events: none;
}

/* =========================================
   Motion — orchestrated reveal primitive
   ========================================= */

@keyframes lp-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================
   Section 1 — Hero (3-scene rotation)
   ========================================= */

.lp-hero {
  padding-top: clamp(52px, 9vw, 100px);
  padding-bottom: var(--lp-section-gap);
}

.lp-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lp-hero-tagline {
  margin: 0;
  font-family: var(--lp-font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: var(--lp-text-primary);
}

.lp-hero-tagline span { display: block; }

.lp-hero-sub {
  margin: 22px 0 0;
  max-width: 30ch;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--lp-text-secondary);
}

.lp-hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.lp-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--lp-accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px -12px rgba(82, 48, 168, 0.5);
  transition: transform var(--lp-dur-fast) var(--lp-ease),
              background var(--lp-dur-fast) var(--lp-ease),
              box-shadow var(--lp-dur-fast) var(--lp-ease);
}

.lp-cta-primary:hover {
  color: #fff;
  background: var(--lp-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(82, 48, 168, 0.5);
}

.lp-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 13px 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--lp-text-secondary);
}

.lp-cta-secondary:hover { color: var(--lp-accent); }

.lp-hero-demo {
  margin-top: clamp(44px, 7vw, 72px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lp-phone-frame {
  width: 248px;
  max-width: 70vw;
  padding: 10px;
  background: var(--lp-bg-tile);
  border: 1px solid var(--lp-border-strong);
  border-radius: 30px;
  box-shadow: 0 30px 70px -28px rgba(44, 44, 42, 0.28),
              0 10px 26px -16px rgba(44, 44, 42, 0.20);
}

.lp-hero-scenes {
  position: relative;
  aspect-ratio: 420 / 910;
  border-radius: 22px;
  overflow: hidden;
  background: var(--lp-bg-secondary);
}

.lp-hero-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s var(--lp-ease);
}

.lp-hero-scene.is-active { opacity: 1; }

.lp-hero-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lp-hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.lp-hero-dot {
  width: 8px; height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--lp-border-strong);
  cursor: pointer;
  transition: background var(--lp-dur-fast) var(--lp-ease),
              transform var(--lp-dur-fast) var(--lp-ease);
}

.lp-hero-dot:hover { transform: scale(1.25); }

.lp-hero-dot.is-active {
  background: var(--lp-accent);
  transform: scale(1.15);
}

/* Orchestrated entrance */
.lp-hero-tagline span,
.lp-hero-sub,
.lp-hero-cta-row,
.lp-hero-demo {
  animation: lp-rise 0.7s var(--lp-ease) both;
}

.lp-hero-tagline span:nth-child(1) { animation-delay: 0.05s; }
.lp-hero-tagline span:nth-child(2) { animation-delay: 0.15s; }
.lp-hero-tagline span:nth-child(3) { animation-delay: 0.25s; }
.lp-hero-sub { animation-delay: 0.42s; }
.lp-hero-cta-row { animation-delay: 0.54s; }
.lp-hero-demo { animation-delay: 0.66s; }

@media (max-width: 640px) {
  .lp-phone-frame { width: 208px; }
}

/* =========================================
   Section 2 — World view (three figures)
   ========================================= */

.lp-world-view { padding-block: var(--lp-section-gap); }

.lp-world-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.lp-world-tile {
  margin: 0;
  border-radius: var(--lp-radius-lg);
  overflow: hidden;
  background: var(--lp-bg-tile);
  border: 1px solid var(--lp-border);
}

.lp-world-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.7s var(--lp-ease);
}

.lp-world-tile:hover img { transform: scale(1.04); }

.lp-world-tile figcaption {
  padding: 15px 18px 18px;
  font-family: var(--lp-font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--lp-text-secondary);
}

@media (max-width: 700px) {
  .lp-world-grid { grid-template-columns: 1fr; max-width: 400px; margin-inline: auto; }
}

/* =========================================
   Section 3 — MCP magic moment (sticky demo + typewriter)
   ========================================= */

.lp-mcp { padding-block: var(--lp-section-gap-lg); }

.lp-mcp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  /* NOTE: intentionally NOT align-items:start — the sticky wrapper must
     stretch to the row height so the inner panel has scroll-travel room. */
}

.lp-mcp-text { align-self: start; }

.lp-pas-stage {
  padding: 26px 0;
  border-top: 1px solid var(--lp-border);
}

.lp-pas-stage:first-child {
  border-top: none;
  padding-top: 0;
}

.lp-pas-label {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lp-accent);
}

.lp-pas-head {
  margin: 0 0 8px;
  font-family: var(--lp-font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--lp-text-primary);
}

.lp-pas-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--lp-text-secondary);
}

.lp-pas-hook {
  margin: 14px 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--lp-accent);
}

.lp-mcp-sticky-wrapper { position: relative; }

.lp-mcp-sticky {
  position: sticky;
  top: 96px;
  background: var(--lp-bg-secondary);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-xl);
  padding: 16px;
}

.lp-mcp-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lp-mini-panel {
  background: var(--lp-bg-primary);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-lg);
  padding: 12px;
}

.lp-mini-label {
  margin: 0 0 10px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lp-text-muted);
}

.lp-mini-card {
  background: var(--lp-bg-secondary);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-md);
  padding: 10px;
  margin-bottom: 8px;
}

.lp-mini-card:last-child { margin-bottom: 0; }

.lp-mini-card-l {
  margin: 0 0 4px;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lp-text-muted);
}

.lp-mini-card-s {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--lp-text-secondary);
}

.lp-mini-card-v {
  margin: 2px 0;
  font-family: var(--lp-font-display);
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--lp-accent);
}

.lp-claude-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--lp-accent-bg);
  color: var(--lp-accent);
  font-size: 0.625rem;
  font-weight: 600;
}

.lp-chat-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.lp-chat-row:last-child { margin-bottom: 0; }

.lp-chat-av {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.625rem;
  font-weight: 600;
  color: #fff;
}

.lp-chat-av-u { background: var(--lp-text-muted); }
.lp-chat-av-a { background: var(--lp-accent); }

.lp-chat-text {
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--lp-bg-secondary);
  color: var(--lp-text-primary);
}

.lp-chat-text-u {
  background: var(--lp-accent-bg);
  color: var(--lp-accent);
}

.lp-chat-typewriter { background: var(--lp-bg-tile); }

.lp-tw-line {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  max-width: 0;
}

.lp-typewriter-active .lp-tw-l1 { animation: lp-typewriter 1.4s steps(22, end) 0.6s forwards; }
.lp-typewriter-active .lp-tw-l2 { animation: lp-typewriter 1.5s steps(24, end) 2.2s forwards; }
.lp-typewriter-active .lp-tw-l3 { animation: lp-typewriter 1.4s steps(22, end) 4.0s forwards; }
.lp-typewriter-active .lp-tw-l4 { animation: lp-typewriter 1.5s steps(24, end) 5.7s forwards; }

@keyframes lp-typewriter { to { max-width: 100%; } }

@media (max-width: 767px) {
  .lp-mcp-grid { grid-template-columns: 1fr; gap: 28px; }
  .lp-mcp-sticky { top: 64px; z-index: 10; padding: 12px; }
  .lp-mcp-sticky-wrapper { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-tw-line { max-width: 100%; animation: none !important; }
}

/* =========================================
   Section 4 — Privacy & philosophy
   ========================================= */

.lp-privacy-philosophy { padding-block: var(--lp-section-gap-lg); }

.lp-privacy-philosophy .lp-section-h-lg {
  max-width: 18ch;
  margin-inline: auto;
}

/* =========================================
   Section 5 — CTA + founder note
   ========================================= */

.lp-cta { padding-bottom: var(--lp-section-gap); }

.lp-cta-card {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 56px) clamp(24px, 5vw, 48px);
  text-align: center;
  background: var(--lp-bg-secondary);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-xl);
  box-shadow: 0 2px 8px rgba(44, 44, 42, 0.04),
              0 14px 36px -18px rgba(44, 44, 42, 0.12);
}

.lp-cta-h {
  margin: 0;
  font-family: var(--lp-font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--lp-text-primary);
}

.lp-cta-sub {
  margin: 12px 0 0;
  font-size: 1rem;
  color: var(--lp-text-secondary);
}

.lp-waitlist-form {
  display: flex;
  gap: 10px;
  margin: 28px 0 0;
}

.lp-waitlist-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--lp-text-primary);
  background: var(--lp-bg-primary);
  border: 1px solid var(--lp-border-strong);
  border-radius: 999px;
  transition: border-color var(--lp-dur-fast) var(--lp-ease),
              box-shadow var(--lp-dur-fast) var(--lp-ease);
}

.lp-waitlist-form input[type="email"]::placeholder { color: var(--lp-text-tertiary); }

.lp-waitlist-form input[type="email"]:focus-visible {
  outline: none;
  border-color: var(--lp-accent);
  box-shadow: 0 0 0 3px var(--lp-accent-bg);
}

.lp-waitlist-submit {
  flex: none;
  padding: 13px 22px;
  border: none;
  border-radius: 999px;
  background: var(--lp-accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--lp-dur-fast) var(--lp-ease),
              transform var(--lp-dur-fast) var(--lp-ease);
}

.lp-waitlist-submit:hover {
  background: var(--lp-accent-hover);
  transform: translateY(-1px);
}

.lp-waitlist-submit:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.lp-waitlist-message {
  margin: 18px 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--lp-text-secondary);
}

.lp-waitlist-message.is-success {
  color: var(--lp-accent);
  font-weight: 500;
}

.lp-founder {
  margin: 30px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--lp-border);
  font-family: var(--lp-font-display);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--lp-text-secondary);
}

.lp-founder em { font-style: italic; }

.lp-founder span {
  font-style: normal;
  font-size: 0.85rem;
  color: var(--lp-text-muted);
}

@media (max-width: 520px) {
  .lp-waitlist-form { flex-direction: column; }
  .lp-waitlist-submit { width: 100%; }
}
