:root {
  --paper: #f2eee3;
  --paper-2: #e8e1d2;
  --ink: #17222b;
  --muted: #687078;
  --line: #bdb7aa;
  --red: #e85d3f;
  --yellow: #f5c542;
  --blue: #347bb5;
  --green: #3a9a68;
  --orange: #ef8b34;
  --white: #f9f7ef;
  --shadow: 0 24px 60px rgba(29, 35, 38, .14);
  --ease: cubic-bezier(.2, .75, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(232, 93, 63, .08), transparent 24rem),
    radial-gradient(circle at 88% 22%, rgba(52, 123, 181, .07), transparent 28rem),
    var(--paper);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.skip-link {
  position: fixed;
  z-index: 99;
  left: 1rem;
  top: -5rem;
  padding: .7rem 1rem;
  background: var(--ink);
  color: white;
  border-radius: .35rem;
}
.skip-link:focus { top: 1rem; }

.site-header {
  width: min(1440px, 100%);
  min-height: 84px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 4.5rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid rgba(23, 34, 43, .22);
}
.brand {
  width: max-content;
  display: inline-flex;
  gap: .7rem;
  align-items: center;
  text-decoration: none;
  font: 600 .78rem/1 "DM Mono", monospace;
  letter-spacing: .1em;
}
.brand-mark {
  width: 30px;
  aspect-ratio: 1;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--ink);
  transform: rotate(-5deg);
}
.brand-mark i:nth-child(1) { background: var(--yellow); }
.brand-mark i:nth-child(2) { background: var(--red); }
.brand-mark i:nth-child(3) { background: var(--blue); }
.brand-mark i:nth-child(4) { background: var(--white); }
nav { display: flex; gap: clamp(1rem, 3vw, 2.6rem); }
.nav-link {
  position: relative;
  padding: 1.95rem .2rem;
  text-decoration: none;
  font-size: .84rem;
  font-weight: 600;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 1.25rem;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--red);
  transform: translateX(-50%) scale(0);
  transition: transform .2s;
}
.nav-link:hover::after, .nav-link:focus-visible::after, .nav-link.active::after { transform: translateX(-50%) scale(1); }
.progress-pill {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .42rem .75rem .42rem .45rem;
  border: 1px solid rgba(23, 34, 43, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  text-align: left;
  cursor: pointer;
}
.progress-pill:hover { background: rgba(255,255,255,.5); }
.progress-ring {
  width: 37px; height: 37px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--red) var(--progress, 0%), #d7d0c1 0);
  font: 600 .7rem "DM Mono", monospace;
}
.progress-ring::before { content: ""; grid-area: 1/1; width: 29px; height: 29px; border-radius: 50%; background: var(--paper); }
.progress-ring span { grid-area: 1/1; z-index: 1; }
.progress-pill b, .progress-pill small { display: block; }
.progress-pill b { font-size: .72rem; }
.progress-pill small { color: var(--muted); font-size: .65rem; }

