/*
 * Tamandua Website Styles
 * Dark theme CSS foundation — US-003
 *
 * Design system:
 *   Base:  #0d1117
 *   Surface: #161b22
 *   Border: #30363d
 *   Text:  #c9d1d9
 *   Accent: #f0883e
 *   Success: #3fb950
 *   Info:   #58a6ff
 *   Muted:  #8b949e
 *
 * No external CSS frameworks — all custom properties and handcrafted styles.
 */

/* ── CSS Custom Properties ─────────────────────────────────────────── */

:root {
  /* Colors */
  --color-bg:           #0d1117;
  --color-surface:      #161b22;
  --color-border:       #30363d;
  --color-border-muted: #21262d;
  --color-text:         #c9d1d9;
  --color-text-em:      #e6edf3;
  --color-text-muted:   #8b949e;
  --color-accent:       #f0883e;
  --color-accent-hover: #ff9d5c;
  --color-success:      #3fb950;
  --color-info:         #58a6ff;
  --color-danger:       #f85149;
  --color-link:         #58a6ff;

  /* Spacing scale — 4px base */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.5rem;
  --space-6:  2rem;
  --space-8:  3rem;
  --space-10: 4rem;
  --space-12: 5rem;

  /* Border radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
               Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', 'Liberation Mono',
               'Courier New', monospace;

  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  2rem;
  --fs-4xl:  2.5rem;

  --lh-body:  1.6;
  --lh-heading: 1.3;
  --lh-code:  1.5;

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Layout */
  --max-width: 1200px;
  --section-pad: var(--space-10);

  /* Transitions */
  --transition: 150ms ease;
}

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

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);

  /* Subtle CSS-only gradient background */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(240, 136, 62, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 80% 80%, rgba(58, 166, 255, 0.04), transparent);
  background-attachment: fixed;
}

/* ── Links ─────────────────────────────────────────────────────────── */

/* Responsive images — max-width prevents overflow on mobile */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition);
}

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

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

/* ── Typography ────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  color: var(--color-text-em);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }

/* Global focus-visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

p + p {
  margin-top: var(--space-4);
}

strong {
  font-weight: var(--fw-semibold);
  color: var(--color-text-em);
}

/* ── Code & Pre ────────────────────────────────────────────────────── */

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-muted);
  color: var(--color-text);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-code);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
  margin: var(--space-5) 0;
  color: var(--color-text);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: #000;
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--transition);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ── Header & Navigation ───────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
}

.logo {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--color-text-em);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color var(--transition);
}

.logo:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* Hamburger menu (hidden on desktop — checkbox hack) */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-hamburger,
.nav-hamburger::before,
.nav-hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition:
    transform var(--transition),
    opacity var(--transition),
    top var(--transition);
  position: relative;
}

.nav-hamburger::before,
.nav-hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-hamburger::before {
  top: -7px;
}

.nav-hamburger::after {
  top: 7px;
}

/* Hamburger open state — animate to X */
.nav-toggle:checked ~ .nav-toggle-label .nav-hamburger {
  background: transparent;
}

.nav-toggle:checked ~ .nav-toggle-label .nav-hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle:checked ~ .nav-toggle-label .nav-hamburger::after {
  transform: rotate(-45deg);
  top: 0;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  list-style: none;
}

nav ul li a {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-sm);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition:
    color var(--transition),
    background var(--transition);
}

nav ul li a:hover {
  color: var(--color-text-em);
  background: var(--color-surface);
  text-decoration: none;
}

nav ul li a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

/* Mobile nav default: hidden unless toggled */
@media (max-width: 767px) {
  /* Hide the hamburger on mobile (it's always visible), but toggle nav links */
  #nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-top: var(--space-3);
    gap: 0;
  }

  .nav-toggle:checked ~ #nav-links {
    display: flex;
  }

  #nav-links li a {
    padding: var(--space-3) var(--space-3);
    border-radius: 0;
    font-size: var(--fs-base);
    border-top: 1px solid var(--color-border-muted);
  }
}

