/*
Theme Name: JM Starter
Description: Clean starter theme for client websites. CSS-variable driven, block-based architecture. Native WooCommerce support.
Author: Jimmour
Version: 1.4.1-efpolis
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jm-starter
*/

/* ========================================
   BREAKPOINTS REFERENCE
   Mobile:  max-width: 768px
   Tablet:  min-width: 769px / max-width: 1024px
   Desktop: min-width: 1025px
   ======================================== */

/* ========================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   Client: EFPOLIS DEVELOPMENT
   Palette lifted from the v1 site, contrast-corrected.
   ======================================== */
:root {
    /* Brand — the teal/slate that carries the whole site */
    --primary: #406776;
    --primary-hover: #33535F;
    --primary-dark: #2C4855;
    --primary-light: #E3EFF0;   /* pale blue-grey ground */
    --accent: #6898A8;          /* the steel-blue in the logo mark */
    --accent-soft: rgba(104, 152, 168, 0.30);

    /* Header & Footer */
    --header-bg: #3F444B;
    --header-text: #ffffff;
    /* The same deep slate as the floor-plan viewer canvas, so the site's two
       dark surfaces read as one material. #3F444B was the v1 grey. */
    --footer-bg: #1B2A31;
    --footer-text: #B9C9D1;

    /* Backgrounds */
    --bg-main: #ffffff;
    --bg-white: #ffffff;
    --bg-tint: #E3EFF0;         /* section ground */
    --bg-deep: #406776;         /* full-bleed teal bands */

    /* Text */
    --text-primary: #22272C;
    --text-secondary: #3D454E;   /* was #5A636D — too light on mobile */
    --text-light: #78828C;
    --text-on-dark: #F2F6F7;    /* body text on teal — was low-contrast grey in v1 */
    --text-on-dark-dim: #CBD9DE;

    /* Borders, Status */
    --border-light: #D8E2E5;
    --border-rule: #B4C6CC;
    --error: #C0392B;
    --success: #3D8B5F;

    /* The signature double border (v1 used `10px double`) */
    --frame-width: 8px;
    --frame-color: var(--primary-light);
    --frame-color-on-dark: rgba(255, 255, 255, 0.55);

    /* Fonts */
    --font-primary: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

    /* Type scale — fluid, mobile-first */
    --fs-display: clamp(2.125rem, 1.45rem + 3.0vw, 4rem);
    --fs-h1:      clamp(1.75rem, 1.30rem + 2.0vw, 2.75rem);
    --fs-h2:      clamp(1.4375rem, 1.18rem + 1.15vw, 2.125rem);
    --fs-h3:      clamp(1.1875rem, 1.06rem + 0.55vw, 1.5rem);
    --fs-body:    clamp(1rem, 0.97rem + 0.14vw, 1.0625rem);
    --fs-small:   0.9375rem;
    --fs-eyebrow: clamp(0.75rem, 0.71rem + 0.18vw, 0.875rem);

    /* Tracking — the architectural signature */
    --ls-eyebrow: 0.28em;
    --ls-heading: 0.06em;
    --ls-title:   0.14em;

    /* Spacing scale */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
    --sp-9: 96px; --sp-10: 128px;

    /* Layout */
    --container-max: 1180px;
    --container-narrow: 820px;
    --section-padding: clamp(44px, 6vw, 84px) 0;

    /* Corners — "rounded a little, not a lot" */
    --radius: 3px;
    --radius-lg: 4px;

    /* Motion */
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --dur: 0.45s;

    /* The fabric seam between two full-bleed photographs. Declared here
       because the hero above it sizes itself from these two numbers — it
       has to end exactly high enough that the band lands at the fold. */
    --seam-height: clamp(62px, 5.4vw, 84px);
    --seam-overlap: clamp(22px, 2.4vw, 32px);
    /* How much of the plate below the seam peeks in at the bottom of the
       first screen — enough to read as "there is more", not enough to
       compete with the hero. */
    --seam-reveal: 30px;
}

/* ========================================
   GLOBAL STYLES
   ======================================== */

