/* ============================================
   aleph-onchain Landing Page
   Design: aleph.cloud visual identity
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300;400;600;700&family=Source+Code+Pro:wght@400;500&display=swap');

:root {
  --purple: #5100CD;
  --purple-light: #7B3FE4;
  --purple-dark: #3A0091;
  --lime: #D4FF00;
  --lime-dark: #A8CC00;
  --light: #F9F4FF;
  --dark: #141421;
  --dark-card: #1E1E30;
  --gray: #8888AA;
  --gray-light: #C4C4D4;
  --white: #FFFFFF;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --section-gap: 120px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Titillium Web', sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ---- NAV ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(249, 244, 255, 0.85);
  border-bottom: 1px solid rgba(81, 0, 205, 0.1);
  transition: background 0.3s;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--dark);
  text-decoration: none;
}

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

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

.nav-links a {
  text-decoration: none;
  color: var(--gray);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
}

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

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

.nav-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  transition: transform 0.3s;
}

/* ---- HERO ---- */
.hero {
  padding: 160px 2rem 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--light) 0%, #EDE4FF 100%);
}

.hero-badge {
  display: inline-block;
  background: var(--purple);
  color: var(--lime);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.4em 1.2em;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-weight: 300;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85em 2em;
  border-radius: 8px;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--purple);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--purple-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(81, 0, 205, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
}

.btn-outline:hover {
  background: var(--purple);
  color: var(--white);
  transform: translateY(-2px);
}

.hero-svg {
  margin-top: 3rem;
  max-width: 700px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* ---- SECTIONS ---- */
section {
  padding: 100px 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-dark {
  background: var(--dark);
  color: var(--white);
  max-width: 100%;
  padding: 100px 2rem;
}

.section-dark .section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-purple {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: var(--white);
  max-width: 100%;
  padding: 100px 2rem;
}

.section-purple .section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-dark .section-num,
.section-purple .section-num {
  color: var(--lime);
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--gray);
  max-width: 600px;
  margin-bottom: 3rem;
  font-weight: 300;
}

.section-dark .section-subtitle {
  color: var(--gray-light);
}

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

.card {
  background: var(--white);
  border: 1px solid rgba(81, 0, 205, 0.08);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(81, 0, 205, 0.1);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.card-icon-purple { background: rgba(81, 0, 205, 0.1); color: var(--purple); }
.card-icon-lime { background: rgba(212, 255, 0, 0.15); color: var(--lime-dark); }
.card-icon-blue { background: rgba(0, 100, 255, 0.1); color: #0064FF; }

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

.card p {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Dark cards */
.card-dark {
  background: var(--dark-card);
  border: 1px solid var(--glass-border);
}

.card-dark:hover {
  border-color: var(--purple);
  box-shadow: 0 12px 40px rgba(81, 0, 205, 0.2);
}

.card-dark p {
  color: var(--gray-light);
}

/* ---- STATS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-value {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--lime);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--gray-light);
  font-weight: 400;
}

/* ---- ARCH DIAGRAM ---- */
.arch-svg {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: block;
}

/* ---- CONTRACT GRAPH ---- */
.contract-graph {
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
  display: block;
}

/* ---- STEPS ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.step {
  text-align: center;
  position: relative;
}

.step-num {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.step h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

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

.step-connector {
  position: absolute;
  top: 32px;
  left: calc(50% + 40px);
  width: calc(100% - 80px);
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--lime));
}

/* ---- CODE BLOCKS ---- */
.code-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}

.code-tab {
  padding: 0.6em 1.5em;
  background: #1a1a2e;
  color: var(--gray-light);
  border: none;
  cursor: pointer;
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
  transition: background 0.2s, color 0.2s;
}

.code-tab.active {
  background: var(--dark-card);
  color: var(--lime);
}

.code-block {
  background: var(--dark-card);
  border-radius: 0 12px 12px 12px;
  padding: 1.5rem;
  overflow-x: auto;
  display: none;
}

.code-block.active {
  display: block;
}

.code-block pre {
  margin: 0;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #e0e0e0;
}

.code-block .keyword { color: #C792EA; }
.code-block .type { color: #82AAFF; }
.code-block .string { color: #C3E88D; }
.code-block .comment { color: #546E7A; }
.code-block .function { color: #FFD54F; }
.code-block .number { color: #F78C6C; }
.code-block .operator { color: #89DDFF; }

/* ---- COMPARISON TABLE ---- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.compare-table th {
  font-weight: 600;
  color: var(--gray-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.compare-table td {
  color: var(--gray-light);
}

.compare-table .highlight-col {
  color: var(--lime);
  font-weight: 600;
}

.compare-table tr:hover td {
  background: rgba(81, 0, 205, 0.05);
}

/* ---- ROADMAP ---- */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
  margin-top: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 12.5%;
  right: 12.5%;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--lime));
  border-radius: 2px;
}

.timeline-item {
  text-align: center;
  position: relative;
  padding-top: 48px;
}

.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--lime);
  border: 3px solid var(--dark);
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-item h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.timeline-badge {
  display: inline-block;
  background: rgba(212, 255, 0, 0.15);
  color: var(--lime);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2em 0.8em;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}

.timeline-item ul {
  list-style: none;
  font-size: 0.8rem;
  color: var(--gray-light);
}

.timeline-item li {
  margin-bottom: 0.25rem;
}

/* ---- TECH GRID ---- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.tech-item {
  background: var(--white);
  border: 1px solid rgba(81, 0, 205, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, border-color 0.2s;
}

.tech-item:hover {
  transform: translateY(-2px);
  border-color: var(--purple);
}

.tech-item .tech-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* ---- TWO PANELS ---- */
.two-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.panel {
  background: var(--white);
  border: 1px solid rgba(81, 0, 205, 0.08);
  border-radius: 16px;
  padding: 2rem;
}

.panel h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.panel-svg {
  width: 100%;
  height: 200px;
}

/* ---- FOOTER ---- */
.footer {
  background: var(--dark);
  color: var(--gray-light);
  padding: 60px 2rem 30px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
}

.footer-brand p {
  font-size: 0.9rem;
  margin-top: 0.75rem;
  color: var(--gray);
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  color: var(--gray);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--lime);
}

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--gray);
}

/* ---- ANIMATIONS ---- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* SVG node animation */
@keyframes pulse {
  0%, 100% { r: 6; opacity: 0.8; }
  50% { r: 8; opacity: 1; }
}

@keyframes dash {
  to { stroke-dashoffset: -20; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .timeline { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .timeline::before { display: none; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: rgba(249, 244, 255, 0.98);
    padding: 1rem 2rem;
    gap: 1rem;
    backdrop-filter: blur(20px);
  }
  .hero { padding: 120px 1.5rem 60px; }
  .hero h1 { font-size: 2rem; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .step-connector { display: none; }
  .two-panels { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .compare-table { font-size: 0.8rem; }
  .compare-table th, .compare-table td { padding: 0.6rem; }
  .code-tabs { overflow-x: auto; }
  section { padding: 60px 1.5rem; }
  .section-dark, .section-purple { padding: 60px 1.5rem; }
}
