/* ==========================================================================
   Maddock Films — Social Brand Mandate
   Display : Archivo (OFL, self-hosted, variable)
   Attrib. : Space Grotesk (OFL, self-hosted, variable)
   Body    : Proxima Nova where licensed, system stack on the web
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/Archivo-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-var.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-display: swap;
}

/* Drop a licensed Proxima Nova webfont here and this rule activates.
   See assets/fonts/README.md — do NOT copy the Adobe CC desktop .otf files. */
@font-face {
  font-family: 'Proxima Nova';
  src: url('../fonts/ProximaNova-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova';
  src: url('../fonts/ProximaNova-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova';
  src: url('../fonts/ProximaNova-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Canonical — #FF7F00 is final and approved, not provisional */
  --orange: #ff7f00;
  --black: #000000;
  --white: #ffffff;

  /* Superseded oranges still in circulation — never use for new work */
  --orange-lockup: #f47921;
  --orange-web-deep: #e05c00;
  --orange-web-bright: #ff7a1a;

  /* Interface */
  --bg: #0a0a0a;
  --bg-raised: #121212;
  --bg-sunken: #060606;
  --line: #242424;
  --line-strong: #383838;
  --ink: #f4f4f4;
  --ink-mid: #a8a8a8;
  --ink-dim: #6e6e6e;

  --ok: #4ade80;
  --no: #f87171;

  --display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --body: 'Proxima Nova', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --attrib: 'Space Grotesk', ui-monospace, monospace;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --nav-w: 268px;
  --gutter: clamp(20px, 4vw, 64px);
  --maxw: 940px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Display type ---------- */
.d {
  font-family: var(--display);
  font-variation-settings: 'wght' 800, 'wdth' 70;
  letter-spacing: -0.04em; /* display tracking -40 */
  line-height: 0.94;
  text-transform: uppercase;
  margin: 0;
}

a { color: var(--orange); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffa04d; }

code, .mono { font-family: var(--mono); font-size: .88em; }

/* ==========================================================================
   Layout
   ========================================================================== */
.shell { display: flex; align-items: flex-start; }

/* ---------- Sidebar ---------- */
.nav {
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 30px 20px 40px 30px;
  border-right: 1px solid var(--line);
  background: var(--bg-sunken);
}
.nav__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.nav__brand img { width: 116px; height: auto; display: block; }
.nav__tag {
  font-family: var(--attrib);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-dim); margin: 0 0 26px 2px;
}
.nav ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.nav li { counter-increment: s; }
.nav a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 7px 10px 7px 8px;
  color: var(--ink-mid); text-decoration: none;
  font-size: 13.5px; line-height: 1.35;
  border-radius: 5px;
  border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.nav a::before {
  content: counter(s, decimal-leading-zero);
  font-family: var(--mono); font-size: 10px; color: var(--ink-dim);
  flex: 0 0 auto; transition: color .15s;
}
.nav a:hover { color: var(--ink); background: #ffffff08; }
.nav a.is-active {
  color: var(--orange); border-left-color: var(--orange); background: #ff7f000f;
}
.nav a.is-active::before { color: var(--orange); }

/* ---------- Main ---------- */
.main { flex: 1 1 auto; min-width: 0; padding: 0 var(--gutter) 140px; }
.wrap { max-width: var(--maxw); margin: 0 auto; }

/* ---------- Cover ---------- */
.cover { padding: clamp(56px, 11vh, 120px) 0 60px; border-bottom: 1px solid var(--line); }
.cover__eyebrow {
  font-family: var(--attrib);
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--orange); margin: 0 0 22px;
}
.cover h1 { font-size: clamp(48px, 10vw, 108px); }
.cover h1 em { font-style: normal; color: var(--orange); }
.cover__sub {
  max-width: 60ch; margin: 26px 0 0;
  font-size: clamp(16px, 2vw, 19px); color: var(--ink-mid);
}
.meta {
  display: flex; flex-wrap: wrap; gap: 10px 34px;
  margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line);
}
.meta div { min-width: 120px; }
.meta dt {
  font-family: var(--attrib); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 3px;
}
.meta dd { margin: 0; font-size: 14px; color: var(--ink); }

/* ---------- Sections ---------- */
section { padding: 78px 0 0; scroll-margin-top: 20px; }
.sec-no {
  font-family: var(--mono); font-size: 11px; color: var(--orange);
  letter-spacing: .1em; margin: 0 0 12px;
}
section > h2 { font-size: clamp(30px, 5.2vw, 50px); margin-bottom: 18px; }
section > h2 + p, .lede {
  max-width: 68ch; color: var(--ink-mid); font-size: 17px; margin-top: 0;
}
h3 {
  font-family: var(--display); font-variation-settings: 'wght' 700, 'wdth' 82;
  text-transform: uppercase; letter-spacing: -0.01em;
  font-size: 19px; margin: 46px 0 12px;
}
h4 {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-dim); margin: 26px 0 10px; font-family: var(--attrib);
}
p { max-width: 72ch; }

/* ---------- Rule / callouts ---------- */
.rule {
  border-left: 2px solid var(--orange);
  background: linear-gradient(90deg, #ff7f0010, transparent 70%);
  padding: 15px 20px; margin: 22px 0; border-radius: 0 6px 6px 0;
}
.rule strong { color: var(--orange); }
.rule p { margin: 0; max-width: none; }

.warn {
  border-left: 2px solid #eab308;
  background: linear-gradient(90deg, #eab30812, transparent 70%);
  padding: 15px 20px; margin: 22px 0; border-radius: 0 6px 6px 0;
}
.warn strong { color: #eab308; }
.warn p { margin: 0; max-width: none; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 480px; }
th, td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--attrib); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-dim); background: var(--bg-sunken);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ffffff05; }
td.num, td .num { font-family: var(--mono); font-size: 13px; color: var(--ink); white-space: nowrap; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  padding: 1px 7px; border-radius: 3px; background: #ffffff10; color: var(--ink-mid);
}

/* ---------- Colour ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 14px; margin: 26px 0; }
.sw {
  border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
  background: var(--bg-raised); cursor: pointer; text-align: left;
  font: inherit; color: inherit; padding: 0; width: 100%;
  transition: border-color .15s, transform .15s;
}
.sw:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.sw:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.sw__chip { height: 92px; display: block; }
.sw__body { display: block; padding: 12px 14px 14px; }
.sw__name { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.sw__hex { display: block; font-family: var(--mono); font-size: 12px; color: var(--ink-mid); }
.sw__use { display: block; font-size: 11.5px; color: var(--ink-dim); margin-top: 7px; line-height: 1.45; }
.sw__copied { color: var(--ok); }

/* ---------- Logo ---------- */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 26px 0; }
.logo-cell { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.logo-cell__art { display: grid; place-items: center; padding: 42px 26px; min-height: 152px; }
.logo-cell__art img { max-width: 190px; width: 100%; height: auto; }
.on-black { background: var(--black); }
.on-white { background: #f2ede6; }
.logo-cell__cap {
  padding: 11px 14px; font-size: 12px; color: var(--ink-mid);
  border-top: 1px solid var(--line); background: var(--bg-raised);
}
.logo-cell__cap b { color: var(--ink); font-weight: 600; }

/* clear space diagram */
.clearspace { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 9px; padding: 34px; margin: 24px 0; }
.clearspace__box { position: relative; max-width: 340px; margin: 0 auto; padding: 12.5%; outline: 1px dashed var(--line-strong); }
.clearspace__box img { width: 100%; display: block; position: relative; z-index: 1; }
.clearspace__box::before {
  content: ''; position: absolute; inset: 12.5%;
  outline: 1px solid var(--orange); outline-offset: 0;
}
.clearspace__note { text-align: center; font-size: 12.5px; color: var(--ink-dim); margin: 20px 0 0; }

/* ---------- Type specimens ---------- */
.spec { border: 1px solid var(--line); border-radius: 9px; padding: 26px 28px; margin: 20px 0; background: var(--bg-raised); }
.spec__head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 16px; }
.spec__name { font-size: 17px; font-weight: 700; }
.spec__role {
  font-family: var(--attrib); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--orange);
}
.spec__lic { font-size: 11.5px; color: var(--ink-dim); margin-left: auto; }
.spec__sample { font-size: clamp(34px, 6.4vw, 62px); line-height: 1; margin: 0 0 6px; word-break: break-word; }
.spec__sample--display { font-family: var(--display); font-variation-settings: 'wght' 800, 'wdth' 70; letter-spacing: -.04em; text-transform: uppercase; }
.spec__sample--attrib { font-family: var(--attrib); font-weight: 700; letter-spacing: -.01em; font-size: clamp(24px, 4.2vw, 40px); text-transform: uppercase; }
.spec__meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-mid); }
.spec__meta b { color: var(--ink); font-weight: 600; }
.spec img { width: 100%; height: auto; border-radius: 6px; display: block; }

