:root{
  --max: 1180px;
  --pad: clamp(16px, 3vw, 36px);
  --radius: 22px;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --glass: rgba(6, 10, 18, .48);
  --line: rgba(255,255,255,.14);
  --line2: rgba(74,163,255,.28);
  --blur: 14px;

  /* Aeronauts-ish accents (dark + cold blue) */
  --accent: #4aa3ff;
  --accent2: #6b5bff;
  --glow: 0 0 0 1px rgba(74,163,255,.22), 0 12px 40px rgba(74,163,255,.10);
}

*{ box-sizing: border-box; margin: 0; padding: 0; }
html{
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body{
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: "Titillium Web", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: #07070b;
  overflow: hidden;
  position: relative;
}

/* Mobile viewport height fix */
@supports (height: 100dvh) {
  html, body {
    height: 100dvh;
  }
}

/* Top Bar - Centered */
.top{
  position: fixed;
  inset: 0 0 auto 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px var(--pad);
  z-index: 50;
  pointer-events: none;
}
.top > *{ pointer-events: auto; }

.header-container{
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--line);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  max-width: min(900px, calc(100vw - 32px));
  justify-content: space-between;
}

.brand{
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 28px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  width: 300px;
  min-width: 300px;
  flex-shrink: 0;
}

.brand-logo{
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  opacity: .9;
  transition: opacity .2s ease;
}

.brand-logo:hover{
  opacity: 1;
}

