/* =========================================================================
   MEDIACLOTH — PRODUCTION STYLES
   Built strictly to SPECIFICATIONS.txt (frozen 30 Aug 2026).
   Do not alter tokens below without an explicit brand-system decision.
   ========================================================================= */

/* -------------------------------------------------------------------------
   FONT LOADING — SELF-HOSTED, COMPLETE (Phase 1 correction #1, final)
   All seven required WOFF2 files are now installed under assets/fonts/,
   generated from the official Google Fonts family downloads supplied
   directly by the owner:

     Newsreader 300, 400, 300italic — instanced from the official variable
     fonts (Newsreader-VariableFont_opsz,wght.ttf and its Italic
     counterpart) at the exact required weight, with opsz pinned to the
     family's own authored default (18), then Latin-subset.

     Libre Franklin 400, 500, 600 — the official static weight files
     (Regular/Medium/SemiBold) supplied directly, Latin-subset as-is.

     IBM Plex Mono 400 — converted from the OFL-licensed TTF already
     available in this build environment (see round 2 notes retained in
     assets/fonts/README-FONTS.txt). Genuine WOFF2, validated.

   All six Newsreader/Libre Franklin files were Latin-subsetted with
   fonttools' pyftsubset using the standard Google Fonts "latin" unicode
   range, then encoded as real WOFF2 via a ctypes shim over this system's
   already-installed libbrotlienc/libbrotlidec libraries (no network
   access was needed or used for compression — only for the font files
   themselves, which the owner supplied directly, so no download was
   attempted or required this round).

   Google Fonts / fonts.gstatic.com dependency remains fully removed.
   ------------------------------------------------------------------------- */

@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-300italic.woff2') format('woff2');
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Libre Franklin';
  src: url('../assets/fonts/librefranklin-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Libre Franklin';
  src: url('../assets/fonts/librefranklin-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Libre Franklin';
  src: url('../assets/fonts/librefranklin-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibmplexmono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* -------------------------------------------------------------------------
   TOKENS
   ------------------------------------------------------------------------- */
:root {
  /* Color — SPECIFICATIONS.txt section 2 */
  --ink-navy: #111C2E;
  --slate: #2E4258;
  --brass: #8A6A3B;
  --light-brass: #C39A5E; /* reversed use only */
  --warm-ivory: #F5F1E8;
  --paper: #FFFDF8;
  --tint-1: #dfd5c1;
  --tint-2: #e3dac6;
  --tint-3: #c9c0ad;
  --navy-panel-1: #16223a;
  --navy-panel-2: #22304a;
  --hairline: #ECE5D6;

  /* Type families */
  --font-display: 'Newsreader', Georgia, 'Iowan Old Style', serif;
  --font-body: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Layout */
  --base-unit: 4px;
  --max-content: 1400px;
  --gutter-desktop: 72px;
  --gutter-mobile: 22px;
  --header-h-desktop: 84px;
  --header-h-mobile: 61px;
}

/* -------------------------------------------------------------------------
   RESET / BASE
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-navy);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Visible keyboard focus everywhere — accessibility floor */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--max-content);
  margin: 0 auto;
  padding-left: var(--gutter-desktop);
  padding-right: var(--gutter-desktop);
}

.hairline {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

/* Skip link — accessibility fundamental, not a new visual section */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink-navy);
  color: var(--warm-ivory);
  padding: 12px 20px;
  z-index: 1000;
  font-family: var(--font-body);
  font-size: 14px;
}
.skip-link:focus { left: 16px; top: 16px; }

