/* =============================================================
   BASE STYLES
   Imports tokens, sets global reset, fonts, typography utility
   classes, and layout primitives.
   Import order in HTML: tokens.css → base.css → components.css
   ============================================================= */

/* -------------------------------------------------------------
   GOOGLE FONTS
   Identified from Figma:
     Headings → Cormorant Garamond (high-contrast display serif)
     Body/UI  → DM Sans (geometric humanist sans-serif)
   ------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300;1,9..40,400&display=swap');

/* -------------------------------------------------------------
   FONT FAMILY TOKENS
   ------------------------------------------------------------- */
:root {
  --font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
}

/* -------------------------------------------------------------
   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-body);
  font-size: var(--text-body-base);
  line-height: var(--lh-body-base);
  color: var(--color-zinc-900);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

hr {
  border: none;
  border-top: 1px solid var(--color-line-stroke);
}

/* -------------------------------------------------------------
   TYPOGRAPHY UTILITY CLASSES
   Bind directly to CSS custom properties from tokens.css.
   Use these on any element — they apply font-size + line-height.
   ------------------------------------------------------------- */

/* Hero — above-the-fold only. Heading font. */
.text-hero {
  font-family: var(--font-heading);
  font-size: var(--text-hero);
  line-height: var(--lh-h1);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* H1 — primary page headings. Heading font. */
.text-h1 {
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  line-height: var(--lh-h1);
  font-weight: 600;
}

/* H2 — section headings. Heading font. */
.text-h2 {
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  line-height: var(--lh-h2);
  font-weight: 600;
}

/* H3 — sub-section headings. Heading font. */
.text-h3 {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  line-height: var(--lh-h3);
  font-weight: 600;
}

/* Body M — large body copy */
.text-body-m {
  font-family: var(--font-body);
  font-size: var(--text-body-m);
  line-height: var(--lh-body-m);
  font-weight: 400;
}

/* Body — default paragraph text */
.text-body {
  font-family: var(--font-body);
  font-size: var(--text-body-base);
  line-height: var(--lh-body-base);
  font-weight: 400;
}

/* Small — secondary / supporting text */
.text-small {
  font-family: var(--font-body);
  font-size: var(--text-body-s);
  line-height: var(--lh-body-s);
  font-weight: 400;
}

/* Caption — metadata, labels, timestamps */
.text-caption {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  line-height: 1.4;
  font-weight: 400;
}

/* Menu — nav links, tabs, tags (always 12px, uppercase) */
.text-menu {
  font-family: var(--font-body);
  font-size: var(--text-menu);
  line-height: 1;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* -------------------------------------------------------------
   ACCENT TEXT
   Italic, accent-dark color. Applied to emphasis spans inside
   headings. Works in both heading and body contexts.
   Usage: <em class="accent">word</em>
   ------------------------------------------------------------- */
.accent {
  font-style: italic;
  color: var(--accent-dark);
  font-family: var(--font-heading);
}

/* Accent inside a non-heading context — keep heading font for italic */
p .accent,
li .accent {
  font-size: inherit;
}

/* -------------------------------------------------------------
   LAYOUT — SECTION SHELL
   Applies consistent vertical + horizontal padding.
   All page sections should use .section as the outer wrapper.
   ------------------------------------------------------------- */
.section {
  padding: var(--space-section-v) var(--space-section-h);
}

/* Tighter padding for case-study content blocks */
.section--cs {
  padding: var(--space-cs-v) var(--space-section-h);
}

/* Accent background variant — pulls --accent-light from active theme */
.section--accent {
  background-color: var(--accent-light);
}

/* Lighter accent background variant */
.section--accent-lighter {
  background-color: var(--accent-lighter);
}

/* -------------------------------------------------------------
   LAYOUT — INNER CONTENT CONTAINER
   Centers content and enforces the 900px max-width.
   Always nest a .section__inner inside a .section.
   ------------------------------------------------------------- */
.section__inner {
  max-width: var(--space-max-width); /* 900px, never changes */
  margin-inline: auto;
  width: 100%;
}

/* Convenience shorthand: .container applies both shell + inner as one element.
   Use when the section itself IS the container (e.g. nav, full-bleed elements). */
.container {
  width: 100%;
  max-width: calc(var(--space-max-width) + (var(--space-section-h) * 2));
  margin-inline: auto;
  padding-inline: var(--space-section-h);
}

/* -------------------------------------------------------------
   LAYOUT — TWO-COLUMN GRID
   General-purpose 2-column layout. Collapses to 1 column
   on mobile.
   ------------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 799px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Equal-gap variant */
.grid-2--gap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 799px) {
  .grid-2--gap {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Three-column grid — collapses to 1 on mobile */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

@media (max-width: 799px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------
   DIVIDERS
   Use <hr class="divider"> for full-width section separators.
   ------------------------------------------------------------- */
.divider {
  width: 100%;
  height: 1px;
  border: none;
  background-color: var(--color-line-stroke);
  margin: 0;
}

/* -------------------------------------------------------------
   VISIBILITY UTILITIES
   ------------------------------------------------------------- */
@media (max-width: 799px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 800px) {
  .hide-desktop {
    display: none !important;
  }
}
