@font-face {
  font-family: "LB Serif";
  src: local("Noto Serif CJK SC"), local("Source Han Serif SC"), local("Songti SC"), local("SimSun");
}

:root {
  --ink: #11110f;
  --paper: #f3f0e7;
  --card: #f8f6ee;
  --acid: #d8ff3e;
  --sun: #ffbd2e;
  --red: #f0442f;
  --blue: #275be8;
  --muted: #5a5a53;
  --line: rgba(17, 17, 15, 0.24);
  --shadow: 12px 14px 0 rgba(17, 17, 15, 0.13);
  --serif: "LB Serif", "Noto Serif SC", "Songti SC", Georgia, serif;
  --sans: "Arial Narrow", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: var(--sans); }
button, input { font: inherit; }
button { color: inherit; touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { min-height: 100vh; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 14px; background: #fff; color: #111; border: 2px solid #111; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.login-page { position: relative; isolation: isolate; min-height: 100vh; overflow: hidden; display: grid; grid-template-rows: auto 1fr; padding: 32px 44px 24px; background: var(--paper); }
.login-header, .dashboard-header { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; color: inherit; text-decoration: none; font-size: 1.05rem; font-weight: 700; letter-spacing: -.03em; }
.brand b { font-family: var(--serif); font-style: italic; font-weight: 400; }
.brand-mark { position: relative; display: block; width: 31px; height: 31px; border: 1.5px solid currentColor; border-radius: 50%; overflow: hidden; transform: rotate(-12deg); }
.brand-mark i { position: absolute; width: 2px; height: 33px; top: -2px; left: 14px; background: currentColor; transform-origin: 50% 100%; }
.brand-mark i:nth-child(2) { transform: rotate(56deg); }
.brand-mark i:nth-child(3) { transform: rotate(-56deg); }

.login-layout { position: relative; z-index: 2; width: min(1180px, 100%); margin: auto; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(48px, 7vw, 112px); padding: 56px 0 40px; }
.eyebrow, .micro-label { margin: 0 0 18px; font-size: .72rem; font-weight: 700; letter-spacing: .23em; text-transform: uppercase; }
.login-layout.signature-empty { grid-template-columns: minmax(0, 430px); justify-content: center; }
.signature-empty .login-card-wrap { justify-self: stretch; }
.signature-display { position: relative; max-width: 660px; padding: clamp(28px, 5vw, 68px) 0; }
.signature-display::before { content: ""; display: block; width: 68px; height: 3px; margin-bottom: 28px; background: currentColor; }
.signature-display blockquote { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font: 500 clamp(2.5rem, 5.6vw, 5.8rem)/1.12 var(--serif); letter-spacing: -.065em; }

.login-card-wrap { width: min(430px, 100%); justify-self: end; }
.login-card { position: relative; padding: 38px; border: 1.5px solid var(--ink); background: rgba(248, 246, 238, .9); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.login-card::before { content: ""; position: absolute; z-index: -1; inset: -13px 16px 12px -14px; border: 1px solid currentColor; opacity: .35; transform: rotate(-1.4deg); }
.micro-label { margin-bottom: 8px; font-size: .64rem; }
.weather-panel { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; margin-bottom: 31px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.weather-symbol { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; }
.weather-symbol svg { width: 26px; height: 26px; }
.weather-copy .micro-label { margin: 0 0 5px; }
.weather-reading { display: flex; align-items: center; gap: 13px; }
.weather-reading > strong { font: 500 2.7rem/1 var(--serif); letter-spacing: -.08em; }
.weather-reading span, .weather-reading b, .weather-reading small { display: block; }
.weather-reading b { margin-bottom: 5px; font: 500 .95rem/1 var(--serif); }
.weather-reading small { color: var(--muted); font-size: .65rem; white-space: nowrap; }
.field-group { margin-bottom: 21px; }
.field-group label { display: block; margin-bottom: 8px; font-size: .82rem; font-weight: 700; letter-spacing: .08em; }
.field-group input { width: 100%; min-height: 52px; padding: 0 14px; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; outline: none; color: var(--ink); background: rgba(255,255,255,.43); font-size: 1rem; transition: background .2s var(--ease), box-shadow .2s var(--ease); }
.field-group input::placeholder { color: #74736d; }
.field-group input:focus { background: #fff; box-shadow: 0 3px 0 var(--sun); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 58px; }
.icon-button { position: absolute; right: 2px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(17,17,15,.07); }
.icon-button:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.form-message { min-height: 22px; margin: -6px 0 11px; font-size: .8rem; font-weight: 700; }
.form-message[data-state="error"] { color: #a51f14; }
.form-message[data-state="success"] { color: #216400; }
.form-message[data-state="hint"] { color: #41413c; }
.submit-button { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; font-weight: 700; letter-spacing: .08em; transition: color .2s var(--ease), background .2s var(--ease); }
.submit-button:hover { color: var(--ink); background: var(--acid); }
.submit-button:disabled { opacity: .65; cursor: wait; }
.privacy-note { margin: 25px 0 0; text-align: center; color: var(--muted); font-size: .72rem; }

.ambient { position: absolute; z-index: -2; pointer-events: none; filter: blur(1px); }
.ambient-a { width: 55vw; height: 150vh; top: -42vh; left: 8vw; background: linear-gradient(115deg, transparent 18%, rgba(255,210,74,.62) 49%, rgba(255,241,185,.1) 70%); transform: rotate(8deg); }
.ambient-b { width: 42vw; height: 42vw; right: -8vw; bottom: -18vw; border-radius: 50%; background: radial-gradient(circle at 38% 32%, rgba(216,255,62,.9), rgba(39,91,232,.14) 43%, transparent 70%); }
.grain { position: absolute; z-index: -1; inset: 0; pointer-events: none; opacity: .22; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E"); mix-blend-mode: multiply; }

/* Daily styles: one komorebi idea, seven visual languages */
body[data-theme="constructivism"] { --paper: #f0eadc; --card: #f4efe3; --sun: #ef3829; --acid: #f2cf28; --shadow: 12px 12px 0 #2553df; }
body[data-theme="constructivism"] .ambient-a { background: linear-gradient(123deg, transparent 31%, #f2cf28 31% 47%, transparent 47%); transform: rotate(-5deg); }
body[data-theme="constructivism"] .ambient-b { border-radius: 0; background: #ef3829; clip-path: polygon(40% 0,100% 0,100% 100%,0 100%); }
body[data-theme="constructivism"] .login-card { transform: rotate(-.7deg); }

body[data-theme="fauvism"] { --paper: #f7a7c9; --card: #fff278; --sun: #ff4a1c; --acid: #4cff74; --blue: #4727c7; --shadow: 13px 14px 0 #4727c7; }
body[data-theme="fauvism"] .ambient-a { background: linear-gradient(112deg, transparent 16%, #ff5c21 44%, transparent 69%); opacity: .78; }
body[data-theme="fauvism"] .ambient-b { background: radial-gradient(circle, #56e8d2 0 34%, transparent 35%), conic-gradient(#4727c7, #fff278, #4727c7); }

body[data-theme="halftone"] { --paper: #f0e8d3; --card: #f7f0df; --sun: #f5cc28; --acid: #ff5d45; --blue: #155bd7; --shadow: 11px 13px 0 #155bd7; }
body[data-theme="halftone"] .login-page::after { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .24; background-image: radial-gradient(#155bd7 1.1px, transparent 1.1px); background-size: 9px 9px; mask-image: linear-gradient(90deg, #000, transparent 72%); }
body[data-theme="halftone"] .ambient-b { background: radial-gradient(circle at 50% 50%, #f34d3f 0 35%, transparent 36%), radial-gradient(circle at 50% 50%, #155bd7 0 55%, transparent 56%); }

body[data-theme="halo"] { --paper: #10140f; --ink: #f8f3df; --card: #171d17; --muted: #c9c8be; --line: rgba(255,255,255,.28); --sun: #ffe580; --acid: #e8ff8a; --blue: #ffe580; --shadow: 0 0 70px rgba(225,255,151,.2); }
body[data-theme="halo"] .login-card { background: rgba(21,27,21,.74); border-color: rgba(255,255,255,.55); }
body[data-theme="halo"] .field-group input { color: #fff; border-color: #fff; background: rgba(255,255,255,.07); }
body[data-theme="halo"] .field-group input::placeholder { color: #bbbdb4; }
body[data-theme="halo"] .field-group input:focus { background: rgba(255,255,255,.13); }
body[data-theme="halo"] .submit-button { color: #111; background: #f8f3df; border-color: #f8f3df; }
body[data-theme="halo"] .submit-button:hover { background: var(--acid); }
body[data-theme="halo"] .ambient-a { background: linear-gradient(116deg, transparent 24%, rgba(244,255,178,.53) 48%, transparent 67%); filter: blur(25px); }
body[data-theme="halo"] .ambient-b { background: radial-gradient(circle, rgba(222,255,145,.72), rgba(83,132,70,.34) 35%, transparent 70%); filter: blur(18px); }
body[data-theme="halo"] .grain { mix-blend-mode: screen; opacity: .12; }

body[data-theme="glitch"] { --paper: #e8e7df; --card: #f3f2ea; --sun: #00f0ff; --acid: #ff2e8c; --blue: #3c3cff; --shadow: -8px 8px 0 #00f0ff, 8px -8px 0 #ff2e8c; }
body[data-theme="glitch"] .signature-display blockquote { text-shadow: -3px 0 #00d9e8, 3px 0 #ff2e8c; }
body[data-theme="glitch"] .ambient-a { background: repeating-linear-gradient(0deg, transparent 0 21px, rgba(60,60,255,.17) 22px 24px), linear-gradient(112deg, transparent 35%, rgba(0,240,255,.45) 36% 53%, transparent 54%); }
body[data-theme="glitch"] .ambient-b { border-radius: 0; background: repeating-linear-gradient(90deg, #ff2e8c 0 12px, transparent 12px 24px); clip-path: polygon(0 11%,100% 0,72% 31%,100% 42%,57% 55%,89% 75%,0 100%,21% 59%); }

body[data-theme="deconstructivism"] { --paper: #ecebe5; --card: #f7f5ed; --sun: #e5ff46; --acid: #e5ff46; --blue: #222; --shadow: 15px 7px 0 rgba(0,0,0,.17); }
body[data-theme="deconstructivism"] .login-layout { transform: skewY(-1.1deg); }
body[data-theme="deconstructivism"] .login-card { transform: translateY(20px) rotate(1.4deg); }
body[data-theme="deconstructivism"] .ambient-a { background: linear-gradient(124deg, transparent 27%, rgba(229,255,70,.9) 27% 48%, transparent 48%); transform: rotate(16deg); }
body[data-theme="deconstructivism"] .ambient-b { border: 60px solid rgba(17,17,15,.11); border-radius: 0; background: transparent; transform: rotate(18deg); }

body[data-theme="retro"] .login-page::before { content: "ARCHIVE / LIGHT STUDY"; position: absolute; top: 30%; left: -45px; transform: rotate(-90deg); font: 700 .65rem/1 var(--sans); letter-spacing: .23em; }

/* Logged-in views */
body[data-theme="dashboard"] { background: #ecebe4; }
.dashboard { min-height: 100vh; background: #ecebe4; }
.dashboard-header { min-height: 80px; padding: 0 clamp(20px, 4vw, 62px); border-bottom: 1px solid #21211e; background: #f4f2ea; }
.dashboard-header nav { display: flex; align-items: center; gap: 14px; }
.role-badge { padding: 6px 10px; border: 1px solid currentColor; font-size: .7rem; font-weight: 700; letter-spacing: .08em; }
.user-name { font: italic 1rem/1 var(--serif); }
.logout-button { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 0; background: transparent; cursor: pointer; font-size: .78rem; }
.logout-button:hover { background: #dedcd3; }
.dashboard-main { width: min(1380px, 100%); margin: 0 auto; padding: clamp(48px, 7vw, 92px) clamp(20px, 5vw, 72px) 80px; }
.dashboard-intro h1, .reader-hero h1, .teacher-heading h1 { margin: 0; font: 500 clamp(3.2rem, 6vw, 6.6rem)/.95 var(--serif); letter-spacing: -.065em; }
.dashboard-intro > p:last-child { max-width: 540px; margin: 28px 0 0 25%; font-family: var(--serif); line-height: 1.8; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 70px; border: 1px solid #21211e; }
.metric-grid article { min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; border-right: 1px solid #21211e; background: #f4f2ea; }
.metric-grid article:last-child { border-right: 0; }
.metric-grid span { font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
.metric-grid strong { font: 500 4.4rem/1 var(--serif); }
.metric-grid small { font-size: .72rem; }
.metric-grid .accent-metric { background: #dfff45; }
.admin-columns { display: grid; grid-template-columns: 1.55fr .7fr; gap: 28px; margin-top: 28px; }
.panel { border: 1px solid #21211e; background: #f4f2ea; }
.panel-title { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 0 20px; border-bottom: 1px solid #21211e; }
.panel-title > div { display: flex; align-items: center; gap: 10px; }
.panel-title h2 { margin: 0; font: 500 1.15rem/1 var(--serif); }
.panel-title > span { font-size: .65rem; letter-spacing: .17em; }
.post-row { display: grid; grid-template-columns: 40px 1fr 44px; align-items: center; gap: 10px; min-height: 78px; padding: 8px 15px; border-bottom: 1px solid rgba(33,33,30,.22); }
.post-row:last-child { border-bottom: 0; }
.post-row > span { font: italic 1rem/1 var(--serif); }
.post-row b, .post-row small { display: block; }
.post-row b { margin-bottom: 6px; font-size: .88rem; }
.post-row small { color: #62615a; font-size: .68rem; }
.post-row button, .dark-card button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid currentColor; background: transparent; cursor: pointer; }
.post-row button:hover { background: #dfff45; }
.access-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 11px; min-height: 78px; padding: 10px 18px; border-bottom: 1px solid rgba(33,33,30,.22); }
.access-row:last-child { border-bottom: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4e971f; }
.access-row b, .access-row small { display: block; }
.access-row b { margin-bottom: 4px; font-size: .82rem; }
.access-row small { color: #62615a; font-size: .7rem; }
.access-row em { font-size: .6rem; font-style: normal; letter-spacing: .12em; }
.signature-editor { margin-top: 28px; }
.signature-editor-body { padding: 24px; }
.signature-editor-body label { display: block; margin-bottom: 9px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; }
.signature-editor-body textarea { width: 100%; min-height: 120px; resize: vertical; padding: 14px; border: 1px solid #21211e; border-radius: 0; outline: none; color: #21211e; background: #fffdf6; font: 1rem/1.7 var(--serif); }
.signature-editor-body textarea:focus { box-shadow: 0 0 0 3px #dfff45; }
.signature-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; }
.signature-editor-footer p { margin: 0; color: #5f5e56; font-size: .76rem; }
.signature-editor-footer > div { display: flex; gap: 9px; }
.primary-button, .secondary-button { min-height: 44px; padding: 0 16px; border: 1px solid #21211e; cursor: pointer; font-size: .78rem; font-weight: 700; }
.primary-button { color: #111; background: #dfff45; }
.secondary-button { background: transparent; }
.primary-button:hover { background: #c9ed39; }
.secondary-button:hover { background: #dfddd5; }

.reader-dashboard { color: #18362b; background: #dde8cd; }
.reader-dashboard .dashboard-header { border-color: #254b3b; background: #e8f0dc; }
.reader-main { position: relative; overflow: hidden; }
.reader-main::before { content: ""; position: absolute; top: -200px; right: 4%; width: 46%; height: 670px; background: linear-gradient(115deg, transparent 20%, rgba(255,248,172,.82) 52%, transparent 76%); transform: rotate(9deg); pointer-events: none; }
.reader-hero { position: relative; min-height: 390px; }
.reader-hero h1 { max-width: 800px; }
.reader-hero > p:nth-of-type(2) { max-width: 460px; margin: 28px 0 36px; font: 1.08rem/1.8 var(--serif); }
.reading-progress { width: min(310px, 100%); height: 4px; background: rgba(24,54,43,.22); }
.reading-progress span { display: block; height: 100%; background: #18362b; }
.reader-hero small { display: block; margin-top: 10px; font-size: .7rem; letter-spacing: .1em; }
.featured-reading { position: relative; display: grid; grid-template-columns: 82px 1.2fr .8fr; min-height: 390px; border: 1px solid #254b3b; background: #edf3e4; }
.feature-number { padding: 24px 0; border-right: 1px solid #254b3b; text-align: center; font: italic 1.5rem/1 var(--serif); }
.feature-copy { align-self: center; padding: 46px clamp(25px, 5vw, 72px); }
.feature-copy h2 { margin: 0; font: 500 clamp(2rem, 3.6vw, 3.8rem)/1.12 var(--serif); letter-spacing: -.045em; }
.feature-copy > p:nth-of-type(2) { max-width: 570px; margin: 24px 0; font-family: var(--serif); line-height: 1.8; }
.text-button { min-height: 44px; display: inline-flex; align-items: center; gap: 12px; padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; cursor: pointer; font-weight: 700; }
.light-window { position: relative; overflow: hidden; border-left: 1px solid #254b3b; background: #214d3a; }
.light-window::after { content: ""; position: absolute; inset: -20%; background: linear-gradient(118deg, transparent 15%, rgba(255,246,165,.88) 42%, transparent 68%); transform: rotate(-7deg); }
.light-window i { position: absolute; z-index: 1; width: 2px; height: 150%; top: -20%; background: rgba(238,244,218,.6); transform: rotate(37deg); }
.light-window i:nth-child(1) { left: 24%; }.light-window i:nth-child(2) { left: 55%; }.light-window i:nth-child(3) { left: 79%; }
.reading-list { margin-top: 48px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid #254b3b; }
.section-heading h2 { margin: 0; font: 500 1.8rem/1 var(--serif); }
.section-heading span { font-size: .68rem; letter-spacing: .12em; }
.reading-list article { display: grid; grid-template-columns: .35fr 1fr auto; align-items: center; min-height: 92px; border-bottom: 1px solid rgba(37,75,59,.28); }
.reading-list article p, .reading-list article span { font-size: .72rem; letter-spacing: .08em; }
.reading-list article h3 { margin: 0; font: 500 1.05rem/1.4 var(--serif); }

.teacher-dashboard { color: #251f1a; background: #eadfc9; }
.teacher-dashboard .dashboard-header { border-color: #4d3b2b; background: #f1e8d7; }
.teacher-main { background-image: linear-gradient(rgba(77,59,43,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(77,59,43,.08) 1px, transparent 1px); background-size: 28px 28px; }
.teacher-heading { display: grid; grid-template-columns: 1fr .55fr; align-items: end; gap: 48px; }
.teacher-heading > p { max-width: 430px; margin: 0 0 9px; padding-left: 20px; border-left: 2px solid #a84d2a; font: 1.05rem/1.8 var(--serif); }
.lesson-board { display: grid; grid-template-columns: 220px 1fr; margin-top: 72px; border: 1px solid #4d3b2b; background: #f2e9d8; box-shadow: 13px 13px 0 rgba(77,59,43,.14); }
.lesson-board aside { display: flex; flex-direction: column; justify-content: space-between; min-height: 330px; padding: 25px; border-right: 1px solid #4d3b2b; background: #ac4d2c; color: #fff8e9; }
.lesson-board aside span { font-size: .72rem; letter-spacing: .15em; }
.lesson-board aside strong { font: 500 3.5rem/1 var(--serif); }
.lesson-board aside small { font-size: .72rem; }
.lesson-board article { align-self: center; padding: 48px clamp(28px, 7vw, 90px); }
.lesson-board h2 { margin: 0; font: 500 clamp(2.3rem, 4.3vw, 4.6rem)/1.1 var(--serif); letter-spacing: -.05em; }
.lesson-board article > p:nth-of-type(2) { max-width: 700px; margin: 22px 0 35px; font-family: var(--serif); line-height: 1.8; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.lesson-meta span { padding: 7px 10px; border: 1px solid rgba(77,59,43,.4); font-size: .7rem; }
.teacher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 38px; }
.teacher-card { position: relative; min-height: 230px; padding: 26px; border: 1px solid #4d3b2b; background: rgba(242,233,216,.92); }
.card-index { position: absolute; right: 18px; top: 13px; font: italic 2.3rem/1 var(--serif); opacity: .22; }
.teacher-card > p { margin: 0 0 50px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; }
.teacher-card h3 { max-width: 300px; margin: 0 0 16px; font: 500 1.4rem/1.35 var(--serif); }
.teacher-card > span { font-size: .68rem; }
.dark-card { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; color: #fff8e9; background: #27211c; }
.dark-card > div { grid-column: 1 / -1; }
.dark-card > p { margin-bottom: 20px; }
.dark-card h3 { align-self: end; margin: 0; }
.dark-card button { align-self: end; color: #fff8e9; }
.dark-card button:hover { color: #27211c; background: #fff8e9; }

@media (max-width: 900px) {
  .login-page { padding: 24px; }
  .login-layout { grid-template-columns: 1fr; gap: 52px; padding-top: 70px; }
  .signature-display blockquote { font-size: clamp(2.8rem, 10vw, 5.4rem); }
  .login-card-wrap { justify-self: center; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid article:nth-child(2) { border-right: 0; }
  .metric-grid article:nth-child(-n+2) { border-bottom: 1px solid #21211e; }
  .admin-columns { grid-template-columns: 1fr; }
  .featured-reading { grid-template-columns: 62px 1fr; }
  .light-window { display: none; }
  .teacher-heading { grid-template-columns: 1fr; }
  .lesson-board { grid-template-columns: 160px 1fr; }
  .teacher-grid { grid-template-columns: 1fr 1fr; }
  .teacher-grid .dark-card { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .login-page { padding: 18px 16px; }
  .login-layout { padding: 64px 0 26px; }
  .signature-display { padding: 18px 0 0; }
  .signature-display blockquote { font-size: clamp(2.4rem, 12vw, 4rem); }
  .login-card { padding: 27px 20px; box-shadow: 8px 9px 0 rgba(17,17,15,.14); }
  .dashboard-header { min-height: 68px; }
  .dashboard-header .brand > span:last-child, .user-name, .logout-button span { display: none; }
  .dashboard-main { padding-top: 48px; }
  .dashboard-intro h1, .reader-hero h1, .teacher-heading h1 { font-size: clamp(2.9rem, 14vw, 4.5rem); }
  .dashboard-intro > p:last-child { margin-left: 0; }
  .metric-grid { margin-top: 46px; }
  .metric-grid article { min-height: 145px; padding: 16px; }
  .metric-grid strong { font-size: 3rem; }
  .signature-editor-footer { align-items: stretch; flex-direction: column; }
  .signature-editor-footer > div { justify-content: flex-end; }
  .featured-reading { grid-template-columns: 45px 1fr; }
  .feature-copy { padding: 35px 20px; }
  .feature-copy h2 { font-size: 2rem; }
  .reading-list article { grid-template-columns: 1fr auto; padding: 16px 0; }
  .reading-list article p { grid-column: 1 / -1; margin: 0 0 8px; }
  .reading-list article h3 { padding-right: 10px; }
  .lesson-board { grid-template-columns: 1fr; }
  .lesson-board aside { min-height: 130px; border-right: 0; border-bottom: 1px solid #4d3b2b; }
  .lesson-board aside strong { font-size: 2.6rem; }
  .lesson-board article { padding: 35px 22px; }
  .lesson-board h2 { font-size: 2.45rem; }
  .teacher-grid { grid-template-columns: 1fr; }
  .teacher-grid .dark-card { grid-column: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .signature-display, .login-card-wrap, .dashboard-main > section { animation: enter .64s var(--ease) both; }
  .login-card-wrap { animation-delay: .12s; }
  .dashboard-main > section:nth-child(2) { animation-delay: .08s; }
  .dashboard-main > section:nth-child(3) { animation-delay: .16s; }
  .ambient-a { animation: drift 9s ease-in-out infinite alternate; }
  @keyframes enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes drift { from { translate: -1% -1%; } to { translate: 2% 1%; } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
