/* The learning layer: a scroll-controlled, progressively enhanced 3D story. */
.learning-layers {
  --layer-progress: 0;
  --layer-ink: #f1f5ff;
  --layer-muted: #a4b4d2;
  position: relative;
  background: #091329;
  color: var(--layer-ink);
  margin: 0 0 100px;
  isolation: isolate;
}
.layers-sticky {
  position: relative;
  min-height: 860px;
  overflow: clip;
  background:
    radial-gradient(ellipse at 72% 43%, #19377750, transparent 58%), #091329;
}
.layers-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid #a4bfff20;
  font-size: 8px;
  letter-spacing: 1.8px;
  color: #91a4c8;
}
.layers-topline > span:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c0ceeb;
}
.layers-topline i {
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: #90aefc;
  box-shadow: 0 0 13px #6590ff;
}
.layers-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 35px;
  align-items: center;
  min-height: 735px;
  padding: 45px 0 65px;
}
.layers-copy {
  position: relative;
  z-index: 2;
}
.layers-copy > .eyebrow {
  font-size: 8px;
  letter-spacing: 1.2px;
  color: #9aacd0;
}
.layers-copy h2 {
  font-size: clamp(43px, 4.4vw, 67px);
  line-height: 1.08;
  letter-spacing: -2.7px;
  margin: 23px 0;
}
.layers-copy h2 em {
  color: #8faeff;
  font-family: Manrope, Arial, sans-serif;
  font-style: normal;
  font-weight: 500;
}
.layers-description {
  color: var(--layer-muted);
  font-size: 13px;
  line-height: 1.9;
  max-width: 360px;
}
.layer-steps {
  display: grid;
  max-width: 415px;
  margin-top: 25px;
}
.layer-step {
  display: flex;
  gap: 15px;
  align-items: start;
  text-align: left;
  padding: 18px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #a4bfff26;
  color: #bdcae4;
  transition:
    color 0.3s,
    border-color 0.3s;
}
.layer-step.active {
  border-bottom-color: #86a7ff;
  color: #fff;
}
.layer-step-number {
  font: 10px/22px monospace;
  color: #93adf0;
}
.layer-step strong {
  font-size: 12px;
  font-weight: 600;
  display: block;
  line-height: 1.8;
}
.layer-step > span:nth-child(2) > span {
  display: block;
  font-size: 11px;
  line-height: 1.8;
  color: #98aaca;
  margin-top: 5px;
  max-width: 330px;
}
.layer-step.active > span:nth-child(2) > span {
  color: #b7c7e4;
}
.layer-step-arrow {
  margin-left: auto;
  color: #94b0fa;
  font-size: 17px;
}
.layers-visual {
  position: relative;
  width: 100%;
  height: 620px;
  isolation: isolate;
  min-width: 0;
}
.layer-canvas {
  position: absolute;
  inset: -8% -8% -4%;
  z-index: 1;
}
.layer-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.layers-floor {
  position: absolute;
  inset: 40% -18% -18%;
  background-image:
    linear-gradient(#718fc526 1px, transparent 1px),
    linear-gradient(90deg, #718fc526 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(500px) rotateX(65deg) rotateZ(-15deg);
  mask-image: radial-gradient(ellipse, #000 10%, transparent 64%);
  z-index: -1;
}
.layers-light {
  position: absolute;
  inset: 15% -10% 0;
  background: radial-gradient(ellipse, #3a65e12b, transparent 65%);
  filter: blur(30px);
  z-index: -1;
}
.layer-label {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  font: 8px monospace;
  letter-spacing: 1.1px;
  color: #bed0fd;
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity 0.4s;
}
.layer-label i {
  width: 24px;
  height: 1px;
  background: #7396e7;
}
.layer-label-work {
  top: 18%;
  right: 1%;
}
.layer-label-context {
  top: 50%;
  right: -2%;
}
.layer-label-hint {
  top: 79%;
  right: 4%;
}
.learning-layers[data-layer="0"] .layer-label-work,
.learning-layers[data-layer="1"] .layer-label-context,
.learning-layers[data-layer="2"] .layer-label-hint {
  color: white;
  opacity: 1;
}
.layers-visual-caption {
  position: absolute;
  bottom: -20px;
  left: 5%;
  right: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font: 7px monospace;
  letter-spacing: 0.5px;
  color: #91a9d6;
}
.layers-live-dot {
  width: 4px;
  height: 4px;
  background: #8eafff;
  border-radius: 50%;
  box-shadow: 0 0 10px #8eafff;
}
.layers-view-label {
  margin-left: auto;
  font-size: 7px;
}
.layers-bottom {
  position: relative;
  display: flex;
  align-items: center;
  gap: 35px;
  padding: 18px 0 25px;
  border-top: 1px solid #a4bfff20;
  color: #95a8cc;
}
.layers-scroll-hint {
  font-size: 8px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}
.layers-scroll-hint > span {
  font-size: 16px;
}
.layers-progress {
  height: 1px;
  flex: 1;
  background: #748db932;
  position: relative;
}
.layers-progress > i {
  position: absolute;
  inset: 0;
  background: #8aaaff;
  transform: scaleX(max(0.04, var(--layer-progress)));
  transform-origin: left;
  box-shadow: 0 0 10px #789fff;
}
.layers-motion {
  color: #a9bce0;
  white-space: nowrap;
}
.layers-motion [data-motion-icon] {
  border-color: #8babe74a;
}
.layers-motion:hover {
  color: white;
}
.layer-fallback {
  position: absolute;
  inset: 8% 15%;
  perspective: 900px;
}
.layer-fallback > div {
  position: absolute;
  left: 0;
  right: 0;
  height: 200px;
  border: 1px solid #92b5ff66;
  border-radius: 16px;
  padding: 28px;
  transform: rotateX(48deg) rotateZ(-28deg);
  box-shadow:
    0 12px 0 #244578,
    0 25px 45px #0005;
  display: flex;
  flex-direction: column;
  gap: 23px;
}
.fallback-sheet {
  top: 0;
  z-index: 3;
  background: linear-gradient(140deg, #fff, #dce8ff);
  color: #243960;
}
.fallback-context {
  top: 31%;
  z-index: 2;
  background: linear-gradient(120deg, #153fba, #4278ee);
  color: #dbe9ff;
}
.fallback-hint {
  top: 62%;
  z-index: 1;
  background: linear-gradient(140deg, #133156, #0e1d36);
  color: #ccddff;
}
.layer-fallback small,
.layer-fallback > div > span {
  font-size: 10px;
  letter-spacing: 1px;
}
.layer-fallback strong {
  font-size: 21px;
  font-weight: 500;
}
.fallback-context b {
  font-size: 35px;
  letter-spacing: 15px;
  color: #a6e6ff;
}
.layer-canvas.is-rendered .layer-fallback {
  display: none;
}
.learning-layers.is-interactive:not(.is-static) {
  height: 250svh;
  min-height: 1800px;
}
.learning-layers.is-interactive:not(.is-static) .layers-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 720px;
  display: flex;
  flex-direction: column;
}
.learning-layers.is-interactive:not(.is-static) .layers-layout {
  flex: 1;
  min-height: 0;
  padding: 20px 0;
}
.learning-layers.is-interactive:not(.is-static) .layers-visual {
  height: min(65svh, 660px);
}
.learning-layers.is-static .layers-scroll-hint {
  font-size: 0;
}
.learning-layers.is-static .layers-scroll-hint::before {
  content: "SELECT A LAYER TO EXPLORE";
  font-size: 8px;
}
.learning-layers.is-static .layers-scroll-hint > span {
  display: none;
}
/* Dimensional cards: the illustration has depth while copy stays easy to read. */
.feature-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --shine-x: 50%;
  --shine-y: 50%;
  position: relative;
  transform-style: preserve-3d;
}
.feature-card .feature-art {
  transition: transform 0.35s ease;
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-origin: 50% 70%;
}
.feature-card .feature-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--shine-x) var(--shine-y),
    #a9c5ff44,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.35s;
}
.feature-card:hover .feature-art::after {
  opacity: 1;
}
.feature-card .math-token,
.feature-card .code-tile,
.feature-card .mini-page {
  transition: translate 0.35s;
}
.feature-card:hover .math-token,
.feature-card:hover .code-tile,
.feature-card:hover .mini-page {
  translate: 0 -9px;
}
body[data-theme="spatial"] .home-hero .art-glow {
  background: radial-gradient(ellipse, #85a9ff70, transparent 63%);
  inset: 0 -25% -5%;
}
body[data-theme="spatial"] .home-hero .art-caption {
  bottom: -1%;
  z-index: 3;
}
.motion-paused .feature-card .feature-art {
  transform: none;
  transition: none;
}
.motion-paused .feature-card:hover .math-token,
.motion-paused .feature-card:hover .code-tile,
.motion-paused .feature-card:hover .mini-page {
  translate: none;
}
@media (min-width: 761px) and (max-height: 800px) {
  .layers-copy h2 {
    font-size: 44px;
    margin: 16px 0;
  }
  .layers-description {
    font-size: 12px;
    line-height: 1.7;
  }
  .layer-steps {
    margin-top: 15px;
  }
  .layer-step {
    padding: 12px 0;
  }
  .layer-step > span:nth-child(2) > span {
    font-size: 10px;
  }
  .layers-topline {
    padding: 19px 0;
  }
  .layers-bottom {
    padding: 13px 0 17px;
  }
  .learning-layers.is-interactive:not(.is-static) .layers-sticky {
    min-height: 640px;
  }
}
@media (max-width: 1100px) {
  .layers-layout {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 15px;
  }
  .layers-copy h2 {
    font-size: 48px;
  }
  .layers-description {
    font-size: 12px;
  }
  .layer-steps {
    max-width: 360px;
  }
  .layer-step strong {
    font-size: 11px;
  }
  .layer-step > span:nth-child(2) > span {
    font-size: 10px;
  }
  .layer-label {
    font-size: 7px;
    letter-spacing: 0.6px;
  }
  .layer-label i {
    width: 15px;
  }
  .layers-visual-caption {
    font-size: 6px;
  }
  .layers-view-label {
    font-size: 6px;
  }
}
@media (max-width: 760px) {
  .learning-layers {
    margin-bottom: 60px;
  }
  .layers-sticky {
    min-height: 0;
  }
  .layers-topline {
    padding: 22px 0;
    font-size: 7px;
    letter-spacing: 1px;
  }
  .layers-topline > span:last-child {
    display: none;
  }
  .layers-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 35px 0 40px;
    min-height: 0;
  }
  .layers-copy {
    width: 100%;
  }
  .layers-copy h2 {
    font-size: 42px;
    letter-spacing: -2px;
    margin: 19px 0;
  }
  .layers-copy h2 br:nth-child(2) {
    display: none;
  }
  .layers-copy h2 em {
    display: block;
  }
  .layers-description {
    font-size: 12px;
    max-width: 430px;
  }
  .layers-copy > .eyebrow {
    font-size: 7px;
  }
  .layer-steps {
    max-width: 100%;
    margin-top: 20px;
  }
  .layer-step {
    padding: 15px 0;
  }
  .layer-step strong {
    font-size: 12px;
  }
  .layer-step > span:nth-child(2) > span {
    font-size: 11px;
    max-width: 100%;
  }
  .layer-step-number {
    font-size: 9px;
  }
  .layers-visual {
    height: 440px;
    margin-top: 18px;
  }
  .layer-canvas {
    inset: -3% -7% 0;
  }
  .layer-label {
    font-size: 6px;
    letter-spacing: 0.5px;
  }
  .layer-label-work {
    right: -2%;
    top: 22%;
  }
  .layer-label-context {
    right: -2%;
    top: 51%;
  }
  .layer-label-hint {
    right: -2%;
    top: 77%;
  }
  .layer-label i {
    width: 12px;
  }
  .layers-visual-caption {
    left: 0;
    right: 0;
    bottom: 0;
    font-size: 6px;
  }
  .layers-view-label {
    font-size: 6px;
  }
  .layers-bottom {
    gap: 15px;
    padding: 19px 0 25px;
  }
  .layers-scroll-hint {
    font-size: 7px;
    letter-spacing: 0.5px;
    gap: 10px;
  }
  .layers-progress {
    display: none;
  }
  .layers-motion {
    margin-left: auto;
    font-size: 9px;
  }
  .layer-fallback {
    inset: 10% 12%;
  }
  .layer-fallback > div {
    height: 140px;
    padding: 20px;
    gap: 14px;
  }
  .layer-fallback strong {
    font-size: 16px;
  }
  .layer-fallback small,
  .layer-fallback > div > span {
    font-size: 8px;
  }
  .fallback-context b {
    font-size: 24px;
    letter-spacing: 10px;
  }
}
@media (max-width: 380px) {
  .layers-copy h2 {
    font-size: 38px;
  }
  .layers-visual {
    height: 370px;
  }
  .layer-label {
    font-size: 5px;
  }
  .layer-step > span:nth-child(2) > span {
    font-size: 10px;
  }
  .layers-visual-caption {
    font-size: 5px;
  }
  .layers-view-label {
    font-size: 5px;
  }
  .layers-scroll-hint {
    font-size: 6px;
  }
  .layers-motion {
    font-size: 8px;
  }
  .layer-step strong {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .feature-card .feature-art {
    transform: none !important;
  }
  .feature-card:hover .math-token,
  .feature-card:hover .code-tile,
  .feature-card:hover .mini-page {
    translate: none;
  }
  .learning-layers.is-interactive {
    height: auto !important;
    min-height: 0 !important;
  }
  .learning-layers .layers-sticky {
    position: relative !important;
    height: auto !important;
  }
  .layers-progress {
    display: none;
  }
}
