/* ==========================================================================
   GODRANK — Front page. Chapters 01 Hero + 02 Expertise.
   Loaded only on the front page. All layer geometry and movement limits are
   declared once in :root — no magic numbers elsewhere in the file.
   ========================================================================== */

:root {
  /* ── Palette ─────────────────────────────────────────────────────────── */
  --gr-ink:        #0A0A0F;   /* near-black canvas                          */
  --gr-aubergine:  #14101C;   /* dark aubergine-black                       */
  --gr-gold:       #C9A84C;   /* GODRANK gold — informational, not decor    */
  --gr-signal:     #E8C96A;   /* bright signal yellow                       */
  --gr-field:      #E9BC33;   /* saturated gold-yellow field, keyed to the
                                 Oracle artwork so plate and section agree  */
  --gr-cream:      #F0EAD6;   /* warm cream                                 */
  --gr-silver:     #9A9AA6;   /* muted metallic silver                      */
  --gr-risk:       #8E2230;   /* deep red — volatility, used sparingly      */
  --gr-rule:       rgba(240,234,214,.14);

  /* ── Type ────────────────────────────────────────────────────────────── */
  --gr-serif: "Playfair Display", "Iowan Old Style", Georgia, serif;
  --gr-sans:  "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gr-mono:  ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --gr-display: clamp(2.5rem, 5.4vw, 5.5rem);
  --gr-h2:      clamp(2rem, 4.4vw, 3.75rem);

  /* ── Layout ──────────────────────────────────────────────────────────── */
  --gr-max:    1440px;
  --gr-gutter: clamp(1.25rem, 4vw, 5rem);
  --gr-navh:   72px;

  /* ── Pointer-driven values, written by home.js ───────────────────────── */
  --gr-px: 0;          /* normalised pointer X, -1 → 1 */
  --gr-py: 0;          /* normalised pointer Y, -1 → 1 */
  --gr-intensity: 0;   /* 0 → 1, orb hover / focus     */

  /* ── Movement limits ─────────────────────────────────────────────────── */
  --orb-max:   16px;
  --annot-max:  6px;

  /* ── Oracle plate geometry ───────────────────────────────────────────────
     Measured from the 1672 × 941 artwork. The orb sprite was cut from
     x303–676, y112–341, so these percentages place it back exactly where it
     was lifted from, at any plate size.                                     */
  --orb-left:   18.122%;
  --orb-top:    11.902%;
  --orb-width:  22.309%;
  --orb-cx:     29.276%;   /* orb centre, for the interactive target */
  --orb-cy:     24.070%;
}

@media (max-width: 900px) { :root { --orb-max: 8px; --gr-navh: 64px; } }

/* ==========================================================================
   Base
   ========================================================================== */
.gr-home {
  background: var(--gr-ink);
  color: var(--gr-cream);
  font-family: var(--gr-sans);
  line-height: 1.6;
  overflow-x: hidden;
}
.gr-home *, .gr-home *::before, .gr-home *::after { box-sizing: border-box; }
.gr-wrap { max-width: var(--gr-max); margin-inline: auto; padding-inline: var(--gr-gutter); }

.gr-home h1, .gr-home h2, .gr-home h3 {
  font-family: var(--gr-serif);
  font-weight: 700; line-height: .98; letter-spacing: -.02em;
  margin: 0; text-wrap: balance;
}

.gr-annot {
  font-family: var(--gr-mono);
  font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gr-silver);
}

.gr-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.gr-home :is(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--gr-signal); outline-offset: 3px; border-radius: 0;
}

/* Printed-paper grain */
.gr-grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   CHAPTER 01 — Interactive hero
   Asymmetric two-column spread: copy left on near-black, the Oracle plate
   right as a saturated colour block. Square corners, no frame, no radius.
   ========================================================================== */
.gr-hero {
  position: relative;
  min-height: 100svh;
  padding-top: calc(var(--gr-navh) + clamp(1.5rem, 5vh, 4rem));
  padding-bottom: clamp(1.5rem, 4vh, 3rem);
  display: grid;
  grid-template-rows: 1fr auto;
  align-content: center;
  isolation: isolate;
  background: radial-gradient(120% 90% at 20% 10%, var(--gr-aubergine) 0%, var(--gr-ink) 60%);
}

.gr-hero__spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

/* ── Copy column ────────────────────────────────────────────────────────── */
.gr-hero__copy { display: grid; align-content: center; gap: clamp(1rem, 2vh, 1.75rem); }
.gr-hero__eyebrow { display: flex; align-items: center; gap: .75rem; }
.gr-hero__eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--gr-rule); }

