:root {
  --bg: #f5f2e8;
  --bg-alt: #efe7d8;
  --text: #1d2b28;
  --muted: #44524c;
  --surface: rgba(255, 255, 255, 0.68);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --line: rgba(24, 48, 42, 0.15);
  --brand: #0f766e;
  --brand-strong: #0a4f4a;
  --accent: #d96a28;
  --shadow: 0 22px 55px rgba(15, 56, 44, 0.14);
  --radius: 20px;
  --bg-gradient-warm: #fff5da;
  --bg-gradient-cool: #d9efe8;
  --grain-dot: rgba(36, 44, 40, 0.08);
  --orb-one: #a4d8cf;
  --orb-two: #f1c49f;
  --chip-bg: #fff;
  --btn-on-brand: #fff;
  --btn-secondary-bg: rgba(255, 255, 255, 0.7);
  --lightbox-bg: rgba(0, 0, 0, 0.82);
  --lightbox-close: #fff;
}

[data-theme="dark"] {
  --bg: #141a1e;
  --bg-alt: #1a2228;
  --text: #e0e4e0;
  --muted: #8a9490;
  --surface: rgba(30, 40, 38, 0.68);
  --surface-strong: rgba(30, 40, 38, 0.86);
  --line: rgba(200, 220, 210, 0.12);
  --brand: #14b8a6;
  --brand-strong: #0d9488;
  --accent: #f59e0b;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.3);
  --bg-gradient-warm: #1e2a1e;
  --bg-gradient-cool: #162028;
  --grain-dot: rgba(200, 220, 210, 0.04);
  --orb-one: rgba(20, 184, 166, 0.25);
  --orb-two: rgba(245, 158, 11, 0.18);
  --chip-bg: rgba(30, 40, 38, 0.7);
  --btn-on-brand: #fff;
  --btn-secondary-bg: rgba(30, 40, 38, 0.6);
  --lightbox-bg: rgba(0, 0, 0, 0.9);
  --lightbox-close: #e0e4e0;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, var(--bg-gradient-warm) 0%, transparent 44%),
    radial-gradient(circle at 92% 8%, var(--bg-gradient-cool) 0%, transparent 36%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-alt) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: radial-gradient(var(--grain-dot) 0.45px, transparent 0.45px);
  background-size: 4px 4px;
  z-index: -1;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.55;
  pointer-events: none;
  z-index: -2;
}

.orb-one {
  width: 22rem;
  height: 22rem;
  background: var(--orb-one);
  top: -6rem;
  right: -6rem;
}

.orb-two {
  width: 18rem;
  height: 18rem;
  background: var(--orb-two);
  bottom: 2rem;
  left: -8rem;
}

