/* ============================================================
   PE LETTERFORMS — "each letter worth a trillion dollars"
   LETTERING V4 (built 2026-11-03, drawer): Form 2 — Gold Leaf Sign,
   Direction A construction in the Deep Gold colorway, approved by
   the owner 2026-11-03 00:15 (art: lettering-audit-2026-11-01/
   site-lettering-forms-2-goldleaf-v4-edges.png; recipe:
   lettering-audit-2026-11-01/COLORWAYS.md, Colorway 1 — Deep Gold).

   What V4 is: a painted-glass gold-leaf face — the Direction A foil
   stack (crown highlight, two fractal-grain layers, vertical
   brushing, diagonal sheen) over the 13-stop Deep Gold face, plus
   Form 2's own marks: fine horizontal leaf striation, diagonal
   facet wedges, a defined dark-bronze edge (.9px, .68), and a HARD
   block shade (stepped solid shadows — no blur; a block shade is a
   solid offset silhouette).

   SUPERSESSION NOTE: the Phase 2 doctrine (2026-10-17, "clipped-
   gradient text is BANNED; layered solid fill only") was the rule
   when this file last shipped. The 2026-11-01 lettering audit put
   three directions to the owner; he picked Direction A (the clipped
   foil face), then the Deep Gold colorway, then approved Form 2
   Gold-Leaf through V2/V3 to V4. The owner's later, specific
   approval governs this system. Do not "restore" the solid fill
   without a new owner ruling.

   ARCHITECTURE (the layering law, proven in QA 2026-11-03): inside
   one element, a ::before/::after copy with negative z-index paints
   ABOVE the element's own background but BELOW its text. So a cast
   copy can never sit behind a background-clip:text face on the SAME
   element — it covers the face and the headline renders as dark
   bronze silhouettes (measured: planner headlines, first V4 build).
   The estate's working pattern (.craft, .wm-name) puts the cast on
   the host and the face on a child. This system mirrors it with the
   two layers the JS span can carry:
   - Plain-text headlines (JS sets data-text): the span's own TEXT
     is the cast body — solid deep bronze with the stepped block +
     ambient + aura in its text-shadow (shadows painted from solid
     glyphs are safe) — and the ::after copy carries the leaf FACE,
     translated a hair up-left so the cast reads down-right.
   - Headlines with inline elements (no data-text; the mirror can't
     replicate styled children): the face rides the span's background
     (background-clip:text) and there is no cast — the pre-V4
     corporate hero H1 already rendered exactly this way.
   - NO drop-shadow filter ever sits on the blended face: QA proved
     blend-stack + filter on one large element crashes Chromium's
     rasterizer (corporate, full viewport). Ambient and aura ride
     the cast layer's blurred text-shadows instead.
   - Clipped text always carries text-shadow:NONE (the audit's
     silver-wash gotcha); the cast text is solid, so ITS shadows
     are the safe kind.
   Layout and copy are untouched — this file only dresses glyphs.
   Loaded LAST in <head> so it wins ties; JS adds .pe-metal classes
   and data-text (for the face mirror).
   Barry 2026-09-24: NEVER flatten to fix darkness — brighten metal.
   ============================================================ */

.pe-metal{
  position:relative!important;
  z-index:0!important;
}
/* the retired single-layer cast never paints in V4 (see header) */
.pe-metal::before{content:none!important}

/* ================================================================
   THE V4 FACE STACK — shared by both paths below.
   Layers (top → bottom): crown highlight · fine grain · broad
   grain · vertical brushing · horizontal leaf striation · 115°
   sheen · diagonal facet wedges · sheen band (parked at 125%) ·
   Deep Gold face. Values are the COLORWAYS max-richness settings
   verbatim: grain rects .85/.70, brushing white .15 / dark .17,
   sheen head white .28, aura rgba(238,182,44,.30).
   ================================================================ */

/* ---- PATH 2 — background face (headlines with inline elements;
   no data-text, no cast) ---- */
