/* ============ TOKENS ============ */
:root{
  --black: #050608;
  --panel: #0c0f16;
  --panel-2: #10141d;
  --ink: #eef2f7;
  --muted: #8a92a3;
  --muted-2: #565d6b;
  --blue: #3d7bff;
  --blue-soft: #7fa8ff;
  --blue-dim: #1c3a7a;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14);
  --glass-bg: rgba(16,20,29,0.55);
  --glass-border: rgba(255,255,255,0.09);

  --f-display: "Fraunces", serif;
  --f-body: "Inter", -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", monospace;

  --nav-h: 84px;
}

*{ margin:0; padding:0; box-sizing:border-box; }

html{
  background: var(--black);
  scroll-behavior: auto;
}

body{
  background: var(--black);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  overflow-x: hidden;
  cursor: default;
  -webkit-font-smoothing: antialiased;
}

.mono{ font-family: var(--f-mono); letter-spacing: 0.04em; }

a{ color: inherit; text-decoration: none; }

::selection{ background: var(--blue); color: #fff; }

/* subtle blueprint grid on the whole page */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  opacity: 0.05;
}

/* ============ CURSOR GLOW ============ */
.cursor-glow{
  position: fixed;
  top: 0; left: 0;
  width: 480px; height: 480px;
  margin-left: -240px; margin-top: -240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,123,255,0.14) 0%, rgba(61,123,255,0.05) 40%, transparent 70%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
@media (hover:hover) and (pointer:fine){
  .cursor-glow{ opacity: 1; }
}

/* ============ TYPE SCALE ============ */
.display{
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h2.display{ font-size: clamp(2rem, 4.4vw, 3.6rem); }
.manifesto-title{ font-size: clamp(2.2rem, 5.2vw, 4.4rem); }
.contact-title{ font-size: clamp(2rem, 4.8vw, 3.8rem); }

.eyebrow{
  font-size: 0.72rem;
  color: var(--blue-soft);
  text-transform: uppercase;
  margin-bottom: 18px;
  display: block;
}

.lede{
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 640px;
}

/* ============ GLASS ============ */
.glass{
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
}

/* ============ NAV ============ */
.nav{
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  width: min(92%, 1180px);
  height: 62px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 22px;
  z-index: 100;
}
.nav-mark{
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  font-weight: 500;
}
.brand-logo{
  height: 38px;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 5px 10px;
}
.brand-logo-foot{ height: 30px; }
.nav-links{ display: flex; gap: 34px; }
.nav-link{
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.3s ease;
}
.nav-link:hover{ color: var(--ink); }
.nav-cta{
  font-size: 0.82rem;
  font-family: var(--f-mono);
  background: var(--ink);
  color: var(--black);
  padding: 11px 20px;
  border-radius: 100px;
  transition: background 0.3s ease, transform 0.3s ease;
}
.nav-cta:hover{ background: var(--blue-soft); }
@media (max-width: 860px){
  .nav-links{ display:none; }
}

/* ============ PROGRESS RULE (signature scrub indicator) ============ */
.progress-rule{
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.progress-rule.is-visible{ opacity: 1; }
.progress-rule-track{
  position: relative;
  width: 1px;
  height: 220px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line-strong) 0, var(--line-strong) 1px,
    transparent 1px, transparent 11px
  );
}
.progress-rule-fill{
  position: absolute;
  top: 0; left: 0;
  width: 1px;
  height: 0%;
  background: var(--blue);
  box-shadow: 0 0 8px 1px rgba(61,123,255,0.8);
}
.progress-rule-marker{
  position: absolute;
  left: 50%;
  top: 0%;
  width: 9px; height: 1px;
  background: var(--blue-soft);
  transform: translate(-50%, -50%);
}
.progress-rule-label{
  font-size: 0.62rem;
  color: var(--muted);
}

