/* ==========================================================================
   Front-page hero: five animated directions (template-parts/hero-lab.php)
   One variant is shown per visit via html[data-hero]; no-JS shows Kelvin.
   Uses the theme tokens from style.css (--ink, --orange, --hair, --font-primary ...).
   ========================================================================== */

.lsh-hero {
    background: #f6f4ef;
    border-bottom: 1px solid var(--hair);
    position: relative;
}

.lsh-wrap { position: relative; padding-top: 64px; padding-bottom: 60px; }

/* ---- variant switch (no flash: set before paint by the inline picker) ---- */
.lsh { display: none; }
html[data-hero="spectrum"] .lsh--spectrum,
html[data-hero="onetap"] .lsh--onetap,
html[data-hero="kelvin"] .lsh--kelvin,
html[data-hero="red"] .lsh--red,
html[data-hero="drawing"] .lsh--drawing,
html:not([data-hero]) .lsh--kelvin { display: grid; }

/* ---- shared layout: head + body left, visual right ---- */
.lsh {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    grid-template-areas: "head visual" "body visual";
    grid-template-rows: auto 1fr;
    column-gap: 56px;
    row-gap: 22px;
    align-items: start;
}
.lsh-head { grid-area: head; align-self: end; }
.lsh-body { grid-area: body; }
.lsh-visual { grid-area: visual; align-self: center; min-width: 0; }

.lsh-title {
    margin: 18px 0 0;
    font-size: clamp(36px, 4.4vw, 64px);
    text-wrap: balance;
    /* The theme turns on hyphens:auto for non-English pages; in a headline only very long
       compounds may break ("richti-ge" must not). hyphenate-limit-chars = word/before/after. */
    hyphenate-limit-chars: 12 5 5;
    -webkit-hyphenate-limit-before: 5;
    -webkit-hyphenate-limit-after: 5;
}
.lsh-sub { hyphenate-limit-chars: 10 4 4; }
.lsh-title .accent { color: var(--orange); }
.lsh-red { color: #c8202b; }
.lsh-sub {
    color: var(--ink-2);
    font-size: 17px;
    line-height: 1.55;
    max-width: 40ch;
    margin: 0;
}
.lsh-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

.lsh-micro {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: var(--font-weight-bold);
}
.lsh-readout {
    font-weight: var(--font-weight-bold);
    font-size: 26px;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    white-space: nowrap;
}

/* ---- photo stage used by One tap / Kelvin / Red ---- */
.lsh-stage {
    position: relative;
    aspect-ratio: 6 / 5;          /* taller than the 16:9 photos (cropped at the sides) so the control card leaves room */
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #e7e1d7;
    box-shadow: 0 24px 50px -32px rgba(30, 27, 24, 0.55);
}
.lsh-stage img,
.lsh-stage video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* pills (spectrum temps, scene buttons) */
.lsh-pill {
    font: inherit;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: var(--font-weight-bold);
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--hair);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.lsh-pill:hover { border-color: var(--ink); }
.lsh-pill[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.lsh-pill:focus-visible,
.lsh-pause:focus-visible,
.lsh-ktrack:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* floating control card inside a stage */
.lsh-ctrl {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    background: rgba(251, 250, 247, 0.95);
    border-radius: 12px;
    padding: 12px 14px 13px;
    box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.45);
    z-index: 3;
}
.lsh-ctrl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 9px; }
.lsh-ctrl-name { font-size: 22px; letter-spacing: -0.01em; font-weight: var(--font-weight-bold); color: var(--ink); }

/* ================= Spectrum ================= */
.lsh-panel {
    background: #efeae1;
    border-radius: var(--radius-lg);
    padding: 18px 20px 16px;
}
.lsh-panel-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lsh-spec .lsh-readout { font-size: 30px; }
.lsh-spec-svg { display: block; width: 100%; height: auto; aspect-ratio: 600 / 250; margin-top: 10px; }
.lsh-axis {
    display: flex;
    justify-content: space-between;
    padding: 4px 3% 0;
    font-size: 9.5px;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.lsh-panel-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.lsh-pills { display: flex; gap: 6px; }

/* ================= One tap ================= */
.lsh-stage [data-scene] { opacity: 0; transition: opacity 0.9s ease; }
.lsh-stage [data-scene].is-on { opacity: 1; }
.lsh-video { opacity: 0; transition: opacity 0.6s ease; z-index: 2; }
.lsh-video.is-on { opacity: 1; }
.lsh-scenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lsh-scenes .lsh-pill { padding: 8px 4px; }
.lsh-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.lsh-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.lsh-bar i { display: block; height: 100%; width: 40%; background: var(--orange); transition: width 0.9s ease; }

/* ================= Kelvin ================= */
.lsh-kstage { touch-action: pan-y; cursor: ew-resize; }
.lsh-kstage img { object-position: 62% 50%; }
.lsh-kstage [data-cool] { opacity: 0; }
.lsh-ktrack {
    position: relative;
    height: 10px;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(45, 42, 38, 0.14);
    margin: 8px 0 6px;
    cursor: pointer;
}
.lsh-ktrack i {
    position: absolute;
    top: 50%;
    left: 0;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--ink);
    box-shadow: 0 3px 8px -2px rgba(0, 0, 0, 0.4);
}
.lsh-kticks { display: flex; justify-content: space-between; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: var(--font-weight-bold); }
.lsh-shelly { display: block; height: 22px; width: auto; margin-top: 18px; }

