/* Kevin Forestell — site shell
   Builds on tokens.css. Page-level chrome, layout primitives, utilities.
*/

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-1);
  color: var(--fg-1);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- Accent override (Tweaks) ---------- */
:root {
  --accent: var(--kf-forest);
  --accent-deep: var(--kf-forest-deep);
  --accent-soft: var(--kf-moss-wash);
  --accent-mid: var(--kf-moss);
}
:root[data-accent="navy"] {
  --accent: #1F2E3D;
  --accent-deep: #15212C;
  --accent-soft: #E4EAF0;
  --accent-mid: #93A8BD;
}
:root[data-accent="ochre"] {
  --accent: #8A5A1F;
  --accent-deep: #6E4716;
  --accent-soft: #F1E6D2;
  --accent-mid: #C5A067;
}
:root[data-accent="ink"] {
  --accent: #1C1C1A;
  --accent-deep: #000000;
  --accent-soft: #ECE7DC;
  --accent-mid: #6B6357;
}

/* ---------- Containers ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.container-narrow {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 16px;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}
.nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 9px 9px 9px 18px;
  background: rgba(251, 249, 244, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 1100px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg-1);
}
.nav-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.nav-brand-name {
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 26px;
  font-size: 13px;
}
.nav-links a {
  color: var(--fg-3);
  text-decoration: none;
  transition: color var(--dur-2) var(--ease-standard);
  padding: 6px 0;
}
.nav-links a:hover { color: var(--fg-1); }
.nav-links a.active { color: var(--fg-1); font-weight: 500; }

.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  background: none; border: none; padding: 6px 0; cursor: pointer;
  color: var(--fg-3); font: inherit; font-size: 13px; transition: color 200ms var(--ease-standard);
  display: inline-flex; align-items: center;
}
.nav-dropdown-trigger:hover, .nav-dropdown-trigger.active { color: var(--fg-1); }
.nav-dropdown-trigger.active { font-weight: 500; }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(-4px);
  background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--r-md);
  box-shadow: var(--shadow-md); padding: 8px; min-width: 320px;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; pointer-events: none; transition: all 220ms var(--ease-standard); z-index: 100;
}
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  padding: 12px 14px; border-radius: var(--r-sm); text-decoration: none; color: var(--fg-1);
  transition: background 160ms var(--ease-standard);
}
.nav-dropdown-menu a:hover { background: var(--bg-3); }
.nav-dd-num { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.04em; }
.nav-dd-name { display: block; font-size: 14px; font-weight: 500; line-height: 1.3; }
.nav-dd-desc { display: block; font-size: 12px; color: var(--fg-3); margin-top: 2px; }

.nav-cta {
  background: var(--accent);
  color: var(--kf-ivory);
  padding: 9px 16px 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-2) var(--ease-standard);
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent-deep); }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-inner { gap: 12px; padding: 8px 8px 8px 14px; }
  .nav-cta { padding: 8px 12px; font-size: 12px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-2) var(--ease-standard);
  font-family: inherit;
}
.btn-primary {
  background: var(--accent);
  color: var(--kf-ivory);
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-secondary {
  background: var(--bg-2);
  color: var(--fg-1);
  border-color: var(--border-1);
}
.btn-secondary:hover { background: var(--bg-3); border-color: var(--kf-dune); }
.btn-ghost {
  background: transparent;
  color: var(--fg-1);
  padding: 12px 0;
}
.btn-ghost:hover { color: var(--accent); }

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Sections ---------- */
.section {
  padding: 96px 0;
}
.section-tight { padding: 64px 0; }
.section-loose { padding: 128px 0; }

@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .section-tight { padding: 48px 0; }
  .section-loose { padding: 80px 0; }
}

/* ---------- Display type ---------- */
.display-xl {
  font-weight: 300;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--fg-1);
  margin: 0;
}
.display-lg {
  font-weight: 300;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--fg-1);
  margin: 0;
}
.display-md {
  font-weight: 300;
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--fg-1);
  margin: 0;
}
.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg-2);
  font-weight: 400;
  margin: 0;
}
.lead-lg {
  font-size: 22px;
  line-height: 1.5;
  color: var(--fg-2);
  font-weight: 300;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 24px;
  transition: border-color var(--dur-2) var(--ease-standard), box-shadow var(--dur-2) var(--ease-standard);
}
.card:hover {
  border-color: var(--kf-dune);
  box-shadow: var(--shadow-sm);
}
.card-dark {
  background: var(--accent);
  color: var(--kf-ivory);
  border-color: transparent;
}
.card-dark .eyebrow { color: rgba(255,254,251,0.6); }
.card-dark .eyebrow-dot { background: var(--kf-moss); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-1);
  background: var(--bg-1);
  padding: 64px 0 40px;
  margin-top: 64px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-col h4 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 16px;
}
.footer-col a {
  display: block;
  color: var(--fg-2);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
  transition: color var(--dur-2) var(--ease-standard);
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border-2);
  font-size: 12px;
  color: var(--fg-3);
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ---------- Pill ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  font-size: 12px;
  color: var(--fg-2);
  font-weight: 500;
}

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: var(--border-2);
  border: 0;
  margin: 0;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 500ms var(--ease-standard) both; }
.fade-up-1 { animation-delay: 0ms; }
.fade-up-2 { animation-delay: 80ms; }
.fade-up-3 { animation-delay: 160ms; }
.fade-up-4 { animation-delay: 240ms; }
.fade-up-5 { animation-delay: 320ms; }

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Density (Tweak) ---------- */
:root[data-density="compact"] .section { padding: 64px 0; }
:root[data-density="compact"] .section-loose { padding: 80px 0; }
:root[data-density="comfy"] .section { padding: 128px 0; }
:root[data-density="comfy"] .section-loose { padding: 160px 0; }
