/* ==========================================================================
   JOEL FLOWSTACK — Design System
   Crystal / Glass / Circuit aesthetic. Dark navy field, blue→violet glass,
   the video-core cube is the single recurring signature object.
   ========================================================================== */

:root{
  /* Neutral studio-grey, lifted straight from the reference video's backdrop —
     the cube's environment, not an invented brand palette. */
  --bg:        #c9cac9;
  --bg-2:      #b7b8b8;
  --surface:   rgba(255,255,255,0.5);
  --surface-2: rgba(255,255,255,0.72);
  --border:    rgba(20,20,22,0.09);
  --border-hi: rgba(20,20,22,0.18);

  --blue:      #3b6ef5;
  --blue-deep: #17245c;
  --violet:    #8b5cf6;
  --cyan:      #2fb3c7;

  --ink:       #14151a;
  --muted:     #55575f;
  --muted-2:   #85878d;

  --grad-brand: linear-gradient(120deg, var(--blue) 0%, var(--violet) 100%);
  --grad-line:  linear-gradient(90deg, rgba(20,20,22,0), rgba(20,20,22,.25), rgba(20,20,22,0));

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.16,1,.3,1);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
::selection{ background: var(--blue); color: #fff; }

body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,.font-display{
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}

p{ margin: 0; color: var(--muted); }
a{ color: inherit; text-decoration: none; }
img{ max-width:100%; display:block; }
button{ font-family: inherit; }

.container{
  width: min(1240px, 92%);
  margin: 0 auto;
}

.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-family: var(--font-display);
  font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow::before{
  content:''; width:7px; height:7px; border-radius:50%;
  background: var(--grad-brand);
  box-shadow: 0 0 12px var(--blue);
}

/* ── BACKGROUND CUBE CANVAS ───────────────────────────────────────────── */
#cube-canvas{
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  display:block;
  pointer-events: none;
}
.bg-veil{
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* seamless studio cove: lighter at top, settling to a mid grey "floor" —
     same read as the reference video's backdrop, no color tint. */
  background:
    radial-gradient(ellipse 70% 55% at 50% 30%, rgba(255,255,255,.35), transparent 62%),
    linear-gradient(180deg, #d7d7d6 0%, #c9cac9 38%, #b9baba 72%, #aaabab 100%);
}
.grain{
  position: fixed; inset:0; z-index:2; pointer-events:none; opacity:.025; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

main, header, footer{ position: relative; z-index: 3; }

/* ── NAV ───────────────────────────────────────────────────────────────── */
#navbar{
  position: fixed; top:0; left:0; right:0; z-index: 50;
  padding: 22px 0;
  transition: padding .4s var(--ease), background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
#navbar.scrolled{
  padding: 14px 0;
  background: rgba(255,255,255,.66);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-inner{ display:flex; align-items:center; justify-content:space-between; gap: 24px; }
.nav-logo{ display:flex; align-items:center; gap:10px; }
.nav-logo-img{ height: 30px; width:auto; }
.nav-word{ font-family: var(--font-display); font-size: 17px; letter-spacing:.02em; }
.nav-word b{ font-weight:700; }

.nav-links{ display:flex; align-items:center; gap: 34px; }
.nav-link{
  font-size: 14px; color: var(--muted); position:relative; padding: 4px 0;
  transition: color .25s;
}
.nav-link::after{
  content:''; position:absolute; left:0; bottom:-2px; height:1.5px; width:0%;
  background: var(--grad-brand); transition: width .3s var(--ease);
}
.nav-link:hover, .nav-link.active{ color: var(--ink); }
.nav-link:hover::after, .nav-link.active::after{ width:100%; }

.nav-cta{
  font-size: 13.5px; font-weight:600; padding: 11px 20px; border-radius: 100px;
  background: var(--grad-brand); color:#fff; white-space:nowrap;
  box-shadow: 0 8px 24px -8px rgba(59,110,245,.6);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.nav-cta:hover{ transform: translateY(-2px); box-shadow: 0 12px 30px -6px rgba(139,92,246,.65); }

.nav-hamburger{ display:none; flex-direction:column; gap:5px; background:none; border:none; cursor:pointer; padding:6px; }
.nav-hamburger span{ width:22px; height:1.5px; background: var(--ink); border-radius:2px; transition:.3s; }

.nav-mobile{
  position:fixed; inset: 0 0 auto 0; top: 0; z-index: 60;
  transform: translateY(-100%); transition: transform .45s var(--ease);
  background: rgba(238,238,238,.97); backdrop-filter: blur(20px);
  padding: 100px 8% 40px; display:flex; flex-direction:column; gap: 26px;
  border-bottom: 1px solid var(--border);
}
.nav-mobile.open{ transform: translateY(0); }
.nav-mobile a{ font-family: var(--font-display); font-size: 26px; }
.nav-mobile-close{ position:absolute; top:26px; right:6%; background:none; border:none; color: var(--ink); font-size:28px; cursor:pointer; }

/* ── BUTTONS ───────────────────────────────────────────────────────────── */
.btn{
  display:inline-flex; align-items:center; gap:10px;
  padding: 15px 28px; border-radius: 100px;
  font-size: 14.5px; font-weight: 600; cursor:pointer; border:none;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s;
}
.btn-primary{
  background: var(--grad-brand); color:#fff;
  box-shadow: 0 10px 30px -10px rgba(59,110,245,.7);
}
.btn-primary:hover{ transform: translateY(-3px); box-shadow: 0 16px 38px -8px rgba(139,92,246,.7); }
.btn-ghost{
  background: var(--surface); color: var(--ink); border:1px solid var(--border);
}
.btn-ghost:hover{ background: var(--surface-2); border-color: var(--border-hi); transform: translateY(-3px); }
.btn-arrow{ transition: transform .3s var(--ease); }
.btn:hover .btn-arrow{ transform: translateX(4px); }

/* ── GLASS CARD ────────────────────────────────────────────────────────── */
.glass{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(120%);
  transition: border-color .35s var(--ease), transform .35s var(--ease), background .35s var(--ease);
}
.glass:hover{ border-color: var(--border-hi); background: var(--surface-2); }

/* ── PAGE HERO (inner pages) ───────────────────────────────────────────── */
.page-hero{
  min-height: 62vh;
  display:flex; flex-direction:column; justify-content:center;
  padding: 180px 0 90px;
}
.page-hero h1{ font-size: clamp(42px, 6vw, 84px); margin-top: 18px; }
.page-hero p.lead{ margin-top: 22px; max-width: 640px; font-size: 18px; color: var(--muted); }
.crumb{ font-size: 13px; color: var(--muted-2); }
.crumb b{ color: var(--muted); }

/* ── SECTION RHYTHM ────────────────────────────────────────────────────── */
section{ padding: 110px 0; position:relative; }
.section-header{ max-width: 640px; margin-bottom: 56px; }
.section-header h2{ font-size: clamp(30px, 4vw, 48px); margin-top:14px; }
.section-header p{ margin-top: 16px; font-size: 16.5px; }
.divider{ height:1px; background: var(--grad-line); border:none; margin: 0; }

/* reveal-on-scroll base */
[data-reveal]{ opacity:0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].in{ opacity:1; transform:none; }

/* ── HOME HERO ─────────────────────────────────────────────────────────── */
.hero{
  min-height: 100svh; display:flex; align-items:center;
  padding: 150px 0 80px;
}
.hero-grid{ display:grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items:center; }
.hero-badge{
  display:inline-flex; align-items:center; gap:10px;
  padding: 8px 16px; border-radius: 100px; font-size: 13px;
}
.hero h1{ font-size: clamp(46px, 6.4vw, 92px); margin-top: 22px; }
.hero h1 .accent{ background: var(--grad-brand); -webkit-background-clip:text; background-clip:text; color:transparent; }
.hero-sub{ margin-top: 24px; font-size: 18.5px; max-width: 520px; }
.hero-ctas{ margin-top: 38px; display:flex; gap:16px; flex-wrap:wrap; }
.hero-stats{ display:flex; gap: 36px; margin-top: 56px; }
.hero-stat b{ font-family: var(--font-display); font-size: 30px; display:block; }
.hero-stat span{ font-size: 12.5px; color: var(--muted-2); letter-spacing:.04em; text-transform:uppercase; }

.hero-visual{ position:relative; height: 520px; }
.hero-visual-frame{
  position:absolute; inset: 6% 8%;
  border: 1px solid var(--border); border-radius: 24px;
}
.scroll-indicator{
  position:absolute; bottom: 26px; left:50%; transform:translateX(-50%);
  display:flex; flex-direction:column; align-items:center; gap:8px;
  font-size: 11px; letter-spacing:.2em; color: var(--muted-2); text-transform:uppercase;
  opacity:0; transition: opacity 1s;
}
.scroll-indicator .line{ width:1px; height: 34px; background: linear-gradient(var(--blue), transparent); animation: scrollpulse 2s infinite; }
@keyframes scrollpulse{ 0%{ opacity:.2 } 50%{ opacity:1 } 100%{ opacity:.2 } }

/* ── MARQUEE ───────────────────────────────────────────────────────────── */
.marquee-wrap{ overflow:hidden; -webkit-mask-image: linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent); mask-image: linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent); }
.marquee{ display:flex; gap: 56px; width:max-content; animation: marquee 34s linear infinite; }
@keyframes marquee{ from{ transform:translateX(0) } to{ transform:translateX(-50%) } }
.marquee-item{ display:flex; align-items:center; gap:10px; font-size:14px; color: var(--muted); white-space:nowrap; }
.marquee-item i{ width:8px; height:8px; border-radius:50%; background: var(--grad-brand); }

/* ── CARDS GRID ────────────────────────────────────────────────────────── */
.grid-3{ display:grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.grid-2{ display:grid; grid-template-columns: repeat(2,1fr); gap: 22px; }
.card{ padding: 34px; }
.card-icon{
  width: 50px; height:50px; border-radius: 14px; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, rgba(59,110,245,.18), rgba(139,92,246,.14));
  border: 1px solid var(--border); margin-bottom: 22px; font-size: 20px;
}
.card h3{ font-size: 20px; margin-bottom: 12px; }
.card p{ font-size: 14.5px; }
.card .tag-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; }
.tag{ font-size:11.5px; padding:5px 10px; border-radius:100px; border:1px solid var(--border); color: var(--muted); }

