/* 수업 자료 허브 — 공통 스타일 (design-log ## 2 토큰 · ## 3 레이아웃 · ## 8 2차 보강: 풀 스크린·히어로·질감·모션 8). 외부 요청 0: 글꼴은 ./fonts/ 동봉. */
@font-face { font-family: "Hakgyoansim Godeunjemok"; src: url("fonts/HakgyoansimGodeunjemokB.woff2") format("woff2"); font-weight: 700; font-display: block; /* 제목체: 대체 글꼴 점멸 대신 짧은 공백(## 8 실측 0.6s 프레임) */ }
@font-face { font-family: "Hakgyoansim Bareondotum"; src: url("fonts/HakgyoansimBareondotumR.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hakgyoansim Bareondotum"; src: url("fonts/HakgyoansimBareondotumB.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F3F5F8; --ink: #1B2430; --soft: #556070; --card: #FFFFFF; --line: #D8DEE6; --accent: #2457A6; --warn: #B23A2E;
  --radius: 14px; --radius-lg: 22px;
  --shadow: 0 1px 0 rgba(27,36,48,.06), 0 10px 24px -12px rgba(27,36,48,.25);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gap: clamp(12px, 1.3vw, 26px);
  --pad: clamp(20px, 2.6vw, 52px);
  --fs-body: clamp(18px, 1.5vw, 30px);
  --fs-soft: clamp(16px, 1.25vw, 24px);
  --fs-h1: clamp(34px, 4.2vw, 82px);      /* 1920: 80 (L1 띠) */
  --fs-h0: clamp(32px, 3.1vw, 60px);      /* 1920: 59.5 (L0 제목 — 히어로·타일에 높이를 양보) */
  --fs-tile: clamp(30px, 3.5vw, 72px);    /* 1920: 67 (과목명 ≥64) */
  --fs-unit: clamp(20px, 2.6vw, 52px);    /* 1920: 50 (단원명 ≥48) */
  --fs-row: clamp(18px, 1.8vw, 36px);     /* 1920: 34.5 (차시 줄 ≥32) */
  --fs-big: clamp(44px, 5.2vw, 104px);    /* 1920: 100 (강조 숫자) */
  --fs-hero: clamp(28px, 3vw, 60px);      /* 1920: 57.6 (히어로 제목) */
  --font-title: "Hakgyoansim Godeunjemok", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --font-body: "Hakgyoansim Bareondotum", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color-scheme: light;
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; animation-timing-function: var(--ease-in-out); }
::view-transition-group(hub-card) { animation-duration: 320ms; animation-timing-function: var(--ease-in-out); }
::view-transition-old(hub-card), ::view-transition-new(hub-card) { height: 100%; object-fit: cover; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: #B9C2CE var(--bg); }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.45; -webkit-font-smoothing: antialiased; }
::selection { background: #CFE0F7; color: var(--ink); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; flex: none; }
.num { font-variant-numeric: tabular-nums; }

/* 뼈대 — 화면을 채운다(스펙 §1-17): page 는 세로 100dvh 플렉스, main 이 남은 높이를 전부 가진다 */
.page { padding: var(--pad); max-width: 1880px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.page > main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: calc(var(--gap) * 2); margin-bottom: var(--gap); }
.top h1 { margin: 0; font-family: var(--font-title); font-weight: 700; font-size: var(--fs-h0); line-height: 1.02; letter-spacing: -0.015em; }
.tag { margin: 0 0 .3em; color: var(--soft); font-size: var(--fs-soft); }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: .35em; margin: 0 0 .5em; color: var(--soft); font-size: var(--fs-soft); }
.crumb a { border-bottom: 1px solid transparent; padding: .1em 0; }
.crumb a:hover { border-bottom-color: currentColor; }
.crumb .icon { opacity: .55; font-size: .8em; }
.crumb b { color: var(--ink); font-weight: 700; }

/* 과목 질감(CSS 패턴, 외부 이미지 0) — `--tint` 를 아주 옅게 깔아 글자 대비는 유지 */
.tx { position: relative; isolation: isolate; overflow: hidden; container-type: size; }
.tx::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; color: var(--tint); }
.tx-stars::before {
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, currentColor 98%, transparent), radial-gradient(1px 1px at 31% 62%, currentColor 98%, transparent),
    radial-gradient(2px 2px at 48% 28%, currentColor 98%, transparent), radial-gradient(1px 1px at 67% 74%, currentColor 98%, transparent),
    radial-gradient(1.5px 1.5px at 79% 14%, currentColor 98%, transparent), radial-gradient(1px 1px at 88% 52%, currentColor 98%, transparent),
    radial-gradient(2px 2px at 21% 86%, currentColor 98%, transparent), radial-gradient(1px 1px at 58% 92%, currentColor 98%, transparent),
    radial-gradient(1px 1px at 93% 88%, currentColor 98%, transparent), radial-gradient(1.5px 1.5px at 40% 48%, currentColor 98%, transparent);
  background-size: 420px 420px; opacity: .55;
}
.tx-paper::before { background-image: repeating-linear-gradient(0deg, currentColor 0 1px, transparent 1px 22px); opacity: .10; }
.tx-grid::before { background-image: repeating-linear-gradient(0deg, currentColor 0 1px, transparent 1px 56px), repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 56px); opacity: .10; }
.tx-waves::before { background-image: radial-gradient(circle at 50% 120%, transparent 58%, currentColor 59% 60%, transparent 61%); background-size: 120px 60px; opacity: .12; }
.tx-dots::before { background-image: radial-gradient(currentColor 1.2px, transparent 1.4px); background-size: 26px 26px; opacity: .16; }
.tx-diag::before { background-image: repeating-linear-gradient(45deg, currentColor 0 1px, transparent 1px 34px); opacity: .10; }
.tx-rings::before { background-image: radial-gradient(circle at 50% 50%, transparent 40%, currentColor 40.5% 41.5%, transparent 42%); background-size: 160px 160px; opacity: .12; }
/* 워터마크 아이콘(Phosphor 한 벌을 크게) */
.wm { position: absolute; right: -0.12em; bottom: -0.18em; z-index: -1; font-size: clamp(120px, 22vh, 320px); font-size: max(120px, 86cqh); color: var(--tint); opacity: .16; pointer-events: none; transition: transform 320ms var(--ease-out); }

