/* ========================================================
   TOOEY — Premium Terminal Aesthetic
   Phosphor glow meets modern design studio
   ======================================================== */

:root {
  --bg:         #0a0e14;
  --bg-surface: #0d1119;
  --bg-card:    #111822;
  --bg-raised:  #151d28;
  --border:     #1e2a3a;
  --border-glow:#2a3f5f;

  --text:       #c8d3e0;
  --text-dim:   #5e7390;
  --text-muted: #3a4d65;

  --green:      #00ff9d;
  --green-dim:  #00cc7d;
  --green-glow: rgba(0, 255, 157, 0.15);
  --amber:      #ffb547;
  --amber-dim:  #cc8f32;
  --cyan:       #47d4ff;
  --cyan-dim:   #2eaacc;
  --rose:       #ff6b8a;
  --purple:     #b48eff;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF 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-color: var(--border) transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scanline overlay on body */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

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

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--green);
}

::selection {
  background: var(--green);
  color: var(--bg);
}

/* ---- Container ---- */
.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---- Scroll Reveal System ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ---- Navigation ---- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo);
  background: transparent;
}

.site-nav.nav-scrolled {
  background: rgba(10, 14, 20, 0.95);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--green);
  letter-spacing: -0.02em;
  text-shadow: 0 0 20px var(--green-glow);
}

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

.nav-links a {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--green);
}

/* ---- Section Headings ---- */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '//';
  color: var(--text-muted);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 540px;
  line-height: 1.7;
}

/* ================ HERO ================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

/* Hero background gradient orbs */
.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0,255,157,0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: hero-pulse 6s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  bottom: 10%;
  right: -100px;
  background: radial-gradient(circle, rgba(71,212,255,0.05) 0%, transparent 70%);
  pointer-events: none;
  animation: hero-pulse 8s ease-in-out infinite reverse;
}

@keyframes hero-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

/* Grid background */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.15;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  pointer-events: none;
}

/* ASCII Logo */
.ascii-logo {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: clamp(0.35rem, 1.2vw, 0.72rem);
  line-height: 1.25;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
  text-shadow:
    0 0 10px rgba(0,255,157,0.4),
    0 0 40px rgba(0,255,157,0.15),
    0 0 80px rgba(0,255,157,0.05);
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.5vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

/* Blinking cursor after tagline */
.tagline::after {
  content: '█';
  color: var(--green);
  font-weight: 400;
  animation: blink-cursor 1s step-end infinite;
  margin-left: 4px;
  font-size: 0.75em;
}

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

.subtitle {
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 2.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.75rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.25s var(--ease-out-expo);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0,255,157,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover {
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0,255,157,0.35), 0 4px 20px rgba(0,255,157,0.15), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  color: var(--green);
  border-color: var(--green);
  background: rgba(0,255,157,0.05);
  transform: translateY(-2px);
}

/* Install command */
.install-cmd {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  position: relative;
}

.install-cmd .prompt {
  color: var(--green);
  user-select: none;
}

.install-cmd code {
  color: var(--text);
  font-size: 0.85rem;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}
.copy-btn:hover {
  color: var(--green);
  border-color: var(--green);
}
.copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
}

/* ================ FEATURES ================ */
.features {
  padding: 6rem 0;
  position: relative;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 2.5rem;
}

.feature-card {
  background: var(--bg-card);
  padding: 1.75rem;
  position: relative;
  transition: all 0.35s var(--ease-out-expo);
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,255,157,0.03) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
}

.feature-card:hover {
  background: var(--bg-raised);
}
.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  display: block;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0,255,157,0.08);
  color: var(--green);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.65;
}

/* ================ ARCHITECTURE ================ */
.architecture {
  padding: 6rem 0;
}

.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin: 2.5rem 0 2rem;
  position: relative;
}

.pipeline-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.65rem 1.25rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  position: relative;
  transition: all 0.3s;
  animation: pipeline-light 4.2s ease-in-out infinite;
}