/* ── WORK / PORTFOLIO ──────────────────────────────────────────────────── */
.work-item{ display:grid; grid-template-columns: .9fr 1.1fr; gap: 0; overflow:hidden; }
.work-item.reverse{ grid-template-columns: 1.1fr .9fr; }
.work-item.reverse .work-media{ order:2; }
.work-media{ position:relative; min-height: 340px; overflow:hidden; }
.work-media img{ width:100%; height:100%; object-fit:cover; transition: transform .7s var(--ease); }
.work-item:hover .work-media img{ transform: scale(1.06); }
.work-body{ padding: 44px; display:flex; flex-direction:column; justify-content:center; gap:16px; }
.work-body h3{ font-size: 26px; }
.work-meta{ display:flex; gap:14px; flex-wrap:wrap; }

/* ── TESTIMONIAL / QUOTE ───────────────────────────────────────────────── */
.quote-block{ padding: 60px; text-align:center; }
.quote-block p{ font-family: var(--font-display); font-size: clamp(20px,2.6vw,30px); color: var(--ink); line-height:1.4; max-width:820px; margin:0 auto; }
.quote-attr{ margin-top: 26px; font-size:13px; color: var(--muted-2); }

/* ── ABOUT ─────────────────────────────────────────────────────────────── */
.about-grid{ display:grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items:start; }
.about-portrait{ position:relative; border-radius: var(--radius); overflow:hidden; border:1px solid var(--border); }
.about-portrait img{ filter: grayscale(1) contrast(1.05); }
.about-portrait::after{
  content:''; position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 40%, rgba(20,20,22,.55) 100%);
}
.about-stats{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:34px; }
.about-stat{ padding:22px; text-align:center; }
.about-stat b{ font-family:var(--font-display); font-size:28px; display:block; }
.about-stat span{ font-size:11.5px; color:var(--muted-2); text-transform:uppercase; letter-spacing:.05em; }
.timeline{ margin-top: 20px; display:flex; flex-direction:column; }
.timeline-item{ display:grid; grid-template-columns: 90px 1fr; gap:20px; padding: 22px 0; border-top:1px solid var(--border); }
.timeline-item:first-child{ border-top:none; }
.timeline-item b{ font-family: var(--font-display); color: var(--cyan); font-size:14px; }
.timeline-item h4{ font-size:17px; margin-bottom:6px; }
.timeline-item p{ font-size:14px; }

