.body {
  background: #000;
  color: #fff;
}

/**
 * All sections but hero are opacity 0 until the video ends
 */
.section {
  opacity: 0;
  transition: opacity 0.5s;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 2em;
  z-index: 1000;
}

.topbar__links { display: flex; gap: 10px; }     /* 10px gutter */
.topbar__icon { width: 32px; height: 32px; display: inline-flex; }
.topbar__icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

/**
 * Loader styles
 */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: #000; color: #fff;
}
.loader__logo {
  width: 80px; height: 80px;
  animation: spin 1.2s linear infinite;
  filter: drop-shadow(0 8px 30px rgba(0,0,0,.45));
}
@keyframes spin { to { transform: rotate(360deg); } }


/**
 * video.js adds this class when the video is done,
 * revealing the rest of the sections
 */
.video-ended .section {
  opacity: 1;
}

/**
 * Section Hero
 */
.hero {
  position: absolute;
  top: 0;
  min-height: 100svh;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  z-index: 2;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.video-ended .hero {
  z-index: 0;
}

/**
 * Section Hello
 */

.hello {
  /**
   * Positions the animated divider in the middle of the screen
   * 260px is the same height as the curtain
   */
  margin-top: calc(50vh - 260px);
  display: grid;
  justify-items: center;
  position: relative;
  z-index: 1;
}

/**
 * A curtain to provide the effect that the text
 * is scrolling behind the divider
 */

 :root{
  /* Filled dot size scales from 18px on small screens to 38px on large */
  --dot-size: clamp(18px, 2.6vw, 38px);

  /* Outlined ring size is a multiple of the dot (3.6–4.2 usually feels right) */
  --ring-mult: 3.8;
  --dot-color: #9B5DE5;
}

.hello-curtain {
  height: 260px;
  width: 100%;
  background: #000;
  position: sticky;
  top: 0;
}

.animated-divider {
  width: 100%;
  height: 120px;
  position: sticky;
  top: 200px;
  margin-top: -60px;
}

.divider-circle {
  width: 120px;
  height: 120px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #000;
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  transform-origin: 50% 50%;
  z-index: 2;
}

.divider-line {
  width: 100%;
  height: 0;
  border: 1px solid #fff;
  position: absolute;
  top: 50%;
  border-top: clamp(1px, 0.2vw, 2px) solid #fff;
  transform-origin: 50% 50%;
  transform: scaleX(var(--line-scale, 1));
  z-index: 1;
}

.divider-dot {
  width: var(--dot-size);
  height: var(--dot-size);
  background: var(--dot-color);
  border-radius: 50%;
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
    translate: -50% -50%;
    transform-origin: 50% 50%;
}

.divider-circle{
  width: calc(var(--dot-size) * var(--ring-mult));
  height: calc(var(--dot-size) * var(--ring-mult));
  background: #000;
  border: clamp(1px, 0.18vw, 2px) solid #fff;
  z-index: 2;
}

.hello-text {
  width: min(90vw, 900px);
  margin-top: 120px;
}

.copy {
  font-size: clamp(20px, 3.5vw, 28px);
  line-height: 1.25;
  margin: 0 0 1.2em 0;
  text-wrap: balance;
  text-align: center;
}

.hello-statement {
 font-size: clamp(56px, 4vw, 80px);
 line-height: 1.25;
 text-wrap: balance;
 text-align: center;
 font-weight: 600;
}

/**
 * Section Bounce*/

.section.bounce {
  max-width: 1438px;
  display: flex;
  justify-content: center;
  margin: -60px auto 0;
}

.ball-assets {
  max-width: 1438px;
  position: relative;
  padding-bottom: 30.75%;
}

.motionPathContainer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}

.ball-illustration {
  display: block;
  width: 100%;
  height: auto;
}

.clouds {
  position: absolute;
  z-index: 20;
  bottom: 0;
  width: 100%;
  height: auto;
}

.motionSvg {
  width: 100%;
}

.ball {
  position: absolute;
  z-index: 10;
  left: calc(50% - var(--dot-size)/2);
  top: calc(0 - var(--dot-size)/2);
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: var(--dot-color);
  opacity: 0;
}

/**
 * Section Projects
 */

/* PROJECTS header */
.header-section {
  width: 100%;
  box-sizing: border-box;

  /* Typography: 56px on small, up to 80px on large */
  font-size: clamp(56px, 5vw, 80px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0 0 24px 0;        /* space below header, no forced height */
  padding-inline: 8vw;

  /* Align text; no need for flex here */
  display: block;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .header-section {
    padding-inline: 6vw;
    margin-bottom: 16px;     /* slightly tighter gap on mobile */
  }
}


.section.projects {
  display: flex;
  flex-direction: column;
  margin-top: 60px;
}

/* Limit the total gap between the header and the cards to 100px max */
.projects .hwrap {
  margin-top: 0px;
}

.hwrap { position: relative; height: 100svh; overflow: hidden; }
#hTrack, .htrack {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4vw;
  padding-inline: 8vw;
  will-change: transform;
}

.hcard {
  flex: 0 0 70vw; max-width: 600px; height: 60svh;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 24px; border-radius: 12px; text-decoration: none;
  color: #fff;
  background: linear-gradient(160deg, #1c1c22 0%, #101013 60%);
  border: 1px solid #ffffff1a;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,.45));
  transition: transform .3s ease, opacity .3s ease;
  opacity: .8;
}

.hcard:focus-visible,
.hcard:hover { transform: translateY(-4px); opacity: 1; }
.hcard__tag {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 0.35rem;
}

.hcard__title {
  font-size: clamp(20px, 4vw, 36px);
  line-height: 1.2;
}

.hcard__tag,
.hcard__title {
  margin: 0;
  flex-shrink: 0;
}

.hcard__bottom-spacer {
  flex-grow: 1;
}


.section.projects {
  position: relative;
}

/* Viewport for the horizontal track */
.projects .hwrap {
  position: relative;
  height: 100svh;        /* fills viewport while pinned */
  overflow: hidden;      /* hide off-screen cards */
}

#hTrack,
.projects .htrack {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4vw;
  padding-inline: 8vw;
  will-change: transform;
}

.hcard__image {
  width: 100%;
  aspect-ratio: 16 / 9;              /* keeps a consistent box */
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: alpa(#000, 0.0);
  align-self: flex-start;
}

.hcard__image picture,
.hcard__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;    /* <— fill entire container, crop to fit */
  object-position: center;
  display: block;
}

@media (max-width: 640px) {
  .hcard__image {
    aspect-ratio: 9 / 16;
    overflow: hidden;
    height: 100%;
    align-self: flex-start;
    border-radius: 12px;
    margin-bottom: 1rem;
  }
}
