/* ==========================================================================
   SCROLLMATION — a scroll-driven turntable portrait for absaar.dev
   Shares the cyber-organic palette of the Orchestra AI studio tour so the two
   pages read as one site.
   ========================================================================== */

:root{
  --ink:       #07080b;
  --ink-2:     #0b0d12;
  --ink-3:     #11141b;
  --line:      rgba(255,255,255,.10);
  --line-2:    rgba(255,255,255,.20);
  --text:      #eef1f6;
  --text-dim:  #8b95a6;
  --text-dimmer: #5a6475;
  --cyan:      #00e5ff;
  --magenta:   #ff3db1;
  --amber:     #ffb469;
  --glass:     rgba(11,13,18,.55);
  --blur:      saturate(150%) blur(14px);
  --ease:      cubic-bezier(.22,.61,.36,1);
  --ease-out:  cubic-bezier(.16,1,.3,1);
  --font:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  --mono:      ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --maxw:      1360px;
  color-scheme: dark;
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html{ scroll-behavior:auto; }

html,body{
  margin:0; padding:0;
  background:var(--ink); color:var(--text);
  font-family:var(--font);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
  overscroll-behavior-y:none;
}

body{ position:relative; }

::selection{ background:var(--cyan); color:#001016; }

a{ color:inherit; }

/* Visible keyboard focus everywhere. */
:focus-visible{
  outline:2px solid var(--cyan);
  outline-offset:3px;
  border-radius:4px;
}

.skip{
  position:fixed; top:-120px; left:16px; z-index:200;
  background:var(--cyan); color:#001016;
  font-weight:700; font-size:.85rem; letter-spacing:.02em;
  padding:.7rem 1.1rem; border-radius:8px;
  transition:top .2s var(--ease);
}
.skip:focus{ top:16px; }

/* ==========================================================================
   FIXED BACKGROUND LAYERS
   ========================================================================== */

/* A tinted wash whose hue is nudged by scroll (var set from JS). */
.aura{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(60vw 60vw at 72% 42%,
      hsla(var(--aura-h,188), 90%, 55%, .16), transparent 60%),
    radial-gradient(55vw 55vw at 24% 78%,
      hsla(var(--aura-h2,320), 90%, 60%, .12), transparent 62%),
    radial-gradient(90vw 70vw at 50% 120%, rgba(0,0,0,.6), transparent 60%);
  transition:background .6s linear;
}

/* Soft floor glow the figure appears to stand on. */
.floor{
  position:fixed; left:50%; bottom:-8vh; z-index:1;
  width:min(900px, 92vw); height:40vh;
  transform:translateX(-50%);
  background:radial-gradient(50% 50% at 50% 50%,
    rgba(0,229,255,.16), rgba(255,61,177,.06) 45%, transparent 72%);
  filter:blur(8px);
  pointer-events:none;
}

.canvas-wrap{
  position:fixed; inset:0; z-index:2; pointer-events:none;
}
#scroll-canvas{
  position:absolute; inset:0;
  width:100%; height:100%;
  display:block;
}

/* Vignette + grain sit above the figure to seat it in the scene. */
.vignette{
  position:fixed; inset:0; z-index:3; pointer-events:none;
  background:radial-gradient(130% 115% at 50% 32%,
    transparent 52%, rgba(3,4,7,.55) 100%);
  mix-blend-mode:multiply;
}
.grain{
  position:fixed; inset:-50%; z-index:4; pointer-events:none;
  width:200%; height:200%;
  opacity:.05;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation:grain 7s steps(6) infinite;
}
@keyframes grain{
  0%{transform:translate(0,0)} 20%{transform:translate(-6%,3%)}
  40%{transform:translate(4%,-5%)} 60%{transform:translate(-3%,4%)}
  80%{transform:translate(5%,2%)} 100%{transform:translate(0,0)}
}

/* ==========================================================================
   LOADER
   ========================================================================== */

.loader{
  position:fixed; inset:0; z-index:100;
  display:grid; place-items:center;
  background:var(--ink);
  transition:opacity .7s var(--ease), visibility .7s var(--ease);
}
.loader.is-gone{ opacity:0; visibility:hidden; }

.loader__inner{ text-align:center; width:min(78vw, 360px); }
.loader__mark{
  position:relative; width:70px; height:70px; margin:0 auto 1.6rem;
}
.loader__ring, .loader__ring--2{
  position:absolute; inset:0; border-radius:50%;
  border:1.5px solid transparent;
  border-top-color:var(--cyan); border-right-color:var(--cyan);
  animation:spin 1.1s linear infinite;
}
.loader__ring--2{
  inset:11px; border-top-color:var(--magenta); border-right-color:var(--magenta);
  animation-duration:1.5s; animation-direction:reverse;
}
.loader__core{
  position:absolute; inset:0; margin:auto; width:8px; height:8px; border-radius:50%;
  background:var(--amber); box-shadow:0 0 18px var(--amber);
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.loader__brand{
  margin:0; font-size:1.1rem; font-weight:800; letter-spacing:.42em;
  text-indent:.42em;
}
.loader__brand b{ color:var(--cyan); font-weight:800; }
.loader__sub{
  margin:.4rem 0 1.7rem; font-size:.72rem; letter-spacing:.3em;
  color:var(--text-dim); text-transform:uppercase;
}
.loader__track{
  height:2px; width:100%; background:var(--line); border-radius:2px; overflow:hidden;
}
.loader__bar{
  height:100%; width:0%;
  background:linear-gradient(90deg, var(--cyan), var(--magenta));
  transition:width .25s var(--ease);
}
.loader__pct{
  margin:.9rem 0 0; font-family:var(--mono); font-size:.7rem;
  letter-spacing:.14em; color:var(--text-dim);
}

/* ==========================================================================
   FIXED CHROME — brand plate, meta, progress rail, section index
   ========================================================================== */

.chrome{ position:fixed; inset:0; z-index:40; pointer-events:none; }
.chrome a, .chrome button{ pointer-events:auto; }

.brand{
  position:fixed; top:clamp(16px,3.2vw,30px); left:clamp(16px,3.2vw,34px);
  z-index:42; display:flex; align-items:center; gap:.6rem;
  font-size:.82rem; font-weight:700; letter-spacing:.28em;
}
.brand__dot{
  width:9px; height:9px; border-radius:50%;
  background:var(--cyan); box-shadow:0 0 12px var(--cyan);
  animation:pulse 2.6s var(--ease) infinite;
}
@keyframes pulse{ 0%,100%{opacity:1; transform:scale(1)} 50%{opacity:.45; transform:scale(.8)} }
.brand b{ color:var(--text-dim); font-weight:600; letter-spacing:.18em; }

.meta{
  position:fixed; top:clamp(16px,3.2vw,30px); right:clamp(16px,3.2vw,34px);
  z-index:42; font-family:var(--mono); font-size:.68rem; letter-spacing:.12em;
  color:var(--text-dim); text-align:right; line-height:1.6;
}
.meta span{ color:var(--cyan); }

/* Vertical progress rail, right edge. */
.rail{
  position:fixed; top:50%; right:clamp(14px,2vw,26px); z-index:42;
  transform:translateY(-50%);
  display:flex; flex-direction:column; align-items:center; gap:.8rem;
}
.rail__track{
  width:2px; height:34vh; max-height:320px; background:var(--line);
  border-radius:2px; overflow:hidden; position:relative;
}
.rail__fill{
  position:absolute; top:0; left:0; width:100%; height:0%;
  background:linear-gradient(180deg, var(--cyan), var(--magenta));
}
.rail__pct{
  font-family:var(--mono); font-size:.64rem; letter-spacing:.1em; color:var(--text-dim);
}

/* Section index dots, left edge. */
.dots{
  position:fixed; top:50%; left:clamp(14px,2vw,26px); z-index:42;
  transform:translateY(-50%);
  display:flex; flex-direction:column; gap:.95rem;
}
.dots button{
  appearance:none; border:0; background:transparent; cursor:pointer;
  display:flex; align-items:center; gap:.55rem;
  font-family:var(--mono); font-size:.62rem; letter-spacing:.1em;
  color:var(--text-dimmer); padding:2px 0;
  transition:color .3s var(--ease);
}
.dots button .tick{
  width:16px; height:2px; background:currentColor; border-radius:2px;
  transition:width .3s var(--ease), background .3s var(--ease);
}
.dots button:hover{ color:var(--text-dim); }
.dots button.is-active{ color:var(--text); }
.dots button.is-active .tick{ width:30px; background:var(--cyan); }

/* ==========================================================================
   STAGE + ACTS (overlaid narrative)
   ========================================================================== */

.stage{ position:relative; z-index:20; }

.act{
  min-height:100svh;
  display:flex; align-items:center;
  padding:clamp(80px,12vh,140px) clamp(22px,7vw,110px);
}
.act__inner{ width:100%; max-width:var(--maxw); margin:0 auto; }

.act--left   .act__inner{ text-align:left; }
.act--right  .act__inner{ text-align:right; margin-left:auto; }
.act--center .act__inner{ text-align:center; }

.kicker{
  display:inline-flex; align-items:center; gap:.6rem;
  font-family:var(--mono); font-size:clamp(.66rem,1.5vw,.78rem);
  letter-spacing:.26em; text-transform:uppercase; color:var(--cyan);
  margin:0 0 1.1rem;
}
.kicker::before{
  content:""; width:28px; height:1px; background:var(--cyan); opacity:.7;
}
.act--right .kicker{ flex-direction:row-reverse; }
.act--center .kicker::before{ display:none; }

.headline{
  margin:0; font-weight:800;
  font-size:clamp(2.6rem, 9.5vw, 8.2rem);
  line-height:.92; letter-spacing:-.02em;
  text-wrap:balance;
}
.headline .accent{
  background:linear-gradient(120deg, var(--cyan), var(--magenta));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.headline .outline{
  color:transparent; -webkit-text-stroke:1.4px var(--line-2);
}

.lede{
  margin:1.6rem 0 0; max-width:34ch;
  font-size:clamp(1rem, 2.1vw, 1.35rem); line-height:1.5; color:var(--text-dim);
}
.act--right .lede{ margin-left:auto; }
.act--center .lede{ margin-inline:auto; }

.bignum{
  display:block; font-family:var(--mono); font-weight:700;
  font-size:clamp(.7rem,1.6vw,.85rem); letter-spacing:.3em;
  color:var(--text-dimmer); margin:0 0 1.4rem;
}

/* Hero scroll cue. */
.cue{
  position:absolute; left:50%; bottom:clamp(22px,5vh,46px);
  transform:translateX(-50%);
  display:flex; flex-direction:column; align-items:center; gap:.5rem;
  font-family:var(--mono); font-size:.62rem; letter-spacing:.24em;
  color:var(--text-dim); text-transform:uppercase;
}
.cue__line{ width:1px; height:40px; background:linear-gradient(var(--cyan), transparent); position:relative; overflow:hidden; }
.cue__line::after{
  content:""; position:absolute; top:-50%; left:0; width:100%; height:50%;
  background:var(--cyan); animation:cue 1.8s var(--ease) infinite;
}
@keyframes cue{ 0%{top:-50%} 100%{top:100%} }

/* Stats strip. */
.stats{
  display:flex; flex-wrap:wrap; gap:clamp(1.4rem,5vw,3.4rem);
  margin-top:2.4rem;
}
.act--right .stats{ justify-content:flex-end; }
.act--center .stats{ justify-content:center; }
.stat{ text-align:left; }
.act--right .stat{ text-align:right; }
.stat b{
  display:block; font-size:clamp(1.8rem,5vw,3rem); font-weight:800;
  line-height:1; letter-spacing:-.02em;
}
.stat b .u{ color:var(--cyan); font-size:.5em; }
.stat span{
  display:block; margin-top:.5rem; font-family:var(--mono);
  font-size:.66rem; letter-spacing:.14em; text-transform:uppercase; color:var(--text-dim);
}

/* CTA button + footer. */
.cta{
  display:inline-flex; align-items:center; gap:.8rem;
  margin-top:2.2rem; padding:1rem 1.8rem;
  border:1px solid var(--line-2); border-radius:999px;
  font-weight:700; font-size:1rem; letter-spacing:.01em;
  text-decoration:none; color:var(--text);
  background:var(--glass); backdrop-filter:var(--blur); -webkit-backdrop-filter:var(--blur);
  transition:transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.cta:hover, .cta:focus-visible{
  transform:translateY(-3px);
  border-color:var(--cyan);
  background:rgba(0,229,255,.1);
}
.cta__arrow{
  display:inline-flex; width:30px; height:30px; border-radius:50%;
  align-items:center; justify-content:center;
  background:linear-gradient(120deg,var(--cyan),var(--magenta)); color:#001016;
  transition:transform .35s var(--ease);
}
.cta:hover .cta__arrow{ transform:translateX(3px); }

.foot{
  margin-top:2.6rem; font-family:var(--mono); font-size:.68rem;
  letter-spacing:.12em; color:var(--text-dimmer);
}
.foot a{ color:var(--text-dim); text-decoration:none; border-bottom:1px solid var(--line); }
.foot a:hover{ color:var(--cyan); border-color:var(--cyan); }

/* Reveal defaults (JS adds .is-in). Removed entirely in reduced motion. */
.reveal{ opacity:0; transform:translateY(26px); }
.reveal.is-in{ opacity:1; transform:none; transition:opacity .9s var(--ease-out), transform .9s var(--ease-out); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width:860px){
  .dots{ display:none; }
  .rail{ right:10px; }
  .rail__track{ height:26vh; }
  .act--right .act__inner{ text-align:left; margin-left:0; }
  .act--right .kicker{ flex-direction:row; }
  .act--right .lede{ margin-left:0; }
  .act--right .stats{ justify-content:flex-start; }
  .act--right .stat{ text-align:left; }
  .meta{ display:none; }
}

/* On narrow screens the figure sits directly behind the text, so seat the type
   with a soft shadow and lift the hero copy clear of the face. */
@media (max-width:760px){
  .act{ align-items:flex-start; }
  .act--hero{ align-items:flex-start; }
  .act--hero .act__inner{ margin-top:8vh; }
  .headline, .lede, .kicker, .bignum{
    text-shadow:0 1px 2px rgba(3,4,7,.65), 0 6px 26px rgba(3,4,7,.5);
  }
  .lede{ color:var(--text); }
}
@media (max-width:460px){
  .act{ padding-inline:20px; }
  .rail{ display:none; }
}

/* ==========================================================================
   REDUCED MOTION — a calm, fully readable static page
   ========================================================================== */

@media (prefers-reduced-motion: reduce){
  .grain{ animation:none; }
  .brand__dot{ animation:none; }
  .cue__line::after{ animation:none; display:none; }
  .loader__ring, .loader__ring--2{ animation:none; }
  .reveal{ opacity:1; transform:none; }
  .act{ min-height:auto; padding-block:clamp(56px,10vh,96px); }
  /* A readable panel behind text since the portrait no longer moves. */
  .act:not(.act--hero) .act__inner{
    background:var(--glass); backdrop-filter:var(--blur); -webkit-backdrop-filter:var(--blur);
    border:1px solid var(--line); border-radius:18px;
    padding:clamp(24px,5vw,44px);
  }
  .cue{ display:none; }
  html{ scroll-behavior:auto; }
}