/* L0 히어로(최근 배포 1편) + 최근 2·3편 */
.hero-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.hero-row.solo { grid-template-columns: 1fr; }
.hero-row {  gap: var(--gap); margin-bottom: var(--gap); }
.hero { display: flex; flex-direction: column; justify-content: flex-end; gap: .3em; min-height: clamp(180px, 25vh, 320px); padding: clamp(16px, 1.8vw, 34px) clamp(20px, 2.4vw, 48px); border-radius: var(--radius-lg); background: var(--c); color: var(--ink-on); transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out); }
.hero::after { content: ""; position: absolute; inset: -30% -10% auto auto; width: 60%; aspect-ratio: 1; z-index: -1; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, color-mix(in srgb, var(--tint) 38%, transparent) 0%, transparent 62%); animation: hero-glow 2.4s var(--ease-out) forwards; }
@keyframes hero-glow { from { opacity: 0; transform: translate(18%, 12%) scale(.8); } to { opacity: 1; transform: none; } }
.hero .where { font-size: var(--fs-soft); opacity: .9; }
.hero .title, .tile .name, .unit .ttl, .row .ttl, .recent .t, .band h1, .lhead h1 { word-break: keep-all; overflow-wrap: anywhere; }
.hero .title { margin: 0; font-family: var(--font-title); font-size: var(--fs-hero); line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; max-width: 22ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero .foot { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); margin-top: .4em; }
.hero .d { font-size: var(--fs-soft); opacity: .9; }
.hero .open { display: inline-flex; align-items: center; gap: .35em; font-weight: 700; font-size: var(--fs-body); padding: .45em 1.1em; border-radius: 999px; background: var(--tint); color: var(--c); }
.recent { display: grid; gap: var(--gap); grid-auto-rows: 1fr; }
.recent a { display: flex; flex-direction: column; justify-content: flex-end; gap: .2em; padding: clamp(14px, 1.4vw, 26px) clamp(16px, 1.6vw, 30px); border-radius: var(--radius-lg); background: var(--c); color: var(--ink-on); transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out); }
.recent .where { font-size: var(--fs-soft); opacity: .9; }
.recent .t { font-weight: 700; font-size: var(--fs-body); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent .d { font-size: max(16px, calc(var(--fs-soft) * .9)); opacity: .85; }
.recent .wm { font-size: max(80px, 90cqh); }
.band .wm, .lhead .wm { font-size: max(160px, 135cqh); right: 0.6em; bottom: -0.45em; }

/* L0 과목 타일 — 남은 높이를 전부 채우는 그리드(2개면 2개가 크게, 8개면 4×2 꽉 차게) */
.tiles { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 22vw, 430px), 1fr)); grid-auto-rows: minmax(clamp(150px, 17vh, 420px), 1fr); }
.tile { display: flex; flex-direction: column; justify-content: space-between; height: 100%; min-height: clamp(150px, 17vh, 420px); padding: clamp(16px, 1.8vw, 34px) clamp(18px, 2vw, 38px); border-radius: var(--radius-lg); background: var(--c); color: var(--ink-on); transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out); }
.tile .name { font-family: var(--font-title); font-size: var(--fs-tile); line-height: 1.05; letter-spacing: -0.01em; }
.tile .meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: .5em; }
.tile .units { font-size: var(--fs-soft); opacity: .9; padding-bottom: .3em; }
.tile .prog { font-family: var(--font-title); font-size: var(--fs-big); font-size: max(var(--fs-big), 30cqh); line-height: .9; color: var(--tint); letter-spacing: -0.02em; }
.tile .prog small { font-family: var(--font-body); font-size: var(--fs-soft); color: var(--ink-on); opacity: .9; margin-left: .25em; letter-spacing: 0; }
.tile .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; background: color-mix(in srgb, var(--tint) 25%, transparent); }
.tile .bar i { display: block; height: 100%; width: var(--p); background: var(--tint); }

