/*
  File: css/home.css
  Purpose: Stylesheet for the home page only (2026-09 landing refresh) —
           cross-fade hero, before/after feature figures, mural services band,
           motion + reduced-motion rules, glossary tooltip bubbles.
           Loaded by Views/layouts/home.php INSTEAD of bootstrap/main.css (their
           global rules collide with these class names). REQUIRES css/site-shell.css
           first (tokens, .wrap, fonts, header bar, footer, @keyframes fade). Design source of truth:
           ~/sandbox-artifacts/ispecllc/landing-refresh/index.html — port edits there.
  Used by: Views/layouts/home.php, Views/public/home.php
  2026-09-13: .figure figcaption flows below the figure (serif, wraps, <b> keeps the
           uppercase display treatment) so the Martin caption can carry a description.
  2026-09-16: .section{overflow-x:clip} — the scroll-linked .drift/.plate offsets used to
           widen the page ≤1000px (scrollWidth 1084@1000 / 537@400); inner pages already clip.
*/

*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--serif);font-size:1.0625rem;line-height:1.7;-webkit-font-smoothing:antialiased}
img{max-width:100%;display:block}
h1,h2,h3,h4{font-family:var(--display);font-stretch:112%;line-height:1.1;margin:0;text-wrap:balance;letter-spacing:-.01em}
p{margin:0 0 1.1em}
p:last-child{margin-bottom:0}
strong{font-weight:600}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* glossary links (a.a2 on the live site) */
.a2{color:var(--teal-deep);text-decoration:underline;text-decoration-color:rgba(42,139,130,.35);text-underline-offset:3px;text-decoration-thickness:1px;transition:text-decoration-color .2s}
.a2:hover{text-decoration-color:var(--teal-deep)}

/* ── hero ────────────────────────────────────────────── */
.hero{position:relative;min-height:clamp(560px,84vh,840px);display:flex;align-items:flex-end;color:#fff;overflow:hidden;isolation:isolate;background:var(--band)}
.hero-bg{position:absolute;inset:0;z-index:-2;transform-origin:60% 50%;background:var(--band)}
.hero-bg img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 45%}
.hero-bg .after{opacity:0}
.js .hero-bg{animation:kenburns 20s var(--ease) forwards,fade 1.6s ease-out both}
.js .hero-bg .after{animation:fade 3s var(--ease) 2.6s forwards}
.hero::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(15,26,25,.6) 0%,rgba(15,26,25,.2) 42%,rgba(15,26,25,.9) 100%),linear-gradient(90deg,rgba(15,26,25,.5),transparent 62%)}
.hero .wrap{padding:calc(var(--nav-h) + 4rem) 0 5.5rem}
.eyebrow{font-family:var(--display);font-weight:600;font-size:.74rem;letter-spacing:.22em;text-transform:uppercase;color:var(--teal);margin:0}
.hero h1{font-size:clamp(2.7rem,7.2vw,5.6rem);font-weight:800;letter-spacing:-.03em;margin:.7rem 0 1.3rem;display:flex;flex-wrap:wrap;gap:0 .3em}
.hero h1 span{display:inline-block}
.hero h1 i{font-style:normal;color:var(--teal)}
.rule{width:72px;height:3px;background:var(--teal);margin:0 0 1.4rem;transform-origin:left}
.hero .lede{font-size:clamp(1.15rem,2vw,1.45rem);font-style:italic;color:rgba(255,255,255,.9);max-width:34ch;margin-bottom:2.1rem}
.hero-actions{display:flex;gap:.8rem;flex-wrap:wrap}
.scroll-cue{position:absolute;left:50%;bottom:1.3rem;transform:translateX(-50%);color:var(--teal);font-family:var(--display);font-weight:700;font-size:1.4rem;line-height:1;text-decoration:none}
.js .scroll-cue{animation:cue 2.2s ease-in-out 2.4s infinite,fade 1s ease-out 2.2s both}

/* load sequence */
.js .hero [data-in]{opacity:0;animation:rise .95s var(--ease) forwards}
.js .hero .eyebrow{animation-delay:.55s}
.js .hero h1 span:nth-child(1){animation-delay:.7s}
.js .hero h1 span:nth-child(2){animation-delay:.85s}
.js .hero h1 span:nth-child(3){animation-delay:1s}
.js .hero .rule{animation:grow .9s var(--ease) 1.05s forwards;transform:scaleX(0)}
.js .hero .lede{animation-delay:1.25s}
.js .hero .hero-actions{animation-delay:1.4s}

