/* =====================================================================
   BASE — reset, type scale, shared components, focus + motion rules
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Every themed block paints its own background + text */
[class*="theme-"] { background: var(--bg); color: var(--fg); }

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

.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--blue); color: var(--white); padding: 10px 16px; border-radius: var(--pill);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---- Focus: always visible, never removed ---- */
:focus-visible {
  outline: 2px solid var(--blue-text);
  outline-offset: 3px;
  border-radius: 4px;
}
.theme-cream :focus-visible { outline-color: var(--blue); }
.theme-blue :focus-visible  { outline-color: var(--white); }

/* =====================================================================
   TYPE
   ===================================================================== */

/* Display: Fraunces, uppercase, tight */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 144;
  text-transform: uppercase;
  line-height: .9;
  letter-spacing: -0.02em;
  font-size: clamp(2.75rem, 8.4vw, 7.25rem);
  color: var(--fg);
}
.display .hl { color: var(--hl-display); }
/* The square "full stop" from the reference layout, in brand blue */
.dot {
  display: inline-block; width: .17em; height: .17em; margin-left: .05em;
  background: var(--blue); vertical-align: baseline;
}
.theme-blue .dot { background: var(--white); }

/* Kicker above headlines: lowercase Poppins SemiBold (brand ref: "how to get a") */
.kicker {
  font: 600 clamp(1.05rem, 2vw, 1.5rem)/1.2 var(--font-body);
  color: var(--fg);
  margin-bottom: .35em;
}

/* Section label: "01 — BRANDS" in JetBrains Mono */
.sec-label, .mono {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sec-label { color: var(--hl); display: flex; align-items: center; gap: .75em; margin-bottom: 1.25rem; }

/* Editorial italic summary (Fraunces italic) */
.lede {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 36;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.45;
  color: var(--fg);
}
.lede .hl, .hl-text { color: var(--hl); }

/* Caveat handwritten note */
.hand {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  line-height: 1.1;
  color: var(--fg);
}

/* Tilted mono aside, like "(in tech)" in the brand reference */
.aside-tilt {
  display: inline-block;
  font: 400 clamp(.9rem, 1.4vw, 1.1rem)/1 var(--font-mono);
  transform: rotate(12deg);
  color: var(--fg);
}

/* =====================================================================
   SECTION HEADER — label / kicker / big headline | italic summary / rule
   ===================================================================== */
.sec-head {
  display: grid;
  gap: 1.5rem;
  padding-bottom: clamp(28px, 4vw, 48px);
  margin-bottom: clamp(32px, 5vw, 64px);
  border-bottom: 1px solid var(--rule);
}
.sec-head .lede { max-width: 30ch; }
@media (min-width: 900px) {
  .sec-head { grid-template-columns: 1.15fr 1fr; align-items: end; column-gap: 4rem; }
  .sec-head .lede { justify-self: start; }
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  min-height: 48px; padding: 0 1.5em;
  border-radius: var(--pill);
  font: 600 .95rem/1 var(--font-body);
  text-decoration: none;
  background: transparent;
  border: 1.5px solid transparent;
  transition: transform .2s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn svg { width: 1em; height: 1em; transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: #1E4C97; }
.btn-secondary { border-color: var(--cream); color: var(--white); }
.btn-secondary:hover { background: var(--cream); color: var(--ink); }
.btn-cream { background: var(--cream); color: var(--ink); }
.btn-cream:hover { background: var(--white); }
.theme-blue .btn-secondary { border-color: var(--white); }
.theme-blue .btn-secondary:hover { background: var(--white); color: var(--blue); }
.theme-cream .btn-secondary { border-color: var(--ink); color: var(--ink); }
.theme-cream .btn-secondary:hover { background: var(--ink); color: var(--cream); }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border: 1.5px solid var(--line); border-radius: 50%;
  color: var(--fg); transition: border-color .2s, background-color .2s, color .2s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--blue); background: var(--blue); color: var(--white); }

/* =====================================================================
   HAND-DRAWN ARROWS — stroke draws in once when scrolled into view
   ===================================================================== */
.arrow { width: 92px; height: 56px; overflow: visible; color: var(--fg); flex: none; }
.arrow path {
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 220; stroke-dashoffset: 220;
}
.is-in .arrow path, .arrow.is-in path { animation: draw 1.1s var(--ease) .25s forwards; }
.is-in .arrow path + path, .arrow.is-in path + path { animation-delay: 1s; animation-duration: .4s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* =====================================================================
   REVEAL ON SCROLL (fade + slide up)
   ===================================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* While main.js builds the page, keep the empty shell invisible so nothing
   appears to jump. (Only set when JS runs; without JS nothing is hidden.) */
.rendering main, .rendering .footer { visibility: hidden; }

/* No JS? Show everything. */
.no-js .reveal { opacity: 1; transform: none; }

/* =====================================================================
   REDUCED MOTION — respect the user's OS setting
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .arrow path { stroke-dashoffset: 0; }
}