/* 과목 5개 이상(4열×2행): 히어로·숫자를 한 단계 줄여 한 화면(1080)에 맞춘다 — 과목명은 ≥64px 유지 */
.page[data-many] .hero { min-height: clamp(160px, 21vh, 260px); }
.page[data-many] .hero .title { font-size: clamp(26px, 2.6vw, 52px); }
.page[data-many] .tile { padding: clamp(14px, 1.3vw, 26px) clamp(16px, 1.6vw, 32px); }
.page[data-many] .tile .prog { font-size: clamp(40px, 3.6vw, 72px); }
.page[data-many] .wm { font-size: max(100px, 72cqh); }
.page[data-many] .tile .meta { margin-top: .25em; }
.page[data-many] .recent a { padding: clamp(12px, 1.1vw, 20px) clamp(16px, 1.6vw, 30px); }
.page[data-many] .recent .t { -webkit-line-clamp: 1; font-size: var(--fs-soft); }

/* L1 과목 헤더 띠(히어로 감각) + 단원 카드 */
.band { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--gap); min-height: clamp(140px, 21vh, 280px); padding: clamp(16px, 1.8vw, 34px) clamp(20px, 2.4vw, 48px); border-radius: var(--radius-lg); background: var(--c); color: var(--ink-on); margin-bottom: var(--gap); }
.band h1 { margin: 0; font-family: var(--font-title); font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -0.015em; }
.band .sum { margin: .2em 0 0; font-size: var(--fs-soft); opacity: .9; }
.band .prog { font-family: var(--font-title); font-size: var(--fs-big); line-height: .9; color: var(--tint); letter-spacing: -0.02em; white-space: nowrap; }
.band .prog small { font-family: var(--font-body); font-size: var(--fs-soft); color: var(--ink-on); opacity: .9; margin-left: .25em; letter-spacing: 0; }
.units-grid { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 21vw, 440px), 1fr)); grid-auto-rows: minmax(clamp(120px, 13vh, 260px), 1fr); }
.units-grid > li, .tiles > li, .lessons > li { min-width: 0; }
.unit { display: grid; height: 100%; min-width: 0; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; gap: 6px clamp(12px, 1.3vw, 24px); align-items: start; min-height: clamp(120px, 13vh, 260px); padding: clamp(14px, 1.4vw, 24px) clamp(16px, 1.6vw, 30px); border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); position: relative; transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 220ms var(--ease-out); }
.unit .no { grid-row: 1 / 3; font-family: var(--font-title); font-size: clamp(44px, 4.4vw, 88px); line-height: .9; color: var(--c); letter-spacing: -0.02em; }
.unit .ttl { font-family: var(--font-title); font-weight: 700; font-size: var(--fs-unit); line-height: 1.15; letter-spacing: -0.01em; grid-column: 2 / 4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.unit .sub { color: var(--soft); font-size: var(--fs-soft); align-self: end; grid-column: 2; white-space: nowrap; }
.state { grid-column: 3; grid-row: 2; align-self: end; justify-self: end; font-size: max(16px, calc(var(--fs-soft) * .85)); padding: .2em .7em; border-radius: 999px; background: #E6EAF0; color: var(--soft); font-weight: 700; }
.state-done { background: #DCEFE3; color: #1F5D3A; }
.state-ask { background: #FBE9C9; color: #7A4B00; }
.state-run { background: #DCE7F7; color: #1F4C8F; }

/* 단원 4개 이하: 카드가 커지므로 번호·단원명을 컨테이너 높이에 비례해 키운다(포스터처럼) */
.units-grid[data-few] .unit { container-type: size; align-items: center; grid-template-rows: 1fr auto; }
.units-grid[data-few] .unit .no { font-size: max(88px, 46cqh); align-self: center; }
.units-grid[data-few] .unit .ttl { font-size: max(var(--fs-unit), 12cqh); align-self: center; }
.units-grid[data-few] .unit .sub { font-size: max(var(--fs-soft), 5cqh); }
@media (max-width: 700px) { .units-grid[data-few] .unit { container-type: normal; } .units-grid[data-few] .unit .no { font-size: 56px; } .units-grid[data-few] .unit .ttl { font-size: 24px; } .units-grid[data-few] .unit .sub { font-size: 16px; } }

/* 단원 9개 이상(4열×3행): 띠·카드를 한 단계 줄여 한 화면 — 단원명 ≥48px 유지 */
.page[data-many] .band { min-height: clamp(130px, 17vh, 220px); padding: clamp(14px, 1.4vw, 26px) clamp(20px, 2.4vw, 48px); }
.page[data-many] .band h1 { font-size: clamp(34px, 3.6vw, 70px); }
.page[data-many] .unit { padding: clamp(12px, 1.1vw, 20px) clamp(14px, 1.4vw, 26px); gap: 4px clamp(10px, 1.1vw, 20px); }
.page[data-many] .unit .ttl { font-size: clamp(20px, 2.5vw, 48px); line-height: 1.12; }
.page[data-many] .unit .no { font-size: clamp(40px, 3.8vw, 74px); }

/* L2 단원 헤더 + 차시 목록 */
.lhead { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--gap); min-height: clamp(110px, 16vh, 220px); padding: clamp(16px, 1.8vw, 32px) clamp(20px, 2.4vw, 48px); border-radius: var(--radius-lg); background: var(--c); color: var(--ink-on); margin-bottom: var(--gap); }
.lhead h1 { margin: 0; font-family: var(--font-title); font-size: clamp(30px, 3.4vw, 66px); line-height: 1.05; letter-spacing: -0.015em; text-wrap: balance; }
.lhead .tag { color: inherit; opacity: .9; }
.lhead .prog { font-family: var(--font-title); font-size: var(--fs-big); line-height: .9; color: var(--tint); letter-spacing: -0.02em; white-space: nowrap; }
.lhead .prog small { font-family: var(--font-body); font-size: var(--fs-soft); color: var(--ink-on); opacity: .9; margin-left: .25em; letter-spacing: 0; }
.lessons { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: clamp(8px, .6vw, 12px); grid-auto-rows: minmax(56px, 1fr); }
@media (min-width: 1400px) { .lessons.two { grid-template-columns: 1fr 1fr; column-gap: var(--gap); grid-auto-flow: row dense; } .lessons.two .row .ttl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.page[data-many] .lhead { min-height: clamp(100px, 12vh, 160px); padding: clamp(12px, 1.2vw, 22px) clamp(20px, 2.4vw, 48px); }
.page[data-many] .lhead h1 { font-size: clamp(28px, 2.8vw, 54px); }
.page[data-many] .lessons { gap: 8px; }
.page[data-many] .row { padding: 6px clamp(14px, 1.4vw, 26px); }
.row { display: grid; height: 100%; grid-template-columns: auto 1fr auto auto; align-items: center; gap: clamp(10px, 1.4vw, 26px); min-height: 56px; padding: 8px clamp(14px, 1.4vw, 26px); border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out); }
.row .no { font-family: var(--font-title); font-size: calc(var(--fs-row) * 1.15); color: var(--c); min-width: 3.2em; letter-spacing: -0.01em; }
.row .ttl { font-size: var(--fs-row); line-height: 1.25; }
.row .st { font-size: max(16px, calc(var(--fs-soft) * .85)); color: var(--soft); white-space: nowrap; }
.row .open { font-weight: 700; font-size: var(--fs-soft); color: var(--accent); display: inline-flex; align-items: center; gap: .25em; white-space: nowrap; }
.row.off { cursor: default; background: transparent; border-style: dashed; color: var(--soft); }
.row.off .no { color: var(--soft); }
.row.off .open { color: var(--soft); font-weight: 400; }
.unit-nav { display: flex; justify-content: space-between; gap: var(--gap); margin-top: var(--gap); }
.unit-nav a, .btn { display: inline-flex; align-items: center; gap: .4em; min-height: 52px; padding: .4em 1.1em; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: var(--fs-soft); font-weight: 700; transition: transform 120ms var(--ease-out), box-shadow 220ms var(--ease-out); }
.unit-nav a:active, .btn:active, .hero .open:active { transform: scale(.97); }
.unit-nav .next { margin-left: auto; }
.empty { color: var(--soft); }
footer { margin-top: calc(var(--gap) * .75); color: var(--soft); font-size: max(16px, calc(var(--fs-soft) * .9)); }

/* 호버(정밀 포인터만) — 떠오름 + 과목색 번짐(오프셋+블러 그림자를 과목색으로 틴트) */
@media (hover: hover) and (pointer: fine) {
  .tile:hover, .hero:hover, .recent a:hover { transform: translateY(-6px) scale(1.012); box-shadow: 0 2px 0 rgba(27,36,48,.04), 0 24px 48px -16px color-mix(in srgb, var(--c) 55%, transparent); }
  .tile:hover .wm, .hero:hover .wm, .recent a:hover .wm { transform: translate(-4%, -4%) rotate(-4deg); }
  .unit:hover, .row:not(.off):hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); box-shadow: 0 2px 0 rgba(27,36,48,.04), 0 20px 40px -16px color-mix(in srgb, var(--c) 40%, transparent); }
  .unit-nav a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
}

/* 진입 1회 스태거 — backwards 로 사전 점멸 0. 등장 = opacity + translate + scale + blur */
@keyframes hub-in { from { opacity: 0; transform: translateY(28px) scale(.96); filter: blur(8px); } }
.in { animation: hub-in 560ms var(--ease-out) backwards; animation-delay: calc(min(var(--i, 0), 12) * 45ms); }
.in-late { animation-delay: calc(90ms + min(var(--i, 0), 12) * 45ms); }

/* 폰 */
@media (max-width: 700px) {
  .page { min-height: 0; }
  .top { flex-direction: column; align-items: stretch; }
  .top > .tag.num { display: none; }
  .hero-row { grid-template-columns: 1fr; }
  .hero { min-height: 220px; }
  .hero .title { font-size: 30px; }
  .recent { grid-auto-rows: auto; }
  .recent a { min-height: 96px; }
  .tiles { grid-template-columns: 1fr; grid-auto-rows: auto; flex: none; }
  .tile { min-height: 150px; height: auto; flex-direction: row; align-items: center; gap: 14px; }
  .tile .name { margin: 0; font-size: 30px; flex: 1; }
  .tile .meta { margin: 0; flex-direction: column; align-items: flex-end; gap: 0; }
  .tile .prog { font-size: 44px; }
  .wm { font-size: 110px; }
  .band, .lhead { min-height: 0; flex-direction: column; align-items: flex-start; }
  .band .prog, .lhead .prog { font-size: 44px; }
  .units-grid { grid-template-columns: 1fr; grid-auto-rows: auto; flex: none; }
  .unit { min-height: 0; height: auto; }
  .unit .ttl { font-size: 24px; }
  .lessons { grid-auto-rows: auto; flex: none; }
  .row { height: auto; grid-template-columns: auto 1fr; grid-template-rows: auto auto; row-gap: 2px; }
  .row .st { grid-column: 2; }
  .row .open { grid-column: 1 / 3; justify-self: end; }
}

/* 로그인 — 같은 히어로 감각: 과목색 타일 조각이 배경에 흩어짐, 폼은 그대로 */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--pad); position: relative; overflow: clip; }
html:has(> body.login) { overflow-x: hidden; }
.login .shard { position: absolute; z-index: 0; opacity: .9; border-radius: var(--radius-lg); background: var(--c); width: var(--w); aspect-ratio: var(--ar, 1.3); pointer-events: none; }
.login form { position: relative; z-index: 1; width: min(100%, 480px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 44px); box-shadow: 0 2px 0 rgba(27,36,48,.04), 0 30px 60px -24px rgba(27,36,48,.35); }
.login h1 { margin: 0 0 .8em; font-family: var(--font-title); font-size: clamp(30px, 2.6vw, 44px); display: flex; align-items: center; gap: .35em; }
.login h1 .icon { color: var(--accent); }
.login label { display: block; font-size: var(--fs-soft); color: var(--soft); margin-bottom: .35em; }
.login input { width: 100%; font: inherit; font-size: var(--fs-body); padding: .5em .7em; border-radius: var(--radius); border: 1px solid #9AA5B4; background: var(--bg); color: var(--ink); }
.login input:focus { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.login .err { margin: .5em 0 0; min-height: 1.4em; color: var(--warn); font-size: var(--fs-soft); opacity: 0; transition: opacity 180ms var(--ease-out); }
.login .err.on { opacity: 1; }
.login button { margin-top: 1em; width: 100%; font: inherit; font-size: var(--fs-body); font-weight: 700; padding: .55em; border: 0; border-radius: 999px; background: var(--accent); color: #fff; cursor: pointer; transition: transform 120ms var(--ease-out); }
.login button:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
  .in { animation: hub-fade 200ms ease backwards; }
  @keyframes hub-fade { from { opacity: 0; } }
  .hero::after { animation: none; }
  .tile, .hero, .recent a, .unit, .row, .unit-nav a, .btn, .login button, .wm { transition: box-shadow 220ms ease, border-color 220ms ease; }
  .tile:hover, .hero:hover, .recent a:hover, .unit:hover, .row:hover { transform: none; }
  .tile:hover .wm, .hero:hover .wm, .recent a:hover .wm { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(hub-card) { animation: none; }
}
