@font-face {
  font-family: Rubik;
  src: url('../assets/fonts/rubik-labels.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #000;
  color: #d7d2e5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }

.pages {
  position: relative;
  height: 100%;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
}
.pages::-webkit-scrollbar { display: none; }

.page {
  width: 100%;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding: 48px 9vw;
}

h1 {
  margin: 0;
  font-size: clamp(88px, 15.3vw, 252px);
  font-weight: 800;
  letter-spacing: -.085em;
  line-height: 1;
  padding-right: .085em;
  user-select: none;
}

.home { position: relative; }
/* The title stays accessible and doubles as a loading/WebGL fallback. */
.home.has-three h1 { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.three-stage { position: absolute; inset: 0; pointer-events: none; }
.three-stage canvas { display: block; width: 100%; height: 100%; }
.section-nav {
  position: fixed;
  left: clamp(20px, 3.2vw, 60px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.section-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #d7d2e5;
  text-decoration: none;
}
.section-dot::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .3;
  transition: opacity 180ms ease, transform 180ms ease;
}
.section-dot.is-active::before { opacity: 1; transform: scale(1.35); }
.section-dot span {
  position: absolute;
  left: 30px;
  font-size: 10px;
  letter-spacing: .06em;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}
.section-dot:hover span, .section-dot:focus-visible span { opacity: .8; transform: none; }
.section-dot:focus-visible { outline: 1px solid #d7d2e5; outline-offset: 3px; border-radius: 50%; }

.projects { position: relative; }
.project-stage { position: absolute; inset: 0; pointer-events: none; }
.project-stage canvas { display: block; width: 100%; height: 100%; }
.projects.has-3d-boxes .project { border-color: transparent; }
.projects.has-3d-boxes .project span {
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.project-grid {
  position: relative;
  width: min(100%, 1120px);
  height: min(65vh, 650px);
  height: min(65dvh, 650px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.project {
  position: relative;
  min-width: 0;
  border: 1.25px solid #fff;
  border-radius: 22px;
  background: transparent;
  cursor: pointer;
}
.project span {
  font-family: Rubik, Arial, sans-serif;
  font-weight: 500;
  position: absolute;
  right: 18px;
  bottom: 16px;
  font-size: 11px;
  letter-spacing: .025em;
  color: #fff;
}

@media (max-width: 700px) {
  .page { padding: 40px 10vw 40px 16vw; }
  .home { padding: 30px; }
  .section-nav { left: 12px; }
  h1 { font-size: clamp(76px, 21vw, 145px); }
  .project-grid {
    height: 74vh;
    height: 74dvh;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .project span { right: 12px; bottom: 12px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.project:focus-visible { outline: 1.25px solid #fff; outline-offset: 6px; }
.project-open .pages { overflow-y: hidden; touch-action: none; }
.project-open .section-nav { visibility: hidden; }
.project-open .projects { cursor: pointer; }


.project-description { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.project-open .project:focus-visible { outline: none; }
