/* io-mcp — Nord-inspired dark theme */
:root {
  --nord0: #2e3440;
  --nord1: #3b4252;
  --nord2: #434c5e;
  --nord3: #4c566a;
  --nord4: #d8dee9;
  --nord5: #e5e9f0;
  --nord6: #eceff4;
  --nord7: #8fbcbb;
  --nord8: #88c0d0;
  --nord9: #81a1c1;
  --nord10: #5e81ac;
  --nord11: #bf616a;
  --nord12: #d08770;
  --nord13: #ebcb8b;
  --nord14: #a3be8c;
  --nord15: #b48ead;

  --color-bg: var(--nord0);
  --color-surface: var(--nord1);
  --color-surface-raised: var(--nord2);
  --color-border: var(--nord3);
  --color-text: var(--nord6);
  --color-text-muted: var(--nord4);
  --color-accent: var(--nord8);
  --color-accent-hover: var(--nord7);
  --color-success: var(--nord14);
  --color-warning: var(--nord13);
  --color-purple: var(--nord15);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'FiraCode Nerd Font', 'SF Mono', Consolas, monospace;
  --max-width: 960px;
  --radius: 8px;
  --radius-lg: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Scroll Animations ─────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger */
.features .fade-in:nth-child(1) { transition-delay: 0ms; }
.features .fade-in:nth-child(2) { transition-delay: 40ms; }
.features .fade-in:nth-child(3) { transition-delay: 80ms; }
.features .fade-in:nth-child(4) { transition-delay: 120ms; }
.features .fade-in:nth-child(5) { transition-delay: 160ms; }
.features .fade-in:nth-child(6) { transition-delay: 200ms; }
.features .fade-in:nth-child(7) { transition-delay: 240ms; }
.features .fade-in:nth-child(8) { transition-delay: 280ms; }
.features .fade-in:nth-child(9) { transition-delay: 320ms; }
.features .fade-in:nth-child(10) { transition-delay: 360ms; }
.features .fade-in:nth-child(11) { transition-delay: 400ms; }
.features .fade-in:nth-child(12) { transition-delay: 440ms; }

.flow-step:nth-child(1) { transition-delay: 0ms; }
.flow-connector:nth-child(2) { transition-delay: 100ms; }
.flow-step:nth-child(3) { transition-delay: 200ms; }
.flow-connector:nth-child(4) { transition-delay: 300ms; }
.flow-step:nth-child(5) { transition-delay: 400ms; }

/* ─── Hero ─────────────────────────────────── */
.hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 5rem 2rem 3rem;
  background: var(--nord0);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(136,192,208,0.1) 0%, rgba(129,161,193,0.05) 40%, transparent 70%);
  pointer-events: none;
  animation: glow-pulse 8s ease-in-out infinite alternate;
}

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

.hero-content { position: relative; z-index: 1; }

.badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(136,192,208,0.08);
  border: 1px solid rgba(136,192,208,0.18);
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, var(--nord8), var(--nord9), var(--nord15), var(--nord8));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero .tagline {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--nord4);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

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

.hero .cta {
  display: inline-flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--nord0);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--nord0);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(136,192,208,0.2);
}
.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  border-color: var(--color-accent);
  background: rgba(136,192,208,0.04);
  transform: translateY(-1px);
}

/* ─── Hero Screenshot ─────────────────────── */
.screenshot-section {
  padding: 0 2rem 3rem;
}
.screenshot-wrapper {
  max-width: 720px;
  margin: 0 auto;
}
.hero-screenshot {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(136,192,208,0.08);
}
.screenshot-caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--nord3);
  margin-top: 0.8rem;
  line-height: 1.4;
}

/* ─── What is io-mcp ──────────────────────── */
.what-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.what-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.what-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
}
.what-card p {
  font-size: 0.88rem;
  color: var(--nord4);
  line-height: 1.6;
}

/* ─── Case Study / Flow ───────────────────── */
.casestudy {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}
.flow {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-top: 0.5rem;
}
.flow-step {
  flex: 1;
  max-width: 280px;
  text-align: center;
  padding: 1.5rem;
}
.flow-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(136,192,208,0.06);
  border: 1px solid rgba(136,192,208,0.15);
  color: var(--color-accent);
  transition: all 0.3s ease;
}
.flow-step:hover .flow-icon {
  background: rgba(136,192,208,0.12);
  border-color: var(--color-accent);
}
.flow-step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.flow-step p {
  font-size: 0.85rem;
  color: var(--nord4);
  line-height: 1.5;
}
.flow-connector {
  display: flex;
  align-items: center;
  padding-top: 1.8rem;
  flex-shrink: 0;
}