.brand-content{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-title{
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-name{
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-left: 28px;
  width: 300px;
  min-width: 300px;
  flex-shrink: 0;
}

.nav-btn{
  appearance: none;
  border: 0;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .2s ease;
  border: 1px solid transparent;
}

.nav-btn:hover{
  background: rgba(255,255,255,.12);
  border-color: var(--line2);
  box-shadow: var(--glow);
}

.nav-btn:active{
  transform: scale(.94);
}

.nav-btn:disabled{
  opacity: .3;
  cursor: not-allowed;
}

.nav-btn svg{
  width: 18px;
  height: 18px;
}

.nav-content{
  flex: 1;
  min-width: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-title{
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .02em;
}

.nav-progress{
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Next arrow */
.next{
  position: fixed;
  left: 50%;
  bottom: calc(var(--pad) + 6px);
  transform: translateX(-50%);
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: rgba(0,0,0,.38);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--glow);
  transition: transform .2s ease, opacity .2s ease;
}
.next:hover{ transform: translateX(-50%) translateY(-3px); }
.next:active{ transform: translateX(-50%) scale(.96); }
.next svg{ width: 22px; height: 22px; transition: transform .3s ease; }
.next.up svg{ transform: rotate(180deg); }
.next::after{
  content: attr(data-label);
  position: absolute;
  top: -18px;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .75;
}

/* Small aeronauts-ish glow tweaks */
.header-container{ border-color: rgba(255,255,255,.12); }
.brand b{ letter-spacing: .06em; }
.card{ box-shadow: var(--shadow), var(--glow); }
.pill{ border-color: rgba(74,163,255,.22); background: rgba(74,163,255,.08); }

/* Scroll container + snap */
.viewport{
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

section.project{
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  scroll-snap-align: start;
  position: relative;
  display: grid;
  place-items: center;
  padding: calc(var(--pad) + 90px) var(--pad) var(--pad);
  isolation: isolate;
}

/* BG image or color */
.bg{
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--bg, #0b0b12);
  background-size: cover;
  background-position: center;
  filter: saturate(1.1);
  transform: scale(1.02);
}

/* overlay gradient */
.overlay{
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 20% 35%, rgba(0,0,0,.02), rgba(0,0,0,.18) 70%),
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.02));
}

/* content grid */
.wrap{
  width: 100%;
  max-width: var(--max);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
}

.card{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2.5vw, 28px);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.kicker{
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
h2{
  margin: 0 0 10px;
  font-size: clamp(24px, 3.5vw, 42px);
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.meta{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 14px;
}
.pill{
  font-size: 11px;
  color: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.16);
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}
p{ margin: 0 0 12px; color: var(--muted); line-height: 1.5; font-size: 14px; }

ul{
  margin: 12px 0 0;
  padding-left: 18px;
  color: rgba(255,255,255,.85);
}
li{ margin: 4px 0; line-height: 1.4; font-size: 13px; }

/* video */
.video{
  justify-self: end;
  align-self: start;
  width: 100%;
}
.video .frame{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.25);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.video .frame.loaded{
  cursor: default;
}

/* Thumbnail */
.thumbnail{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity .3s ease;
}
.frame.loaded .thumbnail{
  opacity: 0;
  pointer-events: none;
}

/* Play Button */
.play-btn{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: opacity .3s ease;
}
.frame.loaded .play-btn{
  opacity: 0;
  pointer-events: none;
}
.play-btn::before{
  content: '';
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,.95);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transition: all .2s ease;
}
.frame:hover .play-btn::before{
  transform: scale(1.1);
  background: rgba(255,255,255,1);
}
.play-btn::after{
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 24px solid #000;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  margin-left: 6px;
}

iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* alternate layout */
section.project[data-align="right"] .wrap{
  grid-template-columns: 1fr 1fr;
}
section.project[data-align="right"] .card{
  order: 1;
}
section.project[data-align="right"] .video{
  order: 2;
  justify-self: end;
}

section.project[data-align="left"] .wrap{
  grid-template-columns: 1fr 1fr;
}
section.project[data-align="left"] .card{
  order: 2;
}
section.project[data-align="left"] .video{
  order: 1;
  justify-self: start;
}

/* footer */
.foot{
  width: min(var(--max), 100%);
  margin: 32px auto 10px;
  padding: 0 var(--pad);
  color: rgba(255,255,255,.7);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Large screens */
@media (min-width: 1400px){
  :root{
    --max: 1400px;
  }

  .header-container{
    max-width: min(1400px, calc(100vw - 32px));
    padding: 16px 32px;
    gap: 32px;
  }

  .brand{
    width: 400px;
    min-width: 400px;
    gap: 16px;
    padding-right: 36px;
  }

  .brand-logo{
    width: 60px;
    height: 60px;
  }

  .brand-title{
    font-size: 18px;
  }

  .brand-name{
    font-size: 13px;
  }

  .nav{
    width: 400px;
    min-width: 400px;
    padding-left: 36px;
    gap: 18px;
  }

  .nav-btn{
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .nav-btn svg{
    width: 20px;
    height: 20px;
  }

  .nav-title{
    font-size: 18px;
  }

  .nav-progress{
    font-size: 14px;
  }

  .next{
    width: 64px;
    height: 64px;
  }

  .next svg{
    width: 24px;
    height: 24px;
  }

  .next::after{
    top: -20px;
    font-size: 11px;
  }
}

/* Very large screens / 4K */
@media (min-width: 1920px){
  :root{
    --max: 1600px;
    --pad: 48px;
  }

  .header-container{
    max-width: min(1600px, calc(100vw - 48px));
    padding: 18px 36px;
    gap: 36px;
  }

  .brand{
    width: 460px;
    min-width: 460px;
    gap: 18px;
    padding-right: 40px;
  }

  .nav{
    width: 460px;
    min-width: 460px;
    padding-left: 40px;
    gap: 20px;
  }

  h2{
    font-size: clamp(38px, 3vw, 48px);
  }

  p{
    font-size: 19px;
    line-height: 1.7;
  }

  .kicker{
    font-size: 14px;
  }

  .pill{
    font-size: 13px;
    padding: 8px 14px;
  }
}

/* Ultra-wide / Large 4K */
@media (min-width: 2560px){
  :root{
    --max: 2000px;
    --pad: 64px;
  }

  .header-container{
    max-width: min(1800px, calc(100vw - 80px));
    padding: 20px 40px;
    gap: 40px;
  }

  .brand{
    width: 520px;
    min-width: 520px;
    gap: 20px;
    padding-right: 44px;
  }

  .nav{
    width: 520px;
    min-width: 520px;
    padding-left: 44px;
    gap: 22px;
  }

  h2{
    font-size: clamp(48px, 3vw, 56px);
  }

  p{
    font-size: 21px;
    line-height: 1.75;
  }
}

/* mobile */
@media (max-width: 900px){
  .viewport{
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: none;
  }

  section.project{
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(var(--pad) + 110px);
    padding-bottom: calc(var(--pad) + 20px);
  }

  /* Force 1 column on mobile - override all align variants */
  .wrap,
  section.project[data-align="left"] .wrap,
  section.project[data-align="right"] .wrap{
    grid-template-columns: 1fr !important;
    gap: clamp(24px, 5vw, 32px);
  }

  .video,
  section.project[data-align="left"] .video,
  section.project[data-align="right"] .video{
    justify-self: stretch !important;
    max-width: 100%;
  }

  .card{
    padding: clamp(18px, 4vw, 24px);
    aspect-ratio: auto;
    height: auto;
  }

  h2{
    font-size: clamp(26px, 5.5vw, 34px);
    margin-bottom: 12px;
    line-height: 1.15;
  }

  p{
    font-size: 15px;
    line-height: 1.55;
  }

  .kicker{
    font-size: 11px;
    margin-bottom: 10px;
  }

  .meta{
    margin: 16px 0 0;
    gap: 6px;
  }

  .pill{
    font-size: 11px;
    padding: 6px 10px;
  }

  .foot{
    display: none;
  }

  .top{
    min-height: auto;
    padding: 12px 0;
  }

  .header-container{
    flex-direction: column;
    width: calc(100% - var(--pad) * 2);
    max-width: var(--max);
    gap: 12px;
    padding: 0;
    background: transparent;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    align-items: center;
  }

  .brand{
    display: flex;
    padding: 14px 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    gap: 0;
    min-width: auto;
    width: auto;
    flex-shrink: 0;
  }

  .brand-logo{
    width: 48px;
    height: 48px;
  }

  .brand-content{
    display: none;
  }

  .nav{
    width: 100%;
    min-width: auto;
    gap: 14px;
    padding: 14px 20px;
    padding-left: 20px;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    justify-content: center;
  }

  .nav-btn{
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .nav-btn svg{
    width: 20px;
    height: 20px;
  }

  .nav-title{
    font-size: 19px;
  }

  .nav-progress{
    font-size: 14px;
  }

  .next{
    width: 48px;
    height: 48px;
    bottom: calc(var(--pad) + 4px);
  }

  .next svg{
    width: 18px;
    height: 18px;
  }

  .next::after{
    display: none;
  }
}

/* Small mobile screens */
@media (max-width: 600px){
  section.project{
    padding-top: calc(var(--pad) + 105px);
  }

  .header-container{
    padding: 14px 16px;
    gap: 10px;
  }

  .brand-logo{
    width: 42px;
    height: 42px;
  }

  .nav{
    gap: 12px;
  }

  .nav-btn{
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .nav-btn svg{
    width: 18px;
    height: 18px;
  }

  .nav-title{
    font-size: 18px;
  }

  .nav-progress{
    font-size: 13px;
  }

  h2{
    font-size: clamp(22px, 6vw, 30px);
  }

  .next{
    width: 48px;
    height: 48px;
    bottom: calc(var(--pad) + 4px);
  }

  .next svg{
    width: 18px;
    height: 18px;
  }
}

/* Very small screens - optimize content */
@media (max-width: 480px){
  section.project{
    padding-top: calc(var(--pad) + 100px);
    padding-bottom: calc(var(--pad) + 16px);
  }

  .header-container{
    padding: 12px 14px;
  }

  .brand-logo{
    width: 34px;
    height: 34px;
  }

  .nav-btn{
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .nav-btn svg{
    width: 17px;
    height: 17px;
  }

  .nav-title{
    font-size: 17px;
  }

  .nav-progress{
    font-size: 12px;
  }

  /* Keep description, only hide bullets */
  .card ul{
    display: none;
  }

  .card{
    padding: 16px;
  }

  .kicker{
    font-size: 10px;
    margin-bottom: 8px;
  }

  h2{
    font-size: clamp(20px, 6.5vw, 28px);
    margin-bottom: 10px;
    line-height: 1.1;
  }

  p{
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
  }

  .meta{
    margin: 12px 0 0;
    gap: 5px;
  }

  .pill{
    font-size: 10px;
    padding: 5px 8px;
  }

  .nav-title{
    font-size: 10px;
  }

  .nav-progress{
    font-size: 8px;
  }

  .next{
    width: 44px;
    height: 44px;
  }

  .next svg{
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce){
  .viewport{ scroll-behavior: auto; }
}