.scale-row { display: flex; align-items: baseline; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.scale-row:last-child { border-bottom: 0; }
.scale-row__lbl { flex: 0 0 108px; font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
.scale-row__art { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Format / safe-zone diagrams ---------- */
.fmt { border: 1px solid var(--line); border-radius: 11px; margin: 30px 0; overflow: hidden; background: var(--bg-raised); }
.fmt__head { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.fmt__title { font-family: var(--display); font-variation-settings: 'wght' 800, 'wdth' 75; text-transform: uppercase; font-size: 17px; letter-spacing: -.01em; }
.fmt__dims { font-family: var(--mono); font-size: 12px; color: var(--orange); }
.fmt__where { font-size: 12px; color: var(--ink-dim); margin-left: auto; }
.fmt__body { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 28px; padding: 24px 20px; align-items: start; }
@media (max-width: 720px) { .fmt__body { grid-template-columns: minmax(0, 1fr); } }

/* the canvas diagram */
.canvas { position: relative; width: 100%; background: #1b1b1b; border: 1px solid var(--line-strong); overflow: hidden; }
.canvas__safe { position: absolute; border: 1px dashed rgba(255,127,0,.85); background: rgba(255,127,0,.05); }
.canvas__excl { position: absolute; background: repeating-linear-gradient(45deg, rgba(248,113,113,.16) 0 5px, transparent 5px 10px); border: 1px solid rgba(248,113,113,.4); }
.canvas__el { position: absolute; border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.1); }
.canvas__el span, .canvas__excl span, .canvas__safe span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  font-family: var(--mono); font-size: 8.5px; color: rgba(255,255,255,.82);
  white-space: nowrap; letter-spacing: .02em; pointer-events: none;
}
.canvas__pill {
  position: absolute; border: 1px solid var(--orange); border-radius: 999px;
  background: rgba(0,0,0,.45);
  display: grid; place-items: center;
  font-family: var(--attrib); font-weight: 700; color: #fff;
  font-size: 7px; letter-spacing: .04em;
}
.canvas__logo { position: absolute; display: grid; place-items: center; }
.canvas__logo img { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 11px; color: var(--ink-dim); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend .l-safe { border: 1px dashed var(--orange); background: rgba(255,127,0,.08); }
.legend .l-excl { background: repeating-linear-gradient(45deg, rgba(248,113,113,.35) 0 4px, transparent 4px 8px); border: 1px solid rgba(248,113,113,.5); }
.legend .l-el { border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12); }

.specs dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 18px; margin: 0; font-size: 13.5px; }
.specs dt { color: var(--ink-dim); }
.specs dd { margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 460px) { .specs dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .specs dt { margin-top: 8px; } }

/* ---------- Do / Don't ---------- */
.dd { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 16px; margin: 26px 0; }
.dd__card { border: 1px solid var(--line); border-radius: 9px; padding: 18px 20px; background: var(--bg-raised); }
.dd__card--do { border-top: 2px solid var(--ok); }
.dd__card--no { border-top: 2px solid var(--no); }
.dd__lbl { font-family: var(--attrib); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.dd__card--do .dd__lbl { color: var(--ok); }
.dd__card--no .dd__lbl { color: var(--no); }
.dd__card ul { margin: 0; padding-left: 17px; font-size: 14px; }
.dd__card li { margin-bottom: 9px; line-height: 1.55; }
.dd__card li:last-child { margin-bottom: 0; }

/* ---------- Examples (copy) ---------- */
.ex { border: 1px solid var(--line); border-left: 2px solid var(--line-strong); border-radius: 0 8px 8px 0; padding: 14px 18px; margin: 12px 0; background: var(--bg-sunken); }
.ex--good { border-left-color: var(--ok); }
.ex--bad { border-left-color: var(--no); }
.ex__lbl { font-family: var(--attrib); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 7px; }
.ex--good .ex__lbl { color: var(--ok); }
.ex--bad .ex__lbl { color: var(--no); }
.ex__txt { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--ink); word-break: break-word; }
.ex__why { font-size: 12.5px; color: var(--ink-dim); margin: 8px 0 0; }

.formula {
  font-family: var(--mono); font-size: 13px; line-height: 1.9;
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px 18px; margin: 18px 0;
  overflow-x: auto; white-space: pre;
}
.formula b { color: var(--orange); font-weight: 400; }

/* ---------- Downloads ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 13px; margin: 26px 0; }
.dl__item {
  display: flex; align-items: center; gap: 13px;
  border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
  background: var(--bg-raised); text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.dl__item:hover { border-color: var(--orange); transform: translateY(-2px); color: inherit; }
.dl__ico { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: #ff7f0018; color: var(--orange); font-family: var(--mono); font-size: 9.5px; font-weight: 700; }
.dl__name { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.dl__sub { display: block; font-size: 11.5px; color: var(--ink-dim); margin-top: 2px; }

/* ---------- Checklist ---------- */
.check { list-style: none; padding: 0; margin: 22px 0; }
.check li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.check li:last-child { border-bottom: 0; }
.check input { margin-top: 4px; accent-color: var(--orange); width: 15px; height: 15px; flex: 0 0 auto; }
.check label { cursor: pointer; }
.check li:has(input:checked) label { color: var(--ink-dim); text-decoration: line-through; }

footer {
  margin-top: 90px; padding-top: 26px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-dim);
}

/* ---------- Mobile ---------- */
.navtoggle {
  display: none; position: fixed; z-index: 50; top: 12px; left: 12px;
  width: 42px; height: 42px; border-radius: 8px;
  background: #141414ee; border: 1px solid var(--line-strong); color: var(--ink);
  font-size: 17px; cursor: pointer; backdrop-filter: blur(8px);
}
@media (max-width: 900px) {
  .navtoggle { display: block; }
  .nav {
    position: fixed; z-index: 40; left: 0; top: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 60px #000c;
  }
  .nav.is-open { transform: none; }
  .main { padding-top: 62px; }
  .shell { display: block; }
}

@media print {
  .nav, .navtoggle { display: none; }
  body { background: #fff; color: #000; }
  .main { padding: 0; }
}