.pe-metal:not([data-text]){
  color:transparent!important;
  -webkit-text-fill-color:transparent!important;
  -webkit-background-clip:text!important;
  background-clip:text!important;
  background-image:
    linear-gradient(180deg,rgba(255,255,255,1) 0%,rgba(255,250,235,.62) 6%,rgba(255,255,255,0) 15%),
    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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.85'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.02' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)' opacity='0.70'/%3E%3C/svg%3E"),
    repeating-linear-gradient(90deg,rgba(255,255,255,.15) 0 1px,rgba(255,255,255,0) 1px 3px,rgba(20,10,0,.17) 3px 4px,rgba(0,0,0,0) 4px 8px),
    repeating-linear-gradient(180deg,rgba(255,255,255,.10) 0 1px,rgba(255,255,255,0) 1px 3px,rgba(43,24,0,.10) 3px 4px,rgba(0,0,0,0) 4px 7px),
    linear-gradient(115deg,rgba(255,255,255,.28) 0%,rgba(255,255,255,0) 24%,rgba(40,20,0,.28) 52%,rgba(255,255,255,0) 76%,rgba(255,240,200,.21) 100%),
    linear-gradient(118deg,rgba(255,255,255,.15) 0%,rgba(255,255,255,.15) 9%,rgba(255,255,255,0) 16%,rgba(255,255,255,0) 30%,rgba(58,32,0,.13) 38%,rgba(58,32,0,.13) 44%,rgba(255,255,255,0) 52%,rgba(255,255,255,0) 68%,rgba(255,244,205,.13) 76%,rgba(255,244,205,.13) 82%,rgba(255,255,255,0) 90%),
    linear-gradient(105deg,rgba(255,252,240,0) 42%,rgba(255,252,240,0) 46%,rgba(255,252,240,1) 50%,rgba(255,252,240,0) 54%,rgba(255,252,240,0) 58%),
    linear-gradient(176deg,#ffffff 0%,#ffeaa8 6%,#f6d05c 12%,#fff7da 19%,#e0a81e 27%,#f9da6c 35%,#cf9211 43%,#fffbe9 51%,#bd7d0c 60%,#f1c750 68%,#a26a06 76%,#e7ba3c 85%,#755002 100%);
  background-size:100% 100%,140px 140px,300px 300px,8px 100%,100% 7px,100% 100%,100% 100%,230% 100%,100% 100%;
  background-position:0 0,0 0,0 0,0 0,0 0,0 0,0 0,125% 0,0 0;
  background-blend-mode:screen,overlay,soft-light,overlay,soft-light,soft-light,soft-light,screen,normal;
  -webkit-text-stroke:.9px rgba(46,28,4,.68)!important;
  text-shadow:none!important;
  filter:none!important;
}

/* ---- PATH 1 — cast body (plain-text headlines; data-text set):
   the span's own glyphs are the deep-bronze block, extended by
   stepped hard shadows, then the ambient drop and warm aura as
   blurred steps. Cast base #140c01, steps #170e02 / #0d0700. ---- */
.pe-metal[data-text]{
  color:#170e02!important;
  -webkit-text-fill-color:#170e02!important;
  background:none!important;
  -webkit-text-stroke:0!important;
  text-shadow:0 .016em 0 #170e02,0 .032em 0 #140c01,0 .048em 0 #0d0700,0 .16em 30px rgba(0,0,0,.50),0 .05em 42px rgba(238,182,44,.26)!important;
  filter:none!important;
}
/* ---- PATH 1 — the leaf face rides ::after, a hair up-left of the
   cast body so the block shade reads down-right ---- */
.pe-metal[data-text]::after{
  content:attr(data-text);
  position:absolute;inset:0;z-index:1;
  color:transparent;-webkit-text-fill-color:transparent;
  -webkit-background-clip:text;background-clip:text;
  background-image:
    linear-gradient(180deg,rgba(255,255,255,1) 0%,rgba(255,250,235,.62) 6%,rgba(255,255,255,0) 15%),
    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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.85'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.02' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)' opacity='0.70'/%3E%3C/svg%3E"),
    repeating-linear-gradient(90deg,rgba(255,255,255,.15) 0 1px,rgba(255,255,255,0) 1px 3px,rgba(20,10,0,.17) 3px 4px,rgba(0,0,0,0) 4px 8px),
    repeating-linear-gradient(180deg,rgba(255,255,255,.10) 0 1px,rgba(255,255,255,0) 1px 3px,rgba(43,24,0,.10) 3px 4px,rgba(0,0,0,0) 4px 7px),
    linear-gradient(115deg,rgba(255,255,255,.28) 0%,rgba(255,255,255,0) 24%,rgba(40,20,0,.28) 52%,rgba(255,255,255,0) 76%,rgba(255,240,200,.21) 100%),
    linear-gradient(118deg,rgba(255,255,255,.15) 0%,rgba(255,255,255,.15) 9%,rgba(255,255,255,0) 16%,rgba(255,255,255,0) 30%,rgba(58,32,0,.13) 38%,rgba(58,32,0,.13) 44%,rgba(255,255,255,0) 52%,rgba(255,255,255,0) 68%,rgba(255,244,205,.13) 76%,rgba(255,244,205,.13) 82%,rgba(255,255,255,0) 90%),
    linear-gradient(105deg,rgba(255,252,240,0) 42%,rgba(255,252,240,0) 46%,rgba(255,252,240,1) 50%,rgba(255,252,240,0) 54%,rgba(255,252,240,0) 58%),
    linear-gradient(176deg,#ffffff 0%,#ffeaa8 6%,#f6d05c 12%,#fff7da 19%,#e0a81e 27%,#f9da6c 35%,#cf9211 43%,#fffbe9 51%,#bd7d0c 60%,#f1c750 68%,#a26a06 76%,#e7ba3c 85%,#755002 100%);
  background-size:100% 100%,140px 140px,300px 300px,8px 100%,100% 7px,100% 100%,100% 100%,230% 100%,100% 100%;
  background-position:0 0,0 0,0 0,0 0,0 0,0 0,0 0,125% 0,0 0;
  background-blend-mode:screen,overlay,soft-light,overlay,soft-light,soft-light,soft-light,screen,normal;
  -webkit-text-stroke:.9px rgba(46,28,4,.68);
  /* text-shadow is INHERITED and Chromium paints a text run's shadow
     ABOVE its clipped background — without this the cast body's shadow
     stack washes the mirror's face to dark bronze (QA bisect3). The
     mirror always carries text-shadow:none. */
  text-shadow:none;
  transform:translate(-.014em,-.028em);
  pointer-events:none;white-space:pre-wrap;
}

