/* Direction-specific layouts: login and home differ per direction (D-28); the rest differs by tokens and small touches. */

.login { min-height: 100vh; display: grid; }
.login .mark svg { color: var(--text); width: auto; display: block; }
.login .word { font-size: clamp(48px, 9vw, 88px); letter-spacing: .08em; margin: 6px 0 4px; }
.login-text { font-size: 19px; max-width: 30ch; }
.login-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.login-form input { flex: 1 1 220px; font: inherit; font-size: 17px; padding: 11px 14px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }

/* v1: split page — hall photo left, paper page right */
.login-v1 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.login-v1-photo { position: relative; min-height: 320px; }
.login-v1-photo .ph { position: absolute; inset: 0; }
.login-v1-photo .caption { position: absolute; left: 16px; bottom: 12px; margin: 0; color: #f4f1e8; font-size: 14px; font-style: italic; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.login-v1-page { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(20px, 5vw, 72px); background: var(--surface); border-left: 1px solid var(--line); }
.login-v1-page .mark svg { height: 120px; }
.login-v1-page hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 18px 0; }
@media (max-width: 760px) { .login-v1 { grid-template-columns: 1fr; grid-template-rows: 260px auto; } .login-v1-page { border-left: 0; padding: 28px 16px; } .login-v1-page .mark svg { height: 80px; } }

/* v2: full-screen dark photo, form bottom-left */
.login-v2 { position: relative; align-items: end; background: #0b0d10; }
.login-v2 .bgphoto { position: absolute; inset: 0; }
.login-v2::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
.login-v2-body { position: relative; z-index: 1; padding: 40px clamp(16px, 6vw, 80px) 64px; max-width: 640px; color: var(--hero-text); }
.login-v2-body .mark svg { height: 90px; color: var(--hero-text); }
.login-v2-body .word { color: var(--hero-text); font-size: clamp(64px, 14vw, 140px); line-height: .9; }
.login-v2 .login-sub { font-family: var(--font-label); letter-spacing: .2em; text-transform: uppercase; font-size: 13px; opacity: .8; }
.login-v2 .login-text { color: var(--hero-text); }
.login-v2 .login-form input { background: rgba(0,0,0,.45); color: #fff; border-color: rgba(255,255,255,.4); }
.login-v2 .btn-primary { background: #eef1f5; color: #0b0d10; border-color: #eef1f5; }
.login-v2 .mocknote { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.3); }

/* v3: museum — framed exhibit and a label */
.login-v3 { align-items: center; justify-items: center; padding: 32px 16px; }
.login-v3-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(20px, 5vw, 64px); align-items: center; max-width: 1100px; width: 100%; }
.login-v3-label { padding: 28px; background: var(--surface); border: 1px solid var(--line); }
.login-v3-label .mark svg { height: 70px; }
.login-v3 .word { font-size: clamp(44px, 7vw, 72px); }
@media (max-width: 760px) { .login-v3-body { grid-template-columns: 1fr; } }

/* museum frames (v3 everywhere they appear) */
.frame { margin: 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.frame .ph { aspect-ratio: 4 / 3; height: auto; }
.frame figcaption { padding-top: 12px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.frame-blank { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--surface-2); }

/* home heroes */
.bleed { margin-inline: calc(50% - 50vw); }
main.wrap > .bleed:first-child { margin-top: -28px; }
.hero { position: relative; overflow: hidden; color: var(--hero-text); }
.hero .ph { position: absolute; inset: 0; }
.hero::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
.hero-body { position: relative; z-index: 1; max-width: 1180px; margin-inline: auto; padding: 96px 16px 36px; }
@media (min-width: 720px) { .hero-body { padding-inline: 28px; } }
.hero h1, .hero .label { color: var(--hero-text); }
.hero h1 a { color: inherit; text-decoration: none; }
.hero-v1 .hero-body p { max-width: 48ch; font-size: 18px; }
.hero-v2 .hero-body { padding-top: 150px; padding-bottom: 48px; }
.hero-v2 h1 { font-size: clamp(44px, 9vw, 96px); line-height: .95; margin-bottom: 12px; }
.hero-meta { font-size: 18px; }
.hero-next { font-size: 15px; opacity: .9; }
.hero-next a { color: inherit; }

/* v1 home: chronicle entries with dates in the margin */
.chronicle { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 48px; }
@media (min-width: 900px) { .chronicle { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.entries { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--text); }
.entries li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.entries .margin { font-family: var(--font-label); font-style: italic; color: var(--seal); font-size: 15px; }
.entries a { color: var(--text); }

/* v2 home: tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); }
.tile { display: grid; grid-template-rows: 150px auto; background: var(--surface); color: var(--text); text-decoration: none; overflow: hidden; }
.tile-blank { display: flex; align-items: center; justify-content: center; background: var(--surface-2); }
.tile-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 4px; }

/* v3 home: hall title, labels, gallery */
.hall-v3 { display: grid; gap: 22px; margin-bottom: 12px; }
.hall-title h1 { max-width: 20ch; }
.frame-wide .ph { aspect-ratio: 21 / 9; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.museum-label { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.museum-label strong { font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; }
.gallery-item { color: var(--text); text-decoration: none; }

/* direction touches on shared screens */
[data-ktf-dir="v1"] header.site { border-bottom: 3px double var(--line); }
[data-ktf-dir="v1"] .pagehead h1 { border-bottom: 1px solid var(--text); padding-bottom: 6px; }
[data-ktf-dir="v1"] .album, [data-ktf-dir="v1"] .inbox-item { box-shadow: var(--shadow); }
[data-ktf-dir="v2"] header.site { background: var(--bg); }
[data-ktf-dir="v2"] .album { border: 0; background: var(--surface); }
[data-ktf-dir="v2"] .album-text strong, [data-ktf-dir="v2"] .pnick { font-weight: 500; }
[data-ktf-dir="v2"] .memory { background: #000; color: #eef1f5; margin-inline: calc(50% - 50vw); padding: 40px max(16px, calc(50vw - 562px)); margin-top: -28px; }
[data-ktf-dir="v2"] .memory h1, [data-ktf-dir="v2"] .memory h2 a { color: #eef1f5; }
[data-ktf-dir="v2"] .memory .memitem { border-color: #2a2f37; }
[data-ktf-dir="v2"] .memory .muted, [data-ktf-dir="v2"] .memory .memyears, [data-ktf-dir="v2"] .memory .memteams, [data-ktf-dir="v2"] .memory .pname { color: #949dab; }
[data-ktf-dir="v2"] .memory .ribbon path:first-child { stroke: #6b7380; }
[data-ktf-dir="v3"] .album, [data-ktf-dir="v3"] .pcard .portrait { padding: 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
[data-ktf-dir="v3"] .pcard .portrait { aspect-ratio: auto; }
[data-ktf-dir="v3"] .pcard .portrait .ph { aspect-ratio: 3 / 4; height: auto; }
[data-ktf-dir="v3"] .pcard .portrait-crest { aspect-ratio: auto; min-height: 160px; }
[data-ktf-dir="v3"] .memitem .portrait { padding: 8px; background: var(--surface); border: 1px solid var(--line); }
