/* Forgewright — Design System
   ----------------------------
   Tech-leaning. Mono accents. Inter throughout for legibility.
   Primary accent: ember — distinctive against AI-design defaults.
   Slightly cooler neutrals than v1 (less craftsman, more product).
*/

:root {
  /* Brand */
  --ember:        oklch(55% 0.18 32);     /* primary accent */
  --ember-dark:   oklch(42% 0.16 30);     /* hover / pressed */
  --ember-soft:   oklch(92% 0.04 35);     /* highlight backgrounds */

  /* Neutrals — minimal warm tint (chroma 0.004-0.008) */
  --cream:        oklch(98% 0.004 70);    /* page background — near-white */
  --cream-deep:   oklch(95% 0.006 70);    /* cards, surfaces */
  --ink:          oklch(15% 0.005 50);    /* body text — near-black */
  --ink-soft:     oklch(38% 0.006 50);    /* secondary text */
  --ink-muted:    oklch(58% 0.006 50);    /* tertiary / captions */
  --rule:         oklch(88% 0.005 50);    /* borders, hairlines */

  /* Type — Inter for everything, JetBrains Mono for tech accents */
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spatial — geometric scale, base 4px */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* Containers */
  --measure: 64ch;
  --content-w: 1080px;
}

/* Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* Base --- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

/* Type scale — Inter, tightened tracking on display */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--ink);
}
h1 {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  letter-spacing: -0.035em;
  font-weight: 800;
}
h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
h3 {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}
p { max-width: var(--measure); }
p + p { margin-top: var(--s-4); }

a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ember); }
a:hover { color: var(--ember-dark); }

/* Layout --- */
.container {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.section {
  padding: var(--s-9) 0;
}
.section--tight { padding: var(--s-7) 0; }

/* Nav --- */
.nav {
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--rule);
}
.nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-5);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.nav__brand img {
  height: 28px;
  width: auto;
  display: block;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  font-size: 0.9375rem;
  line-height: 1;
}
.nav__links a {
  text-decoration: none;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
}
.nav__links a:hover { color: var(--ink); }
.nav__links .btn {
  padding: 10px 18px;
}

/* Hero --- */
.hero {
  padding: var(--s-10) 0 var(--s-9);
}
.hero__kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ember);
  margin-bottom: var(--s-5);
}
.hero__kicker::before { content: "// "; opacity: 0.6; }
.hero__h1 {
  margin-bottom: var(--s-5);
  max-width: 20ch;
}
.hero__lede {
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
  margin-bottom: var(--s-7);
}

/* Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-6);
  border-radius: 2px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background 120ms ease, transform 80ms ease;
  letter-spacing: -0.005em;
}
.btn--primary {
  background: var(--ember);
  color: var(--cream);
}
.btn--primary:hover {
  background: var(--ember-dark);
  transform: translateY(-1px);
}
.btn--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--secondary:hover { background: var(--ink); color: var(--cream); }

/* Cards --- */
.card {
  background: var(--cream-deep);
  border: 1px solid var(--rule);
  padding: var(--s-6);
  border-radius: 4px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
  margin-top: var(--s-6);
}

/* Flip cards --- */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
  margin-top: var(--s-6);
}
.flip {
  perspective: 1200px;
  min-height: 240px;
  cursor: pointer;
}
.flip__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 240px;
  transition: transform 600ms cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-style: preserve-3d;
}
.flip.is-flipped .flip__inner {
  transform: rotateY(180deg);
}
.flip__front, .flip__back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--cream-deep);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
}
.flip__front h3 {
  margin-bottom: var(--s-3);
}
.flip__front p {
  color: var(--ink-soft);
}
.flip__front::after {
  content: "click to see →";
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ember);
  margin-top: auto;
  align-self: flex-start;
  padding-top: var(--s-4);
  opacity: 0.8;
}
.flip__back {
  transform: rotateY(180deg);
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}
.flip__back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.flip.is-flipped .flip__back {
  cursor: pointer;
}
.flip__back::after {
  content: "← click to flip back";
  position: absolute;
  bottom: var(--s-3);
  right: var(--s-4);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ember);
  background: oklch(98% 0.004 70 / 0.85);
  padding: 4px 8px;
  border-radius: 2px;
  opacity: 0.9;
}

