/* ── Reset & Base ────────────────────────── */

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

:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;

  --bg: #f8f6f3;
  --bg-elevated: #fff;
  --bg-subtle: #f0ece8;
  --border: #e2ded9;

  --text: #1c1917;
  --text-secondary: #57534e;
  --text-tertiary: #a8a29e;

  --accent: #b45309;
  --accent-light: #d97706;
  --accent-subtle: rgba(180, 83, 9, 0.08);

  --green: #059669;
  --yellow: #ca8a04;

  --terminal-bg: #1c1917;
  --terminal-border: #44403c;
  --terminal-text: #fafaf9;
  --terminal-dim: #78716c;

  --dot-close: #ff5f57;
  --dot-minimize: #febc2e;
  --dot-maximize: #28c840;

  --radius: 12px;
  --radius-sm: 8px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

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

/* ── Skip Link ──────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 0.75rem;
  color: #fff;
}

/* ── Focus ───────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* ── Nav ─────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(248, 246, 243, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

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

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

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

.nav-lang {
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

/* ── Hero ────────────────────────────────── */

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 10rem 2rem 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 0.35em 1em;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

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

/* ── Buttons ─────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #92400e;
  color: #fff;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--text-tertiary);
}

/* ── Terminal ────────────────────────────── */

.terminal-section {
  max-width: 640px;
  margin: 0 auto 6rem;
  padding: 0 2rem;
}

.terminal {
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--terminal-text);
}

.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--terminal-border);
}

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

.dot-close {
  background: var(--dot-close);
}

.dot-minimize {
  background: var(--dot-minimize);
}

.dot-maximize {
  background: var(--dot-maximize);
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
}

.t-spacer {
  height: 0.5em;
}

.t-prompt {
  color: #f59e0b;
  margin-right: 0.5em;
}

.t-dim {
  color: var(--terminal-dim);
}

.t-green {
  color: #34d399;
}

.t-yellow {
  color: #fbbf24;
}

/* ── Section Title ───────────────────────── */

.section-title {
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 3rem;
}

/* ── Features ────────────────────────────── */

.features {
  max-width: 1080px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  list-style: none;
}

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

.feature-card:hover {
  border-color: var(--accent-light);
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Architecture Flow ───────────────────── */

.arch-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.arch-flow {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
}

.arch-step {
  flex: 0 1 200px;
  text-align: center;
}

.arch-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: 50%;
}

.arch-label {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.arch-step p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.arch-arrow {
  color: var(--text-tertiary);
  font-size: 1.25rem;
  padding-top: 0.4rem;
  flex-shrink: 0;
}

/* ── Usage ───────────────────────────────── */

.usage-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.step {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.step-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 50%;
  flex-shrink: 0;
}

.step-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.usage-extras {
  display: flex;
  gap: 2rem;
}

.usage-extra-item {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.usage-extra-item a {
  color: var(--accent);
  font-weight: 500;
}

.usage-extra-item a:hover {
  color: var(--accent-light);
}

.code-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.code-block code {
  display: block;
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  padding-right: 2.5rem;
  background: var(--bg-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow-x: auto;
  position: relative;
  cursor: text;
  user-select: all;
  -webkit-user-select: all;
}

.code-block .t-dim {
  color: var(--text-tertiary);
  user-select: none;
  -webkit-user-select: none;
}

.code-copy {
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-tertiary);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1;
}

.code-copy:hover .code-copy-btn,
.code-copy-btn:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .code-copy-btn {
    opacity: 0.6;
  }
}

.code-copy-btn:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
}

.code-copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
  opacity: 1;
}

/* ── Limits ──────────────────────────────── */

.limits-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.limits-grid {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.limit-item {
  text-align: center;
}

.limit-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.limit-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Footer ──────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ── Responsive: Tablet ──────────────────── */

@media (max-width: 1024px) and (min-width: 769px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .feature-card {
    padding: 1.5rem;
  }
}

/* ── Responsive: Mobile ─────────────────── */

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

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    gap: 0;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links a {
    display: flex;
    padding: 0.75rem 2rem;
    min-height: 44px;
    align-items: center;
  }

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

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

  .usage-extras {
    flex-direction: column;
    gap: 1rem;
  }

  .arch-flow {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .arch-step {
    flex: none;
    width: 100%;
    max-width: 280px;
  }

  .arch-arrow {
    transform: rotate(90deg);
    padding: 0;
    margin: -0.25rem 0;
  }

  .limits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
  }

  .limit-item {
    flex: none;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .hero {
    padding: 7rem 1.25rem 3rem;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .hero-actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 140px;
  }

  .features,
  .arch-section,
  .usage-section,
  .limits-section,
  .footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .nav-inner {
    padding: 0 1.25rem;
  }

  .terminal-section {
    padding: 0 1.25rem;
  }

  .terminal-body {
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    overflow-x: auto;
  }

  .code-block code {
    mask-image: none;
    -webkit-mask-image: none;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .hero-subtitle br {
    display: none;
  }
}

/* ── Responsive: Small Mobile ───────────── */

@media (max-width: 380px) {
  .hero-title {
    font-size: 2rem;
  }

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

  .limit-value {
    font-size: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }
}
