/* xchOS marketing site */
:root {
  --bg: #06080c;
  --bg-elevated: #0c1018;
  --bg-card: rgba(14, 20, 32, 0.72);
  --border: rgba(120, 200, 140, 0.12);
  --border-hover: rgba(120, 220, 150, 0.35);
  --text: #e8eef4;
  --text-muted: #8a9bb0;
  --accent: #3ecf6e;
  --accent-dim: #2a9d52;
  --accent-glow: rgba(62, 207, 110, 0.35);
  --accent-secondary: #5eead4;
  --gradient: linear-gradient(135deg, #3ecf6e 0%, #5eead4 50%, #22d3ee 100%);
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 72px;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

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

/* Background */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(62, 207, 110, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(94, 234, 212, 0.1), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(34, 211, 238, 0.08), transparent);
  animation: mesh-shift 18s ease-in-out infinite alternate;
}

@keyframes mesh-shift {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.85; transform: scale(1.05); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(62, 207, 110, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 207, 110, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  z-index: 100;
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
}

.nav.scrolled {
  background: rgba(6, 8, 12, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-cta {
  color: var(--accent) !important;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  transition: background 0.2s, box-shadow 0.2s !important;
}

.nav-cta:hover {
  background: rgba(62, 207, 110, 0.1);
  box-shadow: 0 0 24px var(--accent-glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-h) + 3rem) 1.5rem 4rem;
  max-width: var(--max);
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  background: rgba(62, 207, 110, 0.08);
  margin-bottom: 1.75rem;
}

.hero-title {
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.hero-lead code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent-secondary);
  background: rgba(94, 234, 212, 0.08);
  padding: 0.15em 0.45em;
  border-radius: 6px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: var(--gradient);
  color: var(--bg);
  box-shadow: 0 4px 32px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px var(--accent-glow);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: var(--border-hover);
  background: rgba(62, 207, 110, 0.06);
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  flex-shrink: 0;
}

.section-header a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.section-header a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 6rem clamp(1.25rem, 4vw, 2.5rem);
  max-width: var(--max);
  margin: 0 auto;
}

.section-alt {
  max-width: none;
  background: linear-gradient(180deg, transparent, rgba(12, 16, 24, 0.6) 20%, rgba(12, 16, 24, 0.6) 80%, transparent);
}

.section-alt > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--text-muted);
  max-width: 32rem;
  margin: 0 auto;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent-secondary);
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(62, 207, 110, 0.1);
}

.card-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Split / flow */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.split-content h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.split-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.95rem;
}

.formula .eq {
  color: var(--accent);
  font-weight: 500;
}

.muted {
  font-size: 0.9rem;
}

.flow {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.flow-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.flow-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  flex-shrink: 0;
  width: 2rem;
}

.flow-step strong {
  display: block;
  margin-bottom: 0.25rem;
}

.flow-step p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.flow-arrow {
  text-align: center;
  color: var(--accent-dim);
  padding: 0.5rem 0;
  font-size: 1.25rem;
}

/* xchos */
.xchos-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.terminal {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.75rem 1rem;
  background: #1a1f2e;
}

.terminal-bar span:first-child { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-title {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  background: #0a0d14;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
}

.terminal-body .prompt { color: var(--accent); }
.terminal-body .out { color: var(--text-muted); }
.terminal-body .dim { color: #5a6a7a; }

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feature-list li {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.feature-list li:hover {
  border-color: var(--border-hover);
}

.feature-list strong {
  display: block;
  margin-bottom: 0.25rem;
}

.feature-list span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.feature-list a {
  color: var(--accent-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.feature-list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Giving / Marmot Recovery */
.section-giving {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.giving-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem 2.5rem;
  padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(135deg, rgba(180, 140, 90, 0.12), rgba(62, 207, 110, 0.08));
  border: 1px solid rgba(200, 160, 100, 0.25);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.giving-figure {
  flex-shrink: 0;
  margin: 0;
  text-align: center;
}

.giving-marmot {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 2px solid rgba(200, 160, 100, 0.35);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  object-fit: cover;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.giving-card:hover .giving-marmot {
  transform: scale(1.02) rotate(-1deg);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 32px rgba(200, 160, 100, 0.15);
}

.giving-caption {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #c9a86c;
  letter-spacing: 0.04em;
}

.giving-content {
  flex: 1;
  min-width: 260px;
}

.giving-content h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.giving-content > p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  max-width: 40rem;
}

.giving-content a {
  color: #e8c88a;
  text-decoration: none;
  transition: color 0.2s;
}

.giving-content a:hover {
  color: #f5ddb0;
}

.giving-content a strong {
  font-weight: 600;
}

.giving-detail {
  font-size: 0.95rem;
  opacity: 0.9;
}

.btn-giving {
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #c9a227 0%, #e8c88a 50%, #b8860b 100%);
  color: var(--bg);
  box-shadow: 0 4px 28px rgba(200, 160, 100, 0.25);
}

.btn-giving:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(200, 160, 100, 0.35);
}

/* GitHub / source */
.repo-panel {
  padding: 2rem clamp(1.5rem, 4vw, 2.5rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.repo-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.repo-github-mark {
  color: var(--text);
  flex-shrink: 0;
}

.repo-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.repo-name:hover {
  color: var(--accent);
}

.repo-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.repo-clone {
  margin-bottom: 1.75rem;
}

.repo-clone label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.repo-clone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #0a0d14;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.repo-clone-row code {
  flex: 1;
  min-width: 200px;
  font-size: 0.82rem;
  color: var(--accent-secondary);
  word-break: break-all;
}

.btn-copy {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-copy:hover {
  border-color: var(--border-hover);
  background: rgba(62, 207, 110, 0.1);
}

.repo-tree h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.repo-tree ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}

.repo-tree li {
  font-size: 0.95rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
}

.repo-tree li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

.repo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Build steps */
.steps {
  display: grid;
  gap: 1.5rem;
}

.step {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  padding-left: 4.5rem;
}

.step-n {
  position: absolute;
  left: 1.5rem;
  top: 1.75rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-hover);
  border-radius: 50%;
}

.step h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.step pre {
  overflow-x: auto;
}

.step code {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-muted);
  white-space: pre;
}

.iso-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3rem;
  padding: 2rem 2.5rem;
  background: linear-gradient(135deg, rgba(62, 207, 110, 0.12), rgba(94, 234, 212, 0.06));
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
}

.iso-banner h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.iso-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 28rem;
}

/* Footer */
.footer {
  padding: 4rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.footer-inner > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  font-size: 0.8rem !important;
  opacity: 0.7;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Responsive */
@media (max-width: 900px) {
  .split,
  .xchos-grid {
    grid-template-columns: 1fr;
  }

  .split-visual {
    order: -1;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1rem;
    background: rgba(6, 8, 12, 0.98);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 1rem;
    text-align: center;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .iso-banner {
    flex-direction: column;
    text-align: center;
  }
}
