/* ==========================================================================
   Digital Fusion — Theme Tokens & Base
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-primary: #f6f2e9;
  --bg-secondary: #ebe7dc;
  --bg-dark: #06402b;
  --bg-ink: #1a1a1a;

  /* Text */
  --ink-primary: #1a1a1a;
  --ink-muted: #5a5a5a;
  --ink-subtle: #8a8a8a;
  --ink-on-dark: #f6f2e9;
  --ink-on-dark-muted: rgba(246, 242, 233, 0.7);

  /* Accent — client greens */
  --accent: #285846;
  --accent-dark: #06402b;
  --accent-soft: #426256;

  /* Borders */
  --border-subtle: rgba(26, 26, 26, 0.08);
  --border-medium: rgba(26, 26, 26, 0.15);
  --border-on-dark: rgba(246, 242, 233, 0.15);

  /* Typography */
  --ff-serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --ff-sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  /* Fluid type scale */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: clamp(1.05rem, 1vw + 0.9rem, 1.25rem);
  --fs-lg: clamp(1.25rem, 1.5vw + 1rem, 1.75rem);
  --fs-xl: clamp(1.75rem, 2.5vw + 1rem, 2.75rem);
  --fs-2xl: clamp(2.25rem, 4vw + 1rem, 4rem);
  --fs-hero: clamp(2.75rem, 6vw + 1rem, 6.5rem);

  /* Spacing */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 9rem;

  /* Layout */
  --max-w: 1440px;
  --max-w-text: 68ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 72px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur-med: 360ms;
  --dur-slow: 640ms;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

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

@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 {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--ink-primary);
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

ul, ol { list-style: none; padding: 0; }

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5 {
  font-family: var(--ff-serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}

h1 { font-size: var(--fs-hero); font-weight: 400; }
h2 { font-size: var(--fs-2xl); font-weight: 400; }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }

p {
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--ink-primary);
}

.eyebrow {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.lede {
  font-family: var(--ff-serif);
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-primary);
  max-width: var(--max-w-text);
}

.serif { font-family: var(--ff-serif); }
.italic { font-style: italic; }

/* ==========================================================================
   Utilities
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 960px;
}

.section {
  padding-block: var(--space-2xl);
}

@media (min-width: 1024px) {
  .section { padding-block: var(--space-3xl); }
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  background: var(--bg-ink);
  color: var(--ink-on-dark);
  padding: var(--space-xs) var(--space-sm);
  z-index: 100;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-xs); }

/* ==========================================================================
   Buttons & Links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid currentColor;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  cursor: pointer;
}

.btn--primary {
  background: var(--accent);
  color: var(--ink-on-dark);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-primary);
}
.btn--ghost:hover {
  background: var(--ink-primary);
  color: var(--ink-on-dark);
}

.btn--ghost-light {
  background: transparent;
  color: var(--ink-on-dark);
  border-color: var(--ink-on-dark);
}
.btn--ghost-light:hover {
  background: var(--ink-on-dark);
  color: var(--ink-primary);
}

.link-underline {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform-origin: right center;
  transform: scaleX(1);
  transition: transform var(--dur-med) var(--ease-out);
}
.link-underline:hover::after {
  transform-origin: left center;
  transform: scaleX(0);
  animation: underlineReveal var(--dur-med) var(--ease-out) forwards;
  animation-delay: var(--dur-med);
}

@keyframes underlineReveal {
  from { transform: scaleX(0); transform-origin: left center; }
  to { transform: scaleX(1); transform-origin: left center; }
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */

.fade-in, .fade-move {
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.fade-move { transform: translateY(24px); }

.fade-in.is-visible,
.fade-move.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Focus
   ========================================================================== */

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