/* ============================================================
   SPECULATED.IO — Steampunk Trading Machine
   A brass-and-iron aesthetic for the AI trading frontier
   ============================================================ */

/* --- Custom Properties ------------------------------------ */
:root {
  --toffee:       #905F36;
  --graphite:     #3D3937;
  --bark:         #724626;
  --bark-dark:    #5E3E26;
  --tan:          #C7AB87;
  --brass:        #D4A84B;
  --brass-light:  #E8C96A;
  --copper:       #B87333;
  --steam:        rgba(199,171,135,0.08);
  --dark:         #1A1714;
  --darker:       #110F0D;
  --cream:        #F0E6D3;
  --amber-glow:   rgba(212,168,75,0.6);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--toffee) var(--darker);
}

/* Custom Scrollbar (Webkit) */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--darker);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brass), var(--toffee));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--brass-light), var(--copper));
}

body {
  font-family: var(--font-body);
  background: var(--darker);
  color: var(--tan);
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--brass);
  color: var(--darker);
}

a {
  color: var(--brass);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--brass-light);
}

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

/* --- Utility Classes -------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-padding {
  padding: 8rem 0;
}

/* --- Loading Screen --------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--darker);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-gear {
  width: 80px;
  height: 80px;
  animation: spin 2s linear infinite;
}
.loader-gear svg {
  width: 100%;
  height: 100%;
  fill: var(--brass);
  filter: drop-shadow(0 0 15px var(--amber-glow));
}

.loader-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--brass);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.loader-text::after {
  content: '';
  animation: ellipsis 1.5s steps(4, end) infinite;
}

@keyframes ellipsis {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* --- Background Canvas (Steam Particles) ------------------ */
#steam-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* --- Navigation ------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: all 0.5s var(--ease-out-expo);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

.navbar.scrolled {
  background: rgba(17, 15, 13, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212,168,75,0.15);
  padding: 0.6rem 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brass);
  letter-spacing: 0.05em;
}

.nav-logo-gear {
  width: 32px;
  height: 32px;
  animation: spin 8s linear infinite;
}
.nav-logo-gear svg {
  width: 100%;
  height: 100%;
  fill: var(--brass);
}

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

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tan);
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--brass);
  transition: width 0.4s var(--ease-out-expo);
}
.nav-links a:hover {
  color: var(--brass);
}
.nav-links a:hover::after {
  width: 100%;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--brass);
  transition: all 0.3s ease;
  display: block;
}
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section ----------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35) saturate(0.8);
  transform: scale(1.05);
  transition: transform 20s ease;
}

.hero:hover .hero-bg img {
  transform: scale(1.0);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 0%, var(--darker) 75%),
    linear-gradient(180deg, rgba(17,15,13,0.3) 0%, rgba(17,15,13,0.8) 100%);
}

/* Decorative Gears */
.hero-gear {
  position: absolute;
  opacity: 0.06;
  z-index: -1;
}
.hero-gear svg {
  fill: var(--brass);
}
.hero-gear--1 {
  top: 5%;
  right: -5%;
  width: 500px;
  height: 500px;
  animation: spin 30s linear infinite;
}
.hero-gear--2 {
  bottom: -10%;
  left: -8%;
  width: 600px;
  height: 600px;
  animation: spin 40s linear infinite reverse;
}
.hero-gear--3 {
  top: 30%;
  left: 5%;
  width: 200px;
  height: 200px;
  animation: spin 15s linear infinite;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: 2rem;
}

/* Ornate top decoration */
.hero-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInDown 1s var(--ease-out-expo) 0.5s forwards;
}
.hero-ornament__line {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass));
}
.hero-ornament__line:last-child {
  background: linear-gradient(90deg, var(--brass), transparent);
}
.hero-ornament__diamond {
  width: 8px;
  height: 8px;
  background: var(--brass);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--amber-glow);
}

.hero-subtitle-top {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInDown 1s var(--ease-out-expo) 0.7s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--cream);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeInUp 1.2s var(--ease-out-expo) 0.9s forwards;
  text-shadow:
    0 0 40px rgba(212,168,75,0.15),
    0 2px 0 rgba(0,0,0,0.3);
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--brass-light), var(--copper));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--tan);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeInUp 1.2s var(--ease-out-expo) 1.1s forwards;
}

.hero-description {
  font-size: 1.05rem;
  color: rgba(199,171,135,0.7);
  max-width: 600px;
  margin: 0 auto 3rem;
  opacity: 0;
  animation: fadeInUp 1.2s var(--ease-out-expo) 1.3s forwards;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 1.2s var(--ease-out-expo) 1.5s forwards;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brass), var(--copper));
  color: var(--darker);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--brass-light), var(--brass));
  opacity: 0;
  transition: opacity 0.4s ease;
}
.btn-primary:hover::before {
  opacity: 1;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212,168,75,0.3);
}
.btn-primary span {
  position: relative;
  z-index: 1;
}

