/* NestForge landing — shared styles. No frameworks, no external assets.
   Fonts: IBM Plex Sans/Mono, self-hosted from assets/fonts/ (SIL OFL 1.1,
   see assets/fonts/LICENSE-OFL.txt). No runtime requests leave this origin. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #d7dfe9;
  --text: #16212f;
  --muted: #55657a;
  --accent: #0c8a6d;
  --accent-contrast: #ffffff;
  --accent-soft: #e0f3ee;
  --warn: #9a6200;
  --warn-soft: #fdf3e0;
  --err: #b3403c;
  --err-soft: #fdeceb;
  --code-bg: #101828;
  --code-text: #d7e3f4;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 8px 24px rgba(15, 27, 45, .07);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #121b2c;
    --surface-2: #182338;
    --border: #253652;
    --text: #e6edf7;
    --muted: #9db0c9;
    --accent: #2fc79f;
    --accent-contrast: #06231b;
    --accent-soft: #10302c;
    --warn: #e8b04b;
    --warn-soft: #2c2312;
    --err: #f08b87;
    --err-soft: #331b1a;
    --code-bg: #0d1626;
    --code-text: #c9d8ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121b2c;
  --surface-2: #182338;
  --border: #253652;
  --text: #e6edf7;
  --muted: #9db0c9;
  --accent: #2fc79f;
  --accent-contrast: #06231b;
  --accent-soft: #10302c;
  --warn: #e8b04b;
  --warn-soft: #2c2312;
  --err: #f08b87;
  --err-soft: #331b1a;
  --code-bg: #0d1626;
  --code-text: #c9d8ec;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #d7dfe9;
  --text: #16212f;
  --muted: #55657a;
  --accent: #0c8a6d;
  --accent-contrast: #ffffff;
  --accent-soft: #e0f3ee;
  --warn: #9a6200;
  --warn-soft: #fdf3e0;
  --err: #b3403c;
  --err-soft: #fdeceb;
  --code-bg: #101828;
  --code-text: #d7e3f4;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 8px 24px rgba(15, 27, 45, .07);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

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

/* Form controls don't inherit fonts by default (the theme toggle's moon glyph
   used to render in the UA font). */
button, input, select, textarea { font: inherit; }

/* Visible keyboard focus everywhere — never removed without replacement. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ≥44px touch targets for small header/footer controls without shifting the
   visual layout: extend the hit area (invisible overlay), not the box. */
.site-nav a, .lang-switch, .theme-toggle, .site-footer a { position: relative; }
.site-nav a::after, .lang-switch::after, .theme-toggle::after, .site-footer a::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
}

code, .mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .92em;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

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

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14.5px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

.lang-switch, .theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13.5px;
  cursor: pointer;
  line-height: 1.4;
}
.lang-switch:hover, .theme-toggle:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- hero ---------- */

.hero { padding: 64px 0 30px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 42px;
  align-items: center;
}

.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 0 0 16px;
  text-wrap: balance;
}

.hero p.lead {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 26px;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15.5px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); }

.cta-note { font-size: 13px; color: var(--muted); width: 100%; margin-top: 2px; }

.hero-shot {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0b1220; /* screenshot is dark; keep frame consistent in both themes */
}
.hero-shot img { width: 100%; }

.shot-caption {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}
.trust-row span::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* ---------- sections ---------- */

section { padding: 58px 0; }
section.alt { background: var(--surface-2); }

h2 {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 0 0 10px;
  text-wrap: balance;
}

.section-intro { color: var(--muted); max-width: 720px; margin: 0 0 30px; font-size: 16.5px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.card h3 { margin: 0 0 8px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* feature columns — quiet list with hairline dividers (workbench, not SaaS cards) */
.feature-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
}
.feature-cols .feature { padding: 22px 26px 4px 0; }
.feature-cols .feature + .feature { border-left: 1px solid var(--border); padding-left: 26px; }
.feature-cols h3 { margin: 0 0 8px; font-size: 20px; }
.feature-cols p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* material-math example box */
.math-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 18px 22px;
  margin-top: 8px;
}
.math-box p { margin: 6px 0; }
.math-box .fine { font-size: 12.5px; color: var(--muted); }

/* proof checks */
.check-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.check-chips span {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13.5px;
  font-weight: 600;
}
.check-chips span::before { content: "✓ "; }