/* -------------------------------------------------------------------------
   TYPOGRAPHY SCALE — SPECIFICATIONS.txt section 3
   ------------------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; color: var(--ink-navy); }

h1 {
  font-size: 88px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 820px;
}

h2 {
  font-size: 60px;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.section-lead {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 36px;
  line-height: 1.4;
  margin: 0;
}

.capability-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 16px;
}

.about-body {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 31px;
  line-height: 1.5;
  margin: 0;
  max-width: 62ch;
}

.lead-paragraph {
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.7;
  margin: 0;
}

p { margin: 0 0 1em; max-width: 68ch; }

.descriptor {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.section-label {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
}

.field-label {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  display: block;
  margin-bottom: 6px;
}

.footer-mono {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* -------------------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 16px 28px;
  border-radius: 2px;
  border: 1px solid transparent;
  text-decoration: none;
  min-height: 48px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: var(--ink-navy);
  color: var(--paper);
}
.btn-primary:hover { background: var(--navy-panel-2); }

.btn-secondary {
  background: transparent;
  color: var(--ink-navy);
  border-color: var(--ink-navy);
}
.btn-secondary:hover { background: var(--warm-ivory); }

/* Schedule button: implemented per approved design, integration inactive.
   Styling matches secondary button exactly — no substitute experience. */
.btn-secondary[aria-disabled="true"] {
  cursor: default;
  opacity: 0.55;
}

/* -------------------------------------------------------------------------
   HEADER
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--hairline);
  height: var(--header-h-desktop);
}
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.logo-link { display: flex; align-items: center; }
.logo-link img { height: 28px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 36px; }
.site-nav a {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  color: var(--ink-navy);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--brass); }

.header-cta { display: flex; align-items: center; gap: 20px; }
.header-cta .btn { padding: 12px 22px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink-navy);
  margin: 5px 0;
}

/* Fixed overlay rather than in-flow content: the header has a fixed height,
   so an in-flow dropdown would overflow behind the hero instead of pushing
   it down. Bug found and fixed during local QA — see build summary. */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  position: fixed;
  top: var(--header-h-mobile);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  padding: 12px var(--gutter-mobile) 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  overflow-y: auto;
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  font-family: var(--font-body);
  font-size: 17px;
  text-decoration: none;
  color: var(--ink-navy);
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.mobile-nav .btn { margin-top: 12px; }

/* -------------------------------------------------------------------------
   HERO
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 124px var(--gutter-desktop) 108px;
  overflow: hidden;
  background: var(--warm-ivory);
}
.hero-inner { position: relative; z-index: 2; max-width: var(--max-content); margin: 0 auto; }
.hero .descriptor { color: var(--brass); margin-bottom: 20px; display: block; }
.hero h1 { margin-bottom: 28px; }
.hero-support {
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.7;
  max-width: 620px;
  color: var(--slate);
  margin: 0 0 40px;
}
.hero-actions { display: flex; align-items: center; gap: 20px; margin-bottom: 56px; }
.hero-credibility {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--slate);
}

/* Hero weave graphic + animation — SPECIFICATIONS.txt section 6.
   Confined to a right-hand panel rather than a full-bleed background so it
   never crosses the H1 (max-width 820px leaves clear room to its right at
   the 1400px design width). Same unmodified asset, just cropped/anchored —
   a placement judgment call flagged for QA, not a spec-mandated position. */
/* Hero weave graphic + animation — SPECIFICATIONS.txt section 6.
   Desktop: confined to a right-hand panel rather than a full-bleed
   background so it never crosses the H1 (max-width 820px leaves clear
   room to its right at the 1400px design width). Same unmodified asset,
   just cropped/anchored — a placement judgment call flagged for QA, not
   a spec-mandated position.
   Mobile: kept (not removed) as a full-width strip below the hero
   actions — see the 768px media query below. Correction #2. */
.hero-weave {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 46%;
  z-index: 1;
  overflow: hidden;
}
.hero-weave svg { width: 100%; height: 100%; }

/* -------------------------------------------------------------------------
   HERO ANIMATION — no-JS-safe default, JS-enhanced start state.
   Correction #3 and #4.

   Default (no class needed): the SETTLED, FINAL composition at full
   opacity. This is what renders with JavaScript unavailable or failing,
   and is also the reduced-motion state — no animation, no transform.

   Only when the early inline script in <head> detects it should animate
   (motion allowed AND not already played this session) does it add
   `will-animate-hero` to <html>, BEFORE first paint. That class alone
   defines the pre-animation start position. main.js then adds
   `run-hero-anim` on load to trigger the keyframes from that start state
   to the same settled end state defined above.
   ------------------------------------------------------------------------- */
