/* ==========================================================================
   WIFI WEALTH — Base: reset, typography, primitives, layout scaffold
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* header height + breathing room for in-page anchors */
  scroll-padding-top: 7rem;
  /* The grain and the custom cursor are fixed elements deliberately parked
     outside the viewport. Clip at the root so they can never raise a phantom
     horizontal scrollbar. `clip` rather than `hidden` because hidden would
     make this a scroll container and break position:sticky underneath it;
     the hidden declaration is the fallback for Safari 15 and older. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--noir);
  color: var(--bone);
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 300;
  line-height: 1.62;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, h5, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
}
button { cursor: pointer; }

::selection { background: var(--brass); color: var(--noir); }

:focus-visible {
  outline: var(--hair) solid var(--brass);
  outline-offset: 4px;
}

/* Scrollbar — thin, brass thumb, no chrome default */
* { scrollbar-width: thin; scrollbar-color: var(--brass-lo) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--noir); }
::-webkit-scrollbar-thumb {
  background: var(--brass-lo);
  border: 3px solid var(--noir);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--brass); }

/* --------------------------------------------------------------------------
   Typography primitives
   -------------------------------------------------------------------------- */

.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: var(--track-display);
  font-optical-sizing: auto;
}

.t-hero { font-size: var(--t-hero); line-height: 0.84; }
.t-d1   { font-size: var(--t-d1);   line-height: 0.9;  }
.t-d2   { font-size: var(--t-d2);   line-height: 0.98; }
.t-d3   { font-size: var(--t-d3);   line-height: 1.14; letter-spacing: -0.02em; }

.italic { font-style: italic; }

/* The brass italic is the brand's one flourish. Use it sparingly. */
.gilt {
  font-style: italic;
  color: var(--brass);
}

.eyebrow {
  font-family: var(--sans);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--brass);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.85em;
}
.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: var(--hair);
  background: currentColor;
  opacity: 0.55;
  flex: none;
}
.eyebrow.is-bare::before { display: none; }
.eyebrow.is-muted { color: var(--bone-3); }

.caps {
  font-size: var(--t-small);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  font-weight: 400;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--bone-2);
  font-weight: 300;
  max-width: 46ch;
}

.muted { color: var(--bone-2); }
.dim   { color: var(--bone-3); }

.num {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.24em;
  color: var(--bone-3);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.prose p + p { margin-top: 1.15em; }
.prose { max-width: var(--readw); color: var(--bone-2); }
.prose strong { color: var(--bone); font-weight: 500; }
.prose em { font-style: italic; }
.prose a {
  color: var(--bone);
  background-image: linear-gradient(var(--brass), var(--brass));
  background-repeat: no-repeat;
  background-size: 100% var(--hair);
  background-position: 0 100%;
  padding-bottom: 1px;
  transition: background-size var(--dur-1) var(--ease-out), color var(--dur-1);
}
.prose a:hover { color: var(--brass); background-size: 0% var(--hair); }

/* --------------------------------------------------------------------------
   Layout scaffold
   -------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell-wide { max-width: none; padding-inline: var(--gutter); }

.section { padding-block: var(--shelf); position: relative; }
.section-s { padding-block: var(--shelf-s); }
.section-flush-top { padding-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}

.rule { height: var(--hair); background: var(--rule); border: 0; width: 100%; }
.rule-soft { background: var(--rule-soft); }

/* Section head: number + eyebrow on the left, title on the right.
   This asymmetry is the site's structural signature. */
.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: var(--gutter);
  align-items: start;
  padding-top: 1.75rem;
  border-top: var(--hair) solid var(--rule);
}
.sec-head__meta { display: flex; flex-direction: column; gap: 0.9rem; }
.sec-head__body { display: flex; flex-direction: column; gap: 1.5rem; }

@media (max-width: 860px) {
  .sec-head { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.stack   { display: flex; flex-direction: column; }
.stack-1 { gap: 0.5rem; }  .stack-2 { gap: 1rem; }
.stack-3 { gap: 1.75rem; } .stack-4 { gap: 2.75rem; }
.stack-5 { gap: 4rem; }

.row { display: flex; flex-direction: row; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row-between {
  display: flex; flex-direction: row; align-items: center;
  justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}

.tar { text-align: right; }
.tac { text-align: center; }
.nowrap { white-space: nowrap; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: fixed; top: 0.75rem; left: 0.75rem;
  z-index: 200; padding: 0.75rem 1.25rem;
  background: var(--brass); color: var(--noir);
  letter-spacing: var(--track-caps); text-transform: uppercase;
  font-size: var(--t-micro);
  transform: translateY(-160%);
  transition: transform var(--dur-1) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

/* --------------------------------------------------------------------------
   Atmosphere: film grain + the column guides
   Two fixed overlays that give every page the same physical "stock".
   -------------------------------------------------------------------------- */

.grain {
  position: fixed;
  inset: -160px;
  z-index: var(--z-guides);
  pointer-events: none;
  opacity: 0.34;
  background-image: url("../img/texture-grain.svg");
  background-size: 220px 220px;
  mix-blend-mode: overlay;
  animation: grain-drift 6s steps(6, end) infinite;
}
@keyframes grain-drift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-40px, 20px); }
  40%  { transform: translate(30px, -30px); }
  60%  { transform: translate(-20px, -40px); }
  80%  { transform: translate(40px, 30px); }
  100% { transform: translate(0, 0); }
}

.guides {
  position: fixed;
  inset: 0;
  z-index: var(--z-guides);
  pointer-events: none;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}
.guides span {
  border-left: var(--hair) solid var(--rule-soft);
  height: 100%;
}
.guides span:first-child { border-left-color: transparent; }
@media (max-width: 860px) { .guides { display: none; } }

/* Vignette — pulls the eye to centre without a heavy overlay */
.vignette {
  position: fixed;
  inset: 0;
  z-index: var(--z-guides);
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 42%, rgba(0,0,0,0.5) 100%);
}
[data-surface="paper"] .vignette,
[data-surface="paper"] .grain { display: none; }

/* --------------------------------------------------------------------------
   Motion posture
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .grain { animation: none; }
}
