/* ============================================================================
   Khrome — shared reset (Zen Garden baseline)
   The ONLY CSS shared by every design. Keep it unopinionated: structure and
   normalisation only, zero aesthetics. The style switcher UI lives here too so
   it stays identical no matter which design sheet is active.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; }

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

/* In-page nav anchors clear the sticky header when jumped to. */
.section-anchor { display: block; scroll-margin-top: 100px; }
html { scroll-behavior: smooth; }

/* Crossfade the page while the design stylesheet is swapped (switcher.js
   toggles body.is-switching). The switcher panel is outside #wrapper, so it
   stays visible through the fade. */
#wrapper { transition: opacity .22s ease; }
body.is-switching #wrapper { opacity: 0; }

/* Hero slider mechanics (behavioural, not aesthetic). Slides are stacked and
   stay opaque; the incoming slide fades in ON TOP of the previous one, which
   remains covering the backdrop — so transitions never flash through to white.
   (Requires .hero to have an explicit height, which every design sets.) */
.hero { position: relative; overflow: hidden; }
.hero__slide { position: absolute; inset: 0; opacity: 1; z-index: 1; }
.hero__slide--active { z-index: 2; animation: heroSlideIn .8s ease; }
@keyframes heroSlideIn { from { opacity: 0; } to { opacity: 1; } }
.hero__background, .hero__overlay { position: absolute; inset: 0; }

/* ============================================================================
   Style switcher panel — design-independent chrome
   ========================================================================== */
.style-switcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 248px;
}
.style-switcher__toggle {
    background: #111;
    color: #fff;
    width: 100%;
    border-radius: 14px 14px 0 0;        /* flat bottom — fuses to panel top */
    padding: 13px 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    box-shadow: 0 6px 24px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.style-switcher.is-collapsed .style-switcher__toggle { border-radius: 14px; }  /* standalone pill when closed */
/* Collapsed pill bounces ~once every 3s to invite a click; JS drops .is-nudging on first interaction */
@keyframes khromeSwitcherBounce {
    0%, 14%, 100% { transform: translateY(0); }
    5%            { transform: translateY(-11px); }  /* quick hop */
    9%            { transform: translateY(0); }
    11%           { transform: translateY(-4px); }   /* small second bounce */
    13%           { transform: translateY(0); }
}
.style-switcher.is-nudging.is-collapsed .style-switcher__toggle { animation: khromeSwitcherBounce 3s ease-out infinite; }
.style-switcher__toggle-arrow { font-size: 10px; transition: transform .25s ease; }
.style-switcher:not(.is-collapsed) .style-switcher__toggle-arrow { transform: rotate(180deg); }

.style-switcher__panel {
    background: #fff;
    color: #111;
    width: 100%;
    border: 1px solid rgba(0,0,0,.08);
    border-top: 0;
    border-radius: 0 0 14px 14px;        /* shares the toggle's bottom edge */
    padding: 16px 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,.22);
    max-height: 480px;
    overflow: hidden;
    transition: max-height .3s ease, opacity .25s ease, padding .3s ease;
}
.style-switcher.is-collapsed .style-switcher__panel {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: 0;
    box-shadow: none;
    pointer-events: none;
}
.style-switcher__heading {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #888;
    margin-bottom: 10px;
}
.style-switcher__options { display: grid; gap: 9px; }
.style-switcher__option {
    text-align: left;
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    background: #f4f4f5;
    transition: transform .12s ease, box-shadow .12s ease;
}
.style-switcher__option:hover { transform: translateX(-3px); }
.style-switcher__option.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111; }

/* Each option previews the design it selects (fonts loaded globally). */
.style-switcher__option[data-style="basic"] {
    font-family: "Open Sans", Arial, sans-serif; font-weight: 700;
    background: #fff; color: #2563eb; border: 1px solid #e5e7eb; border-radius: 8px;
}
.style-switcher__option[data-style="contemporary"] {
    font-family: "Sora", sans-serif; font-weight: 800;
    background: #0a0a0a; color: #c4ff3d; border-radius: 16px;
}
.style-switcher__option[data-style="mid-century"] {
    font-family: "DM Serif Display", Georgia, serif; font-weight: 400;
    background: #f4ece0; color: #c8553d; border: 2px solid #2b2117; border-radius: 6px;
    box-shadow: 2px 2px 0 #2b2117;
}
.style-switcher__option[data-style="minimalistic"] {
    font-family: "Inter", sans-serif; font-weight: 300;
    text-transform: uppercase; letter-spacing: .14em; font-size: 12px;
    background: #fafaf9; color: #141414; border: 1px solid #e4e4e4; border-radius: 0;
}
