@font-face {
  font-family: "Be Vietnam Pro";
  src: url("assets/fonts/BeVietnamPro-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-vi: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  --font-ko: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --paper: #f2f4ef;
  --white: #fffefa;
  --cream: #fcfaf4;
  --ink: #182c3e;
  --muted: #50645f;
  --green: #285b45;
  --green-dark: #1b4333;
  --green-pale: #edf4e8;
  --border: #dfe7db;
  --amber: #8b552b;
  --blue: #254e80;
  --blue-dark: #193858;
  --blue-pale: #edf4f9;
}

[lang="vi"] { font-family: var(--font-vi); font-synthesis: none; }
html[lang="vi"] [lang="ko"] { font-family: var(--font-ko); font-synthesis: initial; }

body { background: radial-gradient(ellipse at 88% 0%, #e8f0f1, transparent 54%), var(--paper); }
.shell { max-width: 1140px; }
.topbar { border-color: #e3e7dd; background: #fcfaf5f5; }
.topbar-inner { min-height: 70px; }
.brand { gap: 11px; color: var(--ink); font-weight: 900; letter-spacing: -.058em; }
.brand-sub { margin-left: 0; color: #344c50; font-weight: 710; }
.brand-mark { width: 42px; height: 42px; overflow: visible; border: 1px solid #ece2cf; border-radius: 14px; background: radial-gradient(ellipse at 35% 25%, #fffaf0, #eee3cb); }
.brand-mark img { width: 33px; height: 33px; object-fit: contain; }
.locale-switch { display: inline-flex; gap: 2px; flex: none; padding: 3px; border: 1px solid #dce5db; border-radius: 12px; background: #f6f8f1; }
.locale-switch .locale { border: 0; min-width: 0; min-height: 38px; padding: 6px 9px; border-radius: 8px; color: #3e5a50; font-size: .79rem; white-space: nowrap; }
.locale-switch .locale:hover { background: var(--green-pale); }
.locale-switch .locale[aria-pressed="true"] { background: #295844; color: #fffdf7; box-shadow: 0 2px 4px #203a2f21; }

.navigation { gap: 6px; }
.navigation button { gap: 8px; color: #52645f; border-radius: 11px; padding-inline: 12px; }
.navigation button:hover { background: #f0f4ed; }
.navigation button[aria-current="page"] { background: #e9f0ec; color: #224f51; }
.nav-icon { flex: none; display: grid; place-items: center; width: 24px; height: 25px; border-radius: 8px; }
.nav-icon::before { content: ""; display: block; width: 21px; height: 21px; background: currentColor; -webkit-mask: var(--nav-image) center / contain no-repeat; mask: var(--nav-image) center / contain no-repeat; }
.icon-home { --nav-image: url("assets/nav-home.png"); }
.icon-study { --nav-image: url("assets/nav-study.png"); }
.icon-tori { --nav-image: url("assets/nav-tori.png"); }
.icon-history { --nav-image: url("assets/nav-history.png"); }

.workspace { background: var(--cream); border-radius: 30px; padding: 32px 42px; margin-block: 22px; border: 1px solid #e9ebe2; }
.footer { border-color: #dce5db; }
.home-overview { border: 1px solid #dce7da; border-radius: 26px; overflow: hidden; background: #fffdf6; box-shadow: 0 7px 20px #2746330c; }
.hero { min-height: 336px; border: 0; border-radius: 0; background:
  linear-gradient(90deg, #e9f3f9 5%, #e9f3f9 36%, #e9f3f900 65%),
  url("assets/seoul-park.webp") right 59% / auto 140% no-repeat,
  linear-gradient(135deg, #e9f3f9, #f0f1d8); }
.hero::before, .hero::after { content: none; }
.hero-copy { padding: 30px 0 35px 43px; }
.hero h1 { color: var(--ink); letter-spacing: -.072em; margin-bottom: 14px; }
.hero .hero-line { display: inline-block; color: inherit; }
.hero .hero-accent { position: relative; color: #204867; }
.hero p { color: #355350; }
.hero .hero-date { color: #43615e; font-size: .85rem; font-weight: 760; margin-bottom: 13px; }
.hero .glint { right: 14%; top: 24%; color: #c59a45; font-size: 1.6rem; text-shadow: 0 2px 6px #faf2d7c4; }
.hero .glint.second { right: 35%; top: 40%; color: #a77a31; font-size: .85rem; }
.hero-art {
  height: 91%; right: 7%; bottom: 3%; filter: drop-shadow(0 14px 9px #40553448);
  display: grid; place-items: end center; container-type: size; pointer-events: none;
}
.hero-figure { position: relative; width: min(100%, 88.51cqh); aspect-ratio: 655 / 740; }
.hero-figure img { display: block; width: 100%; height: 100%; }
.studio-stats { display: flex; align-items: center; justify-content: space-around; gap: 6px; padding: 11px 10px; border-top: 1px solid #e6e9dc; font-size: .88rem; font-weight: 730; color: #55665d; }
.studio-stats > span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.studio-stats b { color: var(--ink); }
.stat-icon { display: inline-block; width: 15px; height: 15px; flex: none; }
.stat-rank { background: #315e86; -webkit-mask: url("assets/nav-study.png") center / contain no-repeat; mask: url("assets/nav-study.png") center / contain no-repeat; }
.stat-acorns { background: url("assets/acorn-mark.png") center / 17px no-repeat; }
.stat-streak { width: 9px; height: 11px; margin-inline: 3px; border-radius: 72% 30% 70% 49%; transform: rotate(-35deg); background: radial-gradient(ellipse at 60% 70%, #ffd476, #d97830 74%); }
.mission { min-height: 190px; gap: 5px; padding: 16px 20px; border-radius: 21px; }
.mission.study { background: radial-gradient(ellipse at 77% 50%, #4576a4, transparent 64%), linear-gradient(115deg, #1d3859, #2b5079); border-color: #34577a; }
.mission.study::after { width: 55%; height: 150%; right: -9%; top: -25%; background: transparent; border: 1px solid #e3edfb35; opacity: 1; }
.mission.tori { background: linear-gradient(90deg, #f7eddbc9 0%, #f6efdf86 56%, #edf1d342 100%), url("assets/tori-woodland.webp") right 65% / cover no-repeat, #f6efdf; border-color: #e7e9d4; color: #264a3b; }
.mission.tori::after { content: none; }
.mission-title { font-size: clamp(1.38rem, 3vw, 1.73rem); font-weight: 900; letter-spacing: -.065em; line-height: 1.22; }
.mission-caption { font-size: .88rem; font-weight: 620; max-width: 68%; word-break: keep-all; }
.mission.study .mission-caption { color: #e8f0fc; }
.mission.tori .mission-caption { color: #3c594b; }
.mission .track-line { width: 55%; margin-top: 6px; }
.mission .mission-cta { display: inline-block; margin-top: 3px; padding: 3px 9px; border-radius: 7px; background: #244f3c16; font-size: .78rem; font-weight: 850; }
.mission.study .mission-cta { background: #e8f0fb28; color: #fff; }
.mission .mission-art { width: 35%; height: 100%; right: 4%; bottom: -4%; filter: drop-shadow(0 7px 5px #23382147); }
.mission .tori-rig { position: absolute; z-index: -1; }
.mission .mission-art.prop {
  position: absolute; z-index: -1; width: min(33%, 141px); height: auto; aspect-ratio: 1;
  right: 6%; bottom: 50%; translate: 0 50%; filter: none; pointer-events: none;
}
.lens-kit { position: absolute; inset: 0; transform-origin: 58% 58%; filter: drop-shadow(0 8px 7px #14263a65); }
.mission .lens-kit img { position: static; display: block; width: 100%; height: 100%; }
.mission.tori .progress { background: #c8d7bc; }
.mission.tori .progress span { background: #3f7e57; }
.home-note { background: #f8faf2; color: #425d50; }
.panel { background: var(--white); }
.page-frame { width: min(100%, 700px); }
.page-frame:has(.tori-stage) { width: min(100%, 575px); }
.page-frame:has(.choice-list) { width: min(100%, 650px); }
.primary.blue { background: var(--blue); }
.secondary { background: #f0f5ed; border-color: #dce6d9; color: #2f5345; }
.secondary:hover:not(:disabled) { background: #e7f0e6; }
.type { background: #eaf2f8; color: var(--blue-dark); }
.steps { background: #f1f6f9; padding: 4px; border: 1px solid #e0ebf0; border-radius: 13px; }
.steps span { background: transparent; padding: 8px 4px; color: #49616e; }
.steps .active { background: var(--blue); color: #fff; }
.steps .complete { background: #dfede3; color: var(--green-dark); }
.choice-list { grid-template-columns: 1fr; }
.choice { display: flex; align-items: center; gap: 11px; border-color: #e0e9ef; color: var(--blue-dark); background: var(--white); }
.choice span { display: grid; place-items: center; min-width: 25px; height: 25px; border-radius: 7px; color: #365779; background: #e9f0f7; font-size: .77rem; }
.choice.selected-choice { color: var(--blue-dark); border-color: #527797; box-shadow: inset 0 0 0 1px #527797; background: #e9f2f7; }
.choice.selected-choice span { background: var(--blue); color: white; }
.tokens, .correct-sentence { background: var(--blue-pale); border-color: #e0ebf2; color: var(--blue-dark); }
.token { border-color: #dce8f0; color: var(--blue-dark); }
.token:hover:not(:disabled), .choice:hover:not(:disabled) { background: #e6f1f7; border-color: #6486a7; }
.correct-sentence mark { background: #f6e1ab; color: #593d19; }
.rank-line { border-top: 1px solid #e5eae2; color: #516757; font-size: .85rem; margin-top: 9px; padding: 10px 0 0; font-weight: 800; }
.badge-row { display: flex; gap: 7px; flex-wrap: wrap; }
.metrics li { background: #f3f7ee; border-color: #e4ebdf; color: #405c52; }
.progress { display: block; }
.panel-title .progress { min-width: 55px; }

.tori-stage { min-height: 345px; padding-top: 16px; border: 1px solid #e4e8d7; background: url("assets/tori-woodland.webp") center 58% / cover no-repeat, #edf0da; }
.tori-stage::after { height: 75px; width: 124%; left: -12%; bottom: -46px; z-index: 0; background: #f9f3e5eb; }
.tori-stage::before { content: ""; position: absolute; left: 19%; bottom: 16px; width: 62%; height: 19px; border-radius: 50%; background: #6f684232; filter: blur(5px); }
.tori-stage .bubble { position: relative; z-index: 2; width: min(90%, 372px); padding: 12px 16px; color: var(--ink); background: #fffdf6; font-size: clamp(1.25rem, 5vw, 1.58rem); line-height: 1.28; letter-spacing: -.05em; box-shadow: 0 5px 14px #51654418; }
.tori-stage .bubble::after { content: ""; position: absolute; width: 15px; height: 15px; bottom: -5px; left: calc(50% - 7px); transform: rotate(45deg); background: #fffdf6; border-radius: 3px; }
.tori-stage .bubble .vi { color: #4f6258; letter-spacing: 0; margin-top: 5px; }
.tori-stage .tori-rig { position: relative; z-index: 1; width: 245px; height: 225px; margin: auto 0 11px; transform-origin: center bottom; transition: transform .32s ease; filter: drop-shadow(0 6px 5px #575b343d); }
.tori-stage.growth-0 .tori-rig { transform: scale(.87); }
.tori-stage.growth-1 .tori-rig { transform: scale(.99); }
.tori-stage.growth-2 .tori-rig { transform: scale(1.06); }
.tori-stage.growth-3 .tori-rig { transform: scale(1.11); }
.tori-rig { display: block; pointer-events: none; }
.tori-rig > :is(img, canvas) {
  position: absolute; z-index: auto; inset: 0; width: 100%; height: 100%; max-width: none;
  margin: 0; object-fit: contain; object-position: bottom center;
}
.tori-rig canvas, .tori-rig.is-animated img { visibility: hidden; }
.tori-rig.is-animated canvas { visibility: visible; }
.tori-stage.growth-2::after { background: #edf4e5f5; }
.tori-stage.growth-3::after { background: #f9edccf5; }
.tori-spark { z-index: 2; color: #b28231; text-shadow: 0 2px 6px #fff6dcca; }
.room-decoration { position: absolute; z-index: 2; bottom: 22px; right: 51px; font-size: 2rem; color: var(--amber); }
.tori-controls { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 3; margin-top: -33px; text-align: center; }
.mic-trigger { display: flex; flex-direction: column; align-items: center; border: 0; background: transparent; padding: 0; }
.mic-label { font-size: clamp(1.12rem, 5vw, 1.35rem); margin-top: 9px; font-weight: 850; letter-spacing: -.05em; }
.tori-controls .secondary { min-height: 40px; margin-top: 9px; padding: 5px 11px; font-size: .88rem; }
.mic-circle { display: grid; place-items: center; width: 73px; height: 73px; border: 7px solid #d2e6cf; outline: 4px solid var(--white); border-radius: 50%; background: radial-gradient(circle at 38% 30%, #407760, #214d3b 77%); color: white; box-shadow: 0 5px 13px #3d634442, inset 0 0 0 1px #f6ffe62d; }
.mic-trigger:not(:disabled):hover .mic-circle { background: #336f55; }
.mic-circle.recording { background: #973e41; border-color: #f0b2af; }
.mic-symbol { width: 24px; height: 26px; position: relative; display: block; }
.mic-symbol::before { content: ""; position: absolute; left: 8px; top: 0; width: 8px; height: 15px; border-radius: 10px; background: #fffdf6; }
.mic-symbol::after { content: ""; position: absolute; left: 4px; top: 7px; width: 16px; height: 13px; border: 2px solid #fffdf6; border-top: 0; border-radius: 0 0 12px 12px; }
.mic-symbol i { position: absolute; left: 8px; bottom: 0; width: 9px; height: 2px; background: #fffdf6; border-radius: 2px; }
.mic-symbol i::before { content: ""; position: absolute; width: 2px; height: 6px; background: #fffdf6; left: 4px; bottom: 1px; }
.reward-strip { background: #fbefd8; color: #714521; text-align: center; border-radius: 11px; padding: 9px 12px; font-size: .89rem; font-weight: 830; margin-top: 14px; }
.follow-card { background: #f0f5ea; border-radius: 13px; border: 1px solid #e0e9da; padding: 13px; margin-top: 16px; }
.follow-card h3 { font-size: 1.03rem; }
.follow-card .follow-sentence { color: var(--green-dark); font-size: 1.12rem; font-weight: 850; }
.follow-card .buttons { margin-top: 12px; }
.example-box { background: #f8faf0; border: 1px solid #e2e8d7; border-radius: 13px; padding: 11px; margin: 12px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.example-box h3 { width: 100%; font-size: .94rem; margin-bottom: 3px; color: #2c4c3d; }
.example-box button { font-size: .84rem; padding: 8px 10px; min-height: 42px; white-space: normal; }
.demo-panel .tori-stage { min-height: 238px; }
.demo-panel .tori-stage .tori-rig { width: 170px; height: 148px; }
.demo-panel .tori-controls { margin-top: 15px; }
.demo-panel .example-box button:first-of-type { background: #dfeee0; border-color: #b8d2ba; color: #24513f; }
.growth-steps, .decoration-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.growth-steps span { background: #edf3e9; color: #456356; border-radius: 7px; padding: 4px 8px; font-size: .81rem; }
.growth-steps span[aria-current] { background: var(--green); color: white; }
.decoration-picker button { font-size: .8rem; padding: 7px 9px; min-height: 38px; }

.showcase { border: 1px solid #dce6db; background: #eff4eb; border-radius: 15px; padding: 10px 13px; margin-bottom: 17px; color: #294b3d; display: flex; gap: 7px 11px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.showcase div { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
.showcase div span { font-size: .83rem; }
.showcase a, .showcase button { display: inline-block; border: 1px solid #dbe5d9; border-radius: 8px; background: var(--white); color: #2e5645; padding: 6px 8px; min-height: 34px; font-size: .8rem; font-weight: 800; text-decoration: none; }
.demo-link { font-size: .87rem; }
.demo-link a { color: var(--green-dark); font-weight: 850; text-underline-offset: 3px; }
.home-demo { margin-top: 12px; }
.editor { display: grid; gap: 12px; margin-top: 14px; }
.editor label { display: grid; gap: 4px; min-width: 0; font-size: .88rem; font-weight: 760; color: #34574a; }
.editor input:not([type=radio]):not([type=checkbox]), .editor textarea, .editor select { width: 100%; min-height: 41px; padding: 8px 9px; border-radius: 9px; border: 1px solid #dbe6d9; background: #fffefa; color: var(--ink); font: inherit; }
.editor textarea { resize: vertical; }
.editor .check { display: flex; min-height: 31px; align-items: center; gap: 6px; }
.editor input[type="radio"], .editor input[type="checkbox"] { accent-color: var(--green); }
.editor fieldset { margin: 0; border: 1px solid #dce7db; border-radius: 10px; }
.editor legend { padding: 0 5px; font-weight: 780; color: var(--ink); }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.editor-grid.reminder-settings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-message { font-size: .88rem; font-weight: 740; color: var(--green) !important; }
.form-message:empty { display: none; }
.studio-page .secondary[aria-pressed="true"] { background: #deeede; border-color: #bbd2bf; }
.hero h1:lang(vi) { font-weight: 760; line-height: 1.19; letter-spacing: -.027em; }
.hero p:lang(vi) { font-weight: 500; line-height: 1.6; }
.hero .hero-date:lang(vi) { font-weight: 600; line-height: 1.55; }
:is(.brand, .page-title h1, .panel h2, .mission-title, .mic-label):lang(vi) { font-weight: 720; letter-spacing: -.018em; line-height: 1.28; }
.brand-sub:lang(vi) { font-weight: 600; }
.section-head h2:lang(vi) { letter-spacing: -.015em; font-weight: 700; }
:is(.mission-caption, .studio-stats):lang(vi) { font-weight: 500; }
.studio-stats b:lang(vi) { font-weight: 650; }
:is(.navigation button, .locale-switch .locale, .mission .mission-cta, .primary, .secondary, .showcase button, .showcase a):lang(vi) { font-weight: 650; }
.navigation button[aria-current="page"]:lang(vi) { font-weight: 730; }
.tori-stage .bubble .vi:lang(vi) { font-weight: 500; line-height: 1.5; }

@media (max-width: 700px) {
  html { scroll-padding-block-end: 76px; }
  body { background: var(--cream); }
  .topbar-inner { min-height: 61px; }
  .topbar-inner { gap: 8px; }
  .brand { gap: 7px; font-size: 1.11rem; }
  .locale-switch .locale { min-height: 36px; padding-inline: 7px; font-size: .75rem; }
  .brand-mark { width: 40px; height: 40px; }
  .workspace { border: 0; margin-block: 0; padding: 17px 0 29px; border-radius: 0; background: transparent; }
  .navigation { gap: 4px; border-top: 1px solid #e5e9df; background: #fffdfa; box-shadow: 0 -5px 20px #1633280a; padding: 6px 9px calc(5px + env(safe-area-inset-bottom)); }
  .navigation button { gap: 2px; padding: 3px 3px 5px; min-height: 53px; border: 0; border-radius: 10px; font-size: .72rem; color: #51655c; }
  .navigation button[aria-current="page"] { background: transparent; color: #1d4b63; font-weight: 850; }
  .navigation button[aria-current="page"] .nav-icon { background: #e7f0ef; }
  .nav-icon { width: 36px; height: 28px; border-radius: 10px; }
  .nav-icon::before { width: 22px; height: 22px; }
  .home-overview { border-radius: 20px; }
  .hero { min-height: 223px; background:
    linear-gradient(90deg, #eaf4fae8 5%, #eaf4faaf 40%, #eaf4fa00 75%),
    url("assets/seoul-park.webp") right center / cover no-repeat,
    #e9f3f9; }
  .hero-copy { width: 68%; padding: 19px 0 28px 15px; }
  .hero-art { height: 78%; width: 49%; right: -1%; bottom: 2%; }
  .hero h1 { font-size: clamp(1.7rem, 8.2vw, 2.7rem); }
  .hero .hero-date { font-size: .73rem; margin-bottom: 10px; }
  .hero .glint { top: 19%; right: 12%; font-size: 1.25rem; }
  .mission { min-height: 137px; padding: 13px 15px; gap: 3px; border-radius: 17px; }
  .mission .mission-art.prop { width: min(33%, 104px); }
  .mission-caption { font-size: .82rem; }
  .mission .track-line { width: 56%; }
  .section-head { margin-block: 18px 8px; }
  .tori-stage { min-height: 305px; }
  .tori-stage .tori-rig { width: 211px; height: 185px; }
  .studio-stats { font-size: .79rem; padding-inline: 6px; }
  html[lang="vi"] .hero-copy { width: 61%; }
  html[lang="vi"] .hero .hero-date { font-size: .67rem; max-width: none; }
  html[lang="vi"] .mission-title { font-size: clamp(1.14rem, 4.8vw, 1.5rem); }
}

@media (max-width: 365px) {
  .brand { font-size: .99rem; }
  .brand-mark { width: 35px; height: 35px; }
  .brand-mark img { width: 29px; height: 29px; }
  .locale-switch .locale { padding-inline: 5px; font-size: .7rem; }
  .hero h1 { font-size: 1.52rem; }
  .hero .hero-date { max-width: none; white-space: nowrap; }
  .hero-art { width: 45%; }
  .buttons .primary, .buttons .secondary { min-width: 100%; }
  .editor-grid.reminder-settings { grid-template-columns: 1fr; }
  .panel-title .page-tag, .panel-title .type { white-space: normal; }
  html[lang="vi"] .studio-stats { font-size: .68rem; gap: 3px; }
  html[lang="vi"] .studio-stats > span { gap: 3px; }
}

.hero-art, .mission .mission-art {
  transform-origin: 50% 88%;
}

.lens-glass { position: absolute; overflow: hidden; border-radius: 50%; }
.hero-figure .lens-glass { left: 4.5%; top: 34%; width: 14.3%; height: 16%; rotate: -22deg; }
.lens-kit .lens-glass { left: 38.3%; top: 36.5%; width: 44.6%; height: 35%; rotate: -44deg; }
.lens-glass::before {
  content: ""; position: absolute; inset: -8%; opacity: 0;
  background: linear-gradient(107deg, transparent 26%, #d7f5ff62 41%, #fffdf1eb 50%, #e6faff75 55%, transparent 66%);
}
.lens-spark {
  position: absolute; left: 75%; top: 33%; width: 17%; aspect-ratio: 1;
  background: #fff4ca; clip-path: polygon(50% 0, 60% 39%, 100% 50%, 60% 61%, 50% 100%, 40% 61%, 0 50%, 40% 39%);
  opacity: 0;
}
.lens-halo {
  position: absolute; left: 10%; top: 9%; width: 100%; aspect-ratio: 1;
  border: 1px solid #d0ebfcab; border-radius: 50%; opacity: 0;
  box-shadow: inset 0 0 17px #b4e2ff43, 0 0 17px #b4e2ff43;
}
.hero-accent::after {
  content: ""; position: absolute; left: 1%; right: 7%; bottom: 1px; z-index: -1;
  height: .13em; border-radius: 100% 60% 90% 50%; background: #eaba5c8a;
  opacity: 0; transform-origin: left center; pointer-events: none;
}

@keyframes detective-breathe {
  0%, 7%, 43%, 100% { transform: none; }
  20% { transform: translate(-6px, -8px) rotate(-3deg) scale(1.052); }
  28% { transform: translate(-4px, -6px) rotate(-2deg) scale(1.04); }
  38% { transform: translateY(1px) rotate(.8deg) scale(.995); }
}

@keyframes lens-focus {
  0%, 8%, 46%, 100% { transform: none; }
  17% { transform: translate(3px, 2px) rotate(4deg) scale(.96); }
  25% { transform: translate(-3px, -4px) rotate(-9deg) scale(1.27); }
  33% { transform: translate(-1px, -3px) rotate(-6deg) scale(1.21); }
  42% { transform: translateY(1px) rotate(2deg) scale(.99); }
}
@keyframes lens-sweep {
  0%, 15% { opacity: 0; transform: translateX(-100%); }
  21% { opacity: .76; }
  30% { opacity: .94; }
  41%, 100% { opacity: 0; transform: translateX(100%); }
}
@keyframes lens-echo {
  0%, 21% { opacity: 0; transform: scale(.63); }
  26% { opacity: .74; }
  42%, 100% { opacity: 0; transform: scale(1.34); }
}
@keyframes glass-spark {
  0%, 22%, 38%, 100% { opacity: 0; transform: scale(.35) rotate(-15deg); }
  27% { opacity: .98; transform: scale(1.18) rotate(11deg); }
}
@keyframes title-lilt {
  0%, 16%, 37%, 100% { translate: 0 0; }
  24%, 29% { translate: 0 -4px; }
}
@keyframes title-stroke {
  0%, 16% { opacity: 0; transform: scaleX(.08); }
  25%, 29% { opacity: .83; transform: scaleX(1); }
  39%, 100% { opacity: 0; transform: scaleX(1); }
}
@keyframes copy-enter {
  from { opacity: .08; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-art, .mission .mission-art {
    transition: translate 430ms ease-out, rotate 430ms ease-out, scale 430ms ease-out;
  }

  .lens-kit { transition: scale 320ms cubic-bezier(.2,.75,.3,1); }
  #view:not(.motion-paused) .mission.study:focus-visible .lens-kit { scale: 1.045; }
  #view:not(.motion-paused) .mission.tori:focus-visible .mission-art { translate: 0 -4px; scale: 1.025; }
  .mission:active { transform: scale(.986); }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #view:not(.motion-paused) .hero:hover .hero-art { translate: 0 -4px; rotate: 1.8deg; scale: 1.026; }
  #view:not(.motion-paused) .mission.study:hover .lens-kit { scale: 1.045; }
  #view:not(.motion-paused) .mission.tori:hover .mission-art { translate: 0 -3px; scale: 1.025; }
}

@media (hover: none) {
  .mission:hover:not(:active) { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mission:hover { transform: none; }
}

.motion-toggle { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .hero-art { animation: detective-breathe 6.5s ease-in-out infinite; }
  .hero .lens-glass::before { animation: lens-sweep 6.5s linear infinite; }
  .lens-kit { animation: lens-focus 6.5s ease-in-out 560ms infinite; }
  .lens-kit .lens-glass::before { animation: lens-sweep 6.5s linear 560ms infinite; }
  .lens-halo { animation: lens-echo 6.5s ease-out 560ms infinite; }
  .lens-spark { animation: glass-spark 6.5s ease-out 560ms infinite; }
  .hero-accent { animation: title-lilt 6.5s ease-in-out infinite; }
  .hero-accent::after { animation: title-stroke 6.5s ease-out infinite; }

  .motion-enter:not(.motion-paused) :is(.hero-date, .hero-line, .hero-description, .mission-title, .mission-caption, .page-title) {
    animation: copy-enter 480ms cubic-bezier(.18,.74,.22,1) var(--copy-delay, 0ms) both;
  }
  .motion-enter:not(.motion-paused) .hero-line { --copy-delay: 65ms; }
  .motion-enter:not(.motion-paused) .hero-accent {
    --copy-delay: 135ms;
    animation: copy-enter 480ms cubic-bezier(.18,.74,.22,1) var(--copy-delay) both, title-lilt 6.5s ease-in-out infinite;
  }
  .hero-description { --copy-delay: 215ms; }
  .mission-title { --copy-delay: 140ms; }
  .mission-caption { --copy-delay: 220ms; }

  :is(.motion-paused, .motion-offscreen) :is(.hero-art, .lens-kit, .lens-halo, .lens-spark, .hero-accent),
  :is(.motion-paused, .motion-offscreen) .hero-accent::after,
  :is(.motion-paused, .motion-offscreen) .lens-glass::before,
  .motion-enter:not(.motion-paused) .motion-offscreen :is(.hero-date, .hero-line, .hero-description, .mission-title, .mission-caption) {
    animation-play-state: paused;
  }

  .motion-toggle {
    position: absolute;
    z-index: 3;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #233e43;
    background: transparent;
    border: 0;
    border-radius: 50%;
  }
  .motion-toggle span {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fffcf2e6;
    border: 1px solid #2f59452e;
  }
  .tori-stage .motion-toggle { top: auto; bottom: 4px; right: 4px; }
  .motion-toggle span::before {
    content: "";
    width: 8px;
    height: 9px;
    border-inline: 2px solid currentColor;
  }
  .motion-paused .motion-toggle span::before {
    width: 0;
    height: 0;
    margin-left: 2px;
    border: solid transparent;
    border-width: 5px 0 5px 8px;
    border-left-color: currentColor;
  }
}
