/*
 * site.css — shared styles for the productinc.com pages built on the
 * Product™ Agency design system:
 *   /                 home (public/index.html)
 *   /contact/         contact (public/contact/index.html)
 *   /consulting/      consulting services (public/consulting/index.html)
 *   /privacy/, /terms/, /text-messaging/   legal pages
 *
 * Design-system rules this file follows:
 *   - Ground is "paper" (#fffef9), text is "ink" (#121212); no accent hue.
 *   - Two type voices: Tobias Light (display) for headlines, Neue Haas
 *     Grotesk Display 55 Roman for everything else; 65 Medium only for the
 *     wordmark and small labels. Faces switch, weights never change.
 *   - Separation comes from colour and radius, never borders or dividers.
 *   - The sand ramp (sand-100 → sand-300) plus ink colour the four home cards.
 *
 * Deployed with a short cache (see scripts/deploy.sh), so edits go live
 * within about five minutes even without a Cloudflare purge.
 */

/* ---------- Fonts (files live in /fonts/, family names match the design system) ---------- */
@font-face {
  font-family: "tobiaslight";
  src: url("/fonts/tobias-light-webfont.woff2") format("woff2"),
       url("/fonts/tobias-light-webfont.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "haas_grot_disp55_roman";
  src: url("/fonts/neuehaasgrotesk-roman-webfont.woff2") format("woff2"),
       url("/fonts/neuehaasgrotesk-roman-webfont.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "haas_grot_disp65_medium";
  src: url("/fonts/neuehaasgroteskmedium-webfont.woff2") format("woff2"),
       url("/fonts/neuehaasgroteskmedium-webfont.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Design tokens (values from the Product™ Agency design system) ---------- */
:root {
  --paper: #fffef9;
  --ink: #121212;
  --ink-soft: #1f1f1f;
  --charcoal: #2b2b2b;
  --mist: #ddddd6;
  --sand-100: #efe9dc;
  --sand-200: #dfd3b9;
  --sand-300: #c0b7a5;

  --font-display: tobiaslight, Tobias, Georgia, "Times New Roman", serif;
  --font-sans: haas_grot_disp55_roman, "Neue Haas Grotesk Display Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sans-medium: haas_grot_disp65_medium, "Neue Haas Grotesk Display Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: 50px;          /* space-50: page gutter */
  --card-pad: 25px;        /* space-25: card padding */
  --radius-card: 30px;
  --radius-pill: 170px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--ink); }
a:hover { color: var(--ink-soft); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Page shell: header on top, footer pinned to the bottom ---------- */
/* Header, content and footer are capped at 1400px and centred on wider screens. */
.page {
  max-width: calc(1400px + 2 * var(--gutter));
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px var(--gutter) 24px;
  display: flex;
  flex-direction: column;
}

/* ---------- Header: wordmark left, nav + Contact button right ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
}
/* Matches the original PRODUCT™ wordmark on the original productinc.com agency site: 65 Medium, 20px. */
.wordmark {
  font-family: var(--font-sans-medium);
  font-size: 20px;
  line-height: 1.2;
  color: var(--ink-soft);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 32px;
}
.nav-link {
  font-size: 17px;
  line-height: 1.2;
  padding: 12px 0;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav-link:hover,
.nav-link[aria-current="page"] { text-decoration-color: var(--ink); }

/* The one prominent call to action: an ink pill. */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  margin-left: 8px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: 17px;
  line-height: 1.2;
  text-decoration: none;
}
.cta:hover { background: var(--charcoal); color: var(--paper); }

/* The nav is a popover so phones can open it from the hamburger without a
   script. On wider screens it is always shown inline, so the browser's own
   popover styling is reset here. */
.site-nav[popover] {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: inherit;
}
.nav-toggle,
.nav-close,
.mobile-cta { display: none; }
.nav-toggle,
.nav-close {
  width: 48px;
  height: 48px;
  margin-right: -12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Diagonal outbound arrow (the design system's only icon). */
.arrow { width: 12px; height: 12px; flex: none; }

/* ---------- Main area: content centred vertically between header and footer ---------- */
.site-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 56px;
  padding: 48px 0;
}
.display-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 6vw, 88px);
  line-height: 0.9;
}
.lede {
  margin: 0;
  font-size: 27px;
  line-height: 1.1;
}

/* ---------- Home: intro + four cards ---------- */
/* On tall screens the home content sits in the top third: spare height is
   split 1:2 above and below instead of evenly. The negative margins cancel
   the flex gap so the spacers add no fixed space of their own. */
.site-main--home { justify-content: flex-start; }
.site-main--home::before,
.site-main--home::after { content: ""; }
.site-main--home::before { flex-grow: 1; margin-bottom: -56px; }
.site-main--home::after { flex-grow: 2; margin-top: -56px; }
.intro { display: flex; flex-direction: column; gap: 22px; max-width: 900px; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.card {
  min-height: 300px;
  padding: var(--card-pad);
  border-radius: var(--radius-card);
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  transition: transform .2s ease;
}
.card:hover { transform: translateY(-4px); color: var(--ink); }
.card h2 { margin: 0; font-weight: 400; font-size: 29px; line-height: 1.15; }
.card-body { display: flex; flex-direction: column; gap: 18px; }
.card p { margin: 0; font-size: 16px; line-height: 1.3; }
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Cards step darker left to right, like the design system's stacked panels. */
.card--sand-100 { background: var(--sand-100); }
.card--sand-200 { background: var(--sand-200); }
.card--sand-300 { background: var(--sand-300); }
.card--ink { background: var(--ink); color: var(--paper); }
.card--ink:hover { color: var(--paper); }
.card--ink p { color: var(--mist); }

/* ---------- Contact: label / details list ---------- */
.contact-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: center;
  gap: 56px 80px;
}
.contact-layout .display-title { flex: 1 1 360px; }
.contact-list {
  flex: 999 1 560px;
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 36px 56px;
  align-items: baseline;
  font-size: 20px;
  line-height: 1.25;
}
.contact-list dt { font-family: var(--font-sans-medium); white-space: nowrap; }
.contact-list dd { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.contact-list address { font-style: normal; display: flex; flex-direction: column; padding-bottom: 10px; }

/* Quiet underline (sand-300) that darkens on hover; used for emails, phone and body links. */
.quiet-link {
  text-decoration: underline;
  text-decoration-color: var(--sand-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.quiet-link:hover { text-decoration-color: var(--ink); }

/* ---------- Legal pages (privacy, terms, text messaging) ---------- */
.legal-main { justify-content: flex-start; padding-top: 72px; }
.legal-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 80px;
}
.legal-layout .display-title { flex: 1 1 320px; }
.prose {
  flex: 999 1 560px;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 18px;
  line-height: 1.5;
}
.prose p, .prose ul { margin: 0; }
.prose ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.prose h2 {
  margin: 20px 0 0;
  font-family: var(--font-sans-medium);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.25;
}
.prose strong { font-family: var(--font-sans-medium); font-weight: 400; }
.prose a { text-decoration-color: var(--sand-300); text-underline-offset: 4px; }
.prose a:hover { text-decoration-color: var(--ink); }

/* ---------- Consulting page (/consulting/) ----------
 * Matches the "Consulting v4" design. The page is in drafts/consulting/ until approved.
 * Three parts, each laid out like the contact page (heading column left, content right):
 *   1. Top: the AdAge quote, the intro line and an "About our approach" button,
 *      starting at the content column (the heading column is left empty).
 *   2. Work: a three-column client list. Better, Post and Chubb are buttons that
 *      open a case-study side tray.
 *   3. Services: two stacked cards (01 Branding & Campaigns, 02 Digital Products)
 *      beside one tall Capabilities card with a bulleted list at the bottom.
 * Side trays (.tray) slide in from the right over a dimmed backdrop; the inline
 * script in the consulting page opens and closes them.
 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.consulting-main { justify-content: flex-start; gap: 120px; padding: 96px 0; }

/* Heading column + content column, as on the contact page */
.split { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px 80px; }
.split-head { flex: 1 1 360px; }
.split-body { flex: 999 1 560px; min-width: 0; }
.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 5vw, 72px);
  line-height: 0.9;
}

/* 1. Top: quote, intro line, button */
.approach-body { display: flex; flex-direction: column; gap: 36px; }
.big-quote { margin: 0; position: relative; padding-top: 56px; }
.big-quote::before {
  content: "\201C";
  position: absolute;
  top: -18px;
  left: -6px;
  font-family: var(--font-display);
  font-size: 160px;
  line-height: 1;
  color: var(--sand-300);
}
.big-quote p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1.02;
}
.big-quote cite { display: block; margin-top: 24px; font-style: normal; font-size: 18px; }
.approach-body .lede { max-width: 760px; font-size: 27px; line-height: 1.15; }
button.cta { border: 0; font-family: inherit; cursor: pointer; min-height: 52px; padding: 0 28px; margin-left: 0; }

/* 2. Work: client list */
.client-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 40px;
  font-size: 27px;
  line-height: 1.15;
}
.client-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: underline;
  text-decoration-color: var(--sand-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.client-link:hover { text-decoration-color: var(--ink); }

/* 3. Services */
.service-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.service-card {
  min-height: 260px;
  padding: 28px;
  border-radius: var(--radius-card);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.service-card--1 { grid-column: 1; grid-row: 1; background: var(--sand-100); }
.service-card--2 { grid-column: 1; grid-row: 2; background: var(--sand-100); }
.service-card--caps { grid-column: 2; grid-row: 1 / span 2; background: var(--sand-200); }
.service-card-top { display: flex; flex-direction: column; gap: 14px; }
.service-num { font-family: var(--font-sans-medium); font-size: 14px; line-height: 1; }
.service-num--blank { visibility: hidden; } /* keeps "Capabilities" level with card 01's title */
.service-card h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 1; }
.service-card p { margin: 0; font-size: 17px; line-height: 1.35; }
.caps-list { margin: 0; padding: 0 0 0 1.2em; display: flex; flex-direction: column; gap: 6px; font-size: 17px; line-height: 1.35; }

/* Side trays */
body.tray-open { overflow: hidden; }
.tray-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 0;
  padding: 0;
  background: rgba(18, 18, 18, 0.45);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.tray-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .45s ease;
}
.tray {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(960px, 94vw);
  overflow-y: auto;
  padding: 40px 50px 60px;
  border-radius: 60px 0 0 60px;
  background: var(--sand-100);
  color: var(--ink);
  /* Parked off-screen to the right; slides in and back out. visibility keeps a
     closed tray out of the tab order once it has finished sliding away. */
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .55s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear .55s;
}
.tray.is-open {
  transform: none;
  visibility: visible;
  transition: transform .55s cubic-bezier(0.32, 0.72, 0, 1);
}
.tray--approach { width: min(760px, 94vw); background: var(--sand-300); }
.tray-close-row { display: flex; justify-content: flex-end; }
.tray-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}
.tray-close:hover { background: var(--ink); color: var(--paper); }
.tray-title { margin: 24px 0 16px; font-family: var(--font-display); font-weight: 400; font-size: 49px; line-height: 0.9; }
.tray--approach .tray-title { margin-bottom: 32px; font-size: 64px; }
.tray-sub { margin: 0 0 36px; max-width: 640px; font-size: 23px; line-height: 1.2; }
.tray-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px 50px; align-items: start; }
.tray-copy { display: flex; flex-direction: column; gap: 18px; font-size: 17px; line-height: 1.5; }
.tray--approach .tray-copy { gap: 20px; font-size: 18px; }
.tray-copy p { margin: 0; }
.tray-copy h3 { margin: 12px 0 0; font-family: var(--font-sans-medium); font-weight: 400; font-size: 20px; line-height: 1.25; }
.tray-copy a { text-underline-offset: 4px; }
.tray-media { display: flex; flex-direction: column; gap: 16px; }
.media { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--sand-200); }

