/* ============================================================
   Helveticore — stylesheet
   Lightweight static site, no framework. "Swiss minimal" design:
   system typography, strict grid, red accent, dark mode.
   ============================================================ */

:root {
  --bg: #f6f5f2;
  --bg-raised: #ffffff;
  --ink: #14161a;
  --ink-soft: #555b64;
  --ink-faint: #7c828c;
  --line: #e3e1da;
  --line-strong: #c9c6bd;
  --accent: #cf2e24;
  --accent-ink: #ffffff;
  --accent-soft: #f7e4e1;
  --teal: #0e6f66;
  --teal-soft: #e2f1ef;
  --amber: #9a6a00;
  --amber-soft: #f6ecd8;
  --code-bg: #16181d;
  --code-ink: #e8e6e1;
  --code-accent: #ff8a80;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.05), 0 8px 24px -12px rgba(20, 22, 26, 0.18);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0d1014;
  --bg-raised: #16191f;
  --ink: #ece9e3;
  --ink-soft: #a6abb4;
  --ink-faint: #7a808a;
  --line: #23272e;
  --line-strong: #333841;
  --accent: #ff5a4e;
  --accent-ink: #1a0c0a;
  --accent-soft: #2a1715;
  --teal: #4cc7bb;
  --teal-soft: #12231f;
  --amber: #e7b84b;
  --amber-soft: #241d10;
  --code-bg: #0a0c0f;
  --code-ink: #e8e6e1;
  --code-accent: #ff8a80;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -14px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1014;
    --bg-raised: #16191f;
    --ink: #ece9e3;
    --ink-soft: #a6abb4;
    --ink-faint: #7a808a;
    --line: #23272e;
    --line-strong: #333841;
    --accent: #ff5a4e;
    --accent-ink: #1a0c0a;
    --accent-soft: #2a1715;
    --teal: #4cc7bb;
    --teal-soft: #12231f;
    --amber: #e7b84b;
    --amber-soft: #241d10;
    --code-bg: #0a0c0f;
    --code-ink: #e8e6e1;
    --code-accent: #ff8a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -14px rgba(0, 0, 0, 0.55);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  flex-wrap: wrap;
}

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

.brand-mark {
  font-size: 18px;
  color: var(--accent);
  transform: translateY(2px);
}

.brand-name {
  font-weight: 750;
  letter-spacing: 0.02em;
  font-size: 1.06rem;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
}

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

.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 12px;
  cursor: pointer;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
}

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

.nav-toggle-icon::before {
  top: -5px;
}

.nav-toggle-icon::after {
  top: 5px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-soft);
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--bg-raised);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

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

[data-theme="dark"] .theme-toggle .icon-sun,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 750;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 68ch;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.muted {
  color: var(--ink-soft);
}

.faint {
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/* ---------- Sections ---------- */
.section {
  padding: 72px 0;
}

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

.section-head {
  max-width: 76ch;
  margin-bottom: 36px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 64px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  background: var(--bg-raised);
  padding: 22px 20px;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 650;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn-primary:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.btn-ghost {
  background: var(--bg-raised);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  text-decoration: none;
  border-color: var(--ink-faint);
}

/* ---------- Card grid ---------- */
.grid {
  display: grid;
  gap: 20px;
}

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

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

.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
}

.card .kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}

.card-link {
  display: block;
  color: inherit;
}

.card-link:hover {
  text-decoration: none;
}

.card-link:hover h3 {
  color: var(--accent);
}

.card .arrow {
  font-weight: 700;
  color: var(--accent);
  margin-left: 4px;
}

/* ---------- Badges / pills ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--bg);
  white-space: nowrap;
}

.tag-red {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
}

.tag-teal {
  color: var(--teal);
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
  background: var(--teal-soft);
}

.tag-amber {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 40%, var(--line));
  background: var(--amber-soft);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 6px 14px;
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-design {
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line));
}

.status-init {
  color: var(--ink-soft);
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
}

/* ---------- KPI blocks ---------- */
.kpi-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi {
  background: var(--bg-raised);
  padding: 28px 26px;
}

.kpi-value {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.kpi-value em {
  font-style: normal;
  color: var(--accent);
}

.kpi-label {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- Lists ---------- */
.clean-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.clean-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.clean-list li:last-child {
  border-bottom: 0;
}

.clean-list strong {
  color: var(--ink);
}

/* ---------- Flow (pipeline) ---------- */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.flow-step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 0;
}

.flow-step .fs-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
}

.flow-step .fs-note {
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.flow-arrow {
  align-self: center;
  color: var(--ink-faint);
  font-weight: 700;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--bg);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

td code, th code {
  font-family: var(--font-mono);
  font-size: 0.84em;
}

/* ---------- Code ---------- */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  padding: 1px 6px;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

pre .hl {
  color: var(--code-accent);
}

/* ---------- Definition / decisions ---------- */
.decision {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 0 0 28px;
}

.decision .d-title {
  font-weight: 700;
  margin: 0 0 6px;
}

.decision dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 4px 16px;
  margin: 8px 0 0;
  font-size: 0.92rem;
}

.decision dt {
  color: var(--ink-faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 2px;
}

.decision dd {
  margin: 0;
}

.verdict {
  font-weight: 750;
  letter-spacing: 0.02em;
}

.verdict-build {
  color: var(--accent);
}

.verdict-reuse {
  color: var(--teal);
}

/* ---------- Call-to-action / note ---------- */
.note {
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line));
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--ink);
}

.note strong {
  color: var(--amber);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  margin-top: 64px;
  background: var(--bg-raised);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}

.footer-col h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

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

.footer-col li {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

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

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

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

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

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

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

  .kpi-banner {
    grid-template-columns: 1fr;
  }

  .decision dl {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
  }

  .site-nav a {
    padding: 12px 8px;
    font-size: 1rem;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

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

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

  .section {
    padding: 52px 0;
  }

  .hero {
    padding: 56px 0 44px;
  }
}

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}