/* ── buttons ─────────────────────────────────────────── */
.btn{display:inline-flex;align-items:center;gap:.55rem;font-family:var(--display);font-weight:600;font-size:.76rem;letter-spacing:.13em;text-transform:uppercase;text-decoration:none;padding:.9rem 1.45rem;border-radius:999px;border:1.5px solid transparent;transition:.25s var(--ease);cursor:pointer}
.btn svg{width:14px;height:14px;transition:transform .25s var(--ease)}
.btn:hover svg{transform:translateX(3px)}
.btn-solid{background:var(--teal);color:var(--ink)}
.btn-solid:hover{background:var(--teal-bright);transform:translateY(-1px)}
.btn-ghost{border-color:rgba(255,255,255,.6);color:#fff}
.btn-ghost:hover{background:rgba(255,255,255,.1);border-color:#fff}
.btn-line{border-color:var(--line);color:var(--teal-deep);padding:.65rem 1.1rem;background:var(--paper)}
.btn-line:hover{border-color:var(--teal-deep);background:var(--teal-tint)}

/* ── feature sections ───────────────────────────────── */
.section{padding:clamp(4rem,8vw,7rem) 0;overflow-x:clip}
.section + .section{padding-top:0}
.feature{display:grid;grid-template-columns:7fr 5fr;gap:clamp(2.5rem,6vw,5.5rem);align-items:center}
.feature.flip{grid-template-columns:5fr 7fr}
.feature.flip .copy{order:2}
.copy{max-width:62ch}
.copy h2{font-size:clamp(1.9rem,3.4vw,2.7rem);font-weight:700;margin:.55rem 0 1.3rem}
.copy .lead{font-family:var(--display);font-weight:600;font-size:1.05rem;color:var(--teal-deep);margin-bottom:.9rem}
.copy p{color:var(--ink-soft)}
.figure{position:relative}
.drift{position:relative;transform:translateX(var(--drift,0px));will-change:transform}
.plate{position:absolute;inset:0;background:var(--teal);z-index:0;translate:calc(18px - var(--drift,0px) * .7) 18px}
.flip .plate{background:var(--ink);translate:calc(-18px - var(--drift,0px) * .7) 18px}
/* before / after: finished shot at rest, "before" fades in on hover or tap */
.compare{position:relative;z-index:1;display:block;width:100%;padding:0;border:0;background:var(--band);color:#fff;font:inherit;text-align:left;cursor:pointer;overflow:hidden;box-shadow:0 30px 60px -24px rgba(15,26,25,.45)}
.compare img{width:100%;height:auto;aspect-ratio:4/3;object-fit:cover}
.compare .before{position:absolute;inset:0;height:100%;opacity:0;transform:scale(1.04);transition:opacity .7s var(--ease),transform 1.6s var(--ease)}
.compare.is-before .before{opacity:1;transform:none}
.compare-tag{position:absolute;top:.9rem;left:.9rem;z-index:2;display:inline-grid;padding:.42rem .7rem .38rem;background:rgba(15,26,25,.72);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);font-family:var(--display);font-weight:700;font-size:.68rem;letter-spacing:.2em;text-transform:uppercase;line-height:1.2}
.compare-tag b{grid-area:1/1;font-weight:inherit;transition:opacity .35s var(--ease)}
.compare-tag b:last-child{opacity:0;color:var(--teal)}
.compare.is-before .compare-tag b:first-child{opacity:0}
.compare.is-before .compare-tag b:last-child{opacity:1}
.compare-hint{position:absolute;right:.9rem;bottom:.9rem;z-index:2;padding:.36rem .6rem;background:rgba(15,26,25,.55);color:rgba(255,255,255,.88);font-family:var(--display);font-size:.64rem;letter-spacing:.14em;text-transform:uppercase;line-height:1.2;transition:opacity .4s var(--ease)}
.compare.is-before .compare-hint{opacity:0}
.hint-hover{display:none}
@media (hover:hover){.hint-hover{display:inline}.hint-tap{display:none}}
.figure figcaption{margin-top:.75rem;font-family:var(--serif);font-size:.86rem;line-height:1.5;color:var(--muted)}
.figure figcaption b{font-family:var(--display);font-weight:600;font-size:.7rem;letter-spacing:.18em;text-transform:uppercase}
.figure figcaption a{color:var(--teal-deep);text-decoration:underline;text-underline-offset:.15em}
.flip .figure figcaption{text-align:right}

/* ideas */
.narrow{max-width:66ch;margin-inline:auto}
.narrow h2{font-size:clamp(1.9rem,3.4vw,2.7rem);font-weight:700;text-align:center;margin-bottom:1rem}
.narrow .rule{margin:0 auto 2.2rem}
.narrow p{color:var(--ink-soft)}
.motto{font-family:var(--display);font-stretch:112%;font-weight:800;font-size:clamp(1.7rem,3.6vw,2.7rem);letter-spacing:-.02em;text-align:center;margin-top:2.6rem;color:var(--ink)}
.motto i{font-style:normal;color:var(--teal)}

/* scroll reveal */

/* ── services band ──────────────────────────────────── */
.services{background:var(--band);color:#fff;padding:clamp(4.5rem,9vw,8rem) 0;position:relative;overflow:hidden;isolation:isolate}
/* the iSpec mural behind the cards, under a translucent band-colour overlay */
.services::before{content:"";position:absolute;inset:0;z-index:-2;pointer-events:none;background:url(../images/ispecLogoMural2.jpg) center 42%/cover no-repeat}
.services::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,rgba(15,26,25,.86) 0%,rgba(15,26,25,.68) 50%,rgba(15,26,25,.88) 100%)}
.services .wrap{position:relative}
.services-head{display:flex;align-items:flex-end;justify-content:space-between;gap:2rem;flex-wrap:wrap;margin-bottom:3rem}
.services-head h2{font-size:clamp(2rem,4vw,3.2rem);font-weight:800;margin-top:.5rem}
.services-head .rule{margin:0 0 .6rem;width:120px}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:1.25rem}
.card{background:var(--paper);color:var(--ink);padding:2rem 1.6rem 1.8rem;border-radius:4px;display:flex;flex-direction:column;gap:1rem;transition:transform .5s var(--ease),box-shadow .5s var(--ease)}
.card:hover{transform:translateY(-6px);box-shadow:0 34px 60px -26px rgba(0,0,0,.7)}
.icon{width:52px;height:52px;border-radius:4px;background:var(--teal-tint);color:var(--teal-deep);display:grid;place-items:center;transition:.35s var(--ease)}
.icon svg{width:26px;height:26px}
.card:hover .icon{background:var(--teal);color:var(--ink)}
.card h3{font-size:1.2rem;font-weight:700;letter-spacing:-.01em}
.card-body{display:flex;flex-direction:column;gap:.8rem;flex:1}
.card-body p{font-size:.97rem;line-height:1.65;color:var(--ink-soft);margin:0}
.card .btn{align-self:flex-start;margin-top:.4rem}
.js .cards [data-reveal]:nth-child(2){transition-delay:.12s}
.js .cards [data-reveal]:nth-child(3){transition-delay:.24s}
.js .cards [data-reveal]:nth-child(4){transition-delay:.36s}

