/* =====================================================================
   Agents & Skills: Design System (base)
   Light, Apple-inspired. Monochrome palette; color reserved strictly for
   success + deliberate emphasis. No decorative color.
   ===================================================================== */

/* ---- Fonts (vendored, offline) ------------------------------------- */
@font-face {
  font-family: "InterVar";
  src: url("../../vendor/fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "MonoVar";
  src: url("../../vendor/fonts/mono-variable.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
  font-style: normal;
}

/* ---- Design tokens ------------------------------------------------- */
:root {
  /* Type families: SF on Apple devices, Inter everywhere else */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "InterVar", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "MonoVar", ui-monospace, "Menlo", "Consolas", monospace;

  /* Neutrals (the whole palette, essentially) */
  --bg: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-sink: #fafafc;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #515154;
  --text-3: #86868b;
  --line: #d2d2d7;
  --line-soft: rgba(0, 0, 0, 0.08);

  /* Color: used ONLY for success + emphasis */
  --accent: #bf5a3c;          /* warm terracotta, emphasis only */
  --accent-soft: rgba(191, 90, 60, 0.10);
  --success: #1d7a4d;         /* correct / success only */
  --success-soft: rgba(29, 122, 77, 0.10);
  --danger: #9a3412;          /* wrong answer / anti-pattern marker */
  --danger-soft: rgba(154, 52, 18, 0.08);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-emph: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
  --dur-1: 0.18s;
  --dur-2: 0.34s;
  --dur-3: 0.6s;

  /* Rhythm */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px; --sp-10: 160px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-sm: 9px;

  --maxw: 1120px;
  --readw: 720px;
  --nav-h: 52px;
}

/* ---- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--accent-soft); }

/* ---- Typography ---------------------------------------------------- */
.display {
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  font-weight: 680;
}
h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.06; letter-spacing: -0.025em; font-weight: 660; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 640; }
h3 { font-size: 1.28rem; line-height: 1.25; letter-spacing: -0.012em; font-weight: 620; }
h4 { font-size: 1.02rem; letter-spacing: -0.005em; font-weight: 620; }
p  { color: var(--text-2); }
.lead { font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.5; color: var(--text-2); letter-spacing: -0.01em; }
.eyebrow {
  font-size: 0.72rem; font-weight: 620; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow.accent { color: var(--accent); }
strong, b { font-weight: 620; color: var(--text); }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--bg-subtle);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  font-size: 0.86em;
  color: var(--text);
  border: 1px solid var(--line-soft);
}
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }

/* ---- Layout primitives -------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }
.read { max-width: var(--readw); }
.section { padding-block: clamp(64px, 12vw, 150px); }
.stack > * + * { margin-top: var(--sp-4); }
.center { text-align: center; }
.muted { color: var(--text-3); }

/* ---- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 980px;
  font-size: 0.98rem; font-weight: 560; letter-spacing: -0.01em;
  background: var(--text); color: #fff;
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-1) var(--ease-out), background var(--dur-1);
  will-change: transform;
}
.btn:hover { transform: translateY(-1px); opacity: 0.9; }
.btn:active { transform: translateY(0); }
.btn--ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line);
}
.btn--ghost:hover { background: var(--bg-subtle); opacity: 1; }
.btn .arrow { transition: transform var(--dur-1) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Glass nav ----------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease-out), background var(--dur-2);
}
.nav.is-scrolled { border-bottom-color: var(--line-soft); }
.nav__inner { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; font-size: 0.98rem; }
.nav__brand .glyph { width: 22px; height: 22px; flex: none; }
.nav__links { display: flex; gap: clamp(14px, 2.4vw, 30px); align-items: center; }
.nav__links a { font-size: 0.86rem; color: var(--text-2); transition: color var(--dur-1); }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--text); }
@media (max-width: 720px) { .nav__links a:not(.nav__cta) { display: none; } }
.nav__cta { font-weight: 560; color: var(--accent) !important; }

/* ---- Brand glyph (four primitives, monochrome) --------------------- */
.glyph rect, .glyph circle, .glyph path { stroke: currentColor; }

/* ---- Lucide icons: match the house 1.5 line weight ---------------- */
svg.lucide { stroke-width: 1.5; }

/* ---- Footer -------------------------------------------------------- */
.footer { border-top: 1px solid var(--line-soft); background: var(--bg-sink); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between;
  padding-block: 40px; color: var(--text-3); font-size: 0.84rem; }
.footer a:hover { color: var(--text); }

/* ---- Reveal-on-scroll (JS + CSS fallback) -------------------------- */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-in { opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }

/* ---- Focus (accessibility) ---------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---- Reduced motion ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