@media (min-width: 768px) {
  .nav-toggle-label {
    display: none;
  }

  #nav-links {
    display: flex;
    flex-direction: row;
  }
}

/* ── Layout Container ──────────────────────────────────────────────── */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ── Sections ──────────────────────────────────────────────────────── */

section {
  padding: var(--section-pad) 0;
  border-top: 1px solid var(--color-border);
}

section:first-of-type {
  border-top: none;
}

section h2 {
  margin-bottom: var(--space-6);
}

section h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-4);
}

section h2 + p,
section h3 + p {
  margin-top: var(--space-3);
}

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

#hero {
  position: relative;
  padding: var(--space-12) 0;
  text-align: center;
  overflow: hidden;
  /* Dark gradient background */
  background:
    linear-gradient(180deg, var(--color-bg) 0%, rgba(13, 17, 23, 0) 100%),
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(240, 136, 62, 0.06), transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(88, 166, 255, 0.04), transparent 60%);
}

/* CSS-only dot pattern overlay behind hero */
#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(240, 136, 62, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 40%, black 40%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Ant emoji accent above heading */
#hero::after {
  content: "🦔";
  position: absolute;
  top: var(--space-10);
  right: 10%;
  font-size: 6rem;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

#hero h1 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-5);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-tagline {
  max-width: 720px;
  margin-left: auto !important;
  margin-right: auto !important;
  font-size: var(--fs-lg);
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* Install command wrapper — visually distinct */
.hero-install {
  display: inline-block;
  margin-top: var(--space-6);
}

.hero-install pre {
  display: inline-block;
  text-align: left;
  margin: 0;
  background: rgba(22, 27, 34, 0.8);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  position: relative;
}

.hero-install code {
  color: var(--color-accent);
  font-size: var(--fs-sm);
}

/* Copy hint */
.hero-install::after {
  content: "📋 click to copy";
  display: block;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  text-align: center;
  opacity: 0.7;
}

.hero-or {
  margin-top: var(--space-5) !important;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.hero-or strong {
  color: var(--color-text-em);
}

/* CTA Button */
.cta-button {
  display: inline-block;
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-10);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  font-family: var(--font-body);
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition:
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.cta-button:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(240, 136, 62, 0.3);
  text-decoration: none;
  color: #fff;
}

.cta-button:active {
  transform: translateY(0);
  box-shadow: none;
}

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

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

#features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

#features h2 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

/* Feature card icons */
.feature-icon {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: var(--space-4);
  opacity: 0.85;
}

#features article {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition:
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

#features article:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#features article:hover .feature-icon {
  opacity: 1;
}

#features article h3 {
  margin-top: 0;
  margin-bottom: var(--space-3);
  font-size: var(--fs-xl);
}

/* ── Tables ────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  font-size: var(--fs-sm);
  line-height: 1.45;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: var(--fw-semibold);
  color: var(--color-text-em);
  padding: var(--space-3) 0;
  font-size: var(--fs-base);
}

thead {
  border-bottom: 2px solid var(--color-border);
}

th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-weight: var(--fw-semibold);
  color: var(--color-text-em);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-border-muted);
  vertical-align: top;
}

/* Striped rows for readability */
tbody tr:nth-child(even) {
  background: rgba(22, 27, 34, 0.4);
}

/* Hover highlight for entire row */
tbody tr:hover {
  background: var(--color-surface);
}

tbody tr:nth-child(even):hover {
  background: var(--color-surface);
}

/* ── Table Wrapper — horizontal scroll on small screens ────────────── */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-5) 0;
  /* Scroll hint shadow: inset shadow on right edge when content overflows */
  background:
    linear-gradient(to right, var(--color-bg) 30%, transparent),
    linear-gradient(to right, transparent, var(--color-bg) 70%) 100% 0,
    radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.4), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.4), transparent) 100% 0;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
  border-radius: var(--radius-sm);
}

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

.table-wrapper table {
  margin: 0;
  /* Ensure table doesn't collapse below min-content */
  min-width: 100%;
}