/* ============ HERO ============ */
.hero-pin{
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000;
}
.hero-video-wrap{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-size: cover;
  background-position: center;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.hero-scroll-cue{
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 54px;
  overflow: hidden;
  z-index: 3;
  opacity: 0.5;
}
.hero-scroll-cue-line{
  display: block;
  width: 1px;
  height: 100%;
  background: var(--ink);
  animation: cueMove 2.2s ease-in-out infinite;
}
@keyframes cueMove{
  0%{ transform: translateY(-100%); }
  60%{ transform: translateY(100%); }
  100%{ transform: translateY(100%); }
}

/* ============ MANIFESTO ============ */
.manifesto{
  position: relative;
  z-index: 3;
  background: var(--black);
  padding: 200px min(8vw, 140px) 160px;
  max-width: 1180px;
  margin: 0 auto;
}
.manifesto-title{ margin: 6px 0 40px; }

/* ============ SECTION SCAFFOLD ============ */
section{ position: relative; z-index: 3; background: var(--black); }
.section-head{
  padding: 0 min(8vw, 140px);
  max-width: 1180px;
  margin: 0 auto 64px;
}

/* ============ FULL-SCREEN VIDEO REELS ============ */
/* Each reel pins for 320% of scroll while scrubbing its frame sequence
   (same canvas-blit technique as the hero) and zooms down from a tight
   crop to the full frame over the first ~30% of that scroll, so the two
   reels play full-bleed, one after another, rather than sitting in a
   static image grid. */
.reel-pin{
  position: relative;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: #000;
}
.reel-stage{
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.reel-frame-wrap{
  position: absolute;
  inset: 0;
  will-change: transform;
}
.reel-canvas{
  width: 100%;
  height: 100%;
  display: block;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.reel-vignette{
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 100%, rgba(0,0,0,0.55), transparent 55%),
    radial-gradient(120% 90% at 50% 0%, rgba(0,0,0,0.4), transparent 55%);
}
.reel-grain{
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
}
.reel-caption{
  position: absolute;
  left: min(8vw, 140px);
  bottom: clamp(60px, 12vh, 140px);
  z-index: 2;
  max-width: 640px;
}
.reel-eyebrow{ margin-bottom: 16px; }
.reel-title{ color: #fff; }
@media (max-width: 700px){
  .reel-caption{
    left: 24px;
    right: 24px;
    bottom: 48px;
    max-width: none;
  }
}

/* ---- Iris-wipe variant (reels 3 & 4): circular reveal instead of zoom ---- */
.reel-pin--iris .reel-stage{
  background: var(--black);
}
.reel-iris-mask{
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.reel-pin--iris .reel-caption{
  left: 50%;
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  max-width: 720px;
}
.reel-pin--iris .reel-title{
  text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}
@media (max-width: 700px){
  .reel-pin--iris .reel-caption{
    left: 24px;
    right: 24px;
    transform: translateY(-50%);
    max-width: none;
  }
}

/* ---- Wipe variant (section 2 — Revit walkthrough): clip-path wipe reveal instead of zoom or iris ---- */
.reel-pin--wipe .reel-stage{
  background: var(--black);
}
.reel-wipe-mask{
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.reel-pin--wipe .reel-frame-wrap{
  position: absolute;
  inset: 0;
  transform: scale(1.06);
}

/* ============ SERVICES ============ */
.services{ padding: 40px 0 200px; }
.services-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: 1180px;
  margin: 0 auto;
}
.service-card{
  background: var(--black);
  padding: 44px 36px;
  position: relative;
  transition: background 0.4s ease, transform 0.4s ease;
}
.service-card:hover{
  background: var(--panel);
  transform: translateY(-3px);
}
.service-num{
  color: var(--blue-soft);
  font-size: 0.78rem;
  display: block;
  margin-bottom: 28px;
}
.service-icon{
  width: 38px; height: 38px;
  color: var(--muted);
  margin-bottom: 26px;
  transition: color 0.4s ease, transform 0.4s ease;
}
.service-card:hover .service-icon{ color: var(--blue-soft); transform: translateY(-2px); }
.service-card h3{
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 1.08rem;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.service-card p{
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}
@media (max-width: 900px){
  .services-grid{ grid-template-columns: 1fr; }
}

/* ============ PORTFOLIO (horizontal pinned scroll) ============ */
.portfolio-pin{
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: 40px;
}
.portfolio-head{ padding: 0 min(8vw, 140px); max-width: 1180px; margin: 0 auto 48px; width: 100%; }
.portfolio-viewport{
  width: 100%;
  overflow: hidden;
}
.portfolio-track{
  display: flex;
  gap: 28px;
  padding: 0 min(8vw, 140px);
  will-change: transform;
}
.sheet-card{
  flex: 0 0 clamp(300px, 34vw, 460px);
  border: 1px solid var(--line);
  background: var(--panel);
}
.sheet-card-visual{
  height: 300px;
  position: relative;
  background-color: var(--panel-2);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
}
.sheet-card-visual::after{
  content:"";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 30% 20%, rgba(61,123,255,0.16), transparent 60%);
}
.sheet-card-visual::before{
  content:"";
  position: absolute;
  border: 1px solid var(--blue-dim);
  opacity: 0.9;
}

.sheet-card-visual img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
/* keep overlay effects above the image */
.sheet-card-visual::after{ z-index: 1; }
.sheet-card-visual::before{ z-index: 2; }


.bp-1::before{ inset: 40px 60px 90px 30px; }
.bp-2::before{ inset: 60px 30px 40px 70px; border-style: dashed; }
.bp-3::before{ inset: 30px 90px 60px 40px; }
.bp-4::before{ inset: 70px 40px 30px 90px; }
.bp-5::before{ inset: 40px 40px 70px 60px; border-style: dashed; }
.sheet-card-body{ padding: 26px 28px 32px; }
.sheet-tag{ color: var(--blue-soft); font-size: 0.68rem; display:block; margin-bottom: 14px; }
.sheet-card-body h3{
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.sheet-meta{ color: var(--muted-2); font-size: 0.74rem; }

/* ============ PROCESS ============ */
.process{ padding: 40px 0 200px; }
.process-list{
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 min(8vw, 140px);
  border-top: 1px solid var(--line);
}
.process-row{
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.process-num{ color: var(--blue-soft); font-size: 0.9rem; }
.process-copy h3{
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.5rem;
  margin-bottom: 10px;
}
.process-copy p{ color: var(--muted); max-width: 560px; line-height: 1.7; font-size: 0.96rem; }
@media (max-width: 700px){
  .process-row{ grid-template-columns: 1fr; gap: 10px; }
}

/* ============ MARQUEE ============ */
.marquee-band{
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 30px 0;
  overflow: hidden;
}
.marquee-track{
  display: flex;
  gap: 60px;
  width: max-content;
  animation: marqueeScroll 26s linear infinite;
}
.marquee-track span{
  font-family: var(--f-mono);
  font-size: 0.9rem;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
@keyframes marqueeScroll{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

/* ============ STATS ============ */
.stats{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px min(8vw, 140px);
  gap: 40px;
}
.stat{ display: flex; flex-direction: column; gap: 10px; }
.stat-num{ font-size: clamp(2.4rem, 4vw, 3.4rem); color: var(--ink); font-weight: 400; }
.stat-label{ color: var(--muted-2); font-size: 0.72rem; text-transform: uppercase; }
@media (max-width: 800px){
  .stats{ grid-template-columns: repeat(2, 1fr); }
}

/* ============ CONTACT ============ */
.contact{
  max-width: 1180px;
  margin: 0 auto 140px;
  padding: 100px min(7vw, 100px);
  border-radius: 28px;
}
.contact-title{ margin-bottom: 46px; }
.contact-row{ display: flex; align-items: center; gap: 36px; flex-wrap: wrap; }
.contact-email{
  font-family: var(--f-mono);
  font-size: 1rem;
  color: var(--blue-soft);
  border-bottom: 1px solid var(--blue-dim);
  padding-bottom: 4px;
  transition: border-color 0.3s ease;
}
.contact-email:hover{ border-color: var(--blue-soft); }

/* ============ FOOTER ============ */
.foot{
  border-top: 1px solid var(--line);
  padding: 36px min(8vw, 140px) 40px;
}
.foot-grid{
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.foot-mark{ opacity: 0.8; }
.foot-links{ display: flex; gap: 26px; }
.foot-links a{ color: var(--muted); font-size: 0.84rem; }
.foot-links a:hover{ color: var(--ink); }
.foot-meta{ color: var(--muted-2); font-size: 0.68rem; }
@media (max-width: 700px){
  .foot-grid{ flex-direction: column; align-items: flex-start; }
}

/* ============ REVEAL ANIMATION BASE STATE ============ */
.reveal{
  opacity: 0;
  transform: translateY(36px);
  filter: blur(6px);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px){
  .manifesto{ padding: 140px 24px 100px; }
  .section-head{ padding: 0 24px; }
  .services{ padding: 20px 0 120px; }
  .process{ padding: 20px 0 120px; }
  .process-list{ padding: 0 24px; }
  .portfolio-head{ padding: 0 24px; }
  .portfolio-track{ padding: 0 24px; }
  .stats{ padding: 80px 24px; }
  .contact{ margin: 0 16px 100px; padding: 60px 28px; border-radius: 20px; }
  .progress-rule{ display: none; }
}

/* ============ ACCESSIBILITY ============ */
a:focus-visible, button:focus-visible{
  outline: 2px solid var(--blue-soft);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1; transform: none; filter: none; }
  .marquee-track{ animation: none; }
  .hero-scroll-cue-line{ animation: none; }
}


/* ===== PHASE 3 MOBILE OPTIMIZATION ===== */
@media (max-width:768px){
  .portfolio-pin{
    height:auto;
    display:block;
    overflow:visible;
    padding:60px 0;
  }
  .portfolio-viewport{overflow:visible}
  .portfolio-track{
    display:grid;
    grid-template-columns:1fr;
    gap:24px;
    transform:none!important;
  }
  .sheet-card{
    width:100%;
    flex:none;
  }
  .sheet-card-visual{height:240px}
  .hero-pin,.reel-pin{height:70vh}
}
