/* Tandem Collective site. Tokens follow the Tandem style guide
   (tandem/docs/design/brand/style-guide.md); dark is the primary theme. */

:root {
  color-scheme: dark;
  --bg: #0a0a0a; --surface: #121212; --surface-raised: #1c1c1c; --hover: #1a1a1a;
  --border: #262626; --text: #f2f2f2; --text-muted: #a3a3a3;
  --accent: #94ff94; --accent-hover: #a9ffa9; --accent-fg: #0a0a0a;
  --mark: #94ff94;
  --success: #5ce08a; --warning: #f5b84b;
  --glow: rgb(148 255 148 / 0.16);
  --shadow: 0 4px 12px rgb(0 0 0 / 0.5);

  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* Light theme: system preference unless the visitor picked dark, or an explicit pick. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #ffffff; --surface: #ffffff; --surface-raised: #f5f7f5; --hover: #eef2ee;
    --border: #e1e5e1; --text: #121212; --text-muted: #5b645b;
    --accent: #167a31; --accent-hover: #115f26; --accent-fg: #ffffff;
    --mark: #167a31;
    --success: #167a31; --warning: #9a6100;
    --glow: rgb(22 122 49 / 0.10);
    --shadow: 0 4px 12px rgb(0 0 0 / 0.08);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --surface-raised: #f5f7f5; --hover: #eef2ee;
  --border: #e1e5e1; --text: #121212; --text-muted: #5b645b;
  --accent: #167a31; --accent-hover: #115f26; --accent-fg: #ffffff;
  --mark: #167a31;
  --success: #167a31; --warning: #9a6100;
  --glow: rgb(22 122 49 / 0.10);
  --shadow: 0 4px 12px rgb(0 0 0 / 0.08);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
::selection { background: var(--accent); color: var(--accent-fg); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--text-muted); }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--accent); color: var(--accent-fg);
  padding: 8px 14px; border-radius: var(--radius-md); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: var(--radius-md); border: 1px solid transparent;
  font: 600 0.9375rem/1 var(--font-sans);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-fg); }
.btn-quiet { color: var(--text); border-color: var(--border); background: transparent; }
.btn-quiet:hover { background: var(--hover); color: var(--text); }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font: 600 1.25rem/1 var(--font-display); letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }
.mark {
  width: 30px; height: 30px; flex: none;
  background: var(--mark);
  -webkit-mask: url("/assets/mark.svg") center / contain no-repeat;
  mask: url("/assets/mark.svg") center / contain no-repeat;
}
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.site-nav .nav-link { color: var(--text-muted); text-decoration: none; padding: 8px 10px; font-size: 0.9375rem; }
.site-nav .nav-link:hover { color: var(--text); }
.theme-toggle {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--hover); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle[aria-pressed="true"] .icon-sun { display: block; }
.theme-toggle[aria-pressed="true"] .icon-moon { display: none; }
@media (max-width: 640px) {
  .site-nav .nav-link { display: none; }
  .site-nav .btn { padding-inline: 14px; }
}

/* Hero */
.hero { padding-block: clamp(48px, 9vw, 112px) clamp(56px, 8vw, 104px); }
.hero .wrap {
  display: grid; gap: clamp(40px, 6vw, 72px);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
@media (min-width: 960px) {
  .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem); font-weight: 700; letter-spacing: -0.035em; }
.hero .lede { margin-top: 24px; max-width: 34em; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); color: var(--text-muted); }
.hero .actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero .fine { margin-top: 20px; font-size: 0.875rem; color: var(--text-muted); }

