/* CHIP — white background, black text; FLAP logo keeps purple */
:root {
  --bg: #ffffff;
  --bg-elev: #f6f6f6;
  --bg-card: #fafafa;
  --text: #0a0a0a;
  --muted: #666666;
  --dim: #999999;
  --line: rgba(0, 0, 0, 0.1);
  --font: "Space Grotesk", system-ui, sans-serif;
  --display: "Syne", "Space Grotesk", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

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

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

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

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 25%, #000 15%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px clamp(20px, 4vw, 48px);
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.75));
  border-bottom: 1px solid var(--line);
}

.nav-chip {
  justify-self: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 28px);
  letter-spacing: -0.03em;
  color: #000;
  line-height: 1;
  transition: opacity 0.2s;
}

.nav-chip:hover {
  opacity: 0.7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 14px;
  color: #000;
  justify-self: start;
}

/* Keep FLAP mark purple */
.brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: none;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  justify-self: end;
}

.nav-right a {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-right a:hover {
  color: var(--text);
}

.nav-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.15s;
}

.nav-x:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.btn-ca {
  background: #000;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 10px 16px;
  border-radius: 6px;
  transition: transform 0.15s, opacity 0.15s;
}

.btn-ca:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 24px;
  padding: 120px clamp(20px, 4vw, 48px) 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 28px;
}

.eyebrow .line {
  width: 28px;
  height: 2px;
  background: #000;
}

/* ===== CHIP stage ===== */
.chip-stage {
  position: relative;
  min-height: clamp(180px, 28vw, 320px);
  margin-bottom: 28px;
}

.chip-block {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(80px, 15vw, 168px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  display: flex;
  gap: 0.01em;
}

.chip-block[hidden] {
  display: none !important;
}

.chip-letter {
  display: inline-block;
  color: #000;
  will-change: transform, opacity;
  transition: opacity 0.15s ease;
}

.chip-letter.is-gone {
  opacity: 0 !important;
  visibility: hidden;
}

.fly-letter {
  position: fixed;
  z-index: 40;
  font-family: var(--display);
  font-weight: 800;
  color: #000;
  pointer-events: none;
  line-height: 1;
  will-change: transform, font-size;
  margin: 0;
}

.expand-lines {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(4px, 1vw, 12px);
  margin-top: 12px;
}

.expand-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  min-height: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #000;
  transition: min-height 0.35s ease, opacity 0.25s ease, height 0.35s ease;
}

.expand-line.is-active {
  min-height: clamp(44px, 6.5vw, 68px);
  height: auto;
  opacity: 1;
  overflow: visible;
}

.expand-line .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
}

.expand-line .ch.is-on {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.expand-line .ch.is-seed {
  color: #000;
}

.chip-stage.is-done .expand-lines {
  margin-top: 0;
}

.tagline {
  margin: 0 0 28px;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 420px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.tagline strong {
  color: var(--text);
  font-weight: 600;
}

.hero-left.is-ready .tagline {
  opacity: 1;
  transform: translateY(0);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease 0.1s, transform 0.55s ease 0.1s;
}

.hero-left.is-ready .hero-actions {
  opacity: 1;
  transform: translateY(0);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #000;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 14px 22px;
  border-radius: 8px;
  transition: transform 0.15s, opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-primary.on-light {
  background: #fff;
  color: #000;
  border: 1px solid #000;
}

.btn-ghost {
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--muted);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.35);
}

.ca-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background: #fff;
  max-width: 100%;
  opacity: 0;
  transition: opacity 0.55s ease 0.2s;
}

.hero-left.is-ready .ca-box {
  opacity: 1;
}

.ca-label {
  background: #000;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 6px;
  letter-spacing: 0.06em;
}

.ca-box code {
  font-family: var(--font);
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(60vw, 320px);
}

.ca-copy {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #000;
  margin-left: auto;
}

/* Device */
.hero-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

.device-orbit {
  position: absolute;
  width: min(90%, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow:
    0 0 0 40px rgba(0, 0, 0, 0.02),
    0 0 0 90px rgba(0, 0, 0, 0.015);
  animation: pulse-ring 6s ease-in-out infinite;
}

@keyframes pulse-ring {
  50% {
    transform: scale(1.04);
    opacity: 0.65;
  }
}

.device-glow {
  position: absolute;
  width: 55%;
  height: 35%;
  background: #000;
  filter: blur(100px);
  opacity: 0.06;
  border-radius: 50%;
}

.hero-device {
  position: relative;
  z-index: 2;
  width: min(88%, 560px);
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.18));
  animation: float 7s ease-in-out infinite;
  transform: rotate(-4deg);
}

@keyframes float {
  50% {
    transform: rotate(-2deg) translateY(-18px);
  }
}

.float-tag {
  position: absolute;
  z-index: 3;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  color: var(--muted);
}

.tag-top {
  top: 18%;
  right: 4%;
  color: #000;
}

.tag-top::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #000;
  margin-right: 8px;
}

.tag-bot {
  bottom: 22%;
  left: 8%;
}

/* Ticker */
.ticker {
  position: relative;
  z-index: 1;
  border-block: 1px solid var(--line);
  background: #f5f5f5;
  overflow: hidden;
  padding: 14px 0;
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  animation: marquee 28s linear infinite;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.ticker-track img {
  width: 18px;
  height: 18px;
  opacity: 1;
  filter: none; /* purple logo */
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* Sections */
.section {
  position: relative;
  z-index: 1;
  padding: 100px clamp(20px, 4vw, 48px);
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin: 0 0 20px;
}

.section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 48px;
  color: #000;
}

.section-title em {
  font-style: normal;
  color: var(--muted);
}

.section-title.light {
  text-align: center;
  color: #fff;
}

.section-title.light em {
  color: #bbb;
}

.pillar-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 22px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.06);
}

.card-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #000;
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 18px;
}

.card h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: #000;
}

.card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

/* CTA — dark block */
.cta-section {
  max-width: none;
  background: #0a0a0a;
  color: #fff;
  text-align: center;
  padding: 100px 24px 110px;
  margin-top: 20px;
}

.cta-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  filter: none; /* purple logo */
}

.cta-section .section-label {
  color: #999;
}

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
}

.footer-brand img {
  width: 22px;
  height: 22px;
  filter: none; /* purple logo */
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #000;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 12px 20px;
  border-radius: 999px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 100px;
    min-height: auto;
  }

  .hero-right {
    order: -1;
    min-height: 300px;
  }

  .hero-device {
    width: min(78%, 400px);
  }

  .pillar-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .chip-stage {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .nav-right a:not(.nav-x) {
    display: none;
  }

  .pillar-cards {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-device,
  .device-orbit,
  .ticker-track {
    animation: none !important;
  }
}
