/* ============================================================
   GRAYHOST INNOVATIONS — DESIGN SYSTEM CORE
   main.css — tokens, base, typography, layout, header, footer
   Light-first system. Palette from brand logo: #EB7D29 / #313131
   ============================================================ */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Light surfaces (default) */
  --bg: #fbfaf8;
  --surface: #ffffff;
  --tint: #f4f1ea;
  --line: rgba(24, 22, 18, 0.1);
  --text: #1b1b1e;
  --text-muted: #5b574f;

  /* Dark (reserved: footer, CTA band, dark cards) */
  --ink: #121214;
  --ink-2: #1a1a1e;
  --ink-line: rgba(255, 255, 255, 0.12);
  --ink-text: #eceae4;
  --ink-text-muted: #a5a199;

  /* Brand accent (from logo) */
  --accent: #eb7d29;
  --accent-soft: rgba(235, 125, 41, 0.12);
  --accent-vivid: #eb7d29; /* brand orange, used as-is */
  --accent-deep: #b35309; /* AA-safe accent text on light */
  --charcoal: #313131;

  /* Type — Inter everywhere, per brand direction */
  --font-display: "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Scale (1.25 ratio, fluid at display sizes) */
  --text-xs: 0.8rem;
  --text-sm: 0.9rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5625rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1vw, 1.953rem);
  --text-2xl: clamp(1.85rem, 1.4rem + 1.8vw, 2.441rem);
  --text-3xl: clamp(2.2rem, 1.6rem + 2.6vw, 3.052rem);
  --text-4xl: clamp(2.6rem, 1.8rem + 3.6vw, 3.815rem);
  --text-hero: clamp(2.85rem, 1.4rem + 6.5vw, 6.6rem);

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6.5rem;
  --section-pad: clamp(3rem, 2.4rem + 3.5vw, 5.5rem);

  /* Shape */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(24, 22, 18, 0.05), 0 4px 14px rgba(24, 22, 18, 0.05);
  --shadow-md: 0 6px 28px rgba(24, 22, 18, 0.1);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --header-h: 84px;
  --container: 1320px;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@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;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul[class], ol[class] { list-style: none; padding: 0; }

::selection { background: var(--accent); color: #fff; }

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

/* ---------- Typography ----------
   Matched to the Agrisol type system: light-weight headings,
   tight line-height, negative tracking, muted body copy. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
  color: inherit;
}
/* Dark bands (extensions, CTA, footer) keep light headings for contrast. */
.section--dark, .section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4,
.cta-band, .cta-band h1, .cta-band h2, .cta-band h3, .cta-band h4,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4 { color: var(--ink-text); }
.section--dark h2, .cta-band h2 { color: #fff; }

h1 { font-size: var(--text-hero); font-weight: 400; letter-spacing: -0.045em; }
h2 { font-size: var(--text-3xl); font-weight: 400; letter-spacing: -0.04em; }
h3 { font-size: var(--text-xl); font-weight: 450; letter-spacing: -0.03em; }
h4 { font-size: var(--text-md); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }

p { max-width: 65ch; }

.lede {
  font-size: var(--text-md);
  line-height: 1.55;
  font-weight: 400;
  color: var(--text-muted);
}

.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: var(--space-4);
}
/* Higher specificity than ".section-head p" so the kicker keeps its
   brand color inside section headers. */
.section-head .eyebrow { color: var(--accent-deep); }
.section--dark .eyebrow,
.section--dark .section-head .eyebrow,
.cta-band .eyebrow { color: var(--accent); }

.text-muted { color: var(--text-muted); }
.section--dark .text-muted,
.cta-band .text-muted { color: var(--ink-text-muted); }

/* ---------- Layout ---------- */
.container {
  width: min(var(--container), 100% - clamp(2.5rem, 6vw, 6rem));
  margin-inline: auto;
}
.container--narrow { max-width: 880px; }

.section {
  padding-block: var(--section-pad);
  position: relative;
  background: var(--bg);
}
.section--tint { background: var(--tint); }
.section--white { background: var(--surface); }
.section--dark {
  background: var(--ink);
  color: var(--ink-text);
}

.section-head {
  max-width: 820px;
  margin-bottom: clamp(1.75rem, 1.4rem + 1.8vw, 3rem);
}
.section-head p { color: var(--text-muted); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head p {
  margin-top: var(--space-4);
  font-size: var(--text-md);
  color: var(--text-muted);
}
.section--dark .section-head p { color: var(--ink-text-muted); }

.grid-2 { display: grid; gap: clamp(2rem, 4vw, 5rem); }
.grid-3 { display: grid; gap: var(--space-4); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; align-items: center; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform 0.25s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Header (full-width bar) ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: transform 0.4s var(--ease-out), background 0.3s ease,
    border-color 0.3s ease;
}
.site-header.is-hidden { transform: translateY(-105%); }
.site-header.is-scrolled {
  background: rgba(251, 250, 248, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}
html[data-theme="dark"] .site-header.is-scrolled {
  background: rgba(18, 18, 20, 0.88);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

/* Text wordmark (matches the preloader mark) */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text);
  line-height: 1;
}
.brand-mark::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #eb7d29;
  flex-shrink: 0;
}
.site-footer .brand-mark { color: #fff; font-size: 1.6rem; }

.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
.footer-brand-logo { height: 40px; width: auto; display: block; margin-bottom: 1.2rem; }

.site-nav { display: none; }
@media (min-width: 1024px) {
  .site-nav {
    display: flex;
    align-items: center;
    gap: clamp(0.4rem, 1vw, 0.9rem);
  }
}
.site-nav a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-pill);
  transition: color 0.25s ease, background-color 0.25s ease;
}
.site-nav a:hover {
  color: var(--accent-deep);
  background: transparent;
}
.site-nav a[aria-current="page"] {
  color: var(--accent-deep);
  background: transparent;
  font-weight: 600;
}