.proof-steps { counter-reset: step; display: grid; gap: 14px; margin: 24px 0 0; padding: 0; list-style: none; }
.proof-steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 16px 58px;
  position: relative;
}
.proof-steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.proof-steps b { display: block; margin-bottom: 2px; }
.proof-steps p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* dirty-DXF error cards */
.err-cards { display: grid; gap: 12px; margin-top: 22px; }
.err-card {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 10px;
  padding: 13px 16px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
  border: 1px solid var(--border);
}
.err-card .tag { font-weight: 700; margin-right: 8px; }
.err-card .tag.err { color: #ff9d99; }
.err-card .tag.warn { color: #f2c76b; }
.err-card .hint { color: #7fd6b8; }

/* arcs section */
.arcs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}
.compare { margin-top: 18px; display: grid; gap: 8px; font-size: 14.5px; }
.compare .row { display: flex; gap: 10px; align-items: baseline; }
.compare .no { color: var(--err); font-weight: 700; }
.compare .yes { color: var(--accent); font-weight: 700; }

/* benchmark */
.bench-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table.bench { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; }
table.bench th, table.bench td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.bench th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.bench tr:last-child td { border-bottom: none; }
table.bench td.num { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
.bench-note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.bench-pending {
  max-width: 680px;
  margin: 6px auto 0;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
}
.bench-pending p { margin: 0; font-size: 14.5px; color: var(--muted); }
.bench-pending strong { color: var(--text); }
.todo-bench {
  display: inline-block;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 6px;
  padding: 0 6px;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* pricing */
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 780px; margin: 0 auto; }
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
}
.price-card.featured { border: 2px solid var(--accent); position: relative; }
.price-card .flag {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 12px;
}
.price-card h3 { margin: 0 0 4px; font-size: 20px; }
.price {
  font-size: 40px;
  font-weight: 700; /* heaviest self-hosted Plex cut; avoids faux-bold synthesis */
  letter-spacing: -.02em;
  margin: 8px 0 2px;
}
.price .was { font-size: 19px; color: var(--muted); text-decoration: line-through; font-weight: 500; margin-left: 8px; }
.price-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.price-card ul { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.price-card li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.price-card .btn { margin-top: auto; text-align: center; }

/* FAQ */
.faq { max-width: 860px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 0 18px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 0;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq details p, .faq details ul, .faq details ol { color: var(--muted); font-size: 14.5px; margin-top: 0; }
.faq .a { padding-bottom: 16px; }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0 44px;
  font-size: 13.5px;
  color: var(--muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer .copyright { margin-right: auto; }

/* ---------- legal pages ---------- */

.legal-main { max-width: 760px; margin: 0 auto; padding: 44px 20px 70px; }
.legal-main h1 { font-size: 30px; }
.legal-main h2 { font-size: 20px; margin-top: 36px; }
.legal-main h3 { font-size: 16.5px; margin-top: 26px; }
.legal-main p, .legal-main li { font-size: 15px; }
.placeholder {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 5px;
  padding: 0 5px;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: .92em;
  white-space: nowrap;
}
.todo-user-banner {
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  color: var(--warn);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  margin: 0 0 28px;
}

/* ---------- motion (opt-in only; still under prefers-reduced-motion) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* 1: hero screenshot settles in on load */
  @keyframes hero-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
  .hero figure .hero-shot { animation: hero-in .65s ease-out both; }

  /* 2: pricing cards lift on hover */
  .price-card { transition: transform .18s ease, box-shadow .18s ease; }
  .price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .hero-grid, .arcs-grid { grid-template-columns: 1fr; gap: 28px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  /* feature columns stack: hairlines rotate from vertical to horizontal */
  .feature-cols { grid-template-columns: 1fr; }
  .feature-cols .feature { padding: 20px 0 18px; }
  .feature-cols .feature + .feature { border-left: none; border-top: 1px solid var(--border); padding-left: 0; }
}

@media (max-width: 640px) {
  section { padding: 44px 0; }
  .grid-2, .grid-3, .price-grid { grid-template-columns: 1fr; }
  /* Anchor nav stays available on phones: brand + toggles in row one,
     horizontally scrollable anchor strip below. */
  .site-header .wrap { flex-wrap: wrap; gap: 10px 12px; padding-top: 8px; }
  .site-nav { display: contents; }
  .lang-switch { margin-left: auto; }
  .nav-links {
    order: 10;
    flex: 1 0 100%;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    margin: -6px -20px 0;
    padding: 0 14px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { flex: 0 0 auto; white-space: nowrap; padding: 4px 8px; }
}