.site-header {
  width: min(1120px, calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 1rem;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  display: inline-block;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 6px 14px rgba(13, 40, 33, 0.2);
}

.brand-text {
  text-transform: lowercase;
}

.site-nav {
  display: inline-flex;
  gap: 1.2rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

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

main {
  width: min(1120px, calc(100% - 2rem));
  margin: 2.6rem auto 4rem;
  display: grid;
  gap: 3.5rem;
}

section {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(7px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: clamp(1.6rem, 3vw, 3rem);
}

.kicker {
  display: inline-flex;
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--brand-strong);
}

h1,
h2 {
  margin: 0.6rem 0 0;
  font-family: "Fraunces", serif;
  line-height: 1.03;
}

h1 {
  font-size: clamp(2rem, 7vw, 4.1rem);
  max-width: 17ch;
}

h2 {
  font-size: clamp(1.6rem, 4.8vw, 2.8rem);
  max-width: 18ch;
}

.hero-copy {
  margin: 1rem 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-logo {
  width: 74px;
  height: 74px;
  margin-bottom: 0.8rem;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(12, 58, 45, 0.22);
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(140deg, var(--brand), var(--brand-strong));
  color: var(--btn-on-brand);
}

.btn-primary:hover {
  box-shadow: 0 10px 26px rgba(15, 118, 110, 0.26);
}

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

.btn-small {
  padding: 0.5rem 0.95rem;
  background: var(--chip-bg);
  border-color: var(--line);
  color: var(--text);
}

.stats {
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.stats li {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
}

.stats strong {
  display: block;
  font-size: 0.95rem;
}

.stats span {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.hero-grid {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1rem;
}

.terminal-card,
.preview-card,
.feature-card,
.workflow-preview,
.tab-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.terminal-card {
  padding: 1rem;
}

.card-label {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

pre {
  margin: 0;
  overflow-x: auto;
}

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
}

.preview-card {
  margin: 0;
  padding: 0.5rem;
  display: grid;
  gap: 0.65rem;
}

.preview-card img,
.workflow-preview img {
  width: 100%;
  display: block;
  border-radius: 10px;
  cursor: zoom-in;
}

figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 0.15rem 0.1rem;
}

.features,
.install,
.cta {
  padding: clamp(1.5rem, 2.3vw, 2.3rem);
}

.docs {
  padding: clamp(1.5rem, 2.3vw, 2.3rem);
}

.workflow {
  padding: clamp(1.5rem, 2.3vw, 2.3rem);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
}

.section-heading p {
  margin-bottom: 0.45rem;
}

.feature-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.feature-card {
  padding: 1rem;
}

.feature-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.feature-card p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.docs-grid,
.meta-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.list-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  padding: 1rem;
}

.full-width {
  grid-column: 1 / -1;
}

.list-card h3 {
  margin: 0;
  font-size: 1.03rem;
}

.list-card p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.list-card ul,
.list-card ol {
  margin: 0.65rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.55;
}

.table-wrap {
  margin-top: 0.8rem;
  overflow-x: auto;
}

.kbd-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.kbd-table th,
.kbd-table td {
  text-align: left;
  padding: 0.62rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.kbd-table th {
  font-size: 0.86rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

details {
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  background: var(--surface-strong);
}

summary {
  cursor: pointer;
  font-weight: 700;
}

details p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0.7rem 0 0;
}

details pre {
  margin-top: 0.7rem;
}

.chips {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.chips span {
  border: 1px solid var(--line);
  background: var(--chip-bg);
  border-radius: 999px;
  padding: 0.23rem 0.62rem;
  font-size: 0.79rem;
  color: var(--muted);
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.status-legend span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.64rem;
  background: var(--chip-bg);
  color: var(--text);
  font-size: 0.82rem;
}

.gallery {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.timeline {
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.timeline li {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-strong);
  padding: 0.8rem;
  line-height: 1.48;
  color: var(--muted);
}

.timeline span {
  display: inline-block;
  margin-right: 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}

.workflow-preview {
  margin: 0;
  padding: 0.5rem;
  align-self: center;
}

.tab-controls {
  margin-top: 1.2rem;
  display: inline-flex;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem;
  background: var(--surface-strong);
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.43rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--chip-bg);
  color: var(--text);
}

.tab-panel {
  margin-top: 0.9rem;
  padding: 1rem;
}

.install-note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cta {
  text-align: center;
}

.cta p {
  color: var(--muted);
  max-width: 56ch;
  margin: 0.75rem auto 0;
}

.cta .hero-actions {
  justify-content: center;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  padding-bottom: 2rem;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 980px) {
  .hero-grid,
  .workflow {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-grid,
  .meta-grid,
  .gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    border-radius: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

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

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

  .btn {
    width: 100%;
    text-align: center;
  }
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lightbox-bg);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease;
  cursor: zoom-in;
}

.lightbox-img.zoomed {
  max-width: none;
  max-height: none;
  cursor: grab;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--lightbox-close);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover {
  opacity: 1;
}

/* Theme toggle */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--chip-bg);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--brand);
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
