/* =========================================
   1. VARIABLES & ROOT
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;

    /* THE LADDER — MASTERED IN THE PHIDELITY EDITOR.
       Every rung here is the editor's rung, and every master class further
       down is the editor's class. The editor is where the scale is authored
       and where it has to hold together, so it is the master and this file
       follows it; when the two disagree, css/macro.css in the editor repo
       wins. The band-to-band ratio and the per-band ceilings come from
       js/phi-grid.js, which mirrors js/editor-common.js constant for constant.

       Every rung is Base x scale-up^n:
           n=4  H1 Large      n=3  H1 Medium    n=2  H2, H1 Small
           n=1  H3, Summary   n=0  P            n=-1 Caption

       H2 AND H3 ARE BACK UP A RUNG (H2 to n=2, H3 to n=1), which is where
       js/phi-grid.js has been putting them all along. They were moved DOWN
       here to match the editor's macro.css, and that left this file
       contradicting typeRungsCSS() — which wins, because it restates the
       rungs in the scope that changes --scale-up while these declarations
       compute once and inherit. So the sites have been rendering n=1/n=2
       through every widget and n=0/n=1 everywhere else. This file now agrees
       with phi-grid, and the editor has moved up to meet both.

       H1 Small is an alias of H2, not a rung of its own: that is what keeps
       this change from resizing anything that reads --type-h1-s. Declared per
       element (not on :root) so a container that overrides --scale-up
       recomputes them. */
    --type-h3: calc(var(--type-base) * var(--scale-up));

    /* H4 = Base (phi^0). A heading at BODY SIZE, told apart from P by family
       rather than size or weight: serif 400 against Inter 300. H3's move up to
       phi^1 left nothing at reading size, and a card title should not tower
       over a narrow column. Its OWN variable, not var(--type-base) at the call
       site — reading a variable that only happens to equal body size is what
       broke three widgets when H3 moved. */
    --type-h4: var(--type-base);

    --type-h2: calc(var(--type-base) * var(--scale-up) * var(--scale-up));

    /* H1 Standard/Small — the same rung as H2, by the alias above. */
    --type-h1-s: var(--type-h2);

    /* H1 Medium */
    --type-h1-m: calc(var(--type-base) * var(--scale-up) * var(--scale-up) * var(--scale-up));

    /* H1 Large */
    --type-h1-l: calc(var(--type-base) * var(--scale-up) * var(--scale-up) * var(--scale-up) * var(--scale-up));

    /* H1 Large, ceilinged: base-ref x phi^4 x 1.309 = 143.55px. Named because
       Summary Large hangs off it — the two have to cap together or Summary
       keeps climbing after the headline has stopped. */
    --type-h1-l-capped: min(var(--type-h1-l), calc(var(--type-base-ref, 1rem) * 8.97202));

    /* Default H1 mapping */
    --type-h1: var(--type-h1-m);

    /* Display Sizes mapping. Large maps to the CEILINGED rung: a consumer
       reading the variable rather than the .type-display-lg class would
       otherwise bypass the cap. */
    --type-display-med: var(--type-h1-m);
    --type-display-lg: var(--type-h1-l-capped);
    --type-display-sm: var(--type-h1-s);

    /* Summary: Base * Scale Up (Not Down) */
    --type-summary-l: calc(var(--type-base) * var(--scale-up));

    /* Summary S: Base / Scale Down — P a half-step down, H4's partner.
       --scale-down is a flat 1.309 in every band, so this holds a constant
       ratio to body: 12.22px from band 24 up. It resolves to the same number
       as --type-caption today, but is written as the formula because the two
       answer to different things — captions and eyebrows there, card text
       here — and only happen to agree. */
    --type-summary-s: calc(var(--type-base) / var(--scale-down));

    /* Summary Large: H1 Large, one phi-squared step down — NOT base x
       scale-up-squared. Those agree only where scale-up happens to be phi, and
       everywhere else the square collapses this onto H1 Small.

       Floored at SUMMARY, not at H2. The floor is there so the narrow bands
       converge rather than invert; it read --type-h2 while H2 shared the phi^1
       rung with Summary. With H2 a rung higher, a floor still reading it would
       drag Summary Large onto H2 and H1 Small together — three names on one
       size. */
    --type-summary-xl: max(
        var(--type-summary-l),
        calc(var(--type-h1-l-capped) / 2.618033989)
    );

    /* DOWNSCALING (Captions, Micro) - Uses Scale Down */
    --type-caption: calc(var(--type-base) / var(--scale-down));
    --type-micro: calc(var(--type-caption) / var(--scale-down));
}

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

html {
    background-color: var(--mono-09);
    /* LEVEL 1: ROOT CONTAINER */
    container-type: inline-size;
    container-name: phi-root;
}