/* ── CONTACT ───────────────────────────────────────────────────────────── */
.contact-grid{ display:grid; grid-template-columns: .85fr 1.15fr; gap: 40px; }
.contact-info-item{ display:flex; gap:16px; padding: 20px 0; border-top:1px solid var(--border); }
.contact-info-item:first-child{ border-top:none; }
.contact-info-item .ci-icon{ width:40px; height:40px; border-radius:12px; background:var(--surface); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.contact-info-item b{ display:block; font-size:14.5px; }
.contact-info-item span{ font-size:13.5px; color:var(--muted-2); }
.social-row{ display:flex; gap:10px; margin-top: 28px; }
.social-row a{ width:42px; height:42px; border-radius:12px; background:var(--surface); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; transition: .3s var(--ease); }
.social-row a:hover{ border-color: var(--border-hi); transform: translateY(-3px); }

.form{ padding: 40px; }
.form-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field{ margin-bottom: 18px; display:flex; flex-direction:column; gap:8px; }
.field label{ font-size:12.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.field input, .field textarea, .field select{
  background: rgba(255,255,255,.55); border:1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; color: var(--ink); font-family: var(--font-body); font-size:14.5px;
  transition: border-color .3s;
}
.field input:focus, .field textarea:focus, .field select:focus{ outline:none; border-color: var(--blue); }
.field textarea{ resize:vertical; min-height:120px; }

/* ── CTA BAND ──────────────────────────────────────────────────────────── */
.cta-band{ padding: 90px; text-align:center; position:relative; overflow:hidden; }
.cta-band h2{ font-size: clamp(32px,4.5vw,54px); }
.cta-band p{ margin: 18px auto 34px; max-width: 480px; }

/* ── FOOTER ────────────────────────────────────────────────────────────── */
footer{ padding: 70px 0 34px; border-top: 1px solid var(--border); margin-top: 60px; }
.footer-top{ display:grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 60px; }
.footer-brand-logo{ height: 26px; margin-bottom:16px; }
.footer-col h4{ font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted-2); margin-bottom:18px; }
.footer-col a{ display:block; font-size:14.5px; color:var(--muted); padding: 7px 0; transition:color .25s; }
.footer-col a:hover{ color: var(--ink); }
.footer-bottom{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; font-size:13px; color:var(--muted-2); padding-top: 26px; border-top:1px solid var(--border); }

/* ── LOADER ────────────────────────────────────────────────────────────── */
#loader{
  position:fixed; inset:0; z-index:100; background: var(--bg);
  display:flex; align-items:center; justify-content:center;
  transition: opacity .7s var(--ease), visibility .7s;
}
#loader.hidden{ opacity:0; visibility:hidden; }
.loader-inner{ text-align:center; }
.loader-jf{ font-family: var(--font-display); font-size: 46px; font-weight:700; background: var(--grad-brand); -webkit-background-clip:text; background-clip:text; color:transparent; }
.loader-bar{ width: 180px; height:2px; background: rgba(20,20,22,.12); margin: 22px auto 14px; border-radius:2px; overflow:hidden; }
.loader-fill{ height:100%; width:0%; background: var(--grad-brand); animation: loaderfill 2s var(--ease) forwards; }
@keyframes loaderfill{ to{ width:100% } }
.loader-text{ font-size:11px; letter-spacing:.25em; color:var(--muted-2); text-transform:uppercase; }

/* ── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 980px){
  .nav-links, .nav-cta{ display:none; }
  .nav-hamburger{ display:flex; }
  .hero-grid, .about-grid, .contact-grid{ grid-template-columns: 1fr; }
  .hero-visual{ height: 340px; order:-1; }
  .grid-3, .grid-2{ grid-template-columns: 1fr; }
  .work-item, .work-item.reverse{ grid-template-columns: 1fr; }
  .work-item.reverse .work-media{ order:0; }
  .footer-top{ grid-template-columns: 1fr 1fr; }
  .form-row{ grid-template-columns: 1fr; }
  .cta-band{ padding: 60px 24px; }
  section{ padding: 74px 0; }
}
@media (max-width: 560px){
  .footer-top{ grid-template-columns: 1fr; }
  .hero-stats{ flex-wrap:wrap; row-gap:20px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