/* ---- hero grade: deeper block (steps to ≈.10em total) + the
   colorway's full aura at 54px ---- */
.pe-metal--hero[data-text]{
  text-shadow:0 .02em 0 #170e02,0 .04em 0 #170e02,0 .06em 0 #140c01,0 .08em 0 #0d0700,0 .18em 36px rgba(0,0,0,.55),0 .06em 54px rgba(238,182,44,.30)!important;
}
.pe-metal--hero[data-text]::after{transform:translate(-.018em,-.04em)}

/* ---- soft grade: quiet pages (privacy/legal) — metal, no depth
   tricks. Unchanged by V4 by design: the quiet register is a flat
   pale gold, not a headline treatment. Wins over both paths. ---- */
.pe-metal.pe-metal--soft{
  color:#f6db9c!important;
  -webkit-text-fill-color:#f6db9c!important;
  -webkit-text-stroke:0!important;
  background:none!important;
  text-shadow:none!important;
  filter:drop-shadow(0 1px 0 rgba(0,0,0,.7))!important;
  animation:none!important;
}
.pe-metal.pe-metal--soft::before,.pe-metal.pe-metal--soft::after{content:none!important}

/* ---- heritage kickers: Cinzel caps on an engraved plaque (Direction A:
   kickers become Cinzel caps with double hairline rules). Cinzel is
   re-added to fonts.css for this system (the subset file never left
   the disk). Color is NOT forced here: each page context keeps its
   own kicker tone (the Deep Gold contexts already sit in the
   #e3ac2e/#c9920e family; light paper contexts keep their deep gold,
   which the FP-H contrast note requires). Rules follow currentColor. ---- */
.pe-kicker{
  font-family:"Cinzel",serif!important;
  font-weight:700!important;
  letter-spacing:.22em!important;
}
.pe-kicker::before,.pe-kicker::after{
  content:""!important;
  display:inline-block!important;
  width:30px!important;height:5px!important;
  border-top:1px solid currentColor!important;
  border-bottom:1px solid currentColor!important;
  opacity:.75!important;
  vertical-align:middle!important;
  background:none!important;
}
.pe-kicker::before{margin-right:.8em!important}
.pe-kicker::after{margin-left:.8em!important}

/* ---- JS wrapper span: the companion script nests a heading's inline
   content in span.pe-metal, so the host element keeps its own ::before /
   ::after decorations (underline sweeps, badges) and its own layout.
   inline-block gives the face mirror an exact glyph box. ---- */
span.pe-metal{display:inline-block;max-width:100%;vertical-align:baseline}

/* ---- reduced motion: any motion stops, letterforms stay dressed ---- */
@media (prefers-reduced-motion:reduce){
  .pe-metal{animation:none!important}
}

/* ---- mobile: V4 does NOT go flat (the 2026-11-01 audit's verdict on
   the old system: it "goes flat exactly where most visitors see it").
   The leaf face and edge stay at every width; only the block shade
   steps down and the aura tightens so small glyphs don't cram. ---- */
@media (max-width:700px){
  .pe-metal:not([data-text]){-webkit-text-stroke-width:.7px!important}
  .pe-metal[data-text]::after{-webkit-text-stroke-width:.7px}
  .pe-metal[data-text]{
    text-shadow:0 .014em 0 #170e02,0 .028em 0 #0d0700,0 .12em 18px rgba(0,0,0,.5),0 .04em 24px rgba(238,182,44,.22)!important;
  }
  .pe-metal[data-text]::after{transform:translate(-.012em,-.024em)}
  .pe-metal--hero[data-text]{
    text-shadow:0 .016em 0 #170e02,0 .032em 0 #140c01,0 .048em 0 #0d0700,0 .14em 24px rgba(0,0,0,.52),0 .05em 34px rgba(238,182,44,.26)!important;
  }
  .pe-metal--hero[data-text]::after{transform:translate(-.014em,-.03em)}
}


/* ===== Lettering landing slots (finish pass FP-G9) =====
   Every page's H1 carries [data-drawn-lettering-slot]: the slot IS the live
   headline's own box — same markup, same sizing — so the finished drawn
   lettering replaces the slot's contents in one move per page, with no
   layout change. No artwork is placed by this rule; it only guarantees the
   landing contract. */
[data-drawn-lettering-slot]{position:relative}
