/* ============================================================
   KeyOrb — official site
   Aesthetic: dark, precise, "orbital". Teal accent + deep black.
   Type: Clash Display (display) / Satoshi (body), self-hosted.
   ============================================================ */

:root {
  /* Brand — sampled from the KeyOrb mark */
  --teal: #00d4c0;
  --teal-bright: #22e7d3;
  --teal-dim: rgba(0, 212, 192, 0.14);
  --teal-glow: rgba(0, 212, 192, 0.4);

  /* Surfaces */
  --bg: #06080c;
  --bg-2: #0a0e15;
  --bg-3: #0d121b;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Ink */
  --ink: #f2f6f8;
  --ink-2: #c8d0d8;
  --muted: #8b96a3;
  --muted-2: #5e6876;

  /* Type */
  --font-display: "Clash Display", "Satoshi", system-ui, -apple-system, sans-serif;
  --font-body: "Satoshi", system-ui, -apple-system, sans-serif;

  /* Shape */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --maxw: 1180px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

/* Film grain overlay for atmospheric depth */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* ---------- shared bits ---------- */
.grad {
  background: linear-gradient(120deg, var(--teal-bright) 0%, var(--teal) 55%, #6ef0e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.eyebrow--center {
  margin: 0 auto;
}
.eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal-glow);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn--sm { padding: 9px 18px; font-size: 0.88rem; }
.btn--ghost {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink);
}
.btn--ghost:hover {
  background: var(--teal-dim);
  border-color: var(--teal);
  color: var(--teal-bright);
  transform: translateY(-1px);
}

/* ---------- store buttons ---------- */
.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}
.store-row--center { justify-content: center; }

.store-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px 11px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.store-btn:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  background: rgba(0, 212, 192, 0.08);
}
.store-btn--lg { padding: 14px 24px 14px 18px; }
.store-btn svg { flex-shrink: 0; }
.store-btn__label { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-btn__label small { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.02em; }
.store-btn__label strong { font-size: 1.02rem; font-weight: 700; font-family: var(--font-display); }
.store-btn__soon {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-bright);
  background: var(--teal-dim);
  border: 1px solid rgba(0, 212, 192, 0.4);
  padding: 3px 7px;
  border-radius: 6px;
}
.store-note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(6, 8, 12, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(0, 212, 192, 0.25);
}
.brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.brand__word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.nav__links {
  display: flex;
  gap: 34px;
}
.nav__links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--teal);
  transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 0 60px;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero__glow {
  position: absolute;
  top: -20%;
  right: -10%;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(circle, rgba(0, 212, 192, 0.22) 0%, rgba(0, 212, 192, 0.06) 35%, transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 70% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 70% 40%, #000 30%, transparent 75%);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 22px 0 22px;
}
.hero__sub {
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  color: var(--ink-2);
  max-width: 520px;
}

/* ---- orb stage ---- */
.hero__orb {
  display: flex;
  justify-content: center;
  align-items: center;
}
.orb-stage {
  position: relative;
  width: min(440px, 80vw);
  aspect-ratio: 1;
}
.orb-glow {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 192, 0.35) 0%, rgba(0, 212, 192, 0.08) 45%, transparent 70%);
  filter: blur(24px);
  animation: breathe 5s var(--ease) infinite;
  z-index: 0;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}
.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  inset: 0;
  animation: spin linear infinite;
}
.orb-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(0, 212, 192, 0.18);
  transform: rotate(0deg);
}
.orb-ring--outer { animation-duration: 28s; inset: 0; }
.orb-ring--mid { animation-duration: 20s; animation-direction: reverse; inset: 15%; }
.orb-ring--inner { animation-duration: 14s; inset: 30%; }

.orb-dot {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  box-shadow: 0 0 22px rgba(0, 212, 192, 0.25);
  animation: spin linear infinite reverse; /* counter-rotate so icon stays upright */
}
.orb-ring--outer .orb-dot { animation-duration: 28s; }
.orb-ring--mid .orb-dot { animation-duration: 20s; }
.orb-ring--inner .orb-dot { animation-duration: 14s; }
.orb-dot img { width: 26px; height: 26px; object-fit: contain; }