/* ================= Red stays red ================= */
.lsh-scan { cursor: ew-resize; touch-action: pan-y; --x: 50%; }
.lsh-ra97 { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.lsh-scanline {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--x);
    width: 3px;
    margin-left: -1.5px;
    background: var(--orange);
    box-shadow: 0 0 16px 2px rgba(255, 105, 0, 0.55);
    z-index: 2;
}
.lsh-tag {
    position: absolute;
    top: 12px;
    z-index: 3;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: var(--font-weight-bold);
    background: rgba(251, 250, 247, 0.92);
    color: var(--ink);
    border-radius: 999px;
    padding: 5px 10px;
}
.lsh-tag--l { left: 12px; }
.lsh-tag--r { right: 12px; }
.lsh-swatches { display: flex; gap: 4px; margin-top: 22px; flex-wrap: wrap; }
.lsh-swatches span {
    width: 22px;
    height: 32px;
    border-radius: 5px;
    background: var(--c);
    filter: saturate(0.2) brightness(1.08);
    transition: filter 0.35s ease;
}
.lsh-swatches span.is-lit { filter: none; }
.lsh-swatches span.is-r9 { outline: 2px solid var(--ink); outline-offset: 1px; }
.lsh-swatch-cap { margin: 10px 0 0; }

/* ================= From drawing to light ================= */
.lsh--drawing {
    grid-template-areas: "head visual" "body visual" "draw draw" "dims dims";
    grid-template-rows: auto auto auto auto;
}
.lsh-photo {
    position: relative;
    aspect-ratio: 1376 / 768;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #efeae1;
}
.lsh-photo img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transform: scale(1.07); filter: brightness(0.9) saturate(0.8);   /* complete at first paint, then it "settles" */
    transition: transform 2.4s cubic-bezier(0.2, 0.8, 0.2, 1), filter 1.2s ease;
}
.lsh-photo.is-on img { transform: scale(1); filter: none; }
.lsh--drawing .lsh-title { font-size: clamp(34px, 4vw, 54px); }
.lsh-draw {
    grid-area: draw;
    position: relative;
    justify-self: start;
    padding-top: 8px;
    --p: 100%;
}
.lsh-draw img { display: block; width: auto; max-width: 100%; height: auto; max-height: 150px; clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.lsh-pen {
    position: absolute;
    top: 8px;
    bottom: 0;
    left: var(--p);
    width: 2px;
    margin-left: -1px;
    background: linear-gradient(transparent, var(--orange) 20%, var(--orange) 80%, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lsh-draw.is-drawing .lsh-pen { opacity: 1; }
.lsh-dims {
    grid-area: dims;
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    border-top: 1px solid var(--hair);
    padding-top: 14px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: var(--font-weight-bold);
    color: var(--orange-deep);
}
.lsh-dims span { transition: opacity 0.4s ease; }
.lsh-dims.is-hidden span { opacity: 0; }

/* ---- pause button (WCAG 2.2.2) ---- */
.lsh-pause {
    position: absolute;
    right: var(--spacing-md);
    bottom: 18px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--hair);
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 4;
}
.lsh-pause span { width: 10px; height: 12px; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); }
.lsh-pause[aria-pressed="true"] span { width: 0; height: 0; border: 0; border-left: 11px solid var(--ink); border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }

/* ================= Tablet / mobile ================= */
@media (max-width: 900px) {
    .lsh-wrap { padding-top: 36px; padding-bottom: 64px; }
    .lsh,
    .lsh--drawing {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "head" "visual" "body";
        grid-template-rows: auto;
        row-gap: 20px;
    }
    .lsh--drawing { grid-template-areas: "head" "visual" "body" "draw" "dims"; }
    .lsh-title { font-size: clamp(32px, 8.6vw, 46px); }
    .lsh-sub { font-size: 15.5px; }
    .lsh-cta { flex-direction: column; margin-top: 22px; }
    .lsh-cta .btn { width: 100%; max-width: none; }
    .lsh-stage { aspect-ratio: 1 / 0.95; }
    .lsh-ctrl { left: 8px; right: 8px; bottom: 8px; padding: 9px 10px 10px; }
    .lsh-ctrl-name { font-size: 17px; }
    .lsh-readout { font-size: 20px; }
    .lsh-spec .lsh-readout { font-size: 22px; }
    .lsh-scenes .lsh-pill { font-size: 9px; letter-spacing: 0.08em; padding: 7px 2px; }
    .lsh-micro { font-size: 9px; letter-spacing: 0.14em; }
    .lsh-panel { padding: 14px 14px 12px; }
    .lsh-dims { gap: 8px 18px; font-size: 10px; }
    .lsh-pause { right: 16px; bottom: 16px; }
}

@media (max-width: 420px) {
    .lsh-swatches span { width: 17px; height: 26px; }
    .lsh-meter { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .lsh-stage [data-scene], .lsh-video, .lsh-bar i, .lsh-photo img, .lsh-swatches span { transition: none; }
}