.weave-band, .weave-brass { transform: none; opacity: 1; }

html.will-animate-hero .weave-band-1,
html.will-animate-hero .weave-band-2,
html.will-animate-hero .weave-band-3 {
  transform: translateX(120px);
  opacity: 0;
}
html.will-animate-hero .weave-brass {
  transform: translateY(-80px);
  opacity: 0;
}

html.will-animate-hero.run-hero-anim .weave-band-1 {
  animation: weave-in-x 900ms cubic-bezier(0.16, 1, 0.3, 1) 0ms forwards;
}
html.will-animate-hero.run-hero-anim .weave-band-2 {
  animation: weave-in-x 900ms cubic-bezier(0.16, 1, 0.3, 1) 120ms forwards;
}
html.will-animate-hero.run-hero-anim .weave-band-3 {
  animation: weave-in-x 900ms cubic-bezier(0.16, 1, 0.3, 1) 240ms forwards;
}
html.will-animate-hero.run-hero-anim .weave-brass {
  animation: weave-in-y 1040ms cubic-bezier(0.16, 1, 0.3, 1) 360ms forwards;
}

@keyframes weave-in-x {
  from { transform: translateX(120px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes weave-in-y {
  from { transform: translateY(-80px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Headline, eyebrow, paragraph, button never animate — always in frame one */
.hero-inner .descriptor,
.hero-inner h1,
.hero-inner .hero-support,
.hero-inner .hero-actions {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------------------------------
   SECTION SHELL
   ------------------------------------------------------------------------- */
section { padding: 108px 0; }
.section-head { margin-bottom: 56px; }
.section-head .section-label { display: block; margin-bottom: 18px; }

/* -------------------------------------------------------------------------
   ABOUT — grid 200 / 1fr / 400px, gap 60
   ------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr 400px;
  gap: 60px;
  align-items: start;
}
.about-label-col .section-label { position: sticky; top: 120px; }
.about-media {
  aspect-ratio: 4 / 5;
  background: var(--warm-ivory);
  overflow: hidden;
}
.about-media img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------------------------
   CAPABILITIES — row 300 / 1fr, gap 64, pad 52; graphic 300x210
   ------------------------------------------------------------------------- */
.capability {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 64px;
  padding: 52px 0;
  align-items: center;
}
.capability + .capability { border-top: 1px solid var(--hairline); }
.capability-graphic {
  width: 300px;
  height: 210px;
  overflow: hidden;
  position: relative;
  background: var(--warm-ivory);
}
.capability-graphic img {
  position: absolute;
  width: 620px;
  height: auto;
  max-width: none;
}
/* Each capability crops a different portion of the same approved open-weave
   asset — reused per SPECIFICATIONS.txt section 7 ("all website sections"),
   not a new graphic element. Always cropped at two edges per spec. */
.capability:nth-child(1) .capability-graphic img { top: -40px; left: -60px; }
.capability:nth-child(2) .capability-graphic img { top: -120px; left: -220px; }
.capability:nth-child(3) .capability-graphic img { top: -220px; left: -100px; }
.capability:nth-child(4) .capability-graphic img { top: -60px; left: -320px; }

/* -------------------------------------------------------------------------
   APPROACH — 3 x 1fr, gap 56, indent 260
   ------------------------------------------------------------------------- */
.approach-lead { max-width: 760px; margin-bottom: 56px; }
.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
  padding-left: 260px;
}
.approach-step .step-number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--brass);
  display: block;
  margin-bottom: 14px;
}
.approach-step h3 {
  font-size: 24px;
  margin-bottom: 12px;
}
.approach-step p { color: var(--slate); }

/* -------------------------------------------------------------------------
   CONTACT — 2 x 1fr, gap 90
   ------------------------------------------------------------------------- */
.contact-section { background: var(--warm-ivory); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
}
.contact-email {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink-navy);
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
  display: inline-block;
  margin: 28px 0 40px;
}
.contact-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

.contact-form { display: flex; flex-direction: column; gap: 22px; }
.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink-navy);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 14px 16px;
  min-height: 48px;
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--slate);
  margin-top: -6px;
}