.btn-outline {
  background: transparent;
  color: var(--brass);
  border: 1px solid rgba(212,168,75,0.4);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.btn-outline:hover {
  background: rgba(212,168,75,0.1);
  border-color: var(--brass);
  transform: translateY(-2px);
}

/* Scroll Indicator */
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeIn 1s ease 2s forwards;
}
.hero-scroll__text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
  writing-mode: vertical-rl;
}
.hero-scroll__line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--brass), transparent);
  animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

/* --- Section Headers -------------------------------------- */
.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-label::before,
.section-label::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--brass);
  opacity: 0.4;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.section-desc {
  font-size: 1.05rem;
  color: rgba(199,171,135,0.65);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Ornate Dividers -------------------------------------- */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 0;
}
.divider__line {
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,168,75,0.3), transparent);
}
.divider__gear {
  width: 30px;
  height: 30px;
  animation: spin 10s linear infinite;
}
.divider__gear svg {
  fill: var(--brass);
  opacity: 0.4;
  width: 100%;
  height: 100%;
}

/* --- About Section ---------------------------------------- */
.about {
  position: relative;
  background:
    linear-gradient(180deg, var(--darker) 0%, rgba(26,23,20,0.95) 50%, var(--darker) 100%);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-visual {
  position: relative;
}

.about-frame {
  position: relative;
  padding: 2rem;
}

.about-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(212,168,75,0.2);
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 30px 100%, 0 calc(100% - 30px));
}

.about-frame::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(212,168,75,0.08);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}

.ticker-display {
  background: rgba(17,15,13,0.9);
  border: 1px solid rgba(212,168,75,0.15);
  padding: 2rem;
  font-family: var(--font-mono);
  position: relative;
  overflow: hidden;
}

.ticker-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

.ticker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(212,168,75,0.1);
}

.ticker-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #4ADE80;
}
.ticker-status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ADE80;
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
}

.ticker-time {
  font-size: 0.7rem;
  color: var(--toffee);
}

.ticker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(212,168,75,0.05);
  transition: background 0.3s ease;
}
.ticker-row:hover {
  background: rgba(212,168,75,0.03);
}

.ticker-symbol {
  font-weight: 600;
  color: var(--cream);
  font-size: 0.85rem;
}
.ticker-price {
  color: var(--tan);
  font-size: 0.85rem;
}
.ticker-change {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}
.ticker-change.up {
  color: #4ADE80;
  background: rgba(74,222,128,0.1);
}
.ticker-change.down {
  color: #F87171;
  background: rgba(248,113,113,0.1);
}

.about-text h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--cream);
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.about-text p {
  margin-bottom: 1.25rem;
  color: rgba(199,171,135,0.7);
}

.about-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.about-feature {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(212,168,75,0.03);
  border: 1px solid rgba(212,168,75,0.08);
  transition: all 0.3s ease;
}
.about-feature:hover {
  border-color: rgba(212,168,75,0.2);
  background: rgba(212,168,75,0.06);
}

.about-feature__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.about-feature__icon svg {
  width: 100%;
  height: 100%;
  fill: var(--brass);
}

.about-feature__text {
  font-size: 0.9rem;
  color: var(--tan);
  line-height: 1.5;
}
.about-feature__text strong {
  color: var(--cream);
  display: block;
  margin-bottom: 0.2rem;
}

/* --- Stats Section ---------------------------------------- */
.stats {
  position: relative;
  background: linear-gradient(180deg, var(--darker), var(--dark), var(--darker));
}

.stats::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 50px,
      rgba(212,168,75,0.02) 50px,
      rgba(212,168,75,0.02) 51px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 50px,
      rgba(212,168,75,0.02) 50px,
      rgba(212,168,75,0.02) 51px
    );
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.stat-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: rgba(17,15,13,0.6);
  border: 1px solid rgba(212,168,75,0.1);
  position: relative;
  overflow: hidden;
  transition: all 0.5s var(--ease-out-expo);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--brass);
  transition: width 0.5s var(--ease-out-expo);
}
.stat-card:hover::before {
  width: 100%;
}

.stat-card:hover {
  border-color: rgba(212,168,75,0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.stat-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 1.5rem;
}
.stat-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--brass);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--cream);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-value .counter-suffix {
  font-size: 0.6em;
  color: var(--brass);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--toffee);
}

/* --- Engine / Method Section ------------------------------ */
.engine {
  position: relative;
  background: linear-gradient(180deg, var(--darker), rgba(26,23,20,1));
}

.engine-pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  position: relative;
}

/* Connecting line */
.engine-pipeline::before {
  content: '';
  position: absolute;
  top: 80px;
  left: 16.66%;
  right: 16.66%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  opacity: 0.3;
}

.engine-card {
  background: rgba(17,15,13,0.7);
  border: 1px solid rgba(212,168,75,0.1);
  padding: 2.5rem 2rem;
  position: relative;
  transition: all 0.5s var(--ease-out-expo);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.engine-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,168,75,0.05), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}