main { overflow: hidden; }
.hero {
  width: min(1440px, 100%);
  min-height: 740px;
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7.5rem) clamp(1.25rem, 6vw, 6rem) 7rem;
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(500px, 1.14fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 8rem);
}
.hero-copy { min-width: 0; max-width: 100%; }
.eyebrow {
  margin: 0 0 1.15rem;
  font: 500 .72rem/1 "DM Mono", monospace;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.eyebrow span { color: var(--red); margin-right: .45rem; }
h1, h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  line-height: .96;
  letter-spacing: -.045em;
}
h1 { font-size: clamp(4.5rem, 7.8vw, 8.3rem); }
h1 em, h2 em { color: var(--red); font-weight: 600; }
.hero-intro {
  max-width: 560px;
  margin: 2rem 0 2.2rem;
  color: #4f5961;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.button {
  min-height: 49px;
  padding: .8rem 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.button:hover { transform: translateY(-2px); box-shadow: 4px 5px 0 var(--ink); }
.button-primary { background: var(--ink); color: var(--white); }
.button-ghost { background: transparent; }
.trust-row {
  margin-top: 2.2rem;
  display: flex;
  gap: 1.6rem;
  color: var(--muted);
  font: .7rem "DM Mono", monospace;
}
.trust-row b { color: var(--ink); font-size: 1.05rem; }

.cube-workbench {
  position: relative;
  min-width: 0;
  max-width: 100%;
  min-height: 600px;
  padding: 1rem 1rem .75rem;
  background: #dcd4c4;
  border: 1px solid #a9a193;
  box-shadow: var(--shadow), 10px 12px 0 rgba(23,34,43,.12);
  transform: rotate(.6deg);
}
.cube-workbench::before, .cube-workbench::after {
  content: "";
  position: absolute;
  width: 64px; height: 24px;
  background: rgba(248, 223, 155, .66);
  border: 1px solid rgba(128, 107, 69, .18);
  z-index: 4;
}
.cube-workbench::before { left: -24px; top: 45px; transform: rotate(-18deg); }
.cube-workbench::after { right: -22px; bottom: 64px; transform: rotate(-11deg); }
.tape-label {
  position: absolute;
  right: 2rem; top: -14px;
  z-index: 3;
  padding: .4rem 1.5rem;
  background: rgba(248, 223, 155, .88);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  font: .66rem "DM Mono", monospace;
  letter-spacing: .12em;
  transform: rotate(2deg);
}
.stage-toolbar {
  height: 33px;
  padding: 0 .3rem .75rem;
  display: flex;
  align-items: center;
  color: #5d625f;
  font: .65rem "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid rgba(23,34,43,.18);
}
.status-dot { width: 7px; height: 7px; margin-right: .5rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(58,154,104,.14); }
.text-button { margin-left: auto; padding: .35rem; border: 0; background: transparent; text-decoration: underline; cursor: pointer; font: inherit; text-transform: uppercase; }
.cube-scene {
  position: relative;
  height: 385px;
  display: grid;
  place-items: center;
  perspective: 900px;
  overflow: hidden;
}
.cube-iso {
  --cube-size: 208px;
  --rx: -24deg;
  --ry: -38deg;
  position: relative;
  width: var(--cube-size); height: var(--cube-size);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .55s var(--ease), opacity .25s;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}
.cube-iso:active { cursor: grabbing; }
.cube-iso.bump { animation: cube-bump .26s var(--ease); }
@keyframes cube-bump { 50% { scale: .97; } }
.cube-shadow {
  position: absolute;
  width: 260px; height: 85px;
  left: 50%; bottom: 44px;
  background: radial-gradient(ellipse, rgba(23,34,43,.3), transparent 67%);
  filter: blur(5px);
  transform: translateX(-50%) rotate(-6deg);
}
.cube-face {
  position: absolute;
  inset: 0;
  padding: 9px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #131a20;
  border: 2px solid #0d1115;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.06);
  backface-visibility: hidden;
}
.face-f { transform: translateZ(calc(var(--cube-size) / 2)); }
.face-b { transform: rotateY(180deg) translateZ(calc(var(--cube-size) / 2)); }
.face-r { transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2)); }
.face-l { transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2)); }
.face-u { transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2)); }
.face-d { transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2)); }
.sticker {
  min-width: 0;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,.16);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.36), inset 0 -2px 2px rgba(0,0,0,.1);
}
.sticker[data-color="U"] { background: var(--white); }
.sticker[data-color="D"] { background: var(--yellow); }
.sticker[data-color="F"] { background: var(--green); }
.sticker[data-color="B"] { background: var(--blue); }
.sticker[data-color="R"] { background: var(--red); }
.sticker[data-color="L"] { background: var(--orange); }
.cube-net {
  width: min(100%, 440px);
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas: ". u . ." "l f r b" ". d . .";
  gap: 7px;
}
.cube-net:not([hidden]) { display: grid; }
.net-face { padding: 5px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; aspect-ratio: 1; background: #151d23; border-radius: 4px; }
.net-face[data-net="U"] { grid-area: u; }
.net-face[data-net="D"] { grid-area: d; }
.net-face[data-net="F"] { grid-area: f; }
.net-face[data-net="B"] { grid-area: b; }
.net-face[data-net="R"] { grid-area: r; }
.net-face[data-net="L"] { grid-area: l; }
.view-controls {
  position: absolute;
  z-index: 3;
  left: 50%; bottom: 8px;
  display: flex;
  align-items: center;
  gap: .65rem;
  transform: translateX(-50%);
  color: #6d6b65;
  font: .58rem "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}
.view-controls button {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #9e978a;
  border-radius: 50%;
  background: rgba(242, 238, 227, .82);
  cursor: pointer;
}
.view-controls button:hover, .view-controls button:focus-visible { background: var(--ink); color: white; }
.cube-scene.net-open .view-controls, .cube-scene.net-open .cube-shadow { display: none; }
.move-pad {
  padding: .65rem .4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  border-top: 1px solid rgba(23,34,43,.18);
  border-bottom: 1px solid rgba(23,34,43,.18);
}
.move-label { margin-right: .4rem; color: var(--muted); font: .62rem "DM Mono", monospace; }
.move-pad button {
  width: 42px; height: 42px;
  border: 1px solid #9e978a;
  border-radius: 4px;
  background: #eee9de;
  box-shadow: 0 2px 0 #938d81;
  font: 600 .8rem "DM Mono", monospace;
  cursor: pointer;
}
.move-pad button:hover, .move-pad button:focus-visible { background: var(--ink); color: white; transform: translateY(-1px); }
.move-pad button:active { transform: translateY(2px); box-shadow: none; }
.move-pad .prime-toggle { margin-left: .45rem; color: var(--red); }
.move-pad .prime-toggle[aria-pressed="true"] { background: var(--red); color: white; border-color: var(--red); }
.cube-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
.cube-actions button {
  min-height: 48px;
  border: 0;
  border-right: 1px solid rgba(23,34,43,.18);
  background: transparent;
  font-size: .73rem;
  cursor: pointer;
}
.cube-actions button:last-child { border-right: 0; }
.cube-actions button:hover { background: rgba(255,255,255,.35); }
.keyboard-hint { margin: .4rem 0 0; color: #7f7b73; text-align: center; font: .57rem "DM Mono", monospace; }
.live-status { height: 0; overflow: hidden; }

.lesson-section, .notation-section {
  padding: clamp(5rem, 9vw, 9rem) clamp(1.25rem, 6vw, 6rem);
}
.lesson-section { background: var(--ink); color: var(--paper); }
.section-heading {
  width: min(1248px, 100%);
  margin: 0 auto 4rem;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 4rem;
  align-items: end;
}
.section-heading h2, .practice-copy h2 { font-size: clamp(3.2rem, 6vw, 6.6rem); }
.section-heading > p { max-width: 480px; margin: 0; color: #aeb4b7; }
.lesson-layout {
  width: min(1248px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  gap: clamp(2rem, 6vw, 6rem);
}
.lesson-rail { margin: 0; padding: 0; list-style: none; counter-reset: lessons; border-top: 1px solid #465058; }
.lesson-tab {
  counter-increment: lessons;
  width: 100%;
  min-height: 72px;
  padding: .8rem .5rem;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: .8rem;
  align-items: center;
  color: #929a9e;
  border: 0;
  border-bottom: 1px solid #465058;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.lesson-tab::before { content: "0" counter(lessons); font: .65rem "DM Mono", monospace; }
.lesson-tab b { color: inherit; font-size: .86rem; }
.lesson-tab small { display: block; margin-top: .12rem; font: .58rem "DM Mono", monospace; }
.lesson-tab .check { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid #657078; border-radius: 50%; font-size: .65rem; }
.lesson-tab:hover { color: white; }
.lesson-tab.active { color: white; border-left: 3px solid var(--yellow); padding-left: 1rem; background: rgba(255,255,255,.04); }
.lesson-tab.completed .check { border-color: var(--green); background: var(--green); color: white; }
.lesson-panel {
  position: relative;
  min-height: 560px;
  padding: clamp(1.5rem, 4vw, 3rem);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 12px 14px 0 rgba(0,0,0,.2);
}
.lesson-panel::after {
  content: "";
  position: absolute;
  width: 100px; height: 32px;
  left: 50%; top: -16px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(246,220,151,.7);
}
.lesson-kicker { color: var(--red); font: 500 .66rem "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.lesson-panel h3 { max-width: 660px; margin: .5rem 0 1.2rem; font: 650 clamp(2rem, 4vw, 4rem)/1.02 "Fraunces", serif; letter-spacing: -.035em; }
.lesson-goal { max-width: 680px; font-size: 1.03rem; }
.lesson-tip {
  margin: 1.7rem 0;
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: .8rem;
  background: #e4ded2;
  border-left: 3px solid var(--blue);
  font-size: .84rem;
}
.lesson-tip b { display: block; }
.algorithm-card { margin: 1.7rem 0; padding: 1.1rem; border: 1px solid #b9b2a6; background: rgba(255,255,255,.32); }
.algorithm-card header { display: flex; justify-content: space-between; gap: 1rem; font: .62rem "DM Mono", monospace; color: var(--muted); text-transform: uppercase; }
.algorithm { margin: .8rem 0 1rem; font: 500 clamp(1.25rem, 3vw, 2rem) "DM Mono", monospace; letter-spacing: .12em; }
.algorithm-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.mini-button { min-height: 42px; padding: .55rem .8rem; border: 1px solid var(--ink); background: transparent; font-size: .72rem; font-weight: 700; cursor: pointer; }
.mini-button.primary { color: white; background: var(--ink); }
.mini-button:hover { transform: translateY(-1px); box-shadow: 2px 3px 0 #8b867e; }
.lesson-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; }
.lesson-counter { color: var(--muted); font: .65rem "DM Mono", monospace; }

.practice-section {
  padding: clamp(5rem, 9vw, 9rem) clamp(1.25rem, 7vw, 8rem);
  display: grid;
  grid-template-columns: 1fr minmax(420px, .8fr);
  gap: clamp(3rem, 8vw, 9rem);
  align-items: center;
  background: var(--yellow);
}
.practice-copy p:not(.eyebrow) { max-width: 560px; }
.practice-callout { max-width: 480px; margin-top: 2rem; padding-top: 1rem; display: flex; gap: 1rem; border-top: 1px solid rgba(23,34,43,.34); }
.practice-callout span { font-size: 2rem; }
.practice-callout p { margin: 0; font-size: .82rem; }
.practice-callout b { display: block; font: .68rem "DM Mono", monospace; text-transform: uppercase; }
.timer-card { padding: 1.4rem; background: var(--ink); color: white; border-radius: 4px; box-shadow: 12px 14px 0 rgba(23,34,43,.15); transform: rotate(-1deg); }
.timer-topline { display: flex; justify-content: space-between; color: #8f999f; font: .6rem "DM Mono", monospace; letter-spacing: .1em; }
.timer-topline span:last-child { color: var(--green); }
.timer { margin: 2rem 0; text-align: center; font: 500 clamp(3.5rem, 7vw, 6rem)/1 "DM Mono", monospace; letter-spacing: -.08em; }
.scramble-label { margin: 0; color: #8f999f; font: .6rem "DM Mono", monospace; letter-spacing: .1em; }
.scramble-code { min-height: 78px; margin: .45rem 0 1.2rem; padding: 1rem; color: var(--yellow); background: #0d1419; border: 1px solid #3e494f; font: 500 1.05rem/1.7 "DM Mono", monospace; word-spacing: .45rem; }
.timer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.timer-card .button-primary { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.timer-card .button-ghost { color: white; border-color: #59636a; }
.timer-card .button:hover { box-shadow: 4px 5px 0 rgba(255,255,255,.25); }
.best-time { margin-top: 1.3rem; padding-top: 1rem; display: flex; justify-content: space-between; border-top: 1px solid #3e494f; font: .68rem "DM Mono", monospace; }
.best-time b { color: var(--yellow); }

.notation-section { color: var(--ink); }
.notation-section .section-heading > p { color: var(--muted); }
.notation-grid { width: min(1248px,100%); margin: 0 auto; display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.notation-card { min-height: 210px; padding: 1.2rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .2s, transform .2s; }
.notation-card:hover { position: relative; z-index: 1; background: #fffaf0; transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.notation-letter { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 2.2rem; color: white; background: var(--face-color); border: 5px solid var(--ink); box-shadow: 3px 3px 0 #a8a195; font: 600 1.2rem "DM Mono", monospace; }
.notation-card b { display: block; font: 650 1.35rem "Fraunces", serif; }
.notation-card small { color: var(--muted); font-size: .72rem; }
.notation-rule { width: min(960px, 100%); margin: 4rem auto 0; padding: 1.2rem; display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: 1.5rem; align-items: center; border: 1px dashed #9f988b; }
.notation-rule > div { display: flex; align-items: center; gap: .55rem; }
.notation-rule code { width: 40px; height: 40px; display: grid; place-items: center; background: var(--ink); color: white; font: .8rem "DM Mono", monospace; }
.notation-rule span, .notation-rule p { color: var(--muted); font-size: .7rem; }
.notation-rule p { margin: 0; padding-left: 1rem; border-left: 1px solid var(--line); }

footer {
  padding: 2rem clamp(1.25rem, 5vw, 5rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--ink);
  color: var(--paper);
  border-top: 5px solid var(--red);
}
footer p { margin: 0; font: .7rem "DM Mono", monospace; letter-spacing: .08em; }
footer p span { color: #90999e; letter-spacing: 0; }
footer button { margin-left: auto; color: #90999e; background: none; border: 0; text-decoration: underline; font-size: .7rem; cursor: pointer; }
.footer-cube { display: flex; gap: 2px; }
.footer-cube i { width: 10px; height: 10px; background: var(--yellow); }
.footer-cube i:nth-child(2) { background: var(--red); }
.footer-cube i:nth-child(3) { background: var(--blue); }
.toast {
  position: fixed;
  z-index: 80;
  left: 50%; bottom: 1.5rem;
  max-width: calc(100% - 2rem);
  padding: .75rem 1rem;
  color: white;
  background: var(--ink);
  border-left: 4px solid var(--yellow);
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
  font-size: .78rem;
  transform: translate(-50%, 150%);
  transition: transform .35s var(--ease);
}
.toast.show { transform: translate(-50%, 0); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { max-width: 760px; }
  .cube-workbench { width: min(680px, 100%); margin: 0 auto; }
  .notation-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .site-header { grid-template-columns: 1fr auto; min-height: 72px; }
  .site-header nav { display: none; }
  .progress-pill b, .progress-pill small { display: none; }
  .hero { padding-top: 1.5rem; grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  h1 { font-size: clamp(3.4rem, 15.5vw, 5.2rem); }
  h1 em { display: block; max-width: 100%; }
  .hero-copy, .hero-intro { width: 100%; min-width: 0; overflow-wrap: anywhere; }
  .cube-workbench { order: -1; min-height: 565px; transform: none; }
  .cube-scene { height: 350px; }
  .cube-iso { --cube-size: 184px; }
  .section-heading { grid-template-columns: 1fr; gap: 1.4rem; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-rail { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; }
  .lesson-tab { border-right: 1px solid #465058; }
  .practice-section { grid-template-columns: 1fr; }
  .timer-card { width: min(600px,100%); transform: none; }
  .notation-rule { grid-template-columns: 1fr 1fr 1fr; }
  .notation-rule p { grid-column: 1/-1; padding: 1rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .site-header { padding: 0 1rem; }
  .brand { font-size: .68rem; }
  .progress-pill { width: 50px; height: 50px; padding: 5px; justify-content: center; border-radius: 50%; }
  .progress-ring { width: 38px; height: 38px; }
  .hero { min-height: auto; padding: 1.25rem 1rem 5rem; gap: 2.6rem; }
  .hero-intro { margin-top: 1.35rem; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .trust-row { gap: .65rem; justify-content: space-between; flex-wrap: wrap; }
  .cube-workbench { width: 100%; min-width: 0; min-height: 555px; padding-left: .65rem; padding-right: .65rem; overflow: hidden; }
  .tape-label { display: none; }
  .cube-scene { height: 342px; }
  .cube-iso { --cube-size: 174px; }
  .cube-face { padding: 7px; gap: 4px; }
  .move-pad { gap: .2rem; padding-left: 0; padding-right: 0; }
  .move-pad button { width: 44px; height: 44px; flex: 0 0 44px; }
  .move-pad .prime-toggle { margin-left: .1rem; }
  .move-label { display: none; }
  .keyboard-hint { display: none; }
  .view-controls button { width: 44px; height: 44px; }
  .lesson-section, .notation-section, .practice-section { padding-left: 1rem; padding-right: 1rem; }
  .lesson-panel { padding: 1.4rem 1rem; }
  .lesson-footer { align-items: stretch; flex-direction: column; }
  .lesson-footer .mini-button { width: 100%; }
  .notation-grid { grid-template-columns: repeat(2, 1fr); }
  .notation-card { min-height: 180px; }
  .notation-rule { grid-template-columns: 1fr; }
  .notation-rule p { grid-column: auto; }
  .timer { font-size: clamp(3rem, 17vw, 5rem); }
  .timer-actions { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-wrap: wrap; }
  footer button { width: 100%; margin-left: 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