.pipeline-step:nth-child(1)  { animation-delay: 0s; }
.pipeline-step:nth-child(3)  { animation-delay: 0.6s; }
.pipeline-step:nth-child(5)  { animation-delay: 1.2s; }
.pipeline-step:nth-child(7)  { animation-delay: 1.8s; }
.pipeline-step:nth-child(9)  { animation-delay: 2.4s; }
.pipeline-step:nth-child(11) { animation-delay: 3.0s; }
.pipeline-step:nth-child(13) { animation-delay: 3.6s; }

@keyframes pipeline-light {
  0%, 100% {
    color: var(--text-dim);
    border-color: var(--border);
    box-shadow: none;
  }
  15%, 25% {
    color: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 15px rgba(0,255,157,0.15), inset 0 0 15px rgba(0,255,157,0.05);
  }
}

.pipeline-step:first-child {
  border-radius: 8px 0 0 8px;
}
.pipeline-step:last-child {
  border-radius: 0 8px 8px 0;
}

.pipeline-arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0 0.15rem;
  user-select: none;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.4rem;
  font-weight: 600;
}

.pipeline-desc {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.7;
  max-width: 620px;
  margin: 0 auto;
}

/* ================ CODE EXAMPLES ================ */
.code-examples {
  padding: 6rem 0;
}

.code-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

@media (min-width: 768px) {
  .code-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.code-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 500px;
}

.code-block pre {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

/* CRT curvature effect on code blocks */
.code-block::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.3);
  pointer-events: none;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.code-dots {
  display: flex;
  gap: 6px;
}
.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }

.code-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.code-lang {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.code-block pre {
  padding: 1.25rem;
  font-size: 0.78rem;
  line-height: 1.7;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.code-block code {
  font-family: var(--font-mono);
  color: var(--text);
}

/* Go Syntax Highlighting */
.syn-kw { color: var(--purple); }           /* keywords: package, import, func, type, struct, switch, case, return, if */
.syn-fn { color: var(--cyan); }             /* function names / calls */
.syn-str { color: var(--green); }           /* strings */
.syn-cmt { color: var(--text-muted); font-style: italic; }  /* comments */
.syn-type { color: var(--amber); }          /* types: int, string, interface{} */
.syn-num { color: var(--rose); }            /* numbers */
.syn-op { color: var(--text-dim); }         /* operators, punctuation */
.syn-builtin { color: var(--green-dim); }   /* built-in funcs */

/* ================ QUICKSTART ================ */
.quickstart {
  padding: 6rem 0;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  transition: background 0.3s;
}
.step:last-child {
  border-bottom: none;
}
.step:hover {
  background: var(--bg-raised);
}

.step-num {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: var(--bg);
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.step-content p {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.65;
}

.step-content pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  overflow-x: auto;
}

.step-content code {
  color: var(--text);
}

/* ================ FOOTER ================ */
footer {
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer a {
  color: var(--text-dim);
  transition: color 0.2s;
}
footer a:hover {
  color: var(--green);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.footer-separator {
  color: var(--text-muted);
}

.footer-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ================ DIVIDER ================ */
/* ================ DEMO ================ */
.demo-video-wrapper {
  margin-top: 2rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 0 40px rgba(0, 255, 157, 0.06);
}

.demo-video {
  display: block;
  width: 100%;
  border-radius: 12px;
}

.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0;
}

/* ================ RESPONSIVE ================ */
@media (max-width: 768px) {
  .site-nav {
    padding: 0.8rem 1rem;
  }

  .nav-links {
    display: none;
  }

  .container {
    padding: 0 1.25rem;
  }

  .hero {
    padding: 5rem 1.25rem 3rem;
    min-height: auto;
  }

  .pipeline {
    gap: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .pipeline-step {
    font-size: 0.72rem;
    padding: 0.5rem 0.75rem;
  }

  .pipeline-arrow {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }

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

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

  .step {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .ascii-logo {
    font-size: 0.28rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .install-cmd {
    width: 100%;
    justify-content: space-between;
  }
}