/* Remove default table margin when inside a wrapper */
.table-wrapper + .table-wrapper {
  margin-top: var(--space-5);
}

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

.architecture-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-8) 0;
}

.arch-step {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  text-align: center;
  max-width: 480px;
  width: 100%;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.arch-step:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.arch-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-3);
}

.arch-step strong {
  display: block;
  font-size: var(--fs-lg);
  margin-bottom: var(--space-2);
}

.arch-step p {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
  margin: 0;
}

.arch-arrow {
  font-size: 1.5rem;
  color: var(--color-accent);
  opacity: 0.6;
  line-height: 1;
}

@media (min-width: 768px) {
  .architecture-flow {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
  }

  .arch-step {
    flex: 1;
    max-width: none;
  }

  .arch-arrow {
    display: flex;
    align-items: center;
    font-size: 1.75rem;
    padding: 0 var(--space-3);
  }
}

/* ── Installation Grid ──────────────────────────────────────────────── */

.install-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

.install-column {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.install-column:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.install-column h3 {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

.install-column pre {
  margin: var(--space-4) 0;
}

.install-column p {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.install-column p:last-child {
  margin-bottom: 0;
}

.install-prereqs {
  background: var(--color-surface);
  border: 1px solid var(--color-border-muted);
  border-left: 3px solid var(--color-info);
  border-radius: var(--radius-sm);
  padding: var(--space-5) var(--space-6);
  margin-top: var(--space-6);
}

.install-prereqs h3 {
  margin-top: 0;
  margin-bottom: var(--space-3);
}

.install-prereqs ul {
  margin-bottom: var(--space-3);
}

.install-prereqs p {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .install-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Why It Works List ──────────────────────────────────────────────── */

.why-list {
  list-style: none;
  counter-reset: why-counter;
  padding: 0;
  margin: var(--space-8) 0;
}

.why-list li {
  counter-increment: why-counter;
  position: relative;
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-8);
  margin-bottom: var(--space-4);
  border-left: 3px solid var(--color-border-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition:
    border-color var(--transition),
    background var(--transition);
}

/* Alternating left-border accents */
.why-list li:nth-child(1) { border-left-color: var(--color-accent); }
.why-list li:nth-child(2) { border-left-color: var(--color-info); }
.why-list li:nth-child(3) { border-left-color: var(--color-success); }
.why-list li:nth-child(4) { border-left-color: var(--color-accent); }

.why-list li:hover {
  background: var(--color-surface);
}

/* Numbered badge via ::before pseudo-element */
.why-list li::before {
  content: counter(why-counter);
  position: absolute;
  left: 0;
  top: var(--space-5);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  transition:
    border-color var(--transition),
    color var(--transition);
}

.why-list li:nth-child(1)::before { border-color: var(--color-accent); color: var(--color-accent); }
.why-list li:nth-child(2)::before { border-color: var(--color-info); color: var(--color-info); }
.why-list li:nth-child(3)::before { border-color: var(--color-success); color: var(--color-success); }
.why-list li:nth-child(4)::before { border-color: var(--color-accent); color: var(--color-accent); }

.why-list li strong {
  display: block;
  font-size: var(--fs-lg);
  margin-bottom: var(--space-2);
}

.why-list li p {
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ── YAML Code Block ────────────────────────────────────────────────── */

pre.yaml-code {
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(22, 27, 34, 0.5) 100%);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-6);
  white-space: pre;
  position: relative;
}

/* YAML syntax hint: decorative label badge */
pre.yaml-code::before {
  content: "YAML";
  position: absolute;
  top: 0;
  right: var(--space-4);
  padding: 2px var(--space-3);
  background: var(--color-accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

pre.yaml-code code {
  color: var(--color-text);
}

ul, ol {
  padding-left: var(--space-6);
  margin: var(--space-4) 0;
}

li {
  margin-bottom: var(--space-2);
}

li p {
  margin-top: var(--space-1);
  color: var(--color-text-muted);
}

/* ── Screenshots ───────────────────────────────────────────────────── */

.screenshot {
  margin: var(--space-8) auto;
  max-width: 900px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3),
              0 0 0 1px var(--color-border-muted);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.screenshot:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 32px rgba(240, 136, 62, 0.15),
              0 0 0 1px var(--color-accent);
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot figcaption {
  padding: var(--space-3) var(--space-4);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.screenshot figcaption code {
  font-size: 0.9em;
  background: rgba(240, 136, 62, 0.1);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
}

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

footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(240, 136, 62, 0.05), transparent);
  padding: var(--space-10) var(--space-6) 0;
  margin-top: var(--space-12);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-col h3 {
  margin-top: 0;
  margin-bottom: var(--space-3);
  font-size: var(--fs-lg);
  color: var(--color-text-em);
}

.footer-col p,
.footer-col li {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.footer-col a {
  color: var(--color-text);
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: var(--space-1);
}

.footer-branding {
  text-align: center;
  margin-top: var(--space-8);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border);
}

.footer-logo {
  display: block;
  font-size: 2.5rem;
  opacity: 0.5;
  margin-bottom: var(--space-3);
  transition: opacity var(--transition);
}

.footer-logo:hover {
  opacity: 0.8;
}

.footer-built {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* ── Print Styles ──────────────────────────────────────────────────── */

/* ── JS Progressive Enhancement Styles ─────────────────────────────── */

/* Section reveal animations (Intersection Observer) */
.section-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.section-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Active nav link highlighting */
#nav-links a.active,
#nav-links a[aria-current="page"] {
  color: var(--color-accent);
  background: rgba(240, 136, 62, 0.1);
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
  opacity: 0;
  transition:
    opacity var(--transition),
    color var(--transition),
    border-color var(--transition),
    background var(--transition);
}

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

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

.copy-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.copy-btn.copied {
  color: var(--color-success);
  border-color: var(--color-success);
  background: rgba(63, 185, 80, 0.1);
}

/* Copyright footer */
.footer-copyright {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  opacity: 0.7;
}

/* ── Touch Targets — minimum 44x44px ────────────────────────────────── */

/* Nav links — ensure adequate touch target on all screens */
#nav-links a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* CTA button — ensure large touch target */
.cta-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Mobile-specific adjustments (< 768px) ─────────────────────────── */

@media (max-width: 767px) {
  /* Reduce section padding for better information density on mobile */
  :root {
    --section-pad: var(--space-6);
  }

  /* Scale headings down on mobile */
  h1 { font-size: var(--fs-3xl); }    /* 2rem from 2.5rem */
  h2 { font-size: var(--fs-2xl); }    /* 1.5rem from 2rem */
  h3 { font-size: var(--fs-xl); }     /* 1.25rem from 1.5rem */

  /* Hero section tighter on mobile */
  #hero {
    padding: var(--space-8) 0;
  }

  #hero h1 {
    font-size: var(--fs-2xl);
  }

  .hero-tagline {
    font-size: var(--fs-base);
  }

  /* Hero install command smaller on mobile */
  .hero-install pre {
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-xs);
  }

  .hero-install code {
    font-size: var(--fs-xs);
  }

  /* Reduce gap in feature grid on mobile */
  #features {
    gap: var(--space-4);
  }

  /* Prevent horizontal overflow — constrain any potentially wide elements */
  pre, .table-wrapper, .screenshot, iframe, video, canvas, svg, object, embed {
    max-width: 100%;
  }

  /* Ensure all interactive elements remain tappable without horizontal scroll */
  body {
    overflow-x: hidden;
  }
}

/* Body scroll lock when mobile nav is open */
body.nav-open {
  overflow: hidden;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .section-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

@media print {
  /* Reset all backgrounds, colors, shadows, and animations */
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Hide navigation, interactive elements, and decorative content */
  header,
  nav,
  .skip-link,
  #hero pre,
  .cta-button,
  .copy-btn,
  .nav-toggle-label,
  .hero-install,
  footer .footer-built {
    display: none !important;
  }

  /* Hide CSS pseudo-element decorations */
  #hero::before,
  #hero::after,
  pre.yaml-code::before,
  .hero-install::after {
    display: none !important;
  }

  /* Remove section reveal animations — show all content */
  .section-reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Links: black text, underline, show full URL */
  a {
    color: #000 !important;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555 !important;
  }

  /* Don't show URL for same-page anchor links */
  a[href^="#"]::after {
    content: none;
  }

  /* Headings avoid page breaks */
  h1, h2, h3 {
    page-break-after: avoid;
  }

  /* Code blocks: clean borders, no dark backgrounds */
  pre, code {
    border: 1px solid #ccc;
    font-size: 0.9em;
    background: none !important;
  }

  pre {
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* Tables: clean borders */
  table {
    border-collapse: collapse;
  }

  th, td {
    border: 1px solid #ccc;
  }

  /* Remove table wrapper scroll shadows */
  .table-wrapper {
    background: none !important;
    overflow-x: visible;
  }

  /* Sections: no borders, avoid page breaks inside */
  section {
    border: none;
    page-break-inside: avoid;
    padding: 1em 0;
  }

  /* Main content: full width, no padding */
  main {
    max-width: 100%;
    padding: 0;
  }

  /* Footer: clean borders */
  footer {
    border: none;
    padding: 1em 0;
  }

  .footer-grid {
    display: block;
  }

  .footer-grid > div {
    margin-bottom: 1em;
  }

  /* Screenshots: clean borders, full width, no shadows */
  .screenshot {
    max-width: 100%;
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .screenshot img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  .screenshot figcaption {
    background: #f5f5f5;
    color: #333 !important;
    border: none;
  }

  /* Hide YAML decorative badge */
  pre.yaml-code {
    border-left: 1px solid #ccc;
  }

  /* Feature cards = stack vertically */
  #features article {
    border: 1px solid #ccc;
    background: none !important;
    margin-bottom: 0.5em;
  }

  /* Architecture flow = stack vertically */
  .arch-arrow {
    display: none;
  }

  .arch-step {
    border: 1px solid #ccc;
    background: none !important;
    margin-bottom: 0.5em;
    max-width: none;
  }

  /* Why-list items: clean borders */
  .why-list li {
    border-left: 1px solid #ccc;
    border-image: none;
  }

  /* Remove card hover effects */
  #features article:hover,
  .arch-step:hover,
  .install-column:hover,
  .screenshot:hover {
    transform: none;
    box-shadow: none;
    border-color: #ccc;
  }
}

/* ── Responsive Breakpoints ─────────────────────────────────────────── */

/* Tablet (768px+) */
@media (min-width: 768px) {
  #features {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Restore desktop section padding */
  :root {
    --section-pad: var(--space-10);
  }

  /* Restore heading sizes */
  h1 { font-size: var(--fs-4xl); }
  h2 { font-size: var(--fs-3xl); }
  h3 { font-size: var(--fs-2xl); }

  /* Restore hero heading size */
  #hero h1 {
    font-size: var(--fs-4xl);
  }

  .hero-tagline {
    font-size: var(--fs-lg);
  }

  /* Restore install command size */
  .hero-install pre {
    padding: var(--space-4) var(--space-6);
  }

  .hero-install code {
    font-size: var(--fs-sm);
  }
}

/* Desktop (1024px+) — 4-column feature grid, larger type refinements */
@media (min-width: 1024px) {
  #features {
    grid-template-columns: repeat(4, 1fr);
  }

  #features h2 {
    grid-column: 1 / -1;
  }

  /* Slightly larger section padding on desktop */
  :root {
    --section-pad: var(--space-12);
  }
}

/* Large desktop (1440px+) */
@media (min-width: 1440px) {
  /* Slightly more generous spacing and sizing */
  :root {
    --section-pad: var(--space-12);
  }

  html {
    font-size: 105%;  /* Slightly larger base font for big screens */
  }
}