html {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   BUTTONS
   ======================================== */

button,
.button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.wp-block-button__link {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* The decorative lift belongs to buttons that opted into the theme's button
   look. It must never apply to a bare <button>: component buttons routinely
   use transform for positioning (the floor-plan pins centre themselves with
   translate(-50%,-50%)), and a blanket rule silently moves them. */
@media (hover: hover) and (pointer: fine) {
    .button:hover,
    input[type="button"]:hover,
    input[type="submit"]:hover,
    input[type="reset"]:hover,
    .wp-block-button__link:hover {
        background-color: var(--primary-hover);
        transform: translateY(-2px);
    }
}

button,
.button,
input[type="button"],
input[type="submit"],
input[type="reset"],
a.button,
.wp-block-button__link {
    -webkit-tap-highlight-color: transparent !important;
}

button:focus,
.button:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
input[type="reset"]:focus,
.wp-block-button__link:focus {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Cancel the lift on focus only where the lift exists. */
.button:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
input[type="reset"]:focus,
.wp-block-button__link:focus {
    transform: none;
}

@media (hover: hover) and (pointer: fine) {
    .button:focus:hover,
    input[type="button"]:focus:hover,
    input[type="submit"]:focus:hover,
    input[type="reset"]:focus:hover,
    .wp-block-button__link:focus:hover {
        transform: translateY(-2px);
    }
}

button:active,
.button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
.wp-block-button__link:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
.wp-block-button__link:active {
    transform: translateY(0);
}

button:focus-visible,
.button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
.wp-block-button__link:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* ========================================
   LINKS
   ======================================== */

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    a:hover {
        color: var(--primary-hover);
    }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.jm-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .jm-toast-container {
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

.jm-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    border-left: 3px solid;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.4;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.jm-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.jm-toast--exiting {
    opacity: 0;
    transform: translateY(16px);
}

/* Success */
.jm-toast--success {
    background-color: #f0fdf4;
    border-left-color: var(--success);
    color: #166534;
}
.jm-toast--success .jm-toast__icon { color: var(--success); }

/* Error */
.jm-toast--error {
    background-color: #fef2f2;
    border-left-color: var(--error);
    color: #991b1b;
}
.jm-toast--error .jm-toast__icon { color: var(--error); }

/* Info */
.jm-toast--info {
    background-color: #f3f4f6;
    border-left-color: #9ca3af;
    color: #374151;
}
.jm-toast--info .jm-toast__icon { color: #6b7280; }

/* Warning */
.jm-toast--warning {
    background-color: #fffbeb;
    border-left-color: #d97706;
    color: #92400e;
}
.jm-toast--warning .jm-toast__icon { color: #d97706; }

/* Toast inner elements */
.jm-toast__icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.jm-toast__message {
    flex: 1;
    word-break: break-word;
}

.jm-toast__message a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.jm-toast__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: -4px -4px -4px 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 4px;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.jm-toast__close:hover {
    opacity: 1;
    background: none;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .jm-toast { transition: none; }
}


/* ========================================
   DESIGN SYSTEM — EFPOLIS
   Shared primitives every block builds on.
   ======================================== */

body {
    font-size: var(--fs-body);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: var(--ls-heading);
    color: var(--text-primary);
    margin: 0 0 var(--sp-4);
    text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

/* Body copy sits at a comfortable measure rather than stretching full-width */
.jm-prose { max-width: 68ch; }
.jm-prose--center { margin-inline: auto; }

/* ─── Eyebrow / section title ───────────────────────────────
   The tracked uppercase label that opens each section.        */
.jm-eyebrow {
    font-size: var(--fs-eyebrow);
    font-weight: 600;
    letter-spacing: var(--ls-eyebrow);
    text-transform: uppercase;
    color: var(--primary);
    margin: 0 0 var(--sp-5);
    /* the trailing letter's tracking would otherwise push text off-centre */
    text-indent: var(--ls-eyebrow);
}

.jm-eyebrow--on-dark { color: var(--text-on-dark-dim); }

.jm-section-title {
    text-align: center;
    margin-bottom: clamp(20px, 3vw, 36px);
}

/* The thin rule under a heading — v1 used it everywhere, kept. */
.jm-rule {
    width: 56px;
    height: 1px;
    border: 0;
    background: var(--border-rule);
    margin: var(--sp-4) 0 var(--sp-5);
}
.jm-rule--center { margin-inline: auto; }
.jm-rule--on-dark { background: var(--frame-color-on-dark); }

/* ─── The double-border frame ───────────────────────────────
   v1's signature `border: 10px double`. Kept, but tightened and
   made responsive — it collapses on small screens where a 10px
   frame eats the reading width.                                */
.jm-frame {
    border: var(--frame-width) double var(--frame-color);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 5vw, 56px);
    background: var(--bg-white);
}

.jm-frame--on-dark {
    border-color: var(--frame-color-on-dark);
    background: transparent;
}

.jm-frame--flush { background: transparent; }

@media (max-width: 600px) {
    :root { --frame-width: 6px; }
}

/* ─── Sections ─────────────────────────────────────────────── */
.jm-section        { padding: var(--section-padding); }
.jm-section--tint  { background: var(--bg-tint); }
.jm-section--deep  { background: var(--bg-deep); color: var(--text-on-dark); }
.jm-section--deep h1,
.jm-section--deep h2,
.jm-section--deep h3 { color: #fff; }
.jm-section--deep p  { color: var(--text-on-dark); }

.jm-container        { max-width: var(--container-max); margin-inline: auto; padding-inline: var(--sp-5); }
.jm-container--narrow{ max-width: var(--container-narrow); }

/* ─── Buttons ──────────────────────────────────────────────── */
.jm-btn {
    display: inline-block;
    font-size: var(--fs-small);
    font-weight: 600;
    letter-spacing: var(--ls-heading);
    padding: 14px 30px;
    border-radius: var(--radius);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
                border-color var(--dur) var(--ease);
}

.jm-btn--ghost {
    background: transparent;
    color: var(--primary);
}

.jm-btn--on-dark {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.7);
}

@media (hover: hover) and (pointer: fine) {
    .jm-btn:hover        { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
    .jm-btn--ghost:hover { background: var(--primary); color: #fff; }
    .jm-btn--on-dark:hover { background: #fff; color: var(--primary); border-color: #fff; }
}

.jm-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* ─── Media ────────────────────────────────────────────────── */
.jm-media {
    display: block;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--primary-light);
}
.jm-media img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Honour the OS "reduce motion" setting across every block. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-padding);
}

.text-center { text-align: center; }

/* ========================================
   404 PAGE
   ======================================== */

.page-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 60px 20px;
}

.page-404 h1 {
    font-size: 120px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    line-height: 1;
}

.page-404 h2 {
    font-size: 28px;
    margin: 10px 0 20px;
    color: var(--text-primary);
}

.page-404 p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 500px;
}

.page-404 .btn {
    display: inline-block;
    padding: 14px 32px;
    background-color: var(--primary);
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .page-404 .btn:hover {
        background-color: var(--primary-hover);
    }
}

/* ========================================
   SCROLL REVEAL
   The hidden state only applies once JS has confirmed it is running and
   motion is allowed (html.jm-reveal-ready). Without that guard a script
   failure would leave the page permanently blank.
   ======================================== */
.jm-reveal-ready [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
    will-change: opacity, transform;
}

.jm-reveal-ready [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

/* Image variant: settles from a slight over-scale, like a lens focusing. */
.jm-reveal-ready [data-reveal="media"] { transform: none; }
.jm-reveal-ready [data-reveal="media"] img {
    transform: scale(1.06);
    transition: transform 1.1s var(--ease);
}
.jm-reveal-ready [data-reveal="media"].is-revealed img { transform: none; }


/* ========================================
   GLASS EDGE
   A translucent surface reads as a flat wash unless its edge is
   described. Three layers do it: a bright inner line along the inside
   of the edge (the lit top of the pane), a hairline of the brand
   accent, and a soft drop beneath. Together they give the panel
   thickness rather than just colour.
   ======================================== */
.jm-glass-edge-bottom {
    box-shadow:
        inset 0 -1px 0 rgba(255, 255, 255, 0.16),
        0 1px 0 rgba(104, 152, 168, 0.38),
        0 14px 34px -18px rgba(8, 16, 20, 0.62);
}

.jm-glass-edge-all {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -1px 0 rgba(255, 255, 255, 0.28),
        0 18px 44px -26px rgba(22, 40, 48, 0.42);
}


/* ========================================
   PANELS
   One surface treatment, used for every major block on the page: a
   pale ground, a hairline of the brand accent, a lit inner top edge
   and a soft drop. Sections stop reading as flat bands and start
   reading as sheets laid on the page.
   ======================================== */
.jm-panel {
    position: relative;
    background: var(--bg-tint);
    border: 1px solid rgba(104, 152, 168, 0.22);
    border-radius: 20px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 20px 46px -30px rgba(22, 40, 48, 0.45);
}

/* Reading surfaces stay white so long copy keeps maximum contrast. */
.jm-panel--paper {
    background: var(--bg-white);
    border-color: rgba(104, 152, 168, 0.18);
}

/* A frame for photographs: the panel treatment reduced to a mount. */
.jm-panel--media {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 7px;
    overflow: hidden;
}

.jm-panel--media > img,
.jm-panel--media > picture > img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* Page-level rhythm for stacked panels. */
.jm-panel-stack {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vw, 26px);
    padding-inline: clamp(10px, 2.2vw, 26px);
}

/* ========================================
   POSTCARD
   The counterpart to .jm-panel, for type laid over a photograph.

   A panel is a soft, translucent, round-cornered surface — right for a
   section of the page, wrong on top of a picture, where it reads as a
   second frame competing with the first. The postcard is what v1 drew
   and what every architecture site that looks expensive does instead:
   square white card, an inset hairline (the double-border signature
   reduced to one rule), and almost no shadow. The photograph stays
   full-bleed and unframed; only the card has an edge.
   ======================================== */
.jm-postcard {
    position: relative;
    background: var(--bg-white);
    border-radius: 2px;
    padding: clamp(30px, 4vw, 54px) clamp(24px, 3.4vw, 46px);
    /* Long and very soft — the card should look laid on the photograph,
       not floating above it. */
    box-shadow: 0 34px 70px -46px rgba(14, 26, 32, 0.6);
}

.jm-postcard::before {
    content: "";
    position: absolute;
    inset: clamp(9px, 1.1vw, 15px);
    /* Definite, not decorative. A rule this thin only reads as a deliberate
       edge if it is dark enough to survive being 1px — faded to a tint it
       just looks like a rendering artefact. */
    border: 1px solid rgba(34, 39, 44, 0.48);
    pointer-events: none;
}

.jm-postcard--center { text-align: center; }

/* ========================================
   FABRIC
   A woven surface, in the brand's deep teal.

   Two crossed gradients give the warp and the weft; a noise tile on top
   breaks the regularity so it reads as cloth rather than as graph paper.
   On a dark ground the weave needs bright warp threads and deep shadow
   between them — the reverse of what works on a pale one — so the three
   values are variables and a light version only has to override them.

   Contrast is held deliberately low. Push the threads much further and
   the weave stops being a material and becomes a pattern, which is the
   point at which this sort of texture starts to look cheap.
   ======================================== */
.jm-fabric {
    --fabric-ground: var(--bg-deep);
    /* The crisp thread grid laid over the lit cloth. Balanced — equal
       light above and dark below — so it adds structure without shifting
       the panel's colour away from the flat teal used elsewhere. */
    --fabric-warp: rgba(255, 255, 255, 0.055);
    --fabric-weft: rgba(0, 0, 0, 0.075);

    background-color: var(--fabric-ground);
    background-image:
        repeating-linear-gradient(90deg,
            var(--fabric-warp) 0 1px,
            transparent 1px 2px,
            var(--fabric-weft) 2px 3px,
            transparent 3px 4px),
        repeating-linear-gradient(0deg,
            var(--fabric-warp) 0 1px,
            transparent 1px 2px,
            var(--fabric-weft) 2px 3px,
            transparent 3px 4px),
        /* The woven, lit, three-dimensional part — see the file. It is
           centred on mid-grey, so soft-light leaves the ground colour
           alone and only adds the light and shade of the threads. */
        url("assets/textures/cloth.svg");
    background-size: auto, auto, 220px 220px;
    background-blend-mode: normal, normal, soft-light;
}

/* The same cloth in a pale colourway, if a light surface ever needs it. */
.jm-fabric--light {
    --fabric-ground: #E4E9EA;
    --fabric-warp: rgba(255, 255, 255, 0.55);
    --fabric-weft: rgba(40, 58, 66, 0.06);
}

/* The heading rule inside a postcard belongs to the card's ink, not to the
   page's pale blue-grey hairlines. */
.jm-postcard .jm-rule {
    width: 64px;
    background: rgba(34, 39, 44, 0.45);
}

/* ========================================
   BUTTONS — filled, with v1's white edge

   Every button carries a fill. An outlined button is a hole in the page
   with a line round it: it reads as secondary even when it is the only
   thing being asked of the visitor.

   The white hairline is v1's own device — its buttons were #284855 (all
   but identical to --primary-dark) with a 1px solid white border. It is
   what lets a dark button sit on a dark photograph without dissolving
   into it, and it is kept on every variant so they read as one family.

   The fill is held at 84% rather than solid so the button belongs to
   whatever is behind it, with a small backdrop blur to match the rest of
   the site's glass. 84% is the floor: white type on this over a bright
   photograph still measures 6.2:1, and thinning it further starts to
   cost legibility on exactly the images where it matters most.

   Depth is three layers rather than one hard offset: a bright inner line
   along the top edge (the lit face), a tight contact shadow holding it to
   the page, and a wider soft one beneath.

   Corners are 8px — the same radius as the mobile menu rows and the
   social squares, so every tappable thing on the site shares one shape.
   ======================================== */
.jm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    font-size: var(--fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 15px 30px;
    min-height: 48px;
    border-radius: 8px;
    border: 0;
    /* --primary-dark at 84%. The border is an inset shadow rather than a
       real border so the box never changes size between states. */
    background: rgba(44, 72, 85, 0.84);
    -webkit-backdrop-filter: blur(6px) saturate(115%);
            backdrop-filter: blur(6px) saturate(115%);
    color: #fff;
    cursor: pointer;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 1px 2px rgba(10, 20, 26, 0.26),
        0 10px 20px -12px rgba(10, 20, 26, 0.6);
    transition: background 0.28s var(--ease), color 0.28s var(--ease),
                box-shadow 0.28s var(--ease), transform 0.14s var(--ease);
}

/* Secondary on a pale ground: white, not a brand tint. The tint is the
   colour of the panels themselves, so a tinted button laid on one
   disappeared into it and only its hairline survived. White separates
   from both the panels and the page. */
.jm-btn--ghost {
    background: #fff;
    color: var(--primary-dark);
    box-shadow:
        inset 0 0 0 1px rgba(44, 72, 85, 0.16),
        inset 0 -1px 0 rgba(22, 40, 48, 0.08),
        0 1px 2px rgba(22, 40, 48, 0.14),
        0 8px 16px -10px rgba(22, 40, 48, 0.45);
}

/* Primary on a dark panel. */
.jm-btn--on-dark {
    background: #fff;
    color: var(--primary-dark);
    box-shadow:
        inset 0 -1px 0 rgba(22, 40, 48, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.22),
        0 10px 20px -12px rgba(0, 0, 0, 0.55);
}

/* Secondary on a photograph or a dark panel: a frosted fill, not a hole.
   The blur picks up whatever is behind it, so the button belongs to the
   image instead of being stamped on top of it, but it is still a surface
   the label sits on rather than an empty outline. */
.jm-btn--ghost-light {
    background: rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
            backdrop-filter: blur(8px) saturate(120%);
    color: #fff;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 8px 18px -12px rgba(0, 0, 0, 0.6);
}

@media (hover: hover) and (pointer: fine) {
    /* Hover fills in: the same colour at full strength, so the button
       gains presence rather than changing identity. */
    .jm-btn:hover {
        background: var(--primary-dark);
        color: #fff;
        transform: translateY(-1px);
        box-shadow:
            inset 0 0 0 1px #fff,
            inset 0 1px 0 rgba(255, 255, 255, 0.26),
            0 2px 4px rgba(10, 20, 26, 0.28),
            0 16px 26px -14px rgba(10, 20, 26, 0.7);
    }
    .jm-btn--ghost:hover {
        background: var(--primary-dark);
        color: #fff;
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.85),
            inset 0 1px 0 rgba(255, 255, 255, 0.20),
            0 2px 4px rgba(10, 20, 26, 0.26),
            0 16px 26px -14px rgba(10, 20, 26, 0.6);
    }
    .jm-btn--on-dark:hover {
        background: var(--accent);
        color: #fff;
    }
    .jm-btn--ghost-light:hover {
        background: rgba(255, 255, 255, 0.28);
        color: #fff;
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.4),
            0 12px 22px -12px rgba(0, 0, 0, 0.65);
    }
}

/* Presses into the page: the lift goes and the wide shadow collapses to
   the contact shadow. The white edge stays — it is the button's outline,
   not part of its lighting. */
.jm-btn:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 1px 2px rgba(10, 20, 26, 0.35);
}

.jm-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