body {
    /* DEFAULT VARIABLES (Mobile First) */
    --phi: 1.618033988;

    /* MODULAR SCALES */
    --scale-up: 1.309;
    /* Mobile: Moderate growth */
    --scale-down: 1.309;
    /* Mobile: Moderate shrink */

    --nav-width: 362px;
    --header-height: 60px;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'DM Serif Display', serif;

    /* TYPOGRAPHY SCALES.
       --type-base-ref is the size body text takes on a 13px column, which is
       what every band threshold puts it at. A reference, not a rendered size:
       inside a band, phi-grid.js clamps --type-base against it. Elements off
       the ladder keep the fixed --type-base below. */
    --type-base-ref: 1rem;
    --type-base: 1.0618rem;
    /* Optical-size compensation, keyed to the RENDERED size tier:
           H1 Large   (50–116px)  -0.01em
           H1 Med / H1 Small       0em    ← DM Serif Display sets these open
           H2             (~30px) -0.01em
           H3 and below   (17px)  +0.02em ← stays positive on purpose

       H1 Medium and H1 Small were -0.015em and -0.01em until 17 Aug 2026.
       Checked against the Figma masters, DM Serif Display wants 0 at both:
       the negative tracking was closing the counters at the sizes those two
       rungs actually render (38–72px), and only H1 Large is large enough to
       need the pull. H1 Small got its own variable in the same pass — it was
       riding --tracking-h2, which meant it could not move without dragging
       H2 (a different rung, a whole phi-step smaller) along with it. */
    --tracking-display-lg: -0.01em;
    --tracking-display: 0em;
    /* H1 Small. Was --tracking-h2; split out so the two move independently. */
    --tracking-display-sm: 0em;
    --tracking-h2: -0.01em;
    --tracking-heading: 0.02em;
    --tracking-base: 0em;

    /* Leading: Golden Ratio for Body */
    --leading-base: 1.618;
    /* Headings will use tighter line-heights manually */

    /* --- COLOR DEFINITIONS (Strict Phi Palette) --- */

    /* 1. MONOCHROME (1-10, + wash 11) */
    --mono-01: #000000;
    --mono-02: #0E0E0E;
    --mono-03: #252525;
    --mono-04: #3C3C3C;
    --mono-05: #616161;
    --mono-06: #9E9E9E;
    --mono-07: #C3C3C3;
    --mono-08: #DADADA;
    --mono-09: #F1F1F1;
    --mono-10: #FFFFFF;

    /* 2. PHI GREEN (1-12, + wash 13) */
    --green-01: #002500;
    --green-02: #003C00;
    --green-03: #009E00;
    --green-04: #00C300;
    --green-05: #00DA00;
    --green-06: #00F100;
    --green-07: #00FF00;
    --green-08: #00FF61;
    --green-09: #61FF9E;
    --green-10: #9EFFC3;
    --green-11: #C3FFDA;
    --green-12: #DAFFF1;

    /* 3. PHI BLUE (1-14, + wash 15) */
    --blue-01: #00003C;
    --blue-02: #000061;
    --blue-03: #000E9E;
    --blue-04: #000EC3;
    --blue-05: #003CC3;
    --blue-06: #0061DA;
    --blue-07: #009EFF;
    --blue-08: #00C3FF;
    --blue-09: #00DAFF;
    --blue-10: #3CFFFF;
    --blue-11: #61FFFF;
    --blue-12: #9EFFFF;
    --blue-13: #C3FFFF;
    --blue-14: #DAFFFF;

    /* 4. PHI PURPLE (1-8, + wash 9) */
    --purple-01: #250E3C;
    --purple-02: #3C0061;
    --purple-03: #61009E;
    --purple-04: #9E3CC3;
    --purple-05: #9E61C3;
    --purple-06: #C39EFF;
    --purple-07: #DAC3FF;
    --purple-08: #F1F1FF;

    /* 5. PHI MAGENTA (1-10, + wash 11) */
    --magenta-01: #3C003C;
    --magenta-02: #610061;
    --magenta-03: #9E009E;
    --magenta-04: #C300C3;
    --magenta-05: #DA00DA;
    --magenta-06: #F100F1;
    --magenta-07: #FF61FF;
    --magenta-08: #FF9EFF;
    --magenta-09: #FFDAFF;
    --magenta-10: #FFF1FF;

    /* 6. PHI RED (1-12, + wash 13) */
    --red-01: #250000;
    --red-02: #3C0000;
    --red-03: #610000;
    --red-04: #9E0000;
    --red-05: #DA0000;
    --red-06: #FF0000;
    --red-07: #FF3C3C;
    --red-08: #FF6161;
    --red-09: #FF9E9E;
    --red-10: #FFC3C3;
    --red-11: #FFDADA;
    --red-12: #FFF1F1;

    /* 7. PHI EARTH (1-10, + wash 11) */
    --earth-01: #250E0E;
    --earth-02: #3C250E;
    --earth-03: #613C25;
    --earth-04: #9E613C;
    --earth-05: #FF9E61;
    --earth-06: #FFC39E;
    --earth-07: #FFDAC3;
    --earth-08: #FFF1DA;
    --earth-09: #FFFFDA;
    --earth-10: #FFFFF1;

    /* 8. PHI SOLAR (1-12, + wash 13) */
    --solar-01: #F12500;
    --solar-02: #F13C00;
    --solar-03: #F16100;
    --solar-04: #FF9E00;
    --solar-05: #FFC300;
    --solar-06: #FFDA00;
    --solar-07: #FFF100;
    --solar-08: #FFFF61;
    --solar-09: #FFFF9E;
    --solar-10: #FFFFC3;
    --solar-11: #FFFFDA;
    --solar-12: #FFFFF1;

    /* 9. THE WASH RUNGS (1-8, one per family) — 12 Sep 2026
       ------------------------------------------------------------------
       The lightest tint each hue can carry and still be a colour, added so
       the Pantone deck and any page tint have a background wash to reach for.

       THE 88 RUNGS ABOVE HAVE NO BACKGROUND TINT AMONG THEM. Every one pins a
       channel to `00` or `FF`, and in HSL that forces saturation to 100% — so
       71 of the 78 chromatic tokens sit at exactly S=100%, and a tinted card
       reads as highlighter rather than paper. Not one of the 88 is both light
       and muted.

       SAME LADDER, TWO RUNGS FURTHER. Every channel in the palette is 255
       divided by phi repeatedly, plus each rung's 255-complement:
       `00 0E 25 3C 61 9E C3 DA F1 FF`. These add `F6` (9 from white) and `FA`
       (5 from white) — rungs that were simply never reached, because nothing
       had needed to sit this close to white. `E8` (23 from white) is still
       unused and is where a second wash per family would go.

       TWO ARE NOT THE NAIVE CONTINUATION. Earth takes 9-from-white, not 5:
       Earth and Solar travel the same direction (blue channel only) and
       already collide — earth-10 and solar-12 are byte-identical #FFFFF1. At 5
       the new pair sat dE 1.02 apart, the threshold of noticing; 9 doubles it.
       Purple suppresses red and green EQUALLY, (9,9,0) from white, which is
       what makes it violet — suppressing red harder tips the hue to 220, where
       Blue's own wash already sits.

       GREEN CHANGES DIRECTION, deliberately: the family drifts mint (green-12
       is 37:14 red-to-blue), this is symmetric at 14:14, making it the first
       true pale green in the palette.

       MONO'S WASH IS NOT ITS LIGHTEST RUNG, because mono-10 is pure white — so
       mono-11 sits BETWEEN 09 and 10. The number is an identity, not a
       position. Renumbering is not available: --mono-10 is what --c-bg,
       --c-hover and --c-zone-bg resolve to.
       ------------------------------------------------------------------ */
    --mono-11: #FAFAFA;
    --green-13: #F1FFF1;
    --blue-15: #F1FFFF;
    --purple-09: #F6F6FF;
    --magenta-11: #FFFAFF;
    --red-13: #FFFAFA;
    --earth-11: #FFFFF6;
    --solar-13: #FFFFFA;

    /* A second wash on the FA byte (29 Sep 2026), matching the editor's
       master macro.css: green-14, blue-16, purple-10. blue-11 (#61FFFF) stays
       defined but is no longer shown — 1.60 CIEDE2000 from blue-10. */
    --green-14: #FAFFFA;
    --blue-16: #FAFFFF;
    --purple-10: #FAFAFF;

    /* UI MAPPINGS */
    --c-bg: var(--mono-10);
    --c-text: var(--mono-03);

    /* The summary family's colour, as ONE knob. The family contradicted
       itself before: mono-06 on Summary Large's class, mono-05 on Summary's,
       and --c-text (mono-03) on the legacy names — so a legacy name rendered
       visibly darker than its canonical twin at the identical rung.

       mono-05 rather than mono-06 because Summary Small is card BODY text at
       12.22px: AA's 4.5:1 for normal text applies, not the 3:1 large-text
       one. Against white mono-05 is 6.19:1 and mono-06 is 2.68:1. */
    --c-summary: var(--mono-05);
    --c-text-muted: var(--mono-06);
    --c-border: var(--mono-04);
    --c-border-light: var(--mono-08);
    --c-nav-bg: var(--mono-09);
    --c-hover: var(--mono-10);
    --c-zone-bg: var(--mono-10);
    /* Updated to White per user request */

    /* LAYOUT CONTROLLER */
    --max-width: 3840px;
    --radius-base: 0px;

    /* BODY LAYOUT */
    margin: 0 auto;
    /* Centered */
    padding: 0;
    display: grid;
    grid-template-rows: var(--header-height) 1fr var(--header-height);

    max-width: var(--max-width);
    width: 100%;

    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-sans);
    font-size: var(--type-base);
    line-height: var(--leading-base);
    font-weight: 300;
    /* Inter Regular */
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

