/* ═══════════════════════════════════════════════════════════════════
   Infrastructure cube — isometric plates, driven by --pin-progress
   ═══════════════════════════════════════════════════════════════════ */

.cube-section {
  --pin-progress: 0;
  position: relative;
  background: var(--bg-section-alt-1);
  border-top: 1px solid var(--line-1);
  min-height: 300vh;
}
.cube-section__inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  /* Left column wider so the H2 wraps in 2-3 lines instead of 4, and
     there's room between the title and the sub-paragraph below. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 56px;
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  /* Labels are absolute-positioned children of the stage and extend past
     the plate right-edge anchors — overflow must stay visible here. */
  overflow: visible;
}

.cube-section__copy { max-width: 560px; }
/* Pull the section-title back from the default clamp so it stops eating
   all the vertical space in the left column and crowding the paragraph
   below. Keeps line-height proportional. */
.cube-section__copy .section-title {
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin-bottom: 20px;
}
.cube-section__copy .section-sub {
  font-size: 14.5px;
  line-height: 1.6;
}

.cube-progress {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cube-progress__step {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 14px;
  border-left: 1px solid var(--line-1);
  transition: color 240ms var(--ease-std), border-color 240ms var(--ease-std);
}
.cube-progress__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  width: 24px;
  letter-spacing: 0.05em;
}
.cube-progress__step.is-active {
  color: var(--text-heading);
  border-left-color: var(--accent-purple);
}
.cube-progress__step.is-active .cube-progress__num { color: var(--accent-purple); }

/* ── Scene ───────────────────────────────────────────────── */
.cube-scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 720px;
  display: grid;
  place-items: center;
  overflow: visible;
}
.cube-scene__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(200, 210, 230, 0.08) 1px, transparent 1.2px);
  background-size: 22px 22px;
  opacity: .7;
  pointer-events: none;
}
.cube-scene__stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 820px;
}
svg.iso {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Plates fade smoothly; paths are rewritten every frame */
g[data-plate] { transition: opacity .5s ease; }
g[data-plate] polygon,
g[data-plate] path { transition: none; }

/* ── Materials ──────────────────────────────────────────── */

/* SOLID — charcoal glass (top / bottom outer plates) */
[data-plate-mat="solid"] [data-face="top"]   {
  fill: url(#matSolidTop);
  fill-opacity: .92;
  stroke: rgba(255,255,255,.14); stroke-width: 1.1;
}
[data-plate-mat="solid"] [data-face="left"]  {
  fill: url(#matSolidLeft);
  fill-opacity: .94;
  stroke: rgba(255,255,255,.05); stroke-width: .6;
}
[data-plate-mat="solid"] [data-face="right"] {
  fill: url(#matSolidRight);
  fill-opacity: .94;
  stroke: rgba(255,255,255,.07); stroke-width: .6;
}

/* FROSTED — translucent (middleware plates that collapse) */
[data-plate-mat="frosted"] [data-face="top"]   {
  fill: url(#matFrostedTop);
  fill-opacity: .78;
  stroke: rgba(255,255,255,.22); stroke-width: 1.1;
}
[data-plate-mat="frosted"] [data-face="left"]  {
  fill: url(#matFrostedLeft);
  fill-opacity: .82;
  stroke: rgba(255,255,255,.06); stroke-width: .6;
}
[data-plate-mat="frosted"] [data-face="right"] {
  fill: url(#matFrostedRight);
  fill-opacity: .82;
  stroke: rgba(255,255,255,.10); stroke-width: .6;
}

/* CUMBUCA — luminous purple proxy slice */
[data-plate-mat="cumbuca"] [data-face="top"]   {
  fill: url(#matCumbucaTop);
  fill-opacity: .96;
  stroke: rgba(255,255,255,.28); stroke-width: 1.2;
}
[data-plate-mat="cumbuca"] [data-face="left"]  {
  fill: url(#matCumbucaLeft);
  fill-opacity: .96;
  stroke: rgba(255,255,255,.12); stroke-width: .7;
}
[data-plate-mat="cumbuca"] [data-face="right"] {
  fill: url(#matCumbucaRight);
  fill-opacity: .96;
  stroke: rgba(255,255,255,.16); stroke-width: .7;
}
g[data-plate="cumbuca"] {
  filter: drop-shadow(0 0 22px rgba(125, 124, 217, 0.42));
}

/* RIBBED — metallic (regulated ecosystem floor) */
[data-plate-mat="ribbed"] [data-face="top"]   {
  fill: url(#matRibbedTop);
  fill-opacity: .94;
  stroke: rgba(255,255,255,.16); stroke-width: 1.1;
}
[data-plate-mat="ribbed"] [data-face="left"]  {
  fill: url(#patRibbedLeft);
  stroke: rgba(0,0,0,.4); stroke-width: .6;
}
[data-plate-mat="ribbed"] [data-face="right"] {
  fill: url(#patRibbedRight);
  stroke: rgba(0,0,0,.4); stroke-width: .6;
}

/* ── Labels ─────────────────────────────────────────────── */
.plate-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity .4s ease;
  left: 0; top: 0;
  opacity: 0;
}
.plate-label__line {
  width: clamp(40px, 10vw, 90px);
  height: 1px;
  background: linear-gradient(90deg,
    rgba(200,210,230,0) 0%,
    rgba(200,210,230,.22) 30%,
    rgba(200,210,230,.28) 100%);
}
.plate-label__text { min-width: 0; }
.plate-label__title {
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-heading);
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.plate-label__sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 400;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.plate-label--accent .plate-label__title { color: var(--accent-purple-2); font-weight: 600; }
.plate-label--accent .plate-label__sub   { color: var(--accent-purple); }
.plate-label--accent .plate-label__line {
  background: linear-gradient(90deg,
    rgba(125,124,217,0) 0%,
    rgba(125,124,217,.45) 30%,
    rgba(125,124,217,.7) 100%);
  height: 1.5px;
}

@media (prefers-reduced-motion: reduce) {
  .cube-section { --pin-progress: 1; }
  g[data-plate], .plate-label { transition: none; }
}

@media (max-width: 900px) {
  .cube-section { min-height: auto; }
  .cube-section__inner {
    position: relative;
    height: auto;
    grid-template-columns: 1fr;
    padding: 80px var(--gutter);
    gap: 40px;
  }
  .cube-scene { min-height: 500px; }
  .plate-label { display: none; }
}