.engine-card:hover::after {
  opacity: 1;
}

.engine-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212,168,75,0.25);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.engine-step {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.engine-step__num {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brass);
  font-size: 0.8rem;
  color: var(--brass);
  position: relative;
  z-index: 1;
  background: var(--darker);
}

.engine-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--cream);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.engine-card p {
  color: rgba(199,171,135,0.6);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.engine-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}
.engine-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(212,168,75,0.2);
  color: var(--toffee);
  background: rgba(212,168,75,0.04);
}

/* --- Typewriter Terminal Section --------------------------- */
.terminal-section {
  position: relative;
  background: var(--darker);
}

.terminal {
  max-width: 800px;
  margin: 0 auto;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(212,168,75,0.15);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  background: rgba(212,168,75,0.06);
  border-bottom: 1px solid rgba(212,168,75,0.1);
}
.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-dot:nth-child(1) { background: #F87171; }
.terminal-dot:nth-child(2) { background: #FBBF24; }
.terminal-dot:nth-child(3) { background: #4ADE80; }

.terminal-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--toffee);
  letter-spacing: 0.1em;
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  min-height: 300px;
}

.terminal-line {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s ease;
}
.terminal-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.terminal-prompt {
  color: var(--brass);
}
.terminal-command {
  color: var(--cream);
}
.terminal-output {
  color: var(--toffee);
  padding-left: 1rem;
}
.terminal-success {
  color: #4ADE80;
}
.terminal-warning {
  color: #FBBF24;
}
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--brass);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- Principles Section ----------------------------------- */
.principles {
  position: relative;
  background: linear-gradient(180deg, var(--darker), var(--dark));
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.principle-card {
  padding: 2.5rem;
  border: 1px solid rgba(212,168,75,0.08);
  background: rgba(17,15,13,0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.5s var(--ease-out-expo);
}

.principle-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--brass), var(--copper));
  transition: height 0.6s var(--ease-out-expo);
}
.principle-card:hover::before {
  height: 100%;
}

.principle-card:hover {
  border-color: rgba(212,168,75,0.15);
  background: rgba(17,15,13,0.7);
}

.principle-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: rgba(212,168,75,0.1);
  line-height: 1;
  margin-bottom: 1rem;
  transition: color 0.5s ease;
}
.principle-card:hover .principle-number {
  color: rgba(212,168,75,0.2);
}

.principle-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--cream);
  margin-bottom: 0.8rem;
}
.principle-card p {
  color: rgba(199,171,135,0.6);
  font-size: 0.95rem;
}

/* --- CTA / Join Section ----------------------------------- */
.join {
  position: relative;
  background: var(--darker);
  overflow: hidden;
}

.join-inner {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  padding: 5rem 3rem;
  border: 1px solid rgba(212,168,75,0.15);
  background: rgba(17,15,13,0.8);
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 30px 100%, 0 calc(100% - 30px));
}

.join-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(212,168,75,0.05), transparent 70%);
  pointer-events: none;
}

.join-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 2rem;
  opacity: 0.8;
}
.join-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--brass);
  stroke-width: 1;
}

.join h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--cream);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.join p {
  color: rgba(199,171,135,0.65);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
}

.join-disclaimer {
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: rgba(199,171,135,0.3);
  text-transform: uppercase;
}

/* --- Footer ----------------------------------------------- */
.footer {
  background: var(--darker);
  border-top: 1px solid rgba(212,168,75,0.08);
  padding: 3rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--brass);
  font-weight: 700;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(199,171,135,0.35);
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.footer-links a {
  font-size: 0.8rem;
  color: rgba(199,171,135,0.5);
  transition: color 0.3s ease;
}
.footer-links a:hover {
  color: var(--brass);
}

/* --- Scroll Reveal Animations ----------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s var(--ease-out-expo);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s var(--ease-out-expo);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s var(--ease-out-expo);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s var(--ease-out-expo);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s var(--ease-out-expo);
}
.stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}
.stagger.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.6s; }

/* --- Keyframe Animations ---------------------------------- */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* --- Magnetic Hover Effect for Buttons -------------------- */
.btn:active {
  transform: translateY(0) scale(0.98);
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 1024px) {
  .about-grid {
    gap: 3rem;
  }
  .engine-pipeline {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
  .engine-pipeline::before {
    display: none;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    background: rgba(17,15,13,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 5rem 2rem;
    gap: 1.5rem;
    transition: right 0.5s var(--ease-out-expo);
    border-left: 1px solid rgba(212,168,75,0.1);
  }
  .nav-links.open {
    right: 0;
  }
  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .principles-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.5rem 1rem;
  }

  .section-padding {
    padding: 5rem 0;
  }

  .hero-title {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
  }

  .join-inner {
    padding: 3rem 1.5rem;
    clip-path: none;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 0 1.25rem;
  }
  .hero-cta-group {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
}