/* =========================================
   2. BASE STYLES
   ========================================= */

p {
    margin: 0 0 1rem 0;
    font-weight: 300;
    letter-spacing: var(--tracking-base);
}

/* HEADERS: DM Serif Display */
h1,
h2 {
    margin: 0 0 1rem 0;
    font-family: var(--font-serif);
    font-weight: 400;
    /* DM Serif Display is typically 400 */
    /* --tracking-h2, matching the editor's copy. This read --tracking-heading
       (+0.02em, the H3-and-below rung) until 17 Aug 2026, which is where every
       widget that imports macro.css got its h2 tracking — so a 40px serif
       heading opened up instead of pulling in. h1 overrides this on its own
       rule below, so this line now only reaches h2. */
    letter-spacing: var(--tracking-h2);
}

h1 {
    font-size: var(--type-h1);
    line-height: 1.1;
    /* --tracking-display, not --tracking-heading. --type-h1 maps to H1 Medium,
       so a bare h1 IS the H1 Medium rung and must track with it. It read
       --tracking-heading (+0.02em, the H3-and-below rung) until 17 Aug 2026,
       which pointed a 57px serif headline the wrong way down the ladder and
       left it unmoved when the display rungs were retuned. */
    letter-spacing: var(--tracking-display);
}

h2 {
    font-size: var(--type-h2);
    line-height: 1.2;
}

