/* =========================================================================
   home-experience.css — content (interface) layered over the dot device.
   The device itself is the dot field; this file styles the content + intro
   narrative only. No metal frames, no screens: dots carry the form.
   ========================================================================= */

.he{position:relative}
.he-pin{position:relative;min-height:100dvh;overflow:hidden}

.he-stage-layer{position:absolute;inset:0;z-index:2;display:grid;place-items:center;
  padding:var(--nav-h) 12px 0;pointer-events:none}

/* one device footprint per stage. --dev-w matches the dot device width (vh-based,
   same basis the dot field uses) so content stays inside the visible silhouette. */
.he-stage{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;
  text-align:center;padding:var(--nav-h) 12px 9vh;gap:clamp(10px,1.6vh,18px);
  --dev-w:min(1040px,88vw)}                  /* default = full screen */
.he-stage:nth-child(1){--dev-w:min(82vh,58vw);padding:16vh 12px 8vh}    /* phone : hero only */
.he-stage:nth-child(2){--dev-w:min(86vw,120vh);padding:13vh 12px 8vh}    /* tablet : hero + copy */
.he-stage:nth-child(3){--dev-w:min(80vw,132vh);padding:11vh 12px 8vh}    /* laptop : hero + previews */
.he-stage:nth-child(4){--dev-w:min(1480px,94vw);padding:10vh 12px 8vh}  /* full : hero + work + systems + impact */
.he-stage > *{max-width:var(--dev-w);pointer-events:auto}

.he-eyebrow{margin:0;font-size:clamp(11px,1.4vh,13px);font-weight:500;color:var(--text-muted)}

.he-headline{margin:0;font-family:var(--font-display);font-weight:300;letter-spacing:-.03em;
  line-height:1.08;color:var(--text-primary);text-wrap:balance;overflow-wrap:break-word;
  max-width:calc(var(--dev-w) * 0.92);       /* keep type off the silhouette edges */
  font-size:clamp(1.9rem,5vw,4rem)}          /* default; per-stage overrides below */
.he-headline .kw-accent{color:var(--blue);font-weight:600}

/* per-stage type sized to its device (vh scales with the device, so it never exceeds it) */
.he-stage:nth-child(1) .he-headline{font-size:clamp(2.2rem,min(11vh,7.6vw),8rem);letter-spacing:-.03em;line-height:1.02}
.he-stage:nth-child(2) .he-headline{font-size:clamp(1.9rem,min(9vh,6.6vw),6.5rem);letter-spacing:-.03em;line-height:1.03}
.he-stage:nth-child(2) .he-sub{margin-top:clamp(24px,6vh,72px);font-size:clamp(1rem,2vh,1.3rem)}
.he-stage:nth-child(3) .he-headline{font-size:clamp(2rem,min(9vh,7.6vw),6.5rem);letter-spacing:-.03em;line-height:1.03}
.he-stage:nth-child(3) .he-previews{margin-top:clamp(28px,7vh,90px)}
.he-stage:nth-child(4) .he-headline{font-size:clamp(2.2rem,7vw,6.8rem);letter-spacing:-.03em;line-height:1.02}
.he-stage:nth-child(4) .he-regions{margin-top:clamp(32px,8vh,110px);
  /* align to the page container (.intro/.work): 1320 max, same side gutters, centred */
  width:calc(min(1320px, 100vw) - clamp(40px,10vw,128px));max-width:none;margin-inline:auto;box-sizing:border-box}

.he-sub{margin:0;color:var(--text-secondary);line-height:1.5;font-size:clamp(.85rem,1.7vh,1.05rem)}

.he-previews{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:var(--dev-w)}
.he-prev{flex:1 1 130px;min-width:0;border:1px solid var(--border);border-radius:10px;
  padding:10px 12px;background:var(--bg-elevated);text-align:left}
