/* Reset, named text styles, buttons, navigation, motion primitives */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--s-900); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
em, i { font-style: normal; }

::selection { background: var(--brass-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-md);
}

.skip-link {
  position: fixed;
  top: var(--s-200);
  left: var(--s-200);
  z-index: 100;
  padding: var(--s-75) var(--s-100);
  border-radius: var(--r-lg);
  background: var(--forest);
  color: var(--on-forest);
  transform: translateY(-200%);
  transition: transform var(--d-fast) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s-300);
}

/* ---------- Named text styles (B1) ---------- */
.heading-1 { font-size: 60px; line-height: 60px; font-weight: 600; letter-spacing: -0.02em; }
.heading-2 { font-size: 48px; line-height: 48px; font-weight: 600; letter-spacing: -0.02em; }
.heading-3 { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; }
.heading-4 { font-size: 30px; line-height: 36px; font-weight: 600; }
.heading-5 { font-size: 24px; line-height: 32px; font-weight: 600; }
.heading-6 { font-size: 20px; line-height: 28px; font-weight: 600; }
.title-1 { font-size: 20px; line-height: 28px; font-weight: 500; }
.title-2 { font-size: 18px; line-height: 28px; font-weight: 500; }
.title-3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.title-4 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-1 { font-size: 16px; line-height: 24px; font-weight: 600; }
.body-3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-5 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-6 { font-size: 14px; line-height: 20px; font-weight: 400; }
.button-lg { font-size: 18px; line-height: 28px; font-weight: 600; }
.button-md { font-size: 16px; line-height: 24px; font-weight: 600; }
.button-sm { font-size: 14px; line-height: 20px; font-weight: 600; }
.caption-1 { font-size: 14px; line-height: 20px; font-weight: 500; }
.caption-3 { font-size: 12px; line-height: 16px; font-weight: 600; }
.caption-4 { font-size: 12px; line-height: 16px; font-weight: 500; }
.caption-5 { font-size: 12px; line-height: 16px; font-weight: 400; }

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.mono { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Text gradient: the one allowed gradient, on hero text only (B5) */
.text-gradient {
  background: linear-gradient(90deg, var(--heading-from), var(--heading-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons (B2 padding, B9 states) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-75);
  padding: var(--s-75) var(--s-100);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform var(--d-fast) var(--ease),
    background-color var(--d-fast) var(--ease),
    border-color var(--d-fast) var(--ease),
    color var(--d-fast) var(--ease);
}
.btn i { font-size: 18px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--forest); color: var(--on-forest); }
.btn-primary:hover { background: var(--forest-hover); }

.btn-large { padding: var(--s-100) var(--s-300); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); border-color: var(--brass); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-50);
  color: var(--ink-2);
  transition: color var(--d-fast) var(--ease);
}
.link-arrow i { transition: transform var(--d-fast) var(--ease); }
.link-arrow:hover { color: var(--ink); }
.link-arrow:hover i { transform: translateX(4px); }

/* ---------- Floating navigation (B7) ---------- */
.nav {
  position: fixed;
  top: var(--s-200);
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--s-300);
  padding: var(--s-75) var(--s-75) var(--s-75) var(--s-100);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--nav-surface);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  transform: translateX(-50%);
  max-width: calc(100% - var(--s-400));
}

.nav-brand { display: inline-flex; align-items: center; gap: var(--s-75); }
.nav-brand img { width: 32px; height: 32px; border-radius: var(--r-full); }

.nav-links { display: flex; gap: var(--s-50); }
.nav-links a {
  padding: var(--s-75) var(--s-100);
  border-radius: var(--r-full);
  color: var(--ink-2);
  transition: color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a[aria-current="true"] { color: var(--ink); background: var(--brass-soft); }

.nav-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 2px;
  border-radius: var(--r-full);
  background: currentColor;
  transition: transform var(--d-base) var(--ease);
}
.nav-toggle span:first-child { transform: translateY(-3px); }
.nav-toggle span:last-child { transform: translateY(3px); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

.mobile-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-200);
  padding: var(--s-900) var(--s-400) var(--s-600);
  background: var(--panel-surface);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--d-fast) var(--ease), visibility 0s linear var(--d-fast);
}
.mobile-panel.is-open { opacity: 1; visibility: visible; transition: opacity var(--d-fast) var(--ease); }
.mobile-panel a {
  opacity: 0;
  transform: translateY(var(--s-300));
  transition: opacity var(--d-base) var(--ease), transform var(--d-base) var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.mobile-panel.is-open a { opacity: 1; transform: translateY(0); }
.mobile-panel .btn { margin-top: var(--s-300); align-self: flex-start; }

@media (max-width: 860px) {
  .nav-links, .nav .nav-cta { display: none; }
  .nav-toggle { display: inline-block; }
  .nav { gap: var(--s-200); }
}

/* ---------- Scroll reveal (B7) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(var(--s-400));
  transition: opacity var(--d-reveal) var(--ease), transform var(--d-reveal) var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transform: none; transition: opacity var(--d-fast) var(--ease); }
  .mobile-panel a { transform: none; }
  *, *::before, *::after { animation: none !important; }
}