.gr-hero h1 { font-size: var(--gr-display); }
.gr-hero h1 em { font-style: normal; color: var(--gr-gold); }

.gr-hero__lede {
  max-width: 44ch; color: rgba(240,234,214,.74);
  font-size: clamp(.9375rem, 1.15vw, 1.0625rem);
}

.gr-cta-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.gr-btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--gr-mono);
  font-size: .75rem; letter-spacing: .18em; text-transform: uppercase;
  padding: .95rem 1.5rem;
  border: 1px solid var(--gr-gold); border-radius: 0;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.gr-btn--primary {
  background: var(--gr-signal); color: var(--gr-ink); border-color: var(--gr-signal);
  box-shadow: 4px 4px 0 rgba(201,168,76,.28);
}
.gr-btn--primary:hover { background: var(--gr-cream); border-color: var(--gr-cream); box-shadow: 6px 6px 0 rgba(201,168,76,.4); }
.gr-btn--ghost { color: var(--gr-cream); background: transparent; }
.gr-btn--ghost:hover { background: var(--gr-cream); color: var(--gr-ink); border-color: var(--gr-cream); }

/* ── Oracle plate ───────────────────────────────────────────────────────── */
.gr-oracle {
  position: relative;
  aspect-ratio: 1672 / 941;
  width: 100%;
  /* Bleed off the right edge so the plate reads as a spread, not a card */
  margin-right: calc(var(--gr-gutter) * -1);
  isolation: isolate;
}
.gr-oracle__plate {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* The chrome orb, lifted from the plate and reinstated as its own layer so
   it can move. Position matches the pixels it was cut from. */
.gr-oracle__orb {
  position: absolute;
  left: var(--orb-left); top: var(--orb-top); width: var(--orb-width);
  height: auto;
  z-index: 2;
  translate: calc(var(--gr-px) * var(--orb-max)) calc(var(--gr-py) * var(--orb-max));
  filter: brightness(calc(1 + var(--gr-intensity) * .3))
          drop-shadow(0 0 calc(var(--gr-intensity) * 26px) rgba(255,255,255,.75))
          drop-shadow(0 0 calc(var(--gr-intensity) * 46px) rgba(232,201,106,.7));
  transition: translate .45s cubic-bezier(.22,.61,.36,1), filter .3s ease;
  will-change: transform;
}

/* ── Signal-orb interactive target ──────────────────────────────────────
   A real focusable control that tracks the orb, not a pseudo-element.     */
.gr-orbtarget {
  position: absolute;
  z-index: 3;
  left: var(--orb-cx); top: var(--orb-cy);
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  translate: calc(var(--gr-px) * var(--orb-max)) calc(var(--gr-py) * var(--orb-max));
  transition: translate .45s cubic-bezier(.22,.61,.36,1);
  display: grid; place-items: center;
  background: none; border: 0; padding: 0; border-radius: 50%;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.gr-orbtarget__label {
  position: absolute; top: calc(100% + 16px); left: 50%; translate: -50% 0;
  white-space: nowrap;
  font-family: var(--gr-mono); font-size: .625rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gr-cream);
  background: rgba(10,10,15,.88); border: 1px solid var(--gr-gold);
  padding: .45em .75em;
  opacity: var(--gr-intensity); transition: opacity .25s ease;
  pointer-events: none;
}

/* Signal markers are deliberately NOT added in CSS.
   The Oracle artwork already carries its own measurement column and crop
   marks down the right edge; overlaying a second set of annotations read as
   noise and collided with the proof strip. The artwork supplies the
   technical-annotation language for this chapter. */

/* ── Proof strip ────────────────────────────────────────────────────────── */
.gr-proof {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
  border-top: 1px solid var(--gr-rule);
  margin-top: clamp(1.5rem, 4vh, 3rem);
  padding-top: 1.25rem;
}
.gr-proof__v { font-family: var(--gr-serif); font-size: clamp(1.5rem, 2.6vw, 2.5rem); color: var(--gr-gold); line-height: 1; }
.gr-proof__k { margin-top: .35rem; }

/* Scroll cue */
.gr-scrollcue {
  position: absolute; left: 50%; bottom: .5rem; translate: -50% 0; z-index: 3;
  display: grid; justify-items: center; gap: .4rem; text-decoration: none;
}
.gr-scrollcue__line { width: 1px; height: 28px; background: linear-gradient(var(--gr-gold), transparent); }
@media (prefers-reduced-motion: no-preference) {
  .gr-scrollcue__line { animation: gr-cue 2.4s ease-in-out infinite; transform-origin: top; }
  @keyframes gr-cue { 0%,100% { scale: 1 .4; opacity: .4 } 50% { scale: 1 1; opacity: 1 } }
}

@media (max-width: 940px) {
  .gr-hero { min-height: auto; }
  .gr-hero__spread { grid-template-columns: 1fr; gap: 2rem; }
  .gr-oracle { margin-right: calc(var(--gr-gutter) * -1); margin-left: calc(var(--gr-gutter) * -1); }
  .gr-proof { grid-template-columns: repeat(2, 1fr); row-gap: 1.25rem; }
  .gr-scrollcue { display: none; }
}

/* ==========================================================================
   CHAPTER 02 — Expertise
   ========================================================================== */
.gr-expertise {
  position: relative;
  background: var(--gr-field);
  color: var(--gr-ink);
  padding-block: clamp(3.5rem, 9vw, 8rem);
}
.gr-expertise h2 { font-size: var(--gr-h2); max-width: 18ch; }
.gr-expertise .gr-annot { color: rgba(10,10,15,.6); }
.gr-expertise__head { display: grid; gap: 1.25rem; margin-bottom: clamp(2rem, 5vw, 4rem); }

.gr-srv { border-top: 1px solid rgba(10,10,15,.22); }
.gr-srv:last-of-type { border-bottom: 1px solid rgba(10,10,15,.22); }
.gr-srv__link {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1.05fr) auto;
  align-items: baseline;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.25rem, 2.6vw, 2.1rem);
  text-decoration: none; color: inherit;
}
.gr-srv__idx { font-family: var(--gr-mono); font-size: .75rem; letter-spacing: .1em; color: rgba(10,10,15,.55); }
.gr-srv__name {
  font-family: var(--gr-serif);
  font-size: clamp(1.4rem, 2.9vw, 2.4rem); line-height: 1.02;
  transition: translate .3s cubic-bezier(.22,.61,.36,1);
}
.gr-srv__desc { color: rgba(10,10,15,.72); font-size: .9375rem; max-width: 44ch; }
.gr-srv__meta { display: flex; align-items: center; gap: 1rem; }
.gr-srv__market {
  font-family: var(--gr-mono); font-size: .625rem; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(10,10,15,.6);
  border: 1px solid rgba(10,10,15,.28); padding: .3em .55em; white-space: nowrap;
}
.gr-srv__arrow { flex: none; transition: translate .3s cubic-bezier(.22,.61,.36,1); }

