/* ==========================================================================
   Layout primitives — the handful of structural classes the whole site uses.
   ========================================================================== */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.measure {
  max-width: var(--measure);
}

/* Content must never start underneath the fixed nav. */
.nav-offset {
  padding-top: clamp(5.5rem, 9vh, 7.5rem);
}

.section {
  position: relative;
  padding-block: var(--space-section);
}

.stack > * + * {
  margin-top: var(--space-4);
}

/* --- The canvas layer -----------------------------------------------------
   Decorative and inert: aria-hidden, pointer-events none. The site is
   complete without it. `data-loading` raises it above the loader's curtain
   so Nova is actually visible — with the curtain in front, the entire
   loading animation renders into a layer nobody can see. */
#scene {
  position: fixed;
  inset: 0;
  z-index: var(--z-canvas);
  pointer-events: none;
  contain: strict;
}

#scene[data-loading='true'] {
  z-index: var(--z-canvas-loading);
}

main {
  position: relative;
  z-index: var(--z-content);
}

/* --- Grids ---------------------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2\@md { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .grid-3\@lg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* A hairline-separated panel row: the gap IS the divider. */
.panel-row {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgb(var(--ink-3));
  border-radius: var(--radius);
  background: rgb(var(--ink-3));
}

@media (min-width: 900px) {
  .panel-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.panel-row > * {
  padding: var(--space-6);
  background: rgb(var(--ink) / 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.row-between {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .row-between {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

/* Two-column reading layout for the service deep-dives: text left, the 3D
   object occupies the right half of the viewport behind it. */
.column-left {
  max-width: 48rem;
}

@media (min-width: 1100px) {
  .column-left {
    max-width: 36rem;
  }
}