/* Build sheet: the hero's example campaign build */
.sheet {
  position: relative;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sheet::before {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}
.sheet-head {
  position: relative;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.sheet-title { font: 600 1rem/1.3 var(--font-display); }
.sheet-sub { font-size: 0.8125rem; color: var(--text-muted); }
.sheet ol { list-style: none; margin: 0; padding: 0; position: relative; }
.sheet li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.sheet .name {
  font: 500 0.8125rem/1.4 var(--font-mono);
  overflow-wrap: anywhere;
}
.sheet .detail { grid-column: 1; font-size: 0.8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.status {
  grid-row: 1 / span 2; grid-column: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: var(--radius-sm);
  background: var(--surface-raised); border: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  color: var(--warning);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sheet li[data-state="planned"] .status { color: var(--text-muted); }
.sheet li[data-state="creating"] .status { color: var(--text); }
.sheet li[data-state="creating"] .status::before { animation: pulse 0.7s ease-in-out infinite alternate; }
@media (max-width: 480px) {
  .sheet li { grid-template-columns: minmax(0, 1fr); }
  .status { grid-row: auto; grid-column: 1; justify-self: start; margin-top: 4px; }
}
.sheet-foot { position: relative; padding: 16px 20px 18px; display: grid; gap: 10px; }
.progress { height: 4px; border-radius: 2px; background: var(--surface-raised); overflow: hidden; }
.progress span { display: block; height: 100%; width: var(--done, 100%); background: var(--accent); transition: width 0.4s ease; }
.sheet-note { font-size: 0.8125rem; color: var(--text-muted); }
.sheet-note strong { color: var(--success); font-weight: 600; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.25; } }

/* Sections */
.section { padding-block: clamp(64px, 9vw, 112px); border-top: 1px solid var(--border); }
.section-head { max-width: 40rem; }
.section-head h2 { font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem); }
.section-head p { margin-top: 16px; color: var(--text-muted); max-width: 36em; }

/* Organization tree */
.org { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) { .org { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; } }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 11px; padding-left: 20px; border-left: 1px solid var(--border); }
.tree li { padding-top: 12px; }
.tree > li { padding-top: 0; }
.node { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.node .kind { font-size: 0.8125rem; color: var(--text-muted); min-width: 5.5em; }
.node .label { font-weight: 600; }
.node .label.id { font: 500 0.8125rem/1.4 var(--font-mono); font-weight: 500; overflow-wrap: anywhere; }
.org-notes { display: grid; gap: 20px; }
.org-notes p { max-width: 34em; }
.org-notes p + p { color: var(--text-muted); }

/* Features: mixed widths, not a grid of equal cards */
.features { margin-top: clamp(40px, 6vw, 64px); display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .features { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .f-dashboard { grid-column: span 7; }
  .f-reports { grid-column: span 5; }
  .f-builds { grid-column: span 12; }
  .f-logins { grid-column: span 12; }
}
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.panel h3 { font-size: 1.375rem; }
.panel > p { color: var(--text-muted); max-width: 36em; }
.demo-box { margin-top: auto; padding-top: 10px; }

/* Mini dashboard table */
.mini-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.mini-table caption { text-align: left; font-size: 0.8125rem; color: var(--text-muted); padding-bottom: 8px; }
.mini-table th, .mini-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: right; }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; padding-left: 0; }
.mini-table th:last-child, .mini-table td:last-child { padding-right: 0; }
.mini-table thead th { font-weight: 500; color: var(--text-muted); font-size: 0.8125rem; }
.mini-table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 480px) { .mini-table .hide-sm { display: none; } }

/* Spend report snippet */
.report { background: var(--surface-raised); border-radius: var(--radius-md); padding: 18px; display: grid; gap: 14px; }
.report-title { font-weight: 600; font-size: 0.9375rem; }
.report dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.report dt { color: var(--text-muted); }
.report dd { margin: 0; text-align: right; font-weight: 600; }
.meter { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.meter span { display: block; height: 100%; width: 70%; background: var(--accent); }

/* Build steps: a real sequence, so numbered */
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.steps li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-content: start; }
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border);
  font: 600 0.8125rem/1 var(--font-display); color: var(--text);
}
.steps li:last-child::before { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.steps strong { font-weight: 600; }
.steps span { color: var(--text-muted); font-size: 0.9375rem; }
.f-builds .closing { color: var(--text); font-weight: 500; }

.f-logins { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.f-logins > div { display: grid; gap: 8px; max-width: 40em; }
.f-logins p { color: var(--text-muted); }
.login-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--surface-raised); border: 1px solid var(--border);
  font-size: 0.875rem;
}
.login-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--border); font: 600 0.75rem/1 var(--font-display);
}

/* CTA band */
.cta { padding-block: clamp(64px, 9vw, 112px); }
.cta-panel {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(32px, 6vw, 72px);
  display: grid; gap: 24px; justify-items: start;
}
.cta-panel::before {
  content: ""; position: absolute; inset: auto auto -60% -10%; width: 80%; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}
.cta-panel > * { position: relative; }
.cta-panel h2 { font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem); max-width: 16em; }
.cta-panel p { color: var(--text-muted); max-width: 34em; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 40px; font-size: 0.875rem; color: var(--text-muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; }
.footer-id { display: grid; gap: 4px; }
.footer-id strong { color: var(--text); font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.footer-links a, .footer-id a { color: var(--text-muted); }
.footer-links a:hover, .footer-id a:hover { color: var(--text); }
.footer-links a[aria-current="page"] { color: var(--text); }

/* Legal pages */
.legal { padding-block: clamp(48px, 7vw, 88px) clamp(64px, 9vw, 112px); }
.legal .wrap { max-width: calc(44rem + 2 * var(--gutter)); }
.legal h1 { font-size: clamp(2.125rem, 1.6rem + 2vw, 3rem); font-weight: 700; letter-spacing: -0.03em; }
.legal .updated { margin-top: 12px; color: var(--text-muted); font-size: 0.9375rem; }
.legal h2 { font-size: 1.375rem; margin-top: 44px; }
.legal p, .legal ul, .legal ol { margin-top: 14px; max-width: 68ch; }
.legal ul, .legal ol { padding-left: 1.4em; }
.legal li + li { margin-top: 8px; }
.legal ol.steps-list > li::marker { font-family: var(--font-display); font-weight: 600; color: var(--accent); }
.legal .intro { margin-top: 28px; font-size: 1.125rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