/* Hover: shift the name, thicken the rule, reveal the annotation. No card. */
.gr-srv:hover, .gr-srv:focus-within { border-top-color: var(--gr-ink); border-top-width: 2px; }
.gr-srv:hover .gr-srv__name, .gr-srv:focus-within .gr-srv__name { translate: .5rem 0; }
.gr-srv:hover .gr-srv__arrow, .gr-srv:focus-within .gr-srv__arrow { translate: .4rem 0; }
.gr-srv__tech {
  display: block;
  font-family: var(--gr-mono); font-size: .625rem; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(10,10,15,.5);
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .3s ease, opacity .3s ease, margin-top .3s ease;
}
.gr-srv:hover .gr-srv__tech, .gr-srv:focus-within .gr-srv__tech { max-height: 2rem; opacity: 1; margin-top: .5rem; }

@media (max-width: 860px) {
  .gr-srv__link { grid-template-columns: 3rem 1fr auto; row-gap: .6rem; }
  .gr-srv__desc, .gr-srv__meta { grid-column: 2 / -1; }
}

/* ==========================================================================
   CHAPTER 03 — Methodology (warm cream project index)
   ========================================================================== */
.gr-method {
  background: var(--gr-cream);
  color: var(--gr-ink);
  padding-block: clamp(3.5rem, 9vw, 8rem);
}
.gr-method h2 { font-size: var(--gr-h2); max-width: 16ch; }
.gr-method .gr-annot { color: rgba(10,10,15,.55); }
.gr-method__head { display: grid; gap: 1.25rem; margin-bottom: clamp(2rem, 5vw, 4rem); }
.gr-method__lede { max-width: 52ch; color: rgba(10,10,15,.72); }

.gr-stage { border-top: 1px solid rgba(10,10,15,.2); }
.gr-stage:last-of-type { border-bottom: 1px solid rgba(10,10,15,.2); }
.gr-stage__row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.25rem, 2.4vw, 2rem);
  align-items: baseline;
}
.gr-stage__idx { font-family: var(--gr-mono); font-size: .75rem; color: rgba(10,10,15,.5); }
.gr-stage__name { font-family: var(--gr-serif); font-size: clamp(1.25rem, 2.2vw, 1.85rem); line-height: 1.05; }
.gr-stage__desc { color: rgba(10,10,15,.72); font-size: .9375rem; }