@media (max-width: 720px) {
  .consulting-main { gap: 80px; padding: 48px 0; }
  .client-list { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 22px; }
  .service-cards { grid-template-columns: minmax(0, 1fr); }
  .service-card--1, .service-card--2, .service-card--caps { grid-column: 1; grid-row: auto; }
  .service-num--blank { display: none; }
  .tray { padding: 24px 20px 40px; border-radius: 30px 0 0 30px; }
  .tray--approach .tray-title { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) { .tray, .tray.is-open, .tray-backdrop, .tray-backdrop.is-open { transition: none; } }

/* ---------- Footer: legal links left, social icons right ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 40px;
  font-size: 14px;
  line-height: 1.1;
}
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 25px; }
.footer-legal a { text-decoration: underline; text-underline-offset: 3px; }
.footer-social { display: flex; align-items: center; gap: 4px; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}
.social-link:hover { opacity: .7; }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .cta { margin-left: 0; }

  /* Header: wordmark left, hamburger right; the menu opens as a full-screen panel. */
  .site-header { flex-wrap: nowrap; }
  .nav-toggle { display: inline-flex; }
  .site-nav[popover]:not(:popover-open) { display: none; }
  .site-nav[popover]:popover-open {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 32px var(--gutter) 40px;
    background: var(--paper);
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    overflow-y: auto;
  }
  .site-nav::backdrop { background: transparent; }
  .site-nav .nav-close { display: inline-flex; align-self: flex-end; margin-top: -12px; margin-bottom: 24px; }
  .site-nav .nav-link {
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1;
    padding: 8px 0;
  }
  .site-nav .cta { margin-top: 28px; }

  /* Contact us sits right under the content; any spare height goes below it. */
  .site-main { flex-grow: 0; }
  .mobile-cta { display: inline-flex; align-self: center; margin-bottom: auto; }
  .site-footer { margin-top: 48px; }
  .page:not(:has(.mobile-cta)) .site-main { flex-grow: 1; }

  /* Footer: copyright, legal links, social icons on three lines. */
  .site-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-legal { column-gap: 16px; }
  .footer-legal > span { flex-basis: 100%; }
  /* Icons keep 44px tap targets; the negative margin cancels the target's
     padding so the icons line up with the text and sit 10px below it. */
  .footer-social { margin: -12px 0 -12px -12px; }
  /* 16px between the icons, like the legal links; their tap targets overlap a little. */
  .footer-social .social-link + .social-link { margin-left: -12px; }
  .lede { font-size: 22px; }
  .card { min-height: 220px; }
  .contact-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .contact-list dd { margin-bottom: 24px; }
  .contact-list dt { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