/* H3 is SERIF, on the --type-h3 rung (phi^1) rather than P's size. This
   comment used to say "H3 can stay Sans or Serif depending on preference,
   keeping Serif for consistency with headers" and then set sans; the
   preference is settled the way it always leaned. Serif is the display voice
   of every other heading rung, so Inter 700 was the one break in it — and it
   was breaking it at body size, where family was the only signal of a level
   left. DM Serif Display ships one weight: 400, never 700, or the browser
   synthesises it. Tracking and leading come off H2, not --tracking-heading,
   because at phi^1 this is a display line rather than bold body text. */
h3 {
    font-family: var(--font-serif);
    font-size: var(--type-h3);
    line-height: 1.2;
    font-weight: 400;
    margin: 2rem 0 0.5rem 0;
    letter-spacing: var(--tracking-h2);

    /* Keep title with text */
    /* Keep title with text */
    break-after: avoid;
    break-inside: avoid;
    -webkit-column-break-after: avoid;
    /* Safari/WebKit Legacy */
    page-break-after: avoid;
    orphans: 3;
}

/* H4 — serif at BODY SIZE. The bottom heading rung: no size step, the whole
   distinction carried by the family. 400 because DM Serif Display ships one
   weight. Tracking 0, not --tracking-heading's +0.02em, which was tuned for
   Inter. Leading 1.3 rather than H2/H3's 1.2 — at body size this wraps like
   body text. */
h4 {
    font-family: var(--font-serif);
    font-size: var(--type-h4);
    line-height: 1.3;
    font-weight: 400;
    letter-spacing: 0;
    margin: 1.5rem 0 0.5rem 0;

    break-after: avoid;
    break-inside: avoid;
    orphans: 3;
}

/* Force adjacent paragraph to stick to H3 */
h3+p {
    break-before: avoid;
    -webkit-column-break-before: avoid;
}

/* LEAD / SUMMARY TEXT */
.lead {
    font-family: var(--font-sans);
    font-size: var(--type-summary-l);
    font-weight: 300;
    /* Inter Light for elegance */
    line-height: 1.5;
    /* Was --c-text (mono-03), which rendered this visibly DARKER than
       .phi-p-summary at the identical rung. */
    color: var(--c-summary);
    max-width: 65ch;
    /* Optimal reading length */
}

/* THE DISPLAY RUNGS — H1 Large / Medium / Small, the editor's three H1
   palette blocks. Tracking comes off the --tracking-* variables rather than
   literals so it matches the editor exactly; the literals here were -0.04em
   and -0.03em against the editor's -0.02em and -0.015em.

   PAIRING: H1 Large goes with Summary Large (.phi-p-summary-l) and only where
   a section is wide enough to carry a display pair. H1 Medium goes with
   Summary (.phi-p-summary). Do not cross the pairs. */
.type-display-lg {
    font-family: var(--font-serif);
    font-size: var(--type-display-lg);
    line-height: 1.05;
    font-weight: 400;
    letter-spacing: var(--tracking-display-lg);
    margin-bottom: 1rem;
}