/* ── keyframes ──────────────────────────────────────── */
@keyframes rise{from{opacity:0;transform:translateY(22px)}to{opacity:1;transform:none}}
@keyframes grow{to{transform:scaleX(1)}}
@keyframes kenburns{from{transform:scale(1.1) translateX(1.5%)}to{transform:scale(1) translateX(-1%)}}
@keyframes cue{0%,100%{transform:translate(-50%,0)}50%{transform:translate(-50%,8px)}}

/* ── responsive ─────────────────────────────────────── */
@media (max-width:1000px){
  .cards{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:900px){
  .feature,.feature.flip{grid-template-columns:1fr}
  .feature.flip .copy{order:0}
  .figure{max-width:560px}
  .figure figcaption{position:static;margin-top:1.6rem}
}
@media (max-width:560px){
  .cards{grid-template-columns:1fr}
  .hero .wrap{padding-bottom:4.5rem}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js .hero [data-in],.js .hero .rule,.js .hero-bg,.js .hero-bg .after,.js .site-nav,.js .scroll-cue{animation:none;opacity:1;transform:none}
  .drift{transform:none}
  .card,.btn,.compare .before,.compare-tag b,.compare-hint{transition:none}
  .compare .before{transform:none}
}

/* ── glossary tooltips ─────────────────────────────── */
/* a.a2 links carry #slug anchors; js/home.js copies the definition from
   window.glossaryMap into data-tip and this bubble renders it on hover/focus */
.a2[data-tip]{position:relative}
.a2[data-tip]::after{content:attr(data-tip);position:absolute;left:0;bottom:calc(100% + .5rem);z-index:20;width:max-content;max-width:min(36ch,80vw);padding:.6rem .8rem;background:var(--band);color:#fff;font-family:var(--serif);font-size:.85rem;font-style:normal;line-height:1.45;letter-spacing:0;text-transform:none;text-align:left;border-radius:4px;box-shadow:0 12px 30px -10px rgba(15,26,25,.5);opacity:0;visibility:hidden;transform:translateY(4px);transition:.2s var(--ease);pointer-events:none}
.a2[data-tip]:hover::after,.a2[data-tip]:focus-visible::after{opacity:1;visibility:visible;transform:none}
