/* UNDERSTAND — understand.media
   Built from UNDERSTAND Visual Identity v1.3 / design-tokens.json
   US Sans = Barlow (SIL OFL) · US Serif = Spectral (SIL OFL)
   ------------------------------------------------------------ */

/* 1. FONTS ---------------------------------------------------- */

@font-face {
  font-family: "US Sans";
  src: url("../fonts/US-Sans-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "US Sans";
  src: url("../fonts/US-Sans-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "US Sans";
  src: url("../fonts/US-Sans-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "US Serif";
  src: url("../fonts/US-Serif-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "US Serif";
  src: url("../fonts/US-Serif-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "US Serif";
  src: url("../fonts/US-Serif-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* 2. TOKENS --------------------------------------------------- */

:root {
  /* palette — design-tokens.json */
  --ink: #00183E;
  --blue: #003F9E;
  --mid: #2A5296;
  --field-a: #EDF4FF;
  --field-b: #DBE5F6;
  --line: #C9D6EA;
  --gold: #F0C543;
  --paper: #FFFFFF;

  /* derived, accessible text tones */
  --ink-70: rgba(0, 24, 62, .72);
  --ink-55: rgba(0, 24, 62, .58);
  --on-ink-70: rgba(237, 244, 255, .74);

  /* type */
  --sans: "US Sans", "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --serif: "US Serif", "Spectral", Georgia, "Times New Roman", serif;

  /* hierarchy 48 / 32 / 20 / 14 / 11, fluid */
  --t-display: clamp(2.125rem, 1.35rem + 3.4vw, 3rem);   /* 34 → 48 */
  --t-h2:      clamp(1.5rem, 1.16rem + 1.5vw, 2rem);     /* 24 → 32 */
  --t-h3:      1.25rem;                                   /* 20 */
  --t-lead:    clamp(1.0625rem, 1rem + .35vw, 1.25rem);  /* 17 → 20 */
  --t-body:    1.0625rem;                                 /* 17 */
  --t-meta:    .875rem;                                   /* 14 */
  --t-label:   .6875rem;                                  /* 11 */

  /* rhythm */
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --measure: 66ch;
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --radius: 2px;

  /* clear space: one node-to-centre distance around every lockup */
  --clearspace: .75em;
}

/* 3. RESET / BASE --------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.18; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection { background: var(--field-b); color: var(--ink); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .75rem 1.25rem;
  font-size: var(--t-meta); text-decoration: none;
}
.skip:focus { left: .5rem; top: .5rem; color: #fff; }

/* 4. LAYOUT --------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--field { background: var(--field-a); }
.section--rule { border-top: 1px solid var(--line); }

.section-head {
  display: grid;
  gap: .75rem 3rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
@media (min-width: 60rem) {
  .section-head { grid-template-columns: 12rem 1fr; align-items: baseline; }
}

/* eyebrows: short navigational labels carry tracking (see typography rules) */
.label {
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mid);
  margin: 0;
}
.label--ink { color: var(--ink-55); }
.label--onink { color: var(--on-ink-70); }

h2.section-title {
  font-family: var(--serif);
  font-size: var(--t-h2);
  max-width: 22ch;
  letter-spacing: -.01em;
}

.lead {
  font-size: var(--t-lead);
  color: var(--ink-70);
  max-width: 58ch;
  line-height: 1.55;
}

/* 5. WORDMARK / LOCKUP ---------------------------------------- */
/* Set in live text from the supplied artwork's own metrics: US Sans 600,
   tracking 15/94em = .1596em, and the mid-blue lens point inside the counter
   of the final D (x +.151em from the glyph origin, .3617em above the baseline,
   .2128em across). Never stretched, recoloured or rotated. */

.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: .1596em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.wordmark .lens {
  position: relative;
  display: inline-block;
  line-height: 1;
}
.wordmark .lens::after {
  content: "";
  position: absolute;
  top: .4319em;    /* baseline sits .9em below the top of a 1em line box */
  left: .0446em;
  width: .2128em;
  height: .2128em;
  border-radius: 50%;
  background: var(--mid);
}
.wordmark--white { color: #fff; }
.wordmark--white .lens::after { background: #fff; }

.lockup {
  display: inline-grid;
  gap: .5em;
  padding: var(--clearspace);
  margin: calc(var(--clearspace) * -1);
  text-decoration: none;
}
.lockup .descriptor {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mid);
}
.lockup--white .descriptor { color: var(--on-ink-70); }

/* 6. HEADER --------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}
.masthead .wordmark { font-size: 1.0625rem; }

.nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
}
.nav a {
  font-size: var(--t-meta);
  font-weight: 500;
  color: var(--ink-70);
  text-decoration: none;
  padding-block: .5rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--blue); border-bottom-color: var(--blue); }
.nav .nav__contact { color: var(--blue); font-weight: 600; }

@media (max-width: 54rem) {
  .nav li:not(.nav__keep) { display: none; }
}

/* 7. HERO ----------------------------------------------------- */

.hero {
  background: linear-gradient(180deg, var(--field-a) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.5rem, 7vw, 6rem) clamp(2rem, 6vw, 5rem);
}
.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}
@media (min-width: 62rem) {
  .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}

.hero h1 {
  font-family: var(--serif);
  font-size: var(--t-display);
  letter-spacing: -.015em;
  margin-block: 1.25rem 1.5rem;
  max-width: 18ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--blue);
}
.hero .lead { max-width: 46ch; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  background: var(--blue);
  color: #fff;
  font-size: var(--t-meta);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .9375rem 1.5rem;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  transition: background .18s ease, border-color .18s ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--blue); }
.btn--ghost:hover { background: var(--blue); color: #fff; }
.btn--onink { background: var(--field-a); border-color: var(--field-a); color: var(--ink); }
.btn--onink:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.textlink {
  font-size: var(--t-meta);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: .25rem;
}
.textlink:hover { color: var(--blue); border-bottom-color: var(--blue); }

/* provenance strip — source and status always visible */
.provenance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: var(--t-meta);
  color: var(--ink-55);
}
.provenance strong { font-weight: 500; color: var(--ink); }
.dot {
  width: .4375rem; height: .4375rem; border-radius: 50%;
  background: var(--gold); display: inline-block; margin-right: .5rem;
  vertical-align: .04em;
}

/* 8. SIGNATURE FIGURE ----------------------------------------- */

.figure { display: grid; gap: 1rem; justify-items: center; }
.figure svg { width: 100%; max-width: 29rem; height: auto; }
.figure figcaption {
  max-width: 24rem;
  text-wrap: balance;
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-55);
  text-align: center;
}

.diagram .chord { stroke: var(--mid); stroke-width: 1; opacity: .26; }
.diagram .perimeter { stroke: var(--line); stroke-width: 2.2; fill: none; }
.diagram .node { fill: var(--ink); }
.diagram .core { stroke: var(--blue); stroke-width: 2.4; fill: none; }
.diagram .centre { fill: var(--gold); }
.diagram .halo { fill: var(--field-b); opacity: .5; }

/* one orchestrated page-load draw, then still */
@media (prefers-reduced-motion: no-preference) {
  .diagram .chord {
    stroke-dasharray: var(--len, 200);
    stroke-dashoffset: var(--len, 200);
    animation: draw .9s cubic-bezier(.22, .61, .36, 1) forwards;
    animation-delay: calc(var(--i, 0) * 70ms + 200ms);
  }
  .diagram .core {
    stroke-dasharray: 420; stroke-dashoffset: 420;
    animation: draw 1.1s cubic-bezier(.22,.61,.36,1) forwards 1s;
  }
  .diagram .node, .diagram .centre, .diagram .perimeter {
    opacity: 0;
    animation: fade .6s ease forwards;
    animation-delay: calc(var(--i, 0) * 70ms + 300ms);
  }
  .diagram .centre { animation-delay: 1.7s; }
  .diagram .perimeter { animation-delay: .1s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fade { to { opacity: 1; } }
}

/* 9. CLAIM ---------------------------------------------------- */

.claim {
  font-family: var(--serif);
  font-size: clamp(1.625rem, 1.1rem + 2.4vw, 2.5rem);
  line-height: 1.24;
  letter-spacing: -.01em;
  max-width: 20ch;
}
.claim span { color: var(--blue); }

.claim-grid { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); }
@media (min-width: 60rem) {
  .claim-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.prose p + p { margin-top: 1.125rem; }
.prose { max-width: var(--measure); color: var(--ink-70); }
.prose strong { color: var(--ink); font-weight: 500; }

/* 10. IS / ISN'T ---------------------------------------------- */

.ledger { display: grid; gap: clamp(2rem, 4vw, 3rem); }
@media (min-width: 58rem) {
  .ledger { grid-template-columns: 1fr 1fr; gap: 0; }
  .ledger__col + .ledger__col { border-left: 1px solid var(--line); padding-left: clamp(2rem, 4vw, 3.5rem); }
  .ledger__col:first-child { padding-right: clamp(2rem, 4vw, 3.5rem); }
}
.ledger h3 {
  font-family: var(--serif);
  font-size: var(--t-h3);
  margin-bottom: 1.5rem;
}
.ledger li {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: .75rem;
  padding-block: .9375rem;
  border-top: 1px solid var(--line);
  color: var(--ink-70);
}
.ledger li:last-child { border-bottom: 1px solid var(--line); }
.ledger b { display: block; font-weight: 500; color: var(--ink); }
.mark { width: 1.5rem; height: 1.5rem; margin-top: .1875rem; }
.mark--is { color: var(--blue); }
.mark--isnt { color: var(--ink-55); }

/* 11. PRINCIPLES ---------------------------------------------- */

.cards { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 72rem) { .cards { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--paper);
  padding: clamp(1.5rem, 2.5vw, 2rem);
  display: grid;
  gap: .875rem;
  align-content: start;
}
.card img { width: 2.25rem; height: 2.25rem; }
.card h3 { font-family: var(--serif); font-size: var(--t-h3); }
.card p { font-size: var(--t-meta); color: var(--ink-70); line-height: 1.55; }

/* 12. METHOD (a real sequence, so it is numbered) -------------- */

.steps { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
@media (min-width: 64rem) { .steps { grid-template-columns: repeat(4, 1fr); } }

.step {
  background: var(--field-a);
  padding: clamp(1.5rem, 2.5vw, 2rem);
  display: grid;
  gap: .75rem;
  align-content: start;
}
.step__n {
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--blue);
}
.step h3 { font-family: var(--serif); font-size: var(--t-h3); }
.step p { font-size: var(--t-meta); color: var(--ink-70); line-height: 1.55; }

/* 13. AUDIENCES ----------------------------------------------- */

.audiences { display: grid; }
.audience {
  display: grid;
  gap: .5rem 3rem;
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--line);
}
.audience:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 56rem) {
  .audience { grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); align-items: baseline; }
}
.audience h3 { font-family: var(--serif); font-size: var(--t-h3); }
.audience p { color: var(--ink-70); max-width: 58ch; }

/* 14. CONTACT ------------------------------------------------- */

.contact { background: var(--ink); color: var(--field-a); }
.contact__grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 60rem) {
  .contact__grid { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: end; }
}
.contact h2 {
  font-family: var(--serif);
  font-size: var(--t-h2);
  max-width: 20ch;
  color: #fff;
}
.contact p { color: var(--on-ink-70); max-width: 48ch; margin-top: 1.25rem; }
.contact a:not(.btn) { color: #fff; }
.contact__mail {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1rem + 1.4vw, 1.75rem);
  text-decoration: none;
  border-bottom: 1px solid rgba(237, 244, 255, .35);
  padding-bottom: .25rem;
}
.contact__mail:hover { border-bottom-color: var(--gold); color: var(--gold); }
.contact .provenance { border-top-color: rgba(237, 244, 255, .22); color: var(--on-ink-70); }
.contact .provenance strong { color: #fff; }

/* 15. FOOTER -------------------------------------------------- */

.foot { background: var(--ink); color: var(--on-ink-70); border-top: 1px solid rgba(237,244,255,.16); padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.foot__grid { display: grid; gap: 2.5rem; }
@media (min-width: 56rem) { .foot__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } }
.foot__meta { display: grid; gap: 1.25rem; font-size: var(--t-meta); }
@media (min-width: 40rem) { .foot__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; } }
.foot dt {
  font-size: var(--t-label); font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(237,244,255,.5); margin-bottom: .5rem;
}
.foot dd { margin: 0; }
.foot a { color: var(--field-a); }
.foot a:hover { color: var(--gold); }
.foot__base {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(237,244,255,.16);
  display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between;
  font-size: var(--t-meta);
}
.foot__symbol { width: 4rem; height: 4rem; margin-bottom: 1.5rem; }

/* 16. SCROLL REVEAL ------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* 17. PRINT --------------------------------------------------- */

@media print {
  .masthead, .hero__actions, .btn { display: none; }
  body { color: #000; font-size: 11pt; }
  .contact, .foot { background: #fff; color: #000; }
  .contact h2, .foot a { color: #000; }
}