.type-display-med {
    font-family: var(--font-serif);
    font-size: var(--type-display-med);
    line-height: 1.05;
    font-weight: 400;
    letter-spacing: var(--tracking-display);
    margin-bottom: 1rem;
}

.type-display-sm {
    font-family: var(--font-serif);
    font-size: var(--type-display-sm);
    line-height: 1.1;
    font-weight: 400;
    letter-spacing: var(--tracking-display-sm);
    margin-bottom: 1rem;
}

/* SUMMARY, AND WHAT ITS NAME MEANS.

   .summary-l is the SUMMARY rung — Base x scale-up, one step above body —
   and .phi-p-summary below is the same rung under the name the editor and
   the published pages use. Prefer .phi-p-summary in new markup; keep this
   one working, it is on pages already out there.

   The "-l" is not "Large". It dates from a scale that had exactly two
   summaries, l and s, where l meant "the bigger of the two". The editor's
   ladder has a third rung above this one — Summary Large, --type-summary-xl,
   H1 Large a phi-squared step down — and that is the one that pairs with H1
   Large, in sections wide enough to carry a display pair. Reading "-l" as
   that rung is how a hero ends up authored a full step too big.

   Summary Large itself is deliberately NOT defined here yet: it is floored
   at H2 in the editor, and this stack rungs H2 one step higher (Base x
   scale-up-squared against the editor's Base x scale-up), so a copied
   definition would collapse onto H1 Small. Re-runging H2/H3 is a visible
   restyle of every heading on the site and a separate decision — the same
   one js/phi-grid.js records at typeRungsCSS. */
/* Legacy name for .phi-p-summary's rung. The two were NOT interchangeable
   before this: same size, mono-03 here against mono-05 there. */
.summary-l {
    font-family: var(--font-sans);
    font-size: var(--type-summary-l);
    font-weight: 300;
    line-height: 1.5;
    color: var(--c-summary);
}

/* Legacy. NOT the same rung as .phi-p-summary-s: this sits at body size, the
   canonical Summary Small a --scale-down step below. Size kept, colour joins
   the family. */
.summary-s {
    font-family: var(--font-sans);
    font-size: var(--type-base);
    font-weight: 300;
    line-height: 1.5;
    color: var(--c-summary);
}

