/* Home page: hero (3D logo) and team, one stage, no page scroll.
   Brand: #0A0A0A, #0047FF, orange #FF5A1F for the WIP signal, Montserrat only. */
:root {
  --bf-black: #0A0A0A;
  --bf-blue: #0047FF;
  --bf-orange: #FF5A1F;
  --muted: rgba(255, 255, 255, .62);
  --signal: cubic-bezier(.2, 0, 0, 1);
  --top-h: 122px;              /* ribbon + header; set by home.js from the real elements */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bf-black); color: #fff; overflow: hidden; overscroll-behavior: none; }
body { font: 16px/1.5 Montserrat, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.stage { position: fixed; inset: 0; }
.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .5)); }
.fade { position: absolute; inset: 0; background: var(--bf-black); opacity: 0; pointer-events: none; transition: opacity 160ms linear; z-index: 8; }

/* loading (from the portfolio's entrance): one group per logo path, the path itself is the fill (.f), each of its contours
   is drawn by its own stroke (.s, pathLength 1), so every letter is drawn at the same pace. Stroke width in the logo's
   units: 2493.44 / 380 = 6.56, i.e. 1 px at 380 px. It stays (breathing softly) until the scene is ready, then leaves. */
.intro { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--bf-black); pointer-events: none; transition: opacity 420ms var(--signal), visibility 0s linear 420ms; }
.intro svg { width: min(380px, 72vw); height: auto; overflow: visible; animation: introLogo 900ms var(--signal) forwards, introWait 1.6s ease-in-out 1.2s infinite alternate; }
.intro path { fill: #fff; fill-opacity: 0; stroke: #fff; stroke-width: 6.56; stroke-opacity: .9; animation: introFill 260ms var(--signal) 420ms forwards; }
.intro .f { stroke: none; }
.intro .s { fill: none; stroke-dasharray: 1; stroke-dashoffset: 1; animation: introDraw 560ms var(--signal) forwards, introFill 260ms var(--signal) 420ms forwards; }
.intro g:nth-child(2) .s { animation-delay: 40ms, 460ms; } .intro g:nth-child(3) .s { animation-delay: 80ms, 500ms; }
.intro g:nth-child(4) .s { animation-delay: 120ms, 540ms; } .intro g:nth-child(5) .s { animation-delay: 160ms, 580ms; }
.intro g:nth-child(2) .f { animation-delay: 460ms; } .intro g:nth-child(3) .f { animation-delay: 500ms; }
.intro g:nth-child(4) .f { animation-delay: 540ms; } .intro g:nth-child(5) .f { animation-delay: 580ms; }
@keyframes introDraw { to { stroke-dashoffset: 0; } }
@keyframes introFill { to { fill-opacity: 1; stroke-opacity: 0; } }
@keyframes introLogo { from { transform: scale(.97); } to { transform: scale(1); } }
@keyframes introWait { to { opacity: .55; } }
.loaded .intro { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .intro path { fill-opacity: 1; stroke: none; } }
/* then the hero copy comes in, line by line (rise and fade) */
.hero h1 span, .hero .cta { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--signal), transform 500ms var(--signal); }
.loaded .hero h1 span, .loaded .hero .cta { opacity: 1; transform: none; }
.loaded .hero h1 span:nth-child(1) { transition-delay: 180ms; } .loaded .hero h1 span:nth-child(2) { transition-delay: 240ms; }
.loaded .hero h1 span:nth-child(3) { transition-delay: 300ms; } .loaded .hero .cta { transition-delay: 380ms; }

/* ribbon and header: the site's own (site.css), laid over the scene */
.home-top { position: absolute; top: 0; left: 0; right: 0; z-index: 6; }
.home-top .header { border-bottom: 0; background: rgba(0, 0, 0, .22); }   /* a faint veil sets the bar apart, no grey rule */

