:root {
  --ink: #2d211c;
  --green: #a84316;
  --green-2: #c85c20;
  --cream: #fff0df;
  --paper: #fffaf2;
  --coral: #ef7627;
  --gold: #ffb24a;
  --line: rgba(78, 40, 23, 0.16);
  --muted: #78665c;
  --white: #fffdfa;
  --hero-stage: #f2a33a;
  --hero-stage-deep: #ad620a;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --sans: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --shadow: 0 28px 60px rgba(29, 49, 42, 0.12);
}
:root[data-featured-stage="primary"] { --hero-stage: #f2a33a; --hero-stage-deep: #ad620a; }
:root[data-featured-stage="junior"] { --hero-stage: #e76032; --hero-stage-deep: #a84316; }
:root[data-featured-stage="senior"] { --hero-stage: #9f4161; --hero-stage-deep: #712b48; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.portfolio-root { scrollbar-gutter: stable; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  z-index: 20;
  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='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: white;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 4.5vw;
  transition: background 0.25s, box-shadow 0.25s, height 0.25s;
}
.site-header.is-scrolled {
  height: 60px;
  background: rgba(255, 252, 245, 0.9);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  line-height: 1.15;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--paper);
  background: var(--green);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.08rem;
}
.brand strong { display: block; font-family: var(--serif); font-size: 0.98rem; }
.brand small { display: block; margin-top: 0.18rem; color: var(--muted); font-size: 0.5rem; letter-spacing: 0.16em; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, 0.82fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 8rem);
  min-height: 100vh;
  padding: 134px 8vw 70px;
  overflow: hidden;
  background:
    radial-gradient(circle at 79% 31%, rgba(255, 178, 74, 0.22), transparent 22%),
    linear-gradient(115deg, #fffaf2 0 61%, #ffe3c2 61% 100%);
}
.hero::after {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  right: -235px;
  bottom: -250px;
  border: 1px solid rgba(23, 63, 53, 0.24);
  border-radius: 50%;
  box-shadow: 0 0 0 65px rgba(23, 63, 53, 0.05), 0 0 0 130px rgba(23, 63, 53, 0.04);
}
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.eyebrow {
  margin: 0 0 1.3rem;
  color: var(--green-2);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.35rem, 6.35vw, 7.3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.hero h1 em { color: var(--coral); font-style: normal; }
.hero-intro { max-width: 600px; margin: 2rem 0 0; color: #49554f; font-size: clamp(1rem, 1.3vw, 1.18rem); }
.hero-actions { display: flex; align-items: center; gap: 2rem; margin-top: 2rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.75rem 1.45rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-2); }
.text-link { text-underline-offset: 0.3rem; font-size: 0.9rem; font-weight: 600; }
.text-link span, .case-link span { color: var(--coral); }
.hero-stats { display: flex; gap: clamp(1.4rem, 4vw, 4rem); margin: 3.1rem 0 0; }
.hero-stats div { display: grid; gap: 0.1rem; }
.hero-stats dt { font-family: var(--serif); font-size: clamp(1.65rem, 2.5vw, 2.25rem); font-weight: 700; line-height: 1; }
.hero-stats dd { margin: 0; color: var(--muted); font-size: 0.78rem; }
.demo-note { margin: 1.35rem 0 0; color: #8d7971; font-size: 0.72rem; }
.hero-visual { position: relative; z-index: 2; justify-self: center; width: min(100%, 460px); }
.portrait-card { position: relative; padding: 1rem; background: var(--white); box-shadow: var(--shadow); transform: rotate(1.4deg); }
.portrait-placeholder { position: relative; aspect-ratio: 4 / 4.75; overflow: hidden; background: #d8e5df; }
.portrait-placeholder svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.portrait-placeholder > span {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: 0.35rem 0.7rem;
  color: white;
  background: rgba(23, 63, 53, 0.8);
  font-size: 0.68rem;
}
.portrait-caption { display: flex; align-items: center; gap: 0.55rem; padding: 1rem 0.3rem 0.25rem; color: var(--muted); font-size: 0.76rem; }
.status-dot { width: 7px; height: 7px; background: #4b9d65; border-radius: 50%; box-shadow: 0 0 0 4px rgba(75, 157, 101, 0.13); }
.paper-note {
  position: absolute;
  left: -29%;
  bottom: 9%;
  width: 220px;
  padding: 1.1rem 1.25rem;
  background: #fff2c6;
  box-shadow: 0 10px 25px rgba(63, 52, 18, 0.13);
  transform: rotate(-6deg);
}
.paper-note span { display: block; color: #8f7d49; font-size: 0.65rem; }
.paper-note strong { display: block; margin-top: 0.3rem; font-family: var(--serif); font-size: 1.05rem; }
.paper-note svg { display: block; width: 100%; margin-top: 0.4rem; }
.paper-note path { fill: none; stroke: var(--coral); stroke-width: 2; }
.seal {
  position: absolute;
  top: -3rem;
  right: -3rem;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  color: var(--coral);
  border: 2px solid var(--coral);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  transform: rotate(9deg);
}

.section { position: relative; padding: 120px 8vw; }
.section-number { position: absolute; top: 7.6rem; left: 3vw; color: var(--coral); font-family: var(--serif); font-size: 0.75rem; }
.section-heading h2, .work-header h2, .experience-heading h2, .contact-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4.6vw, 4.8rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.intro { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 9vw; background: var(--cream); }
.intro-body { max-width: 690px; padding-top: 2.7rem; }
.intro-body p { color: #53605a; }
.intro-body .lead { color: var(--ink); font-family: var(--serif); font-size: clamp(1.2rem, 1.9vw, 1.65rem); line-height: 1.75; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.tag-list li { padding: 0.42rem 0.9rem; border: 1px solid #9bab9f; border-radius: 99px; color: #3d554c; font-size: 0.76rem; }

.work { background: var(--paper); }
.work-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 3rem; }
.filter-group { display: flex; gap: 0.4rem; padding: 0.35rem; border: 1px solid var(--line); border-radius: 99px; }
.filter-button { padding: 0.45rem 0.9rem; color: var(--muted); background: transparent; border: 0; border-radius: 99px; cursor: pointer; font-size: 0.75rem; }
.filter-button.is-active { color: white; background: var(--green); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem; }
.project-card { min-width: 0; transition: opacity 0.25s, transform 0.25s; }
.project-card.is-hidden { display: none; }
.project-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 0.7fr; background: #eef1eb; }
.project-featured .project-media { min-height: 510px; }
.project-featured .project-copy { align-self: center; padding: clamp(2rem, 5vw, 5rem); }
.project-media { position: relative; min-height: 350px; overflow: hidden; }
.media-green { background: #a84316; }
.media-cream { background: #f2dcc0; }
.media-rust { background: #d46124; }
.media-blue { background: #b66f45; }
.media-label { position: absolute; top: 1.25rem; left: 1.25rem; z-index: 2; padding: 0.3rem 0.65rem; color: white; border: 1px solid rgba(255,255,255,0.5); border-radius: 99px; font-size: 0.65rem; }
.media-label.dark { color: var(--ink); border-color: rgba(24,35,31,0.3); }
.duration { position: absolute; right: 1.25rem; bottom: 1.2rem; color: rgba(255,255,255,0.75); font-size: 0.7rem; }
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  color: var(--green);
  background: white;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.2s;
}
.play-button span { margin-left: 4px; }
.play-button:hover { transform: translate(-50%, -50%) scale(1.08); }
.chalkboard-art { position: absolute; inset: 12% 11%; color: #f8f1d3; font-family: var(--serif); }
.chalkboard-art::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image: repeating-linear-gradient(3deg, transparent 0 11px, #fff 12px 13px, transparent 14px 25px);
}
.chalk-title { position: absolute; top: 12%; left: 39%; font-size: clamp(2rem, 4.5vw, 4rem); }
.chalk-line { position: absolute; top: 35%; left: 27%; width: 47%; height: 2px; background: #f4d66d; transform: rotate(-2deg); }
.chalk-copy { position: absolute; top: 43%; left: 18%; font-size: clamp(0.9rem, 1.6vw, 1.25rem); letter-spacing: 0.3em; }
.chalk-arrow { position: absolute; top: 51%; left: 50%; color: #f0b39f; font-size: 2.6rem; }
.chalk-question { position: absolute; right: 8%; bottom: 14%; font-size: clamp(0.9rem, 1.6vw, 1.3rem); transform: rotate(-3deg); }
.project-copy { padding: 1.55rem 0 1rem; }
.project-meta { display: flex; gap: 0.45rem; margin-bottom: 0.8rem; color: var(--green-2); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; }
.project-meta span + span::before { content: "·"; margin-right: 0.45rem; }
.project-copy h3 { margin: 0; font-family: var(--serif); font-size: clamp(1.35rem, 2.2vw, 2.15rem); line-height: 1.35; }
.project-copy p { margin: 0.8rem 0 1.2rem; color: var(--muted); font-size: 0.9rem; }
.case-link { padding: 0; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--ink); cursor: pointer; font-size: 0.79rem; font-weight: 700; }
.paper-stack { position: absolute; inset: 18% 18%; transform: rotate(-3deg); }
.paper { position: absolute; inset: 0; padding: 2.1rem; background: var(--paper); box-shadow: 0 12px 22px rgba(60, 50, 34, 0.13); }
.paper-back { transform: rotate(8deg) translate(12px, 5px); background: #bfaa86; }
.paper-front small { display: block; color: var(--muted); font-size: 0.58rem; }
.paper-front strong { display: block; margin: 1.1rem 0 1.4rem; font-family: var(--serif); font-size: clamp(1.2rem, 2.5vw, 2rem); }
.paper-front i { display: block; width: 100%; height: 5px; margin: 0.5rem 0; background: #d8d3c8; }
.paper-front i.short { width: 62%; }
.paper-front span { position: absolute; right: 1rem; bottom: 1rem; color: var(--coral); font-size: 0.6rem; }
.board-canvas { position: absolute; inset: 18% 11% 14%; color: #fff4dc; border: 2px solid rgba(255,255,255,0.4); font-family: var(--serif); }
.board-main { position: absolute; top: 11%; left: 50%; font-size: 2.2rem; transform: translateX(-50%); }
.board-main::after { content: ""; position: absolute; left: -20%; right: -20%; bottom: -6px; height: 2px; background: #ffd16f; }
.board-left, .board-right { position: absolute; top: 46%; font-size: 0.9rem; }
.board-left { left: 9%; }.board-right { right: 9%; }
.board-center { position: absolute; top: 45%; left: 50%; padding: 0.3rem; color: #ffd16f; border: 1px solid #ffd16f; border-radius: 50%; transform: translateX(-50%); }
.board-footer { position: absolute; left: 50%; bottom: 9%; white-space: nowrap; transform: translateX(-50%); font-size: 0.78rem; letter-spacing: 0.13em; }
.poem-art { position: absolute; inset: 0; display: grid; place-content: center; gap: 1.1rem; color: white; background: radial-gradient(circle at 50% 80%, rgba(255,255,255,0.35), transparent 33%); font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.8rem); text-align: center; }
.poem-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 41%; background: linear-gradient(165deg, transparent 0 40%, #607b80 41% 60%, #536d71 61%); opacity: 0.75; }
.poem-art span { position: relative; z-index: 1; }

.philosophy { color: white; background: var(--green); overflow: hidden; }
.philosophy::after { content: "学"; position: absolute; right: -2vw; bottom: -14vw; color: rgba(255,255,255,0.035); font-family: var(--serif); font-size: 44vw; line-height: 1; }
.eyebrow.light, .section-number.light { color: #efbd6b; }
.principle-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 4rem; background: rgba(255,255,255,0.18); }
.principle { min-height: 300px; padding: 2.5rem; background: var(--green); }
.principle-icon { display: grid; place-items: center; width: 54px; height: 54px; color: #efbd6b; border: 1px solid rgba(239,189,107,0.6); border-radius: 50%; font-family: var(--serif); font-size: 1.15rem; }
.principle h3 { margin: 2rem 0 0.6rem; font-family: var(--serif); font-size: 1.45rem; }
.principle p { color: rgba(255,255,255,0.66); font-size: 0.88rem; }
.quote { position: relative; z-index: 1; margin: 5rem 0 0 auto; padding-left: 2rem; max-width: 600px; border-left: 2px solid var(--coral); }
.quote p { margin: 0; font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 2.5rem); }
.quote cite { color: rgba(255,255,255,0.55); font-size: 0.73rem; font-style: normal; }

.experience { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 10vw; background: var(--cream); }
.experience-heading { position: sticky; top: 120px; align-self: start; }
.experience-heading > p:last-child { color: var(--muted); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 0.35fr 1fr; gap: 2rem; padding: 0 0 3rem 2rem; border-left: 1px solid #b4bcb6; }
.timeline li::before { content: ""; position: absolute; top: 0.55rem; left: -5px; width: 9px; height: 9px; background: var(--coral); border-radius: 50%; box-shadow: 0 0 0 6px var(--cream); }
.timeline time { color: var(--green-2); font-size: 0.75rem; font-weight: 700; }
.timeline h3 { margin: 0; font-family: var(--serif); font-size: 1.4rem; }
.timeline p { margin: 0.2rem 0 0.7rem; color: var(--coral); font-size: 0.78rem; }
.timeline span { color: var(--muted); font-size: 0.86rem; }

.contact { padding-top: 0; background: var(--cream); }
.contact-card { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 7rem); color: white; background: var(--coral); }
.contact-card h2 { max-width: 750px; font-size: clamp(2.7rem, 5.8vw, 6rem); }
.contact-card > p:not(.eyebrow) { max-width: 560px; color: rgba(255,255,255,0.76); }
.button-light { margin-top: 1rem; color: var(--coral); background: white; }
.contact-card small { display: block; margin-top: 0.8rem; color: rgba(255,255,255,0.62); font-size: 0.68rem; }
.contact-decoration { position: absolute; right: 7%; top: 50%; color: rgba(255,255,255,0.22); font-family: var(--serif); font-size: 18vw; line-height: 1; transform: translateY(-50%) rotate(15deg); }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.7rem 8vw; background: var(--paper); font-size: 0.75rem; }
.site-footer > p { color: var(--muted); }

.case-dialog {
  width: min(760px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}
.case-dialog::backdrop { background: rgba(16, 28, 24, 0.72); backdrop-filter: blur(3px); }
.dialog-close { position: sticky; z-index: 2; top: 1rem; float: right; display: grid; place-items: center; width: 40px; height: 40px; margin: 1rem 1rem 0 0; padding: 0; color: white; background: var(--green); border: 0; border-radius: 50%; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.dialog-close svg { display: block; width: 20px; height: 20px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dialog-inner { padding: clamp(2rem, 6vw, 5rem); }
.dialog-kicker { color: var(--coral); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.13em; }
.dialog-inner h2 { margin: 0.7rem 0 1.2rem; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.2; }
.dialog-summary { color: var(--muted); font-size: 1rem; }
.dialog-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 2rem 0; background: var(--line); }
.dialog-details div { padding: 1rem; background: var(--cream); }
.dialog-details small { display: block; color: var(--muted); font-size: 0.66rem; }
.dialog-details strong { font-size: 0.82rem; }
.dialog-inner h3 { margin: 2rem 0 0.6rem; font-family: var(--serif); }
.dialog-inner ul { padding-left: 1.2rem; color: var(--muted); }
.placeholder-panel { margin-top: 2rem; padding: 1.3rem; color: #765a3f; background: #fff0c8; font-size: 0.8rem; }

.toast { position: fixed; z-index: 80; right: 1.25rem; bottom: 1.25rem; max-width: 330px; padding: 0.85rem 1rem; color: white; background: var(--ink); border-radius: 3px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(1rem); transition: 0.25s; font-size: 0.78rem; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .site-header { height: 64px; }
  .hero { grid-template-columns: 1fr; padding-top: 125px; }
  .hero-copy { max-width: 760px; }
  .hero-visual { width: min(76vw, 440px); margin-top: 2rem; }
  .intro, .experience { grid-template-columns: 1fr; gap: 3rem; }
  .intro-body { padding-top: 0; }
  .experience-heading { position: static; }
  .project-featured { grid-template-columns: 1fr; }
  .project-featured .project-media { min-height: 420px; }
  .principle { padding: 2rem 1.5rem; }
}

@media (max-width: 680px) {
  .section { padding: 84px 6vw; }
  .section-number { display: none; }
  .hero { min-height: auto; padding: 110px 6vw 82px; background: linear-gradient(155deg, #fffaf2 0 72%, #ffe3c2 72% 100%); }
  .hero h1 { font-size: clamp(3rem, 14vw, 4.5rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .hero-stats { justify-content: space-between; gap: 1rem; }
  .hero-visual { width: 80vw; }
  .paper-note { left: -12%; bottom: -3%; width: 175px; }
  .seal { right: -8%; width: 76px; height: 76px; font-size: 0.7rem; }
  .work-header { align-items: flex-start; flex-direction: column; }
  .filter-group { max-width: 100%; overflow-x: auto; }
  .project-grid { grid-template-columns: 1fr; }
  .project-featured { grid-column: auto; display: block; }
  .project-featured .project-media, .project-media { min-height: 330px; }
  .project-featured .project-copy { padding: 1.55rem 0 1rem; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle { min-height: auto; }
  .timeline li { grid-template-columns: 1fr; gap: 0.35rem; padding-left: 1.5rem; }
  .contact { padding-top: 0; }
  .contact-card { margin: 0 -6vw; padding: 4rem 6vw; }
  .contact-decoration { display: none; }
  .site-footer { align-items: flex-start; flex-direction: column; padding: 2.3rem 6vw; }
  .site-footer > p { margin: 0; }
  .dialog-details { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Mathematics teaching lab */
.brand-mark { font-family: Georgia, var(--serif); font-weight: 700; }
.math-visual { width: min(100%, 500px); }
.math-board-card {
  position: relative;
  padding: 1.1rem;
  color: #fff7e8;
  background: #2f241f;
  border: 12px solid #fffaf2;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}
.math-board-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image: repeating-linear-gradient(2deg, transparent 0 13px, #fff 14px 15px, transparent 16px 29px);
}
.math-board-top { position: relative; z-index: 1; display: flex; justify-content: space-between; color: #efb48d; font-size: 0.65rem; letter-spacing: 0.12em; }
.equation-stage { position: relative; z-index: 1; min-height: 360px; padding: 3.8rem 1rem 1rem; }
.equation { display: block; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 5vw, 4.6rem); text-align: center; }
.question-mark { position: absolute; top: 6.2rem; right: 8%; color: var(--gold); font-family: var(--serif); font-size: 4.5rem; transform: rotate(12deg); }
.annotation { position: absolute; left: 7%; bottom: 4.4rem; color: #ffd7a4; font-family: var(--serif); font-size: 1rem; transform: rotate(-4deg); }
.equation-stage svg { position: absolute; right: 2%; bottom: 3rem; width: 62%; }
.equation-stage path { fill: none; stroke: var(--coral); stroke-width: 2; stroke-dasharray: 7 5; }
.version-strip { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,0.2); }
.version-strip span { padding: 0.65rem 0.25rem; color: rgba(255,255,255,0.55); background: #2f241f; font-size: 0.6rem; text-align: center; }
.version-strip .is-current { color: #fff; background: var(--coral); }
.math-note { left: -24%; bottom: 5%; width: 225px; background: #ffd58f; }
.math-seal { color: var(--green); border-color: var(--green); }

.curriculum-map { background: #fffaf2; }
.map-heading { display: grid; grid-template-columns: 1.1fr 0.9fr; column-gap: 8vw; align-items: end; }
.map-heading .eyebrow { grid-column: 1 / -1; }
.map-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.25rem, 4.6vw, 4.8rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.035em; }
.map-heading > p:last-child { color: var(--muted); }
.map-intro-action { align-self: end; }
.map-intro-action p { margin: 0 0 1.4rem; color: var(--muted); }
.stage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 4rem; }
.stage-card { position: relative; min-height: 390px; padding: 2.2rem; background: #fff; border: 1px solid #ead7c6; overflow: hidden; transition: transform 0.25s, box-shadow 0.25s; }
.stage-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.stage-card.is-active { color: white; background: var(--green); border-color: var(--green); }
.stage-index { position: absolute; right: 1.4rem; top: 0.7rem; color: rgba(168,67,22,0.1); font-family: Georgia, serif; font-size: 5rem; line-height: 1; }
.stage-card.is-active .stage-index { color: rgba(255,255,255,0.12); }
.stage-card > p { margin: 0; color: var(--coral); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.16em; }
.stage-card.is-active > p { color: #ffd09a; }
.stage-card h3 { margin: 2.3rem 0 1.2rem; font-family: var(--serif); font-size: 2rem; }
.stage-card ul { display: grid; gap: 0.6rem; padding: 0; list-style: none; color: var(--muted); font-size: 0.86rem; }
.stage-card.is-active ul { color: rgba(255,255,255,0.7); }
.stage-status { position: absolute; left: 2.2rem; right: 2.2rem; bottom: 2rem; padding-top: 0.8rem; border-top: 1px solid currentColor; color: var(--green-2); font-size: 0.7rem; }
.stage-card.is-active .stage-status { color: #ffd09a; }

.section-description { margin: 0.7rem 0 0; color: var(--muted); font-size: 0.86rem; }
.algebra-art .chalk-title { top: 16%; left: 7%; font-size: clamp(1.6rem, 3vw, 3rem); }
.balance-equation { position: absolute; top: 43%; left: 11%; font-family: Georgia, serif; font-size: clamp(2.4rem, 4vw, 4rem); }
.algebra-art .chalk-copy { top: auto; left: 8%; bottom: 21%; letter-spacing: 0.1em; }
.algebra-art .chalk-question { right: 4%; bottom: 8%; }
.version-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.2rem 0; }
.version-pills span { padding: 0.35rem 0.65rem; color: var(--green); background: #ffe4c8; border-radius: 99px; font-size: 0.65rem; }
.lesson-placeholder { display: grid; place-items: center; }
.big-symbol { color: rgba(168,67,22,0.2); font-family: Georgia, serif; font-size: clamp(6rem, 12vw, 10rem); line-height: 1; }
.light-symbol { color: rgba(255,255,255,0.24); font-size: clamp(3.3rem, 7vw, 6.5rem); }
.lesson-label { position: absolute; left: 1.5rem; bottom: 1.4rem; display: grid; }
.lesson-label small { color: var(--muted); font-size: 0.65rem; }
.lesson-label strong { font-family: var(--serif); font-size: 1.35rem; }
.light-label small { color: rgba(255,255,255,0.65); }.light-label strong { color: white; }
.archive-note { margin: 2.5rem 0 0; padding: 1rem 1.2rem; color: #8a5c3e; background: #fff0d2; border-left: 3px solid var(--gold); font-size: 0.76rem; }

.practice-grid { grid-template-columns: repeat(4, 1fr); }
.practice-grid .principle { min-height: 330px; padding: 2.2rem 1.7rem; }

.qualification-list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 2rem; }
.qualification-list span { padding: 0.4rem 0.7rem; color: var(--green); background: #ffe2c4; border-radius: 99px; font-size: 0.66rem; }
.profile-stack { display: grid; gap: 4rem; }
.profile-group { position: relative; }
.profile-kicker { margin: 0 0 1.7rem; padding-bottom: 0.7rem; color: var(--green); border-bottom: 2px solid var(--green); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.15em; }
.profile-entry { position: relative; padding: 0 0 2.5rem 8.5rem; }
.profile-entry + .profile-entry { padding-top: 2.5rem; border-top: 1px solid var(--line); }
.profile-entry time { position: absolute; left: 0; top: 0.25rem; color: var(--muted); font-size: 0.66rem; }
.profile-entry + .profile-entry time { top: 2.75rem; }
.profile-entry h3 { margin: 0; font-family: var(--serif); font-size: 1.35rem; }
.profile-entry p { margin: 0.15rem 0 0.7rem; color: var(--coral); font-size: 0.77rem; }
.profile-entry ul { margin: 0.7rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.82rem; }
.profile-entry > span { color: var(--muted); font-size: 0.82rem; }

@media (max-width: 980px) {
  .map-heading { grid-template-columns: 1fr; }
  .stage-grid { grid-template-columns: 1fr; }
  .stage-card { min-height: 320px; }
  .practice-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .math-visual { width: 88vw; }
  .equation-stage { min-height: 310px; }
  .question-mark { top: 5.3rem; }
  .math-note { left: -8%; width: 185px; }
  .map-heading h2 { font-size: 2.45rem; }
  .stage-grid { margin-top: 2.5rem; }
  .practice-grid { grid-template-columns: 1fr; }
  .profile-entry, .profile-entry + .profile-entry { padding-left: 0; padding-top: 2.2rem; }
  .profile-entry time, .profile-entry + .profile-entry time { position: static; display: block; margin-bottom: 0.4rem; }
}

/* Homepage 2026 — information-first teaching portfolio */
.portfolio-home .home-hero {
  grid-template-columns: minmax(0, 0.92fr) minmax(520px, 0.9fr);
  align-items: stretch;
  gap: clamp(2rem, 3.5vw, 4.5rem);
  padding: 70px 6vw 0;
  background:
    radial-gradient(circle at 49% 18%, color-mix(in srgb, var(--hero-stage) 18%, transparent), transparent 24%),
    linear-gradient(115deg, #fffaf2 0 58%, color-mix(in srgb, var(--hero-stage) 18%, #fffaf2) 58.15% 100%);
}
.portfolio-home .home-hero::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 57.45%, color-mix(in srgb, var(--hero-stage) 28%, transparent) 57.5% 57.62%, transparent 57.67%),
    linear-gradient(115deg, transparent 0 65.2%, rgba(255,255,255,0.58) 65.25% 65.62%, transparent 65.67%);
}
.home-hero .hero-copy { align-self: center; max-width: 800px; padding-block: clamp(3rem, 7vh, 6rem); }
.home-hero h1 { font-size: clamp(3rem, 4.9vw, 5.75rem); }
.home-hero h1 > span, .home-hero h1 > em { display: block; white-space: nowrap; }
.home-hero .eyebrow { color: var(--hero-stage-deep); }
.home-hero h1 em { color: var(--hero-stage); }
.home-hero .text-link span { color: var(--hero-stage); }
.hero-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; max-width: 650px; margin-top: 2.2rem; background: var(--line); border: 1px solid var(--line); }
.hero-proof div { display: grid; gap: 0.18rem; padding: 0.85rem 1rem; background: rgba(255,250,242,0.88); }
.hero-proof strong { color: var(--hero-stage-deep); font-family: var(--serif); font-size: 1.2rem; }
.hero-proof span { color: var(--muted); font-size: 0.68rem; }
.candidate-line { max-width: 680px; margin: 1.7rem 0 0; padding-top: 1rem; color: var(--muted); border-top: 1px solid color-mix(in srgb, var(--hero-stage) 28%, transparent); font-size: 0.76rem; }
.candidate-line strong { color: var(--ink); }
.portfolio-home .site-header:not(.is-past-hero) .brand-mark { background: var(--hero-stage-deep); }
.portfolio-home .site-header:not(.is-past-hero) .brand small { color: var(--hero-stage-deep); }
.home-hero .eyebrow,.home-hero h1 em,.home-hero .text-link span,.hero-proof strong,.portfolio-home .site-header .brand-mark,.portfolio-home .site-header .brand small,.candidate-line { transition: color .28s ease,background-color .28s ease,border-color .28s ease; }
.featured-area { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); align-self: stretch; width: 100%; max-width: none; margin-top: -70px; padding: 78px 0 1.4rem; background: linear-gradient(155deg, rgba(255,255,255,.28), color-mix(in srgb, var(--hero-stage) 8%, transparent)); }
.featured-stage-tabs { z-index: 4; display: grid; grid-template-columns: repeat(3, 1fr); grid-column: 1; grid-row: 1; gap: .32rem; margin-bottom: 0.65rem; padding: 0.32rem; background: rgba(255,250,242,0.9); border: 1px solid rgba(143,55,24,0.16); border-radius: 99px; box-shadow: 0 10px 24px rgba(105,52,25,.1); }
.featured-stage-tabs button { min-height: 38px; padding: 0.55rem 1rem; color: white; background: var(--featured-stage); border: 0; border-radius: 99px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); cursor: pointer; font-size: 0.7rem; font-weight: 700; opacity: .58; transition: opacity .2s, transform .2s, box-shadow .2s; }
.featured-stage-tabs button[data-featured-stage="primary"] { --featured-stage: #f2a33a; }
.featured-stage-tabs button[data-featured-stage="junior"] { --featured-stage: #e76032; }
.featured-stage-tabs button[data-featured-stage="senior"] { --featured-stage: #9f4161; }
.featured-stage-tabs button[aria-selected="true"] { opacity: 1; transform: translateY(-1px); box-shadow: 0 6px 15px color-mix(in srgb, var(--featured-stage) 34%, transparent), inset 0 0 0 1px rgba(255,255,255,.22); }
.featured-lesson { --featured-stage: #f2a33a; position: relative; z-index: 2; display: grid; grid-template-rows: auto auto auto; grid-column: 1; grid-row: 2; align-self: start; overflow: hidden; width: 100%; min-height: 0; color: white; background: var(--featured-stage); box-shadow: 0 28px 64px rgba(85,43,23,0.25); cursor: pointer; }
.featured-lesson[data-featured-panel="junior"] { --featured-stage: #e76032; }
.featured-lesson[data-featured-panel="senior"] { --featured-stage: #9f4161; }
.featured-lesson:focus-visible { outline: 4px solid color-mix(in srgb, var(--featured-stage) 48%, white); outline-offset: 4px; }
.featured-lesson.is-inactive { z-index: 1; visibility: hidden; pointer-events: none; }
.featured-topline { display: flex; justify-content: space-between; padding: 0.8rem 1.1rem; color: rgba(255,255,255,0.82); background: color-mix(in srgb, var(--featured-stage) 82%, #5d2a1d); border-bottom: 1px solid rgba(255,255,255,0.16); font-size: 0.62rem; letter-spacing: 0.07em; }
.featured-media { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; min-height: 0; overflow: hidden; background: #2f241f; cursor: default; }
.featured-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #211814; }
.featured-video[hidden], [data-featured-video-placeholder][hidden] { display: none; }
.fraction-visual { position: relative; width: 100%; height: 100%; min-height: 0; background: radial-gradient(circle at 74% 25%, rgba(255,194,111,0.23), transparent 25%), #2f241f; }
.featured-video-status { position: absolute; z-index: 3; top: .85rem; right: .9rem; padding: .35rem .62rem; color: rgba(255,255,255,.82); background: rgba(24,16,13,.58); border: 1px solid rgba(255,255,255,.2); border-radius: 99px; font-size: .56rem; font-weight: 700; letter-spacing: .06em; backdrop-filter: blur(8px); }
.fraction-circle { position: absolute; top: 54%; left: 25%; width: 155px; height: 155px; overflow: hidden; border: 3px solid #ffe9c7; border-radius: 50%; transform: translate(-50%,-50%); }
.fraction-circle::after { position: absolute; inset: 0 50% 0 0; content: ""; background: var(--gold); }
.fraction-circle i { position: absolute; z-index: 1; top: 50%; left: 0; width: 100%; height: 3px; background: #ffe9c7; transform: translateY(-50%); }
.fraction-symbol { position: absolute; top: 42%; left: 51%; display: grid; width: 66px; color: #fff2d7; font-family: Georgia, serif; font-size: 3.2rem; line-height: 0.95; text-align: center; transform: translate(-50%,-50%); }
.fraction-symbol span:first-child { padding-bottom: 0.22rem; border-bottom: 2px solid #fff2d7; }
.fraction-visual p { position: absolute; right: 7%; bottom: 12%; margin: 0; color: #ffd496; font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; transform: rotate(-3deg); }
.featured-copy { padding: 1.15rem 1.55rem 1.2rem; background: var(--featured-stage); }
.featured-copy > p { margin: 0 0 0.25rem; color: rgba(255,255,255,.78); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em; }
.featured-copy h2 { margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 2.15vw, 2.05rem); line-height: 1.25; }
.featured-copy ul { display: grid; gap: 0.28rem; margin: 0.72rem 0 0.8rem; padding-left: 1.15rem; color: rgba(255,255,255,0.8); font-size: 0.73rem; }
.featured-open { width: 100%; padding: 0.7rem 0 0; color: white; background: transparent; border-top: 1px solid rgba(255,255,255,0.32); font-size: 0.73rem; font-weight: 700; text-align: left; }
.featured-open span { float: right; color: white; }
.featured-empty { display: grid; place-content: center; height: 100%; min-height: 0; padding: 3rem; text-align: center; background: var(--featured-stage); }
.featured-empty > div { display: grid; place-items: center; }
.featured-empty > div span { color: rgba(255,255,255,.58); font-size: .62rem; font-weight: 800; letter-spacing: .18em; }
.featured-empty > div strong { color: rgba(255,255,255,.16); font-family: var(--serif); font-size: 11rem; font-weight: 500; line-height: 1; }
.featured-empty > p { margin: -1.4rem 0 .65rem; font-family: var(--serif); font-size: 1.65rem; }
.featured-empty > small { max-width: 330px; color: rgba(255,255,255,.65); font-size: .72rem; line-height: 1.75; }

.archive-section { min-height: 100vh; background: #fffaf2; }
.archive-count { display: grid; min-width: 110px; text-align: right; }
.archive-count strong { color: var(--coral); font-family: Georgia, serif; font-size: 2.8rem; line-height: 1; }
.archive-count span { color: var(--muted); font-size: 0.66rem; }
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; }
.archive-card { overflow: hidden; background: white; border: 1px solid #ead9cb; transition: transform 0.25s, box-shadow 0.25s; }
.archive-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.archive-visual { position: relative; min-height: 320px; color: white; background: #43312a; }
.archive-status { position: absolute; z-index: 2; top: 1.1rem; left: 1.1rem; padding: 0.3rem 0.65rem; color: white; border: 1px solid rgba(255,255,255,0.42); border-radius: 99px; font-size: 0.6rem; }
.archive-visual svg { position: absolute; inset: 16% 6% 5%; width: 88%; height: 76%; }
.archive-visual .axis { fill: none; stroke: rgba(255,255,255,0.28); stroke-width: 1.5; }
.archive-visual .curve { fill: none; stroke: #ffc66e; stroke-width: 5; stroke-linecap: round; }
.archive-visual circle { fill: var(--coral); stroke: white; stroke-width: 2; }
.archive-visual text { fill: rgba(255,255,255,0.8); font-family: var(--serif); font-size: 13px; }
.fraction-small { overflow: hidden; color: var(--ink); background: #f6c066; }
.fraction-small::before { position: absolute; width: 280px; height: 280px; right: -75px; bottom: -100px; content: ""; border: 1px solid rgba(89,48,24,0.22); border-radius: 50%; box-shadow: 0 0 0 36px rgba(255,255,255,0.09), 0 0 0 72px rgba(255,255,255,0.08); }
.fraction-small .archive-status { color: var(--ink); border-color: rgba(45,33,28,0.32); }
.mini-fractions { position: absolute; left: 9%; bottom: 11%; display: flex; align-items: baseline; gap: 1.1rem; font-family: Georgia, serif; }
.mini-fractions b { color: var(--green); font-size: 8.5rem; font-weight: 400; line-height: 1; }
.mini-fractions span { color: rgba(45,33,28,0.45); font-size: 3.2rem; }
.fraction-small > p { position: absolute; right: 8%; top: 38%; color: #70401f; font-family: var(--serif); font-size: 1rem; }
.archive-copy { padding: 1.7rem; }
.archive-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--green-2); font-size: 0.65rem; font-weight: 700; }
.archive-copy h3 { margin: 0.55rem 0 0; font-family: var(--serif); font-size: 2rem; }
.archive-copy > p { min-height: 4.8em; margin: 0.65rem 0 1.1rem; color: var(--muted); font-size: 0.82rem; }
.evidence-list { display: flex; flex-wrap: wrap; gap: 0.38rem; margin-bottom: 1.25rem; }
.evidence-list span { padding: 0.28rem 0.55rem; color: var(--green); background: #fff0df; border-radius: 99px; font-size: 0.6rem; }

.curriculum-preview { min-height: 100vh; padding-block: 86px; color: white; background: #392922; }
.portfolio-home .section { padding-inline: 6vw; }
.preview-copy { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: .75rem 3rem; }
.preview-copy .eyebrow { grid-column: 1 / -1; margin-bottom: .1rem; }
.preview-copy h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.3rem, 4.4vw, 4.7rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.035em; }
.preview-copy > p:not(.eyebrow) { margin: 1.5rem 0 0; color: rgba(255,255,255,0.66); }
.preview-legend { display: flex; flex-wrap: wrap; gap: 0.8rem 1.1rem; margin: 0; color: rgba(255,255,255,0.72); font-size: 0.65rem; }
.preview-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.preview-legend i { width: 11px; height: 11px; border-radius: 3px; }
.preview-legend .primary { background: #f2a33a; }.preview-legend .junior { background: #e76032; }.preview-legend .senior { background: #9f4161; }.preview-legend .started { background: white; box-shadow: 0 0 0 2px var(--gold); }
.preview-copy > .button { grid-column: 2; justify-self: start; }
.mini-map-shell { margin-top: 3rem; padding: 0.9rem; color: var(--ink); background: #fffaf2; box-shadow: 0 30px 70px rgba(0,0,0,0.28); }
.mini-map-head { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0.55rem 0.85rem; color: var(--muted); font-size: 0.68rem; }
.mini-map-head strong { color: var(--green); }
.mini-map { position: relative; display: grid; grid-template-rows: none; gap: 0.5rem; height: auto; min-height: 0; overflow: visible; padding: 0.5rem; background: #eadfce; border: 1px solid #d5c1ad; }
.mini-stage-row { display: grid; grid-template-rows: 34px auto; min-height: 0; overflow: visible; background: color-mix(in srgb, var(--mini-stage) 11%, white); border: 1px solid color-mix(in srgb, var(--mini-stage) 30%, #d7c9bc); }
.mini-stage-title { display: flex; align-items: center; justify-content: space-between; padding: .35rem .75rem; color: white; background: var(--mini-stage); }
.mini-stage-title strong { font-family: var(--serif); font-size: .82rem; }
.mini-stage-title span { opacity: .7; font-size: .52rem; letter-spacing: .08em; }
.mini-grade-groups { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 1px; min-width: 0; min-height: 0; background: color-mix(in srgb, var(--mini-stage) 18%, #ddd3c9); }
.mini-grade-group { display: grid; grid-template-rows: 29px auto; min-width: 0; min-height: 0; overflow: visible; background: rgba(255,255,255,.74); }
.mini-grade-group > header { display: flex; align-items: center; justify-content: space-between; padding: .25rem .45rem; border-bottom: 1px solid color-mix(in srgb, var(--mini-stage) 18%, #ddd3c9); }
.mini-grade-group > header strong { color: color-mix(in srgb, var(--mini-stage) 75%, #42352e); font-family: var(--serif); font-size: .68rem; }
.mini-grade-group > header span { color: #9a8a7e; font-family: Georgia,serif; font-size: .58rem; }
.mini-grade-terms { display: grid; grid-template-rows: repeat(2,auto); min-height: 0; }
.mini-term { display: grid; grid-template-columns: 42px minmax(0,1fr); min-height: 64px; padding: .25rem; }
.mini-term + .mini-term { margin-top: 3px; }
.mini-term > span { align-self: start; padding: .15rem .2rem; color: color-mix(in srgb, var(--mini-stage) 72%, #6c5d54); font-size: .5rem; font-weight: 700; }
.mini-units { display: flex; align-content: flex-start; flex-wrap: wrap; gap: 3px; min-width: 0; overflow: visible; }
.mini-unit { --unit-scale: 1; --unit-shift-x: 0px; --unit-shift-y: 0px; position: relative; display: inline-block; max-width: 100%; padding: 3px 5px; overflow: hidden; color: color-mix(in srgb, var(--mini-stage) 66%, #574a43); background: color-mix(in srgb, var(--mini-stage) 8%, white); border: 1px solid color-mix(in srgb, var(--mini-stage) 20%, #ddd6cf); border-left: 3px solid color-mix(in srgb, var(--mini-stage) 62%, #c0b3a8); border-radius: 2px; font-family: var(--serif); font-size: 0.61rem; line-height: 1.25; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; transform: translate3d(var(--unit-shift-x), var(--unit-shift-y), 0) scale(var(--unit-scale)); transform-origin: center; transition: transform 0.16s cubic-bezier(0.2,0.8,0.2,1), color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease; }
.mini-unit.is-fisheye-near { will-change: transform; }
.mini-unit.is-started { color: #fff; background: var(--mini-stage); }
.mini-unit.is-fisheye-center { color: #fff; background: var(--mini-stage); box-shadow: 0 5px 16px rgba(62,39,27,0.22); font-weight: 800; }
.mini-unit:focus-visible { color: #fff; background: var(--mini-stage); outline: 2px solid #fff; outline-offset: 2px; }
.mini-map-hint { margin: 0.65rem 0 0; color: var(--muted); font-size: 0.62rem; text-align: center; }

.resume-section { align-items: start; padding-top: 130px; background: #fff0df; }
.resume-mail { display: inline-block; margin-top: 1.4rem; color: var(--green); font-size: 0.76rem; font-weight: 700; text-underline-offset: 0.25rem; }
.resume-section .profile-stack { gap: 4.5rem; }
.resume-section .profile-entry { padding-left: 9.5rem; }
.resume-section .profile-entry li + li { margin-top: 0.35rem; }
.credential-list { border-top: 0; }
.credential-list article { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid color-mix(in srgb,var(--green) 20%,transparent); }
.credential-list article:last-child { border-bottom: 0; }
.credential-list article > span { color: color-mix(in srgb,var(--green) 42%,transparent); font-family: Georgia,serif; font-size: 1.35rem; line-height: 1; }
.credential-list strong { color: var(--green); font-family: var(--serif); font-size: 1rem; }
.credential-list p { margin: .3rem 0 0; color: var(--muted); font-size: .79rem; line-height: 1.7; }

.about-final { display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 8vw; min-height: 72vh; color: white; background: var(--green); }
.about-final h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 5.2rem); font-weight: 600; line-height: 1.22; letter-spacing: -0.04em; }
.about-details > p { margin: 0; color: rgba(255,255,255,0.72); font-family: var(--serif); font-size: clamp(1rem, 1.45vw, 1.3rem); line-height: 1.9; }
.about-links { display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem; }
.light-link { color: white; }
.contact-mail { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1.5rem; min-width: min(100%,390px); padding: 1rem 1.1rem; color: white; border: 1px solid rgba(255,255,255,.26); text-decoration: none; transition: background .2s,border-color .2s; }
.contact-mail:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.55); }
.contact-mail span { grid-column: 1; color: rgba(255,255,255,.6); font-size: .6rem; letter-spacing: .12em; }
.contact-mail strong { grid-column: 1; font-family: var(--serif); font-size: 1.08rem; font-weight: 500; }
.contact-mail i { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #ffd09a; font-style: normal; }
.portfolio-home .site-footer { background: #2f241f; color: white; }
.portfolio-home .site-footer { justify-content: center; text-align: center; }
.footer-center { display: grid; gap: .45rem; }
.footer-center p { margin: 0; color: rgba(255,255,255,.62); }
.footer-center .site-copyright { color: rgba(255,255,255,.34); font-size: .6rem; letter-spacing: .14em; }

@media (max-width: 1100px) {
  .portfolio-home .home-hero { grid-template-columns: 1fr; min-height: auto; gap: 3rem; padding: 108px 6vw 76px; }
  .home-hero .hero-copy { padding-block: 0; }
  .featured-area { width: min(100%, 760px); margin-top: 0; padding: 0; justify-self: start; background: transparent; }
  .featured-lesson { display: block; height: auto; }
  .featured-empty { min-height: 520px; }
  .mini-map-shell { width: 100%; }
}

@media (max-width: 760px) {
  .portfolio-home .home-hero { padding-inline: 6vw; }
  .home-hero h1 { font-size: clamp(2.55rem, 10.4vw, 4.4rem); }
  .hero-proof { grid-template-columns: 1fr; }
  .featured-area { width: 100%; }
  .fraction-visual { min-height: 0; }
  .fraction-circle { left: 27%; width: 125px; height: 125px; }
  .fraction-symbol { left: 58%; }
  .fraction-visual p { display: none; }
  .archive-grid { grid-template-columns: 1fr; }
  .archive-copy > p { min-height: 0; }
  .curriculum-preview { padding-inline: 6vw; }
  .preview-copy { grid-template-columns: 1fr; align-items: start; }
  .preview-copy .eyebrow,.preview-copy h2,.preview-legend,.preview-copy > .button { grid-column: 1; grid-row: auto; }
  .preview-legend { margin: .55rem 0; }
  .mini-map-shell { margin-top: 2rem; padding: 0.5rem; }
  .mini-map-head { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .mini-map { display: grid; grid-template-rows: none; gap: .65rem; height: auto; padding: 0.4rem; overflow: hidden; }
  .mini-stage-row { grid-template-rows: 38px auto; }
  .mini-stage-title strong { font-size: .9rem; }
  .mini-grade-groups { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; overscroll-behavior-inline: contain; scrollbar-width: thin; }
  .mini-grade-groups { -webkit-overflow-scrolling: touch; }
  .mini-grade-group { flex: 0 0 min(78vw,285px); scroll-snap-align: start; }
  .mini-grade-group > header strong { font-size: .82rem; }
  .mini-term { grid-template-columns: 48px minmax(0,1fr); padding: .4rem; }
  .mini-term > span { font-size: .58rem; }
  .mini-unit { padding: 4px 6px; font-size: .72rem; transform: none; transition: background .15s,color .15s; }
  .mini-map-hint { font-size: .66rem; line-height: 1.6; }
  .resume-section .profile-entry, .resume-section .profile-entry + .profile-entry { padding-left: 0; padding-top: 2.2rem; }
  .about-final { grid-template-columns: 1fr; }
  .about-final { min-height: auto; }
  .archive-count { display: none; }
  .portfolio-home .site-footer { align-items: center; }
}

/* Integrated curriculum overview: the same vertical grade logic as the full map. */
.mini-map { display: block; height: auto; overflow: visible; padding: .6rem; }
.mini-overview-canvas { min-width: 0; }
.mini-overview-bands,.mini-overview-grades { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 4px; }
.mini-overview-bands { margin-bottom: 5px; }
.mini-overview-stage { grid-column: span var(--stage-span); display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: .5rem .75rem; color: white; background: var(--mini-stage); box-shadow: 0 4px 12px rgba(64,40,28,.12); }
.mini-overview-stage strong { font-family: var(--serif); font-size: .86rem; }
.mini-overview-stage span { opacity: .7; font-size: .5rem; letter-spacing: .08em; }
.mini-overview-grades { align-items: stretch; }
.mini-overview-grade { min-width: 0; padding: 0 .35rem .6rem; background: rgba(255,255,255,.79); border-top: 4px solid var(--mini-stage); }
.mini-overview-grade-head { display: flex; align-items: flex-start; justify-content: space-between; min-height: 58px; margin: 0 -.35rem; padding: .65rem .45rem .5rem; background: rgba(255,255,255,.94); border-bottom: 1px solid #dfd5ca; }
.mini-overview-grade-head div { min-width: 0; }
.mini-overview-grade-head strong { display: block; overflow: hidden; font-family: var(--serif); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.mini-overview-grade-head small { display: block; margin-top: .15rem; overflow: hidden; color: #8d8179; font-size: .46rem; text-overflow: ellipsis; white-space: nowrap; }
.mini-overview-grade-head > span { color: color-mix(in srgb,var(--mini-stage) 70%,#4d4038); font-family: Georgia,serif; font-size: .9rem; }
.mini-column-term { margin-top: .65rem; }
.mini-column-term + .mini-column-term { margin-top: .28rem; }
.mini-column-term > header { display: flex; align-items: end; justify-content: space-between; gap: .25rem; min-height: 31px; margin-bottom: .52rem; padding: .18rem .15rem .36rem; background: transparent; border-bottom: 2px solid color-mix(in srgb,var(--mini-stage) 62%,#d8cfc7); }
.mini-column-term > header strong { color: color-mix(in srgb,var(--mini-stage) 78%,#493a32); font-family: var(--serif); font-size: .68rem; letter-spacing: .035em; white-space: nowrap; }
.mini-column-term > header span { color: color-mix(in srgb,var(--mini-stage) 48%,#8f837b); font-size: .4rem; white-space: nowrap; }
.mini-column-units { display: grid; gap: .28rem; }
.mini-overview-grade .mini-unit { display: grid; place-items: center start; width: 100%; min-height: 44px; padding: .48rem .45rem; overflow: visible; color: #594f49; background: color-mix(in srgb,var(--mini-stage) 9%,#f7f4f0); border: 1px solid color-mix(in srgb,var(--mini-stage) 23%,#ddd7d1); border-left: 4px solid color-mix(in srgb,var(--mini-stage) 65%,#bdb4ac); border-radius: 2px; font-size: .7rem; line-height: 1.28; text-overflow: clip; white-space: normal; }
.mini-overview-grade .mini-unit strong { font-weight: 600; overflow-wrap:anywhere; }
.mini-overview-grade .mini-unit.is-started { color: white; background: var(--mini-stage); border-color: color-mix(in srgb,var(--mini-stage) 75%,#4b372d); }
.mini-overview-grade .mini-unit.is-fisheye-center:not(.is-started) { color: color-mix(in srgb,var(--mini-stage) 82%,#382b25); background: #fffaf2; border-color: var(--mini-stage); box-shadow: 0 0 0 3px color-mix(in srgb,var(--mini-stage) 24%,transparent),0 10px 24px rgba(50,31,22,.22); }
.mini-overview-grade .mini-unit.is-started.is-fisheye-center { color: white; background: var(--mini-stage); box-shadow: 0 0 0 3px rgba(255,255,255,.78),0 10px 24px rgba(50,31,22,.28); }

.map-explorer { inset: 0; width: min(1540px,calc(100vw - 42px)); max-width: none; height: calc(100vh - 42px); height: calc(100dvh - 42px); max-height: none; margin: auto; padding: 0; overflow: hidden; opacity: 1; background: #f5f0e9; border: 2px solid rgba(255,245,235,.92); border-radius: 18px; box-shadow: 0 0 0 1px rgba(72,45,31,.34),0 38px 110px rgba(25,15,11,.58); transform: none; transform-origin: center; }
.map-explorer::backdrop { background: rgba(34,24,19,.68); animation: map-backdrop-in .24s ease-out both; }
.map-explorer.is-preparing { opacity: 0; pointer-events: none; }
.map-explorer.is-preparing::backdrop { background: transparent; animation: none; }
.map-explorer.is-closing::backdrop { animation: map-backdrop-out .22s ease-in both; }
.map-explorer.is-transitioning { opacity: .16; transform: translate3d(var(--map-origin-x,0),var(--map-origin-y,0),0) scale(var(--map-origin-scale-x,1),var(--map-origin-scale-y,1)); transition: transform .38s cubic-bezier(.2,.82,.28,1),opacity .24s ease; will-change: transform,opacity; }
.map-explorer.is-expanded { opacity: 1; transform: translate3d(0,0,0) scale(1); }
.map-explorer.is-closing { opacity: 0; transform: scale(.88); transition: transform .22s cubic-bezier(.4,0,1,1),opacity .16s ease; will-change: transform,opacity; }
.map-explorer iframe { display: block; width: 100%; height: 100%; opacity: 1; background: #f5f0e9; border: 0; transition: opacity .08s linear; }
.map-explorer.is-closing iframe { opacity: 0; }
.portfolio-home.is-map-open { overflow: hidden; }
.map-explorer-close { position: absolute; z-index: 100; top: 10px; right: 11px; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; color: white; background: #392922; border: 1px solid rgba(255,255,255,.34); border-radius: 50%; box-shadow: 0 8px 24px rgba(42,27,20,.3); cursor: pointer; transition: transform .16s ease,background-color .16s ease; }
.map-explorer-close:hover { background: #a84316; transform: scale(1.05); }
.map-explorer-close span { font-size: 1.45rem; line-height: 1; }
@keyframes map-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes map-backdrop-out { to { opacity: 0; } }

@media (max-width: 1100px) {
  .mini-map { overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; }
  .mini-overview-canvas { min-width: 1320px; }
}

@media (max-width: 760px) {
  .mini-map { display: block; height: auto; overflow-x: auto; overflow-y: hidden; padding: .45rem; scroll-snap-type: x proximity; }
  .mini-overview-canvas { min-width: 2040px; }
  .mini-overview-bands,.mini-overview-grades { gap: 5px; }
  .mini-overview-grade { scroll-snap-align: start; }
  .mini-overview-grade-head strong { font-size: .9rem; }
  .mini-column-term > header strong { font-size: .72rem; }
  .mini-overview-grade .mini-unit { min-height: 50px; padding: .52rem; font-size: .8rem; transform: none; }
  .map-explorer { width: calc(100vw - 10px); height: calc(100dvh - 10px); border-radius: 12px; }
  .map-explorer-close { top: max(8px,env(safe-area-inset-top)); right: 8px; width: 42px; height: 42px; padding: 0; border-radius: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .map-explorer,.map-explorer::backdrop { animation: none!important; transition: none!important; }
}