.orb-core {
  position: absolute;
  inset: 36%;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow:
    0 0 0 6px rgba(0, 212, 192, 0.12),
    0 0 40px rgba(0, 212, 192, 0.4),
    0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  z-index: 2;
}
.orb-core img { width: 86%; height: 86%; object-fit: contain; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* counter-rotating dot: parent ring rotates; dot keeps icon upright by reversing */
.orb-ring--outer .orb-dot,
.orb-ring--mid .orb-dot,
.orb-ring--inner .orb-dot {
  animation-name: spin-reverse;
}
@keyframes spin-reverse {
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* ---- marquee ---- */
.hero__marquee {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track {
  display: flex;
  gap: 40px;
  padding: 18px 0;
  width: max-content;
  animation: marquee 30s linear infinite;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.marquee__track span { font-size: 1rem; letter-spacing: 0.02em; }
.marquee__track i { color: var(--teal); font-style: normal; opacity: 0.6; }
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 120px 0;
  position: relative;
}
.section--alt { background: var(--bg-2); }
.section__head {
  max-width: 640px;
  margin-bottom: 64px;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 20px 0 18px;
}
.section__sub {
  font-size: 1.06rem;
  color: var(--muted);
}

/* ---- chain cards ---- */
.chain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.chain-card {
  position: relative;
  padding: 36px 30px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.chain-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at 50% -10%, rgba(0, 212, 192, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.chain-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 212, 192, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.chain-card:hover::before { opacity: 1; }
.chain-card__icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}
.chain-card__icon img { width: 36px; height: 36px; object-fit: contain; }
.chain-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.chain-card p { color: var(--muted); font-size: 0.95rem; }
.chain-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  list-style: none;
}
.chain-card__tags li {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--teal-bright);
  background: var(--teal-dim);
  border: 1px solid rgba(0, 212, 192, 0.25);
  padding: 5px 11px;
  border-radius: 999px;
}

/* ---- features ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature {
  padding: 32px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.feature:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 212, 192, 0.35);
  background: var(--surface-2);
}
.feature__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--teal-dim);
  color: var(--teal-bright);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 212, 192, 0.2);
}
.feature h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 9px;
}
.feature p { color: var(--muted); font-size: 0.92rem; }

/* ---- security band ---- */
.band {
  position: relative;
  padding: 90px 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(0, 212, 192, 0.08), transparent 70%),
    var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.band__inner {
  display: flex;
  align-items: center;
  gap: 56px;
}
.band__mark { flex-shrink: 0; filter: drop-shadow(0 0 24px rgba(0, 212, 192, 0.35)); }
.band__copy h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.band__copy p { color: var(--muted); max-width: 560px; font-size: 1.05rem; }

/* ---- download ---- */
.download {
  text-align: center;
  padding: 40px 0;
}
.download__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 20px 0 16px;
}
.download__sub { color: var(--muted); max-width: 480px; margin: 0 auto; }
.download .store-row--center { justify-content: center; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 70px 0 30px;
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 60px;
  margin-bottom: 50px;
}
.footer__tag { margin-top: 14px; color: var(--muted); font-size: 0.9rem; max-width: 240px; }
.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.footer__col h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 16px;
}
.footer__col a {
  display: block;
  color: var(--ink-2);
  font-size: 0.92rem;
  padding: 5px 0;
  transition: color 0.2s var(--ease);
}
.footer__col a:hover { color: var(--teal-bright); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 10px;
}
.footer__bottom code {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--teal-bright);
  background: var(--teal-dim);
  padding: 2px 7px;
  border-radius: 5px;
}

/* ============================================================
   REVEAL ON SCROLL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}
.reveal--delay { transition-delay: 0.12s; }
.reveal--delay2 { transition-delay: 0.24s; }
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee__track, .orb-ring, .orb-ring .orb-dot, .orb-glow, .eyebrow__dot { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 50px; }
  .hero__sub { margin: 0 auto; }
  .store-row { justify-content: center; }
  .hero__orb { order: -1; }
  .orb-stage { width: min(340px, 70vw); }
  .chain-grid, .feature-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .band__inner { flex-direction: column; text-align: center; gap: 28px; }
  .band__copy p { margin: 0 auto; }
  .footer__inner { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 720px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .nav.is-open .nav__links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: rgba(6, 8, 12, 0.96);
    backdrop-filter: blur(16px);
    padding: 20px 24px 26px;
    gap: 18px;
    border-bottom: 1px solid var(--border);
  }
  .nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .section { padding: 80px 0; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); }
  .store-btn { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .hero { padding-top: 100px; }
  .orb-stage { width: 78vw; }
  .footer__cols { grid-template-columns: 1fr; }
}
