/* =====================================================
   base.css — shared styles used by EVERY page
   (fonts, colors, text sizes, page width, header, footer,
   buttons, links, and the grainy title effect)
   ===================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Alte Haas Grotesk";
  src: url("../assets/fonts/AlteHaasGrotesk-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* DM Mono is loaded from Google Fonts in each page's <head>. */

/* ---------- Design tokens (your colors + sizes from Figma) ---------- */
:root {
  --bg: #111111;
  --text-title: #ffffff;
  --text-primary: #d0d0d0;
  --text-secondary: #a3a3a3;

  --accent: #b0ff93;
  --accent-hover: #6bef8e;
  --accent-blue: #74d3ff;
  --accent-pink: #fcbdff;

  --button: #c0ffbd;
  --button-pressed: #9ff99b;
  --link: #c0ffbd;
  --link-hover: #9ff99b;

  --font-title: "Alte Haas Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-title-xl: 80px;
  --fs-title: 64px;
  --fs-heading: 32px;
  --ls-title: -0.038em;     /* 64px and 80px titles */
  --ls-heading: -0.019em;   /* 32px, 24px and 16px headings */

  --page-margin: 40px;   /* space at the left/right of the page */
  --grid-gap: 35px;      /* gap between columns (your Figma gutter) */
}

@media (max-width: 767px) {
  :root {
    --fs-title-xl: 40px;
    --fs-title: 32px;
    --page-margin: 15px;
    --grid-gap: 10px;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }

:focus-visible { outline: 2px solid var(--text-title); outline-offset: 4px; }

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

/* ---------- Page width ----------
   .container        = all 12 columns (1105px on your 1440 design)
   .container--narrow = columns 2 to 11 (915px)                      */
.container        { width: min(1105px, 100% - 2 * var(--page-margin)); margin-inline: auto; }
.container--narrow{ width: min(915px,  100% - 2 * var(--page-margin)); margin-inline: auto; }

/* Large phones: the phone design stays in a centered column instead of stretching.
   450px of content + the 15px margins = a 480px column. Phones up to 480 wide are not affected.
   To make the column wider or narrower, change 450px here and the matching numbers in
   landing.css (.logos-section) and case-studies.css (.takeaway__art). */
@media (max-width: 767px) {
  .container, .container--narrow { width: min(450px, 100% - 2 * var(--page-margin)); }
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 36px;
}
.location {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 16px; line-height: 24px;
}
.location img { width: 24px; height: 24px; }

/* ---------- Green pill button ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 24px; border-radius: 999px;
  background: var(--button); color: var(--bg);
  font-size: 16px; line-height: 1; text-decoration: none; white-space: nowrap;
  box-shadow: 0 0 0 2px transparent;         /* the white outline is drawn OUTSIDE so the button never changes size */
  transition: box-shadow .15s ease, background-color .15s ease;
}
/* hover styles only apply to a mouse or trackpad, so they never "stick" after a tap on a phone */
@media (hover: hover) { .btn:hover { box-shadow: 0 0 0 2px #fff; } }
.btn:focus-visible { box-shadow: 0 0 0 2px #fff; }
.btn:active { background: var(--button-pressed); box-shadow: 0 0 0 2px #fff; }

/* "Back" link */
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-title); text-decoration: none; font-size: 16px; line-height: 24px; }
.back { transition: color .15s ease; -webkit-tap-highlight-color: transparent; }
.back svg { width: 24px; height: 24px; flex: none; }
/* hover, keyboard selection and press: text and arrow turn button green */
@media (hover: hover) { .back:hover { color: var(--button); } }
.back:focus-visible, .back:active { color: var(--button); }
/* ...and the arrow slides 4px to the left (skipped when "reduce motion" is on) */
@media (prefers-reduced-motion: no-preference) {
  .back svg { transition: transform .2s ease; }
  .back:focus-visible svg, .back:active svg { transform: translateX(-4px); }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .back:hover svg { transform: translateX(-4px); }
}

/* Touch screens (phones and tablets): a bigger tap area around "Back".
   It is invisible, so nothing looks different. 24px text + 10px above and below = 44px. */
@media (pointer: coarse) {
  .back { position: relative; }
  .back::after { content: ""; position: absolute; inset: -10px; }
}

/* Text that only shows on desktop or only on phones */
.only-mobile { display: none; }
@media (max-width: 767px) { .only-desktop { display: none; } .only-mobile { display: inline; } }

/* ---------- Text links ---------- */
.link {
  color: var(--link); text-decoration: underline; text-underline-offset: 3px;
  transition: color .15s ease;
}
@media (hover: hover) { .link:hover { color: var(--link-hover); } }
.link:focus-visible { color: var(--link-hover); }
.link:active { color: var(--accent-hover); }

/* these have their own pressed style, so the phone's default tap flash is switched off */
.btn, .link { -webkit-tap-highlight-color: transparent; }

/* ---------- Titles (with optional grain effect) ---------- */
.title {
  font-family: var(--font-title); font-weight: 700;
  font-size: var(--fs-title); line-height: 1.2; letter-spacing: var(--ls-title);
  color: var(--text-title);
}
.title--xl { font-size: var(--fs-title-xl); line-height: 1.2; }
.grain { filter: url(#grain-lg); }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-top: 66px; padding-bottom: 61px;
  font-size: 12px; line-height: 16px; color: var(--text-primary);
}
.site-footer__right { text-align: right; }

@media (max-width: 767px) {
  .grain { filter: url(#grain-sm); }
  .btn { font-size: 12px; }
  .site-header { margin-top: 18px; }
  .location { font-size: 12px; gap: 8px; }
  .location img { width: 16px; height: 16px; }
  .site-footer { flex-direction: column; align-items: stretch; gap: 16px; margin-top: 32px; padding-bottom: 36px; }
}