/* hero copy: left edge and width set by home.js from the logo's box on screen */
.hero { position: absolute; left: 56%; top: 50%; width: min(660px, 34vw); transform: translateY(-50%); z-index: 3; will-change: transform, opacity; }
.hero h1 { font-weight: 700; font-size: 48px; line-height: 1.06; letter-spacing: -.01em; margin: 0 0 32px; }
.hero h1 span { display: block; white-space: nowrap; }
.cta { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 26px; border-radius: 999px; background: var(--bf-blue); color: #fff; text-decoration: none; font-weight: 700; font-size: 12px; letter-spacing: .18em; transition: background 200ms var(--signal); }
.cta:hover { background: #1a5cff; }

/* team: title and cards placed by home.js over the dot portraits */
.team { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.team h2 { position: absolute; left: 50%; top: 0; margin: 0; transform: translateX(-50%); font-weight: 700; font-size: clamp(28px, 2.8vw, 42px); line-height: 1.1; opacity: 0; white-space: nowrap; }
.members { display: contents; }
.member { display: contents; margin: 0; }
.shot, .card { position: absolute; left: 0; top: 0; opacity: 0; }
.shot { border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 18px 40px rgba(0, 0, 0, .5); transform-origin: 0 0; }
/* linked portraits (LinkedIn): the <a> is the positioned box, its image fills it; blue ring on hover and keyboard focus */
a.shot { display: block; overflow: hidden; transition: box-shadow 200ms var(--signal); }
.shot > img { display: block; width: 100%; height: 100%; object-fit: cover; }
a.shot:hover, a.shot:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bf-blue), 0 0 26px rgba(0, 71, 255, .55), 0 18px 40px rgba(0, 0, 0, .5); }
.ghost { display: none; }
.card { width: clamp(150px, 12.5vw, 196px); padding: 12px 14px; border-radius: 12px; background: rgba(10, 14, 30, .55); border: 1px solid rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-align: center; }
.card strong { display: block; font-weight: 700; font-size: 14px; line-height: 1.25; }
.card span { display: block; margin-top: 4px; font-weight: 500; font-size: 11px; line-height: 1.35; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Instagram (the old landing's footer link): bottom right, discreet */
.home-social { position: absolute; right: max(40px, var(--safe-r)); bottom: max(22px, var(--safe-b)); z-index: 4; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .55); text-decoration: none; transition: color 200ms var(--signal); }
.home-social:hover, .home-social:focus-visible { color: #fff; }
.home-social:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 760px) { .home-social { right: max(16px, var(--safe-r)); bottom: max(10px, var(--safe-b)); } }

/* chapter overview (right edge) */
.prog { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 14px; z-index: 4; }
.prog a, .prog .wip { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 11px; letter-spacing: .2em; color: rgba(255, 255, 255, .5); text-decoration: none; transition: color 200ms var(--signal); }
.prog b { width: 9px; height: 9px; border: 1px solid currentColor; transform: scale(.667); transition: transform 200ms var(--signal), background 200ms var(--signal), box-shadow 200ms var(--signal); }
.prog a:hover { color: rgba(255, 255, 255, .85); }
.prog a.on { color: #fff; }
.prog a.on b { transform: none; background: var(--bf-blue); border-color: var(--bf-blue); box-shadow: 0 0 6px var(--bf-blue), 0 0 16px rgba(0, 71, 255, .6); }
.prog .wip { color: rgba(255, 255, 255, .42); margin-top: 6px; cursor: default; }
.prog .wip b { border-color: var(--bf-orange); background: var(--bf-orange); box-shadow: 0 0 6px var(--bf-orange), 0 0 14px rgba(255, 90, 31, .45); }
.prog.compact a > span, .prog.compact .wip > span { opacity: 0; transition: opacity 200ms var(--signal); }
.prog.compact:hover a > span, .prog.compact:hover .wip > span, .prog.compact:focus-within a > span { opacity: 1; }

/* portrait windows (class set by home.js): logo above, copy at the bottom */
.stack .hero { left: max(20px, 6vw); right: max(20px, 6vw); width: auto; top: auto; bottom: max(9vh, 24px); transform: none; }
.stack .hero h1 { margin-bottom: 24px; }
@media (max-width: 760px) {
  .prog { right: 12px; }
  .prog a > span, .prog .wip > span { display: none; }
  .card { padding: 9px 8px; }
  .card strong { font-size: 13px; }
  .card span { font-size: 10px; letter-spacing: .08em; }
}
@media (max-height: 480px) { .card { padding: 7px 8px; } .card span { margin-top: 2px; } }

/* without WebGL: still image behind the hero, the team as a plain grid */
.nogl .gl { display: none; }
.nogl .stage { background: var(--bf-black) url("../assets/home/poster.webp") center / cover no-repeat; }
.nogl .team { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: var(--top-h) 80px 40px; opacity: 0; transition: opacity 300ms var(--signal); background: rgba(10, 10, 10, .85); }
.nogl .team h2 { position: static; transform: none; opacity: 1; }
.nogl .members { display: grid; grid-template-columns: repeat(5, minmax(0, 190px)); gap: 20px; }
.nogl .member { display: flex; flex-direction: column; gap: 10px; }
.nogl .shot, .nogl .card { position: static; opacity: 1; width: 100%; height: auto; }
.nogl .shot > img { height: auto; }
.nogl .ghost { display: block; aspect-ratio: 560 / 616; border-radius: 10px; background: radial-gradient(rgba(201, 214, 255, .5) 1.2px, transparent 1.6px) 0 0 / 8px 8px; opacity: .5; }
.nogl.at-team .team { opacity: 1; pointer-events: auto; }
.nogl.at-team .hero { opacity: 0; pointer-events: none; }
@media (max-width: 760px) { .nogl .members { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nogl .team { padding: var(--top-h) 20px 24px; justify-content: flex-start; overflow-y: auto; } }
