/* Shared foundation for every Infinite Stack idea site.
   Each product sets its own tokens in /<product>/theme.css. */

:root {
  --bg: #fbf8f4;
  --surface: #ffffff;
  --surface-2: #f5f1eb;
  --ink: #111a2e;
  --ink-2: #4b5468;
  --muted: #8a909c;
  --line: #ede8e1;
  --line-strong: #ddd6cc;
  --accent: #14203a;
  --accent-hover: #0b1427;
  --accent-ink: #ffffff;
  --tone-1: #2f7d4f;   /* green: expansion, resolved */
  --tone-2: #b7791f;   /* amber: watching */
  --tone-3: #c4513d;   /* red: worth checking in */
  --tone-4: #3563a8;   /* blue: patterns, investigating */
  --tone-1-soft: #e5f3e9;
  --tone-2-soft: #fbf0dc;
  --tone-3-soft: #fce7e2;
  --tone-4-soft: #e7eefa;

  --font-display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Inter', system-ui, sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(17, 26, 46, .04), 0 1px 3px rgba(17, 26, 46, .04);
  --shadow: 0 1px 2px rgba(17, 26, 46, .04), 0 10px 30px -12px rgba(17, 26, 46, .14);
  --shadow-lg: 0 2px 6px rgba(17, 26, 46, .04), 0 30px 60px -24px rgba(17, 26, 46, .22);
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--tone-2-soft); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em; line-height: 1.06; margin: 0; }
h1 { font-size: clamp(40px, 5.6vw, 66px); letter-spacing: -.04em; }
h2 { font-size: clamp(30px, 3.8vw, 46px); }
h3 { font-size: 20px; letter-spacing: -.02em; line-height: 1.25; font-weight: 650; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12.5px/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.lede { font-size: clamp(18px, 1.6vw, 20px); color: var(--ink-2); line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 26px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 16px; line-height: 1; text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-2); }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
:focus-visible { outline: 2px solid var(--tone-4); outline-offset: 3px; border-radius: 6px; }

/* ---------- nav ---------- */
.site-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-nav.scrolled { border-bottom-color: var(--line); }
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 750 26px/1 var(--font-display); letter-spacing: -.04em; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--ink-2); }
.nav-links a:not(.btn):hover { color: var(--ink); }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* ---------- sections ---------- */
section { padding: clamp(72px, 10vw, 128px) 0; }
.section-head { max-width: 680px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { margin: 14px 0 16px; }
.alt { background: var(--surface-2); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 550; line-height: 1.3; white-space: nowrap;
}
.tag-1 { background: var(--tone-1-soft); color: var(--tone-1); }
.tag-2 { background: var(--tone-2-soft); color: color-mix(in srgb, var(--tone-2) 80%, #000); }
.tag-3 { background: var(--tone-3-soft); color: var(--tone-3); }
.tag-4 { background: var(--tone-4-soft); color: color-mix(in srgb, var(--tone-4) 80%, #000); }
.tag-plain { background: var(--surface-2); color: var(--ink-2); }

/* ---------- forms ---------- */
.field { display: grid; gap: 8px; }
.field label, .field legend { font-weight: 600; font-size: 15px; padding: 0; }
.field .hint { font-size: 13.5px; color: var(--muted); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%234a5465' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--tone-4); box-shadow: 0 0 0 4px var(--tone-4-soft); }
.input[aria-invalid="true"] { border-color: var(--tone-3); }
.field-error { color: var(--tone-3); font-size: 14px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.segmented { justify-self: start; display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 999px; gap: 4px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 8px 20px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 15px; color: var(--ink-2); transition: background .15s, color .15s; }
.segmented input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + label { outline: 2px solid var(--tone-4); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */
.site-footer { padding: 40px 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; gap: 22px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- legal / simple pages ---------- */
.prose { max-width: 720px; }
.prose h1 { font-size: clamp(36px, 5vw, 52px); margin: 14px 0 12px; }
.prose h2 { font-size: 26px; margin: 40px 0 12px; }
.prose p, .prose li { color: var(--ink-2); margin-bottom: 12px; }
.prose ul { padding-left: 20px; }