/* Dropdown (Our Work) */
.nav-item { position: relative; }
.nav-item > a .caret {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 0.35rem;
  vertical-align: middle;
  transition: transform 0.25s var(--ease-out);
}
.nav-item:hover > a .caret,
.nav-item:focus-within > a .caret { transform: rotate(180deg); }
.nav-drop {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 6px);
  padding-top: 0.65rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.3s var(--ease-out), visibility 0s 0.25s;
}
.nav-item:hover .nav-drop,
.nav-item:focus-within .nav-drop {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.25s ease, transform 0.3s var(--ease-out);
}
.nav-drop-panel {
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  display: grid;
}
.nav-drop-panel a {
  display: block;
  font-size: var(--text-sm);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.site-header .header-cta { display: none; }
@media (min-width: 1024px) {
  .site-header .header-cta {
    display: inline-flex;
    padding: 0.65rem 1.4rem;
  }
}

/* Burger */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  align-items: center;
  border-radius: var(--radius-sm);
}
@media (min-width: 1024px) { .nav-toggle { display: none; } }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  padding: calc(var(--header-h) + 2rem) clamp(1.5rem, 6vw, 3rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out), visibility 0s 0.35s;
}
.mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.35s var(--ease-out);
}
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-menu nav > a {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  padding-block: 0.55rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.5s ease;
}
.mobile-menu.is-open nav > a { transform: none; opacity: 1; }
.mobile-menu nav > a:nth-child(2) { transition-delay: 0.04s; }
.mobile-menu nav > a:nth-child(3) { transition-delay: 0.08s; }
.mobile-menu nav > a:nth-child(4) { transition-delay: 0.12s; }
.mobile-menu nav > a:nth-child(5) { transition-delay: 0.16s; }
.mobile-menu nav > a:nth-child(6) { transition-delay: 0.2s; }
.mobile-menu nav > a:nth-child(7) { transition-delay: 0.24s; }
.mobile-menu nav > a::after {
  content: "\2192";
  font-size: 1.2rem;
  color: var(--accent-deep);
}
.mobile-menu .menu-meta {
  margin-top: auto;
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: grid;
  gap: 0.3rem;
}
.mobile-menu .menu-meta a { color: var(--text); }

body.menu-locked { overflow: hidden; }

/* ---------- Footer (dark anchor) ---------- */
.site-footer {
  background: var(--ink);
  color: var(--ink-text);
  padding-top: var(--space-7);
  overflow: clip;
}
.footer-top {
  display: grid;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
}
@media (min-width: 900px) {
  .footer-top {
    grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
    gap: var(--space-5);
  }
}
.footer-brand img { height: 36px; margin-bottom: var(--space-4); }
.footer-brand p {
  color: var(--ink-text-muted);
  font-size: var(--text-sm);
  max-width: 34ch;
}
.footer-col h4 {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-text-muted);
  margin-bottom: var(--space-4);
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; }
.footer-col ul { display: grid; gap: 0.55rem; }
.footer-col a {
  font-size: var(--text-sm);
  color: var(--ink-text);
  opacity: 0.85;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.footer-col a:hover { opacity: 1; color: var(--accent); }
.footer-contact li { font-size: var(--text-sm); color: var(--ink-text-muted); }
.footer-contact a { color: var(--ink-text); }
.footer-contact a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--ink-line);
  padding-block: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--ink-text-muted);
}
.footer-bottom .socials { display: flex; gap: 1.1rem; }
.footer-bottom .socials a:hover { color: var(--accent); }

.footer-wordmark {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 12.5vw, 12rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px rgba(235, 125, 41, 0.35);
  user-select: none;
  pointer-events: none;
  transform: translateY(18%);
}

/* ---------- Utility ---------- */
main { display: block; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.flow > * + * { margin-top: var(--space-3); }

/* Decorative fine grid for heroes (light) */
.backdrop-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(24, 22, 18, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 22, 18, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, black 30%, transparent 75%);
  pointer-events: none;
}
.section--dark.backdrop-grid::before,
.cta-band.backdrop-grid::before {
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}
.backdrop-glow::after {
  content: "";
  position: absolute;
  width: min(720px, 90vw);
  aspect-ratio: 1;
  top: -22%;
  right: -12%;
  background: radial-gradient(circle, rgba(235, 125, 41, 0.14), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
}

/* Dark mode removed: the site is light-only. */