small {
    font-family: var(--font-sans);
    font-size: var(--type-caption);
    color: var(--c-text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.caption {
    font-family: var(--font-sans);
    font-size: var(--type-base);
    font-weight: 300;
    color: var(--mono-06);
    display: block;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.name {
    font-family: var(--font-sans);
    font-size: var(--type-base);
    font-weight: 700;
    color: var(--c-text);
    margin: 0;
}

.role {
    font-family: var(--font-sans);
    font-size: var(--type-base);
    font-weight: 300;
    color: var(--mono-05);
    margin: 0;
}

.type-micro {
    font-family: var(--font-sans);
    font-size: var(--type-micro);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.eyebrow-l {
    font-family: var(--font-sans);
    font-size: var(--type-base);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 300;
    line-height: 1.2;
}

.eyebrow-s {
    font-family: var(--font-sans);
    font-size: var(--type-micro);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    line-height: 1.2;
}

.zone {
    background: var(--c-zone-bg);
    /*   border: 1px solid var(--c-border); */
    min-height: 1em;
    /* Reduced from 300px to prevent gaps */

    /* Flex Container for Height Filling */
    display: flex;
    flex-direction: column;

    /* Container Query Context */
    container-type: inline-size;
    container-name: macro-zone;
}

/* UTILITY: Dark Zone (Matches mono-02 widgets, hides border) */
.zone.dark {
    background: var(--mono-02);
    border-color: var(--mono-02);
}

/* UTILITY: Dark Border Only */
.zone.border-dark {
    border-color: var(--mono-02);
}

/* =========================================
   3. APP SHELL
   ========================================= */

/* MAIN GRID */
.shell-body {
    display: grid;
    transition: grid-template-columns 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
    position: relative;
    height: calc(100vh - 120px);
    /* Viewport - Header - Footer */
}

/* DESKTOP LOGIC (Container > 1000px) */
@container phi-root (min-width: 1000px) {
    body {
        /* Desktop: Aggressive growth upwards (Phi), Gentle shrink downwards (Half-step) */
        --scale-up: 1.618;
        --scale-down: 1.309;

        /* Re-calc variables that depend on scale-up (CSS vars don't auto-recalc if defined in body but logic is sound if these are just values) 
           Actually, since we defined --type-h3 as calc(--scale-up), updating --scale-up here WILL update the result. 
        */
    }

    /* APPLICATION MODE: Force Moderate Scale on Desktop */
    body.mode-app {
        --scale-up: 1.309;
        --scale-down: 1.309;
    }

    /* CONTENT OVERRIDES: Force mobile scale (1.309) on narrow containers */
    @container macro-view (max-width: 999px) {
        .phi-macro-orchestrator, .phi-content-block, .zone, phi-section, .phi-h1 {
            --scale-up: 1.309 !important;
            --scale-down: 1.309 !important;
        }
    }
    @container macro-zone (max-width: 999px) {
        .phi-macro-orchestrator, .phi-content-block, .zone, phi-section, .phi-h1 {
            --scale-up: 1.309 !important;
            --scale-down: 1.309 !important;
        }
    }
    @container phi-section (max-width: 999px) {
        .phi-macro-orchestrator, .phi-content-block, .zone, phi-section, .phi-h1 {
            --scale-up: 1.309 !important;
            --scale-down: 1.309 !important;
        }
    }
    @container zone-main (max-width: 999px) {
        .phi-macro-orchestrator, .phi-content-block, .zone, phi-section, .phi-h1 {
            --scale-up: 1.309 !important;
            --scale-down: 1.309 !important;
        }
    }

    .shell-body {
        grid-template-columns: var(--nav-width) 1fr 0px;
    }

    phi-left-nav {
        border-right: 1px solid var(--c-border);
        border-left: 1px solid var(--c-border);
    }

    phi-right-nav {
        border-left: 1px solid var(--c-border);
        border-right: 1px solid var(--c-border);
        visibility: hidden;
        opacity: 0;
    }

    /* States */
    .left-closed .shell-body {
        grid-template-columns: 0px 1fr 0px;
    }

    .left-closed phi-left-nav {
        visibility: hidden;
        opacity: 0;
    }

    .right-open .shell-body {
        grid-template-columns: var(--nav-width) 1fr var(--aside-width, var(--nav-width));
    }

    .right-open phi-right-nav {
        visibility: visible;
        opacity: 1;
    }

    .left-closed.right-open .shell-body {
        grid-template-columns: 0px 1fr var(--aside-width, var(--nav-width));
    }
}

/* MOBILE LOGIC (Container < 1000px) */
@container phi-root (max-width: 999px) {
    .shell-body {
        display: block;
        position: relative;
        height: auto;
        min-height: calc(100vh - 120px);
    }

    phi-left-nav,
    phi-right-nav {
        position: fixed;
        top: var(--header-height);
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 4000;
        background: var(--c-nav-bg);
        transition: transform 0.3s ease;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
        visibility: hidden;
    }

    phi-left-nav {
        left: 0;
        border-right: 1px solid var(--c-border);
        transform: translateX(-100%);
    }

    phi-right-nav {
        right: 0;
        border-left: 1px solid var(--c-border);
        transform: translateX(100%);
    }

    body.mobile-left-open phi-left-nav {
        transform: translateX(0);
        visibility: visible;
    }

    body.mobile-right-open phi-right-nav {
        transform: translateX(0);
        visibility: visible;
    }

    /* Backdrop */
    body.mobile-left-open::after,
    body.mobile-right-open::after {
        content: '';
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 3000;
        animation: fadeIn 0.3s forwards;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =========================================
   4. ZONES (Content Slots)
   ========================================= */
.zone {
    background: var(--c-zone-bg);
    /* border: 1px solid var(--c-border); */
    min-height: 1em;
    /* Container Query Context */
    container-type: inline-size;
    container-name: macro-zone;
    /* content-visibility: auto; <-- REMOVED: Breaks anchor scrolling height calculation */
}

/* UTILITY: Dark Zone */
.zone.dark {
    background: var(--mono-02);
    border-color: var(--mono-02);
}

/* UTILITY: Dark Border Only */
.zone.border-dark {
    border-color: var(--mono-02);
}

/* =========================================
   5. GRID CONTAINERS & FLEX BOXES
   ========================================= */

/* The root macro grid container that establishes math calculations for all children */
article,
.phi-container {
    container-type: inline-size;

    /* 
       Global Phidelity Grid Math
       Variables are exposed to all children for perfectly synced spacing.
       --col-count is typically set by the container or via responsive classes (default 74)
    */
    --phi-col-w: calc(100cqw / var(--col-count, 74));
    --phi-row-h: calc(var(--phi-col-w) / 1.618033988);
}

/* 
   Content Block
   A container meant to be placed on a grid, but uses Flexbox internally.
   Padding and Gap perfectly match the exact parent grid geometry.
*/
.Content,
.phi-content-block {
    display: flex;
    flex-direction: column;
    /* Default spacing - Vertical padding: 0, Horizontal padding: 0 */
    padding: 0;
    /* Space between flex items is exactly 2 rows */
    gap: calc(var(--phi-row-h) * 2);

    /* Visual card styles */
    background-color: var(--mono-10);
    border: none;
}

/* Explicit breakpoint flow overrides set by the Phidelity Editor */
.Content[data-flex-dir="row"],
.phi-content-block[data-flex-dir="row"] {
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: stretch;
}

/* Force flex children to split horizontal space perfectly when in row mode */
.Content[data-flex-dir="row"]>*,
.phi-content-block[data-flex-dir="row"]>* {
    flex: 1;
    min-width: 0;
}

/* Modifiers for Padding */
.Content.pad-1,
.phi-content-block.pad-1 {
    /* 1 row down, 1 column in */
    padding: var(--phi-row-h) var(--phi-col-w);
}

.Content.pad-2,
.phi-content-block.pad-2 {
    /* 2 rows down, 2 columns in */
    padding: calc(var(--phi-row-h) * 2) calc(var(--phi-col-w) * 2);
}

.Content.pad-3,
.phi-content-block.pad-3 {
    /* 3 rows down, 3 columns in */
    padding: calc(var(--phi-row-h) * 3) calc(var(--phi-col-w) * 3);
}

.Content.pad-0,
.phi-content-block.pad-0 {
    padding: 0;
}

/* Modifiers for Gap */
.Content.gap-1,
.phi-content-block.gap-1 {
    gap: var(--phi-row-h);
}

.Content.gap-2,
.phi-content-block.gap-2 {
    gap: calc(var(--phi-row-h) * 2);
}

.Content.gap-3,
.phi-content-block.gap-3 {
    gap: calc(var(--phi-row-h) * 3);
}

.Content.gap-0,
.phi-content-block.gap-0 {
    gap: 0;
}


/* Dark variant */
.Content.dark,
.phi-content-block.dark {
    background-color: var(--mono-02);
    border-color: var(--mono-02);
    color: var(--mono-10);
}

/* =========================================
   6. GRID-LOCKED IMAGE UTILITIES
   ========================================= */

/* 
   By calculating aspect ratios using exact grid variables, 
   we guarantee visual alignment with adjacent structural blocks, 
   ignoring native aspect-ratio percentages that would fail on gaps. 
*/

.phi-image-placeholder {
    width: 100%;
    background-color: var(--mono-08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mono-05);
    font-family: var(--font-sans);
    font-size: var(--type-base);
    font-weight: 600;
}

.landscape {
    /* 1 col wide : 1 col tall (1:1.618 ratio technically) */
    width: 100%;
    height: auto;
    aspect-ratio: var(--phi);
    object-fit: cover;
}

.square {
    /* 2 cols wide : 3 rows tall */
    width: 100%;
    height: auto;
    aspect-ratio: calc((2 * var(--phi)) / 3);
    object-fit: cover;
}

.portrait {
    /* 1 col wide : 2 rows tall */
    width: 100%;
    height: auto;
    aspect-ratio: calc(var(--phi) / 2);
    object-fit: cover;
}

.tall {
    /* 1 col wide : 4 rows tall */
    width: 100%;
    height: auto;
    aspect-ratio: calc(var(--phi) / 4);
    object-fit: cover;
}

.panorama {
    /* 3 cols wide : 1 row tall */
    width: 100%;
    height: auto;
    aspect-ratio: calc(3 * var(--phi));
    object-fit: cover;
}

/* 
   Image Background Modifier 
   Moves the image to a z-index layer behind the text inside a Content Block. 
   Content Block parent must be position: relative! 
*/
.phi-content-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    /* Override aspect ratios if necessary to fill parent */
    height: 100%;
    z-index: -1;
    /* Placed exactly underneath text children */
    object-fit: cover;
    pointer-events: none;
    /* Ignore clicks so text can be edited */
}

/* Make sure parent content blocks are relative to trap backgrounds */
.Content,
.phi-content-block {
    position: relative;
    z-index: 1;
}

/* =========================================
   7. MASTER TYPOGRAPHY (Micro Elements)
   ========================================= */
.phi-h1 {
    font-family: var(--font-serif);
    font-size: var(--type-h1);
    line-height: 1.1;
    /* Declared rather than inherited from the `h1` element rule: .phi-h1 is
       also used on non-h1 elements, and its 0,1,0 specificity would otherwise
       leave those at the default tracking while real h1s got the ladder. */
    letter-spacing: var(--tracking-display);
    color: var(--mono-02);
    margin: 0;
}

.phi-h2 {
    font-family: var(--font-serif);
    font-size: var(--type-h2);
    line-height: 1.2;
    letter-spacing: var(--tracking-h2);
    color: var(--mono-02);
    margin: 0;
}

/* PULL QUOTE — rides H3, italic, no added weight. It was pinned to the
   phi-squared rung to stop it shrinking when H2 moved down; with H2 back at
   phi^2 that pin would give it H2's exact size in H2's family, so a quote
   mid-article read as a section heading. It was never bold — no weight was
   declared, so it took body's 300 and DM Serif Display only has a 400 — but
   at phi^2 in near-black --mono-02 it read heavy. 400 is stated, and the
   colour eases one step. */
.phi-blockquote {
    font-family: var(--font-serif);
    font-size: var(--type-h3);
    font-style: italic;
    font-weight: 400;
    line-height: 1.35;
    color: var(--mono-03);
    margin: 0;
    padding: 0;
    border: none;
}

/* Mirrors the `h3` element rule above — serif 400 on the phi^1 rung. The two
   must not drift: .phi-h3 gets applied to non-h3 elements. */
.phi-h3 {
    font-family: var(--font-serif);
    font-size: var(--type-h3);
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: var(--tracking-h2);
    color: var(--mono-02);
    margin: 0;
}

/* Mirrors the `h4` element rule — serif 400 at body size. */
.phi-h4 {
    font-family: var(--font-serif);
    font-size: var(--type-h4);
    line-height: 1.3;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--mono-02);
    margin: 0;
}

.phi-p {
    font-family: var(--font-sans);
    font-size: var(--type-base);
    line-height: var(--leading-base);
    color: var(--mono-04);
    margin: 0;
}

.phi-p-summary {
    font-family: var(--font-sans);
    font-size: var(--type-summary-l);
    font-weight: 300;
    line-height: 1.4;
    color: var(--c-summary);
    margin: 0;
}

/* Summary Small — H4's partner. Inter against H4's serif, a half-step under
   body. Leading 1.5 sits between Summary's 1.4 and P's phi: the family
   loosens as it shrinks. */
.phi-p-summary-s {
    font-family: var(--font-sans);
    font-size: var(--type-summary-s);
    font-weight: 300;
    line-height: 1.5;
    color: var(--c-summary);
    margin: 0;
}

/* Summary Large — the partner for H1 Large, and only that. It exists here now
   because H2 sits at n=1 as it does in the editor, which is what its floor
   assumes; on the old runging this collapsed onto H1 Small. */
.phi-p-summary-l {
    font-family: var(--font-sans);
    font-size: var(--type-summary-xl);
    font-weight: 300;
    line-height: 1.3;
    /* Was mono-06 — one step DARKER now, on the family token. The only rung
       that moves toward the text rather than away from it. */
    color: var(--c-summary);
    margin: 0;
}

.phi-eyebrow {
    font-family: var(--font-sans);
    /* The Caption rung, not a literal 0.8rem — an eyebrow that does not move
       with the band renders larger than Summary at the narrow end. */
    font-size: var(--type-caption);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    /* Matches .phi-p weight. The kicker reads as a label via caps and
       tracking, not extra weight — the editor's own call, and this copy was
       still at 700 against it. */
    font-weight: 300;
    color: var(--mono-05);
    margin: 0;
}

.phi-caption {
    font-family: var(--font-sans);
    font-size: var(--type-caption);
    line-height: 1.4;
    color: var(--mono-05);
    margin: 0;
}

/* =========================================
   8. MACRO SECTION GRID (24-COL ORCHESTRATOR)
   ========================================= */

.phi-macro-orchestrator {
    display: block;
    width: 100%;
    position: relative;
    /* Anchors the absolute 24-col Mesh Grid */
}

.phi-macro-orchestrator>section,
.phi-macro-orchestrator>phi-section {
    /* Let CSS Grid dictate width natively horizontally */
    margin: 0;
    padding: 0;
}

phi-section[data-hidden="true"],
.phi-section[data-hidden="true"] {
    display: none !important;
}

.phi-macro-orchestrator.edit-mode>section,
.phi-macro-orchestrator.edit-mode>phi-section {
    position: relative;
    outline: 2px dashed var(--blue-07);
    outline-offset: -2px;
}

@container phi-root (min-width: 1000px) {

    /* LIVE PUBLIC GRID (Standard 24-Column Flow) */
    .phi-macro-orchestrator {
        display: grid;
        grid-template-columns: repeat(24, 1fr);

        --macro-col-w: calc(100cqw / 24);
        --macro-row-h: calc(var(--macro-col-w) / var(--phi, 1.618033988));

        align-items: start;
        grid-auto-rows: min-content;
        gap: 0;
    }

    .phi-macro-orchestrator>section,
    .phi-macro-orchestrator>phi-section {
        grid-column: span 24;
        margin-bottom: 0px;
        min-height: min-content;
    }

    /* SPECIFIC EDITOR CANVAS GRID (144-Square Matrix) */
    .phi-macro-orchestrator.edit-mode {
        grid-template-columns: repeat(144, 1fr);

        --macro-col-w: calc(100cqw / 144);
        --macro-row-h: var(--macro-col-w);
        /* Perfect squares */
    }
}