/* ─── Architecture Diagram ─────────────────── */
.arch-section { padding: 0 2rem 3rem; }
.arch-wrapper { max-width: 600px; margin: 0 auto; }
.diagram {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--nord4);
  overflow-x: auto;
  white-space: pre;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

/* ─── Kitty Graphics ──────────────────────── */
.kitty-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}
.kitty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.kitty-detail p {
  font-size: 0.88rem;
  color: var(--nord4);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}
.kitty-detail ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}
.kitty-detail ul li {
  font-size: 0.85rem;
  color: var(--nord4);
  padding: 0.25rem 0;
  padding-left: 1.2rem;
  position: relative;
}
.kitty-detail ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}
.kitty-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* ─── Sections ─────────────────────────────── */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}
section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
section .subtitle {
  color: var(--nord4);
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ─── Feature Grid ─────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
}
.feature {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: border-color 0.2s ease;
}
.feature:hover { border-color: rgba(136,192,208,0.3); }
.feature-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.feature .icon { font-size: 1.2rem; flex-shrink: 0; }
.feature h3 { font-size: 0.9rem; font-weight: 600; }
.feature p { font-size: 0.82rem; color: var(--nord4); line-height: 1.5; }

/* ─── Code ─────────────────────────────────── */
pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--nord4);
}
code { font-family: var(--font-mono); font-size: 0.85em; }
.inline-code {
  background: var(--color-surface);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  font-size: 0.82em;
  color: var(--color-accent);
  border: 1px solid rgba(76,86,106,0.4);
}
.code-comment { color: var(--nord3); }
.code-key { color: var(--nord9); }
.code-value { color: var(--nord14); }
.code-num { color: var(--nord15); }

/* ─── MCP Tools ────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}
.tool-group {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.tool-group h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}
.tool {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.25rem 0;
  font-size: 0.82rem;
}
.tool code { color: var(--color-text); font-weight: 500; white-space: nowrap; }
.tool span { color: var(--nord3); font-size: 0.78rem; }

/* ─── Quick Start ──────────────────────────── */
.quickstart-section {
  background: linear-gradient(180deg, transparent 0%, rgba(59,66,82,0.25) 50%, transparent 100%);
  max-width: 100%;
  padding: 4rem 2rem;
}
.quickstart-section h2,
.quickstart-section .subtitle {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}
.quickstart-steps {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.qs-step {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}
.qs-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(136,192,208,0.08);
  border: 1px solid rgba(136,192,208,0.2);
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}
.qs-content { flex: 1; }
.qs-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.qs-content pre { margin: 0; }

/* ─── Architecture Grid ───────────────────── */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.arch-component {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
  transition: border-color 0.2s ease;
}
.arch-component:hover { border-color: rgba(136,192,208,0.3); }
.arch-label { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; }
.arch-port {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
  opacity: 0.8;
}
.arch-component p { font-size: 0.8rem; color: var(--nord4); line-height: 1.4; }

/* ─── Footer ───────────────────────────────── */
footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 2rem;
  text-align: center;
}
.footer-content { max-width: var(--max-width); margin: 0 auto; }
.footer-brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, var(--nord8), var(--nord9));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
footer p { color: var(--nord3); font-size: 0.8rem; }
footer a { color: var(--nord4); }
footer a:hover { color: var(--color-accent); }

/* ─── Responsive ───────────────────────────── */
@media (max-width: 900px) {
  .arch-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .kitty-grid { grid-template-columns: 1fr; }
  .what-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .flow { flex-direction: column; align-items: center; }
  .flow-connector { transform: rotate(90deg); padding-top: 0; margin: -0.5rem 0; }
  .flow-step { max-width: 100%; }
}

@media (max-width: 640px) {
  .hero { padding: 3rem 1.5rem 2rem; min-height: 40vh; }
  section { padding: 3rem 1.5rem; }
  .quickstart-section { padding: 3rem 1.5rem; }
  .features { grid-template-columns: 1fr; }
  .qs-step { flex-direction: column; gap: 0.6rem; }
  .hero h1 { font-size: clamp(2.2rem, 10vw, 3rem); }
  .diagram { font-size: 0.6rem; padding: 1rem; }
}
