/* Shared base styles and reusable components across all tools. */

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Optional modular active background slot (populated by tool layer). */

.site-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

main {
  flex: 1;
  position: relative;
  z-index: 1;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  font-weight: 700;
}

h2 {
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  font-weight: 650;
}

h3 {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  font-weight: 600;
}

p {
  color: var(--text-muted);
}

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

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: var(--font-mono);
}

/* Layout primitives */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-7);
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-hero {
  padding-block: var(--space-7) var(--space-8);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  align-items: center;
  gap: var(--space-7);
}

.hero-copy {
  min-width: 0;
}

.hero-subheadline {
  font-size: var(--text-base);
  max-width: 58ch;
}

.hero-media {
  display: flex;
  justify-content: center;
}

.app-screenshot {
  display: block;
  width: 100%;
  max-width: 390px;
  height: auto;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

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

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-weight: 650;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background-color: var(--accent);
  display: inline-block;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
}

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

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

/* Segmented controls (shared theme toggle) */

.segmented {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  gap: 2px;
}

.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button[aria-pressed="true"] {
  background-color: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:hover {
  text-decoration: none;
}

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

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

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

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

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}

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

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background-color: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
  width: fit-content;
}

/* Cards */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-kicker {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
}

.card-title {
  color: var(--text);
}

.card-body {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Command / code block */

.cmd-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: fit-content;
  max-width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 1rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.cmd-text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text);
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.cmd-prompt {
  color: var(--accent);
  user-select: none;
  margin-right: var(--space-2);
}

.cmd-copy {
  appearance: none;
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.cmd-copy:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.cmd-copy[data-copied="true"] {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent);
}

/* Footer */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: var(--space-8);
  border-top: 1px solid var(--border);
  padding-block: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-subtle);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

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

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

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

/* Responsive adjustments */

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .app-screenshot {
    max-width: 360px;
  }
}

@media (max-width: 700px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .site-header-inner {
    flex-wrap: wrap;
    min-height: auto;
    gap: var(--space-2) var(--space-3);
    padding-block: var(--space-2);
  }

  .site-nav {
    gap: var(--space-2) var(--space-3);
  }

  .section,
  .section-hero {
    padding-block: var(--space-6);
  }

  .cmd-block {
    width: 100%;
  }
}