/* Stat blocks --- */
.stat {
  border-left: 2px solid var(--ember);
  padding-left: var(--s-5);
}
.stat__num {
  font-family: var(--font-mono);
  font-size: clamp(2.25rem, 3.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}
.stat__label {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin-top: var(--s-2);
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-6);
  margin: var(--s-7) 0;
}

/* Mechanism list --- */
.mech-list {
  list-style: none;
  display: grid;
  gap: var(--s-6);
  margin-top: var(--s-6);
}
.mech-list li {
  padding-left: var(--s-7);
  position: relative;
}
.mech-list li::before {
  content: counter(mech, decimal-leading-zero);
  counter-increment: mech;
  position: absolute;
  left: 0;
  top: 6px;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ember);
}
.mech-list {
  counter-reset: mech;
}
.mech-list h3 { margin-bottom: var(--s-2); }

/* Section labels --- */
.section__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ember);
  margin-bottom: var(--s-4);
}
.section__label::before { content: "// "; opacity: 0.6; }
.section__lede {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--ink-soft);
  margin-top: var(--s-5);
}

/* Footer --- */
.footer {
  border-top: 1px solid var(--rule);
  padding: var(--s-7) 0;
  margin-top: var(--s-9);
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-4);
}
.footer__links {
  display: flex;
  gap: var(--s-5);
}
.footer__links a {
  text-decoration: none;
  color: var(--ink-muted);
}
.footer__links a:hover { color: var(--ink); }

/* Form (privacy/terms reading pages) --- */
.prose {
  max-width: var(--measure);
}
.prose p, .prose ul, .prose ol {
  margin-bottom: var(--s-5);
}
.prose h2 { margin-top: var(--s-7); margin-bottom: var(--s-4); font-size: 1.5rem; }
.prose h3 { margin-top: var(--s-6); margin-bottom: var(--s-3); font-size: 1.125rem; }
.prose ul, .prose ol { padding-left: var(--s-6); }
.prose li { margin-bottom: var(--s-2); }

/* VSL placeholder --- */
.video-frame {
  background: var(--ink);
  color: var(--cream);
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--s-6) 0;
  position: relative;
  overflow: hidden;
}
.video-frame__placeholder {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: oklch(70% 0.01 60);
  font-variation-settings: "opsz" 24;
}

/* Calendar embed wrapper --- */
.calendar-wrap {
  background: var(--cream-deep);
  border: 1px solid var(--rule);
  border-radius: 6px;
  min-height: 640px;
  margin-top: var(--s-6);
  overflow: hidden;
}

/* Category row (what-we-build) --- */
.cat-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s-7);
  padding: var(--s-9) 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.cat-row:last-child { border-bottom: none; }
.cat-row__num {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--ember);
}
.cat-row__label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-top: var(--s-3);
  margin-bottom: var(--s-4);
}
.cat-row__title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 14ch;
}
.cat-row__items {
  display: grid;
  gap: var(--s-5);
}
.cat-item {
  border-left: 2px solid var(--rule);
  padding: var(--s-3) 0 var(--s-3) var(--s-5);
  transition: border-color 150ms ease;
}
.cat-item:hover {
  border-left-color: var(--ember);
}
.cat-item h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--s-2);
  letter-spacing: -0.01em;
}
.cat-item p {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .cat-row {
    grid-template-columns: 1fr;
    gap: var(--s-5);
    padding: var(--s-7) 0;
  }
  .cat-row__num { font-size: 4rem; }
}

/* Mobile tweaks --- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav__links { display: none; }
  .section { padding: var(--s-7) 0; }
  .hero { padding: var(--s-8) 0 var(--s-7); }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}