.he-prev b{display:block;font-weight:700;font-size:clamp(.78rem,1.5vh,.92rem);color:var(--text-primary);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.he-prev span{font-size:clamp(11px,1.3vh,12px);color:var(--text-muted)}

.he-regions{display:grid;grid-template-columns:repeat(3,1fr);width:var(--dev-w);text-align:left;
  border-top:1px solid var(--border);border-left:1px solid var(--border)}
.he-region{border-right:1px solid var(--border);border-bottom:1px solid var(--border);
  padding:14px 18px;min-height:74px;min-width:0;display:flex;flex-direction:column;justify-content:center}
.he-region b{display:block;font-weight:700;font-size:clamp(.85rem,1.6vh,1rem);color:var(--text-primary)}
.he-region span{font-size:clamp(11px,1.3vh,12px);color:var(--text-muted);line-height:1.4;margin-top:2px}

@media (max-width:760px){
  /* STAGE 1 only: typography leads, the phone is allowed to crop behind it */
  .he-stage:nth-child(1){--dev-w:min(80vw,30rem);padding: 11vh 18px 12vh;}
  .he-stage:nth-child(1) .he-headline{font-size:clamp(2rem,10vw,3.6rem);line-height:1.04;letter-spacing:-.025em}
  /* STAGE 2 only: wide tablet, hero headline + supporting copy */
  .he-stage:nth-child(2){--dev-w:min(88vw,34rem);padding:16vh 18px 10vh}
  .he-stage:nth-child(2) .he-headline{font-size:clamp(1.7rem,8vw,3rem);line-height:1.05;letter-spacing:-.02em}
  .he-stage:nth-child(2) .he-sub{margin-top:clamp(16px,4vh,32px);font-size:clamp(.95rem,3.6vw,1.1rem)}
  /* STAGE 4 only: ecosystem, hero headline + grid */
  .he-stage:nth-child(4){--dev-w:min(92vw,38rem);padding:12vh 18px 10vh}
  .he-stage:nth-child(4) .he-headline{font-size:clamp(2rem,9.5vw,3.6rem);line-height:1.03;letter-spacing:-.02em}
  .he-stage:nth-child(4) .he-regions{grid-template-columns:1fr 1fr;margin-top:clamp(20px,5vh,44px)}
  /* STAGE 3 only: laptop, hero headline + work examples */
  .he-stage:nth-child(3){--dev-w:min(88vw,34rem);padding:14vh 18px 10vh}
  .he-stage:nth-child(3) .he-headline{font-size:clamp(1.8rem,9vw,3rem);line-height:1.05;letter-spacing:-.02em}
  .he-stage:nth-child(3) .he-previews{flex-direction:column;margin-top:clamp(20px,5vh,40px)}
}

/* ---- PRELOADER narrative (beneath the RM, never inside it) ---- */
.preloader{position:fixed;inset:0;z-index:6;pointer-events:none}
.preloader__narrative{position:absolute;left:50%;top:63%;transform:translateX(-50%);white-space:nowrap;
  display:flex;align-items:center;gap:16px;font-family:var(--font-display);font-weight:600;
  text-transform:uppercase;letter-spacing:.14em;font-size:clamp(.78rem,1.3vw,.95rem);color:var(--text-muted)}
.preloader__narrative .arrow{color:var(--blue);font-weight:700}
html.intro-done .preloader{display:none}

/* ---- story progress rail (Screen / Product / Platform / Ecosystem) ---- */
.story-rail{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:50;
  width:min(460px,84vw);pointer-events:none;opacity:0;transition:opacity .5s var(--ease-out)}
.story-rail.is-shown{opacity:1}
.story-rail__icons{display:flex;gap:6px;margin-bottom:8px}
.story-rail__icons .ricon{flex:1;display:flex;justify-content:center;align-items:flex-end}
.story-rail__icons .ricon svg{width:26px;height:24px;color:var(--text-muted);opacity:.4;
  transition:color .3s ease,opacity .3s ease,transform .3s var(--ease-out);transform:translateY(2px) scale(.92)}
.story-rail__icons .ricon.is-active svg{color:var(--text-primary);opacity:1;transform:translateY(0) scale(1)}
.story-rail__labels{display:flex;gap:6px;margin-bottom:9px}
.story-rail__labels .srl{flex:1;text-align:center;font-family:var(--font-display);
  font-size:11px;font-weight:500;letter-spacing:.1em;text-transform:uppercase;
  color:var(--text-muted);opacity:.5;transition:color .3s ease,opacity .3s ease}
.story-rail__labels .srl.is-active{color:var(--text-primary);opacity:1;font-weight:600}
/* clickable stages (only when the rail is shown) */
.story-rail.is-shown .srl,.story-rail.is-shown .ricon{pointer-events:auto;cursor:pointer}
.story-rail.is-shown .srl:hover,.story-rail.is-shown .ricon:hover svg{color:var(--text-primary);opacity:1}
.story-rail .srl:focus-visible{outline:2px solid var(--blue);outline-offset:3px;border-radius:3px;color:var(--text-primary);opacity:1}
.story-rail__track{display:flex;gap:6px}
.story-rail__seg{flex:1;height:2px;background:var(--border);border-radius:2px;overflow:hidden;position:relative}
.story-rail__seg .segfill{position:absolute;top:0;left:0;bottom:0;width:0;background:var(--blue);border-radius:2px}
@media (max-width:760px){
  .story-rail{width:min(300px,80vw);bottom:16px}
  .story-rail__labels{display:none}            /* mobile: icons + minimal 4-segment bar */
  .story-rail__icons .ricon svg{width:22px;height:20px}
}

/* ---- color-reactive headline ink (see core/text-ink.js) ---- */
.ink-letter {
  display: inline;
  background-repeat: no-repeat;
  -webkit-text-fill-color: currentColor; /* fallback before any bloom paints */
}
.ink-letter[style*="transparent"] { -webkit-text-fill-color: transparent; }