/* -------------------------------------------------------------------------
   FOOTER — padding 46 / 72
   ------------------------------------------------------------------------- */
.site-footer {
  background: var(--ink-navy);
  color: var(--warm-ivory);
  padding: 46px 0;
}
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
/* Correction #8: compact reversed lockup was rendering at ~178.5px wide
   (height:34px × its 252:48 intrinsic ratio = 178.5px), just under the
   180px handoff minimum. Set explicit width instead so it never drops
   below the minimum, height follows automatically, proportions and
   clear space unchanged. */
.footer-logo img { width: 180px; height: auto; }
.footer-links { display: flex; gap: 28px; align-items: center; }
.footer-links a {
  color: var(--warm-ivory);
  text-decoration: none;
  opacity: 0.85;
}
.footer-links a:hover { opacity: 1; }
.footer-meta { color: var(--light-brass); opacity: 0.9; }

/* -------------------------------------------------------------------------
   RESPONSIVE — breakpoints 1400 / 1024 / 768 / 390
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .wrap, .hero { padding-left: 40px; padding-right: 40px; }
  h1 { font-size: 64px; }
  .about-grid { grid-template-columns: 160px 1fr 320px; gap: 40px; }
  .approach-grid { padding-left: 0; gap: 40px; }
  .contact-grid { gap: 56px; }
}

@media (max-width: 768px) {
  .site-nav, .header-cta .btn-secondary { display: none; }
  .nav-toggle { display: block; }
  /* Hero weave PRESERVED on mobile (correction #2) — repositioned to a
     full-width strip below the hero actions instead of the desktop side
     panel, since the copy runs full-width here and a side panel would
     cross the headline. Same unmodified asset, cropped differently. */
  .hero { display: flex; flex-direction: column; }
  .hero-inner { order: 1; }
  .hero-weave {
    position: relative;
    order: 2;
    inset: auto;
    top: auto; right: auto; bottom: auto;
    width: 100%;
    /* Correction #2 (round 2): a fixed short height cropped the artwork
       down to ~1 band + 1 brass segment — well under the "3-4 elements"
       open-weave requirement. aspect-ratio keeps a constant, calculated
       crop window (viewBox y=130 to y=470, worked out from the source
       geometry) regardless of viewport width, always showing all three
       bands plus the brass crossing. Same unmodified asset. */
    aspect-ratio: 1400 / 340;
    height: auto;
    margin-top: 32px;
  }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-label-col .section-label { position: static; }
  .about-media { max-width: 480px; }
  .capability { grid-template-columns: 1fr; gap: 24px; }
  .capability-graphic { width: 100%; }
  .approach-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  :root { --gutter-mobile: 22px; }
  .wrap, .hero, section .wrap { padding-left: 22px; padding-right: 22px; }
  .site-header { height: var(--header-h-mobile); }
  .hero { padding: 44px 22px 48px; }
  h1 { font-size: 42px; line-height: 1.04; max-width: 100%; }
  .hero-support { font-size: 17px; }
  body { font-size: 16px; line-height: 1.75; }
  section { padding: 44px 0; }
  h2 { font-size: 38px; }
  .about-body { font-size: 24px; }
  .about-media { aspect-ratio: 4 / 3; max-width: 100%; }
  .capability-graphic { height: 120px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; min-height: 48px; }
  .contact-buttons { flex-direction: column; }
  .footer-grid { flex-direction: column; align-items: flex-start; }
}

/* -------------------------------------------------------------------------
   REDUCED MOTION — hard override in addition to the JS-gated approach
   above. Correction #4: settled state is full opacity, matching the
   completed animation exactly, not a dimmed 0.9.
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .weave-band, .weave-brass {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