/* Approved client categories — we name market types, never invent clients */
.gr-cats { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.gr-cats__list { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; padding: 0; list-style: none; }
.gr-cats__list li {
  font-family: var(--gr-mono); font-size: .6875rem; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(10,10,15,.72);
  border: 1px solid rgba(10,10,15,.28); padding: .5em .8em;
}

@media (max-width: 860px) {
  .gr-stage__row { grid-template-columns: 3rem 1fr; row-gap: .5rem; }
  .gr-stage__desc { grid-column: 2 / -1; }
}

/* ==========================================================================
   CHAPTER 04 — Intelligence (near-black technical)
   ========================================================================== */
.gr-intel { background: var(--gr-ink); color: var(--gr-cream); padding-block: clamp(3.5rem, 9vw, 8rem); }
.gr-intel h2 { font-size: var(--gr-h2); max-width: 16ch; }
.gr-intel__head { display: grid; gap: 1.25rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }

.gr-intel__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

/* Article rows — dividers, not cards */
.gr-post { border-top: 1px solid var(--gr-rule); }
.gr-post:last-of-type { border-bottom: 1px solid var(--gr-rule); }
.gr-post__link {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1.5rem;
  align-items: baseline; padding-block: 1.4rem;
  text-decoration: none; color: inherit;
}
.gr-post__cat { display: block; margin-bottom: .5rem; }
.gr-post__title {
  font-family: var(--gr-serif); font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.2;
  transition: color .2s ease;
}
.gr-post:hover .gr-post__title, .gr-post:focus-within .gr-post__title { color: var(--gr-signal); }
.gr-post__arrow { flex: none; transition: translate .3s cubic-bezier(.22,.61,.36,1); }
.gr-post:hover .gr-post__arrow, .gr-post:focus-within .gr-post__arrow { translate: .35rem 0; }

/* Scanner module — carries the chrome orb motif forward from the hero */
.gr-scanner { border: 1px solid rgba(201,168,76,.38); padding: clamp(1.5rem, 3vw, 2.25rem); position: relative; }
.gr-scanner__orb {
  width: 84px; height: auto; display: block; margin-bottom: 1rem;
  filter: drop-shadow(0 0 18px rgba(232,201,106,.35));
}
.gr-scanner h3 { font-family: var(--gr-serif); font-size: clamp(1.3rem, 2vw, 1.7rem); margin-bottom: .75rem; }
.gr-scanner__desc { color: rgba(240,234,214,.72); font-size: .9375rem; }
.gr-scanner__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin: 1.5rem 0; padding-block: 1rem;
  border-top: 1px solid var(--gr-rule); border-bottom: 1px solid var(--gr-rule);
}
.gr-scanner__v { font-family: var(--gr-mono); font-size: 1.05rem; color: var(--gr-signal); }
.gr-scanner__note { margin-top: .9rem; }

@media (max-width: 940px) { .gr-intel__grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   CHAPTER 05 — Contact (dark aubergine, large gold type)
   ========================================================================== */
.gr-contact { background: var(--gr-aubergine); color: var(--gr-cream); padding-block: clamp(3.5rem, 9vw, 8rem); }
.gr-contact h2 {
  font-size: clamp(2.25rem, 6.5vw, 5.5rem);
  color: var(--gr-signal);
  max-width: 14ch;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.gr-contact__lede { max-width: 50ch; color: rgba(240,234,214,.74); margin-bottom: clamp(2rem, 4vw, 3rem); }

/* One action per row. In a multi-column grid the space-between arrow lands at
   its own cell's right edge and reads as though it belongs to the next item. */
.gr-contact__actions {
  display: grid; grid-template-columns: 1fr;
  border-top: 1px solid rgba(201,168,76,.35);
}
.gr-contact__action {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: clamp(1.1rem, 2vw, 1.6rem) 0;
  border-bottom: 1px solid rgba(201,168,76,.35);
  text-decoration: none; color: var(--gr-cream);
  font-family: var(--gr-serif); font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  transition: color .2s ease, padding-left .25s ease;
}
.gr-contact__action + .gr-contact__action { border-left: 0; }
.gr-contact__action:hover { color: var(--gr-signal); padding-left: .5rem; }

.gr-contact__meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}
.gr-contact__meta p { margin: .4rem 0 0; color: rgba(240,234,214,.7); font-size: .9375rem; }
.gr-contact__meta a { color: var(--gr-signal); }

/* ==========================================================================
   Reduced motion — static plate, no parallax, no pulse
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .gr-home * { animation: none !important; transition: none !important; }
  .gr-oracle__orb, .gr-orbtarget, .gr-hero__markers { translate: none !important; }
}
