/* Kat Kerr Videos: the Window Wall. Tokens and the idea: docs/DESIGN.md. State classes on <html>: is-showing, is-playing, mode-yt/mode-file, is-filtered. */
:root {
  --pearl: #FBF7EC; --cream: #F2E9D2; --sky: #DCEBF6;
  --ink: #17213D; --ink-soft: #3A4566;
  --gold-deep: #5F4305; --gold: #C99A1E; --gold-hi: #F4DC8A; --rose: #8A2156; --night: #0E1530;
  --goldgrad: linear-gradient(135deg, #F7E5A0 0%, #D9AC2E 26%, #9C7314 52%, #E8C55A 76%, #B8891B 100%);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --cap: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; position: relative; background: var(--pearl); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--gold-deep); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--gold-hi); }
[hidden] { display: none !important; }

/* ---- the bar: Global Menu key, wordmark, Share ---- */
.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 58px; padding: .35rem clamp(.5rem, 2vw, 1.4rem); background: var(--pearl); border-bottom: 3px solid var(--gold); box-shadow: 0 6px 18px -10px rgba(23, 33, 61, .5); }
.key { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .2rem .95rem; font: 700 .95rem/1 var(--sans); color: var(--ink); background: var(--pearl); border: 2px solid var(--gold-deep); border-radius: 999px; cursor: pointer; }
.key:hover { background: var(--gold-hi); }
.key .glyph { letter-spacing: .05em; }
.mark { flex: 1; margin: 0; text-align: center; font-weight: 400; min-width: 0; }
.mark-vis { display: inline-flex; align-items: baseline; justify-content: center; gap: .15rem .7rem; flex-wrap: wrap; }
.kk { font: 700 .74rem/1 var(--cap); letter-spacing: .2em; text-transform: uppercase; color: var(--rose); }
.rv { font: 700 clamp(1.15rem, 3vw, 1.85rem)/1.05 var(--cap); color: var(--gold-deep); text-shadow: 0 1px 0 #fff8dc; white-space: nowrap; }
.tk { display: inline-block; min-width: 5.3ch; text-align: left; transition: opacity .35s; }
.tk.fade { opacity: 0; }
.tk[lang="ko"] { font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif; font-weight: 700; }

/* ---- the sky behind the stage ---- */
.sky { position: absolute; inset: 0 0 auto 0; height: min(104svh, 940px); background: var(--sky) url(sky.jpg) center top / cover no-repeat; z-index: 0; pointer-events: none; overflow: hidden; }
.sky::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(251, 247, 236, 0) 52%, var(--pearl) 100%); }
.sky .glow { position: absolute; left: 50%; top: 40%; width: min(140vw, 1600px); aspect-ratio: 1; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(255, 236, 170, .9), rgba(255, 236, 170, 0) 70%); opacity: .3; transition: opacity .7s; }
.is-showing .sky .glow { opacity: .6; }
.is-playing .sky .glow { opacity: .85; }
main { position: relative; z-index: 1; }

/* ---- the Great Window: the stage ---- */
.stage { --sw: min(94vw, calc((100svh - 205px) * 16 / 9), 1100px); display: flex; flex-direction: column; align-items: center; padding: 1.1rem 0 2rem; }
.crest { position: relative; width: calc(var(--sw) * .36); height: 24px; background: var(--goldgrad); border-radius: 300px 300px 0 0 / 24px 24px 0 0; box-shadow: 0 0 0 2px #6E4F06; }
.crest i { position: absolute; left: 50%; top: -9px; width: 17px; height: 17px; transform: translateX(-50%) rotate(45deg); background: var(--goldgrad); border: 2px solid #6E4F06; }
.frame { width: var(--sw); padding: clamp(7px, 1.2vw, 15px); background: var(--goldgrad); border-radius: 10px 10px 3px 3px; box-shadow: 0 0 0 2px #6E4F06, inset 0 0 0 2px rgba(255, 248, 220, .75), 0 22px 54px -14px rgba(23, 33, 61, .6); }
.screen { position: relative; aspect-ratio: 16 / 9; background: var(--night); outline: 3px solid #5a4106; overflow: hidden; }
.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bigplay { position: absolute; left: 50%; top: 50%; width: clamp(64px, 9vw, 96px); aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: rgba(251, 247, 236, .94); border: 4px solid var(--gold-deep); box-shadow: 0 0 0 6px rgba(244, 220, 138, .55), 0 10px 30px rgba(0, 0, 0, .45); transition: transform .2s; }
.bigplay:hover { transform: translate(-50%, -50%) scale(1.07); }
.tri { width: 0; height: 0; margin-left: 8%; border-style: solid; border-width: clamp(13px, 2vw, 20px) 0 clamp(13px, 2vw, 20px) clamp(22px, 3.3vw, 34px); border-color: transparent transparent transparent var(--ink); }
.is-playing .poster, .is-playing .bigplay { display: none; }
.player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.ledge { width: calc(var(--sw) + 30px); max-width: 100vw; height: 13px; background: var(--goldgrad); border-radius: 3px; box-shadow: 0 0 0 2px #6E4F06, 0 8px 16px -6px rgba(23, 33, 61, .55); }

.nowbox { width: var(--sw); margin-top: 1rem; padding: .7rem clamp(.7rem, 1.6vw, 1.2rem); background: rgba(251, 247, 236, .9); border: 2px solid rgba(110, 79, 6, .35); border-radius: 12px; display: grid; gap: .6rem 1.4rem; grid-template-columns: 1fr; }
.kick { margin: 0; font: 700 .76rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--rose); }
.nowbox h2 { margin: .1rem 0 .1rem; font: italic 600 clamp(1.3rem, 2.6vw, 1.85rem)/1.12 var(--serif); }
.meta { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.ways { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: .35rem 1.05rem; font: 700 .92rem/1.1 var(--sans); color: var(--ink); text-decoration: none; background: var(--pearl); border: 2px solid var(--gold-deep); border-radius: 999px; cursor: pointer; }
.btn:hover { background: var(--gold-hi); }
.btn.quiet { border-style: dashed; font-weight: 400; }

/* ---- the wall ---- */
.wall { max-width: 1260px; margin: 0 auto; padding: 1.5rem clamp(.8rem, 3vw, 2.4rem) 2rem; }
.wall-head h2 { margin: 0 0 .5rem; font: 700 clamp(1.5rem, 3.2vw, 2.3rem)/1.1 var(--cap); color: var(--gold-deep); }
.lede { text-align: justify; hyphens: auto; -webkit-hyphens: auto; max-width: 62ch; margin: 0; font: 500 1.32rem/1.4 var(--serif); }
.tools { display: none; }
.js .tools { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.1rem; margin: 1.2rem 0 .3rem; }
.find { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.find input { min-height: 44px; width: min(22rem, 78vw); padding: .3rem 1rem; font: 400 1rem var(--sans); color: var(--ink); background: #fff; border: 2px solid var(--gold-deep); border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { min-height: 44px; padding: .3rem 1rem; font: 700 .92rem/1 var(--sans); color: var(--ink); background: var(--pearl); border: 2px solid var(--gold-deep); border-radius: 999px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--gold-deep); color: #fff; }
.count { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.none { margin: 1.5rem 0; font: italic 600 1.3rem var(--serif); }

.row { padding: 1.5rem 0 .6rem; border-top: 1px solid rgba(110, 79, 6, .28); }
.yr { margin: 0 0 1rem; display: flex; align-items: baseline; gap: .9rem; }
.yr .num { font: 700 clamp(1.15rem, 2.2vw, 1.65rem)/1.1 var(--cap); color: var(--gold-deep); }
.yr .cnt { font: 400 .88rem var(--sans); color: var(--ink-soft); }
.windows { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.5rem 1.2rem; }
.win { width: 152px; }
.w { --k: 1; display: grid; grid-template-rows: calc(var(--maxh) * 1px * var(--k)) 13px auto auto auto; color: var(--ink); text-decoration: none; height: 100%; }
.pane { display: block; align-self: end; height: calc(var(--h) * 1px * var(--k)); padding: 5px; background: var(--goldgrad); border-radius: 73px 73px 3px 3px; box-shadow: 0 0 0 1.5px #6E4F06, 0 10px 20px -10px rgba(23, 33, 61, .55); transition: box-shadow .25s; }
.glass { position: relative; display: block; height: 100%; overflow: hidden; border-radius: 68px 68px 1px 1px; background: var(--night); }
.glass img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter .25s; }
.glass::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(244, 220, 138, .6) calc(50% - 1px), rgba(244, 220, 138, .6) calc(50% + 1px), transparent calc(50% + 1px)),
              linear-gradient(180deg, transparent calc(34% - 1px), rgba(244, 220, 138, .6) calc(34% - 1px), rgba(244, 220, 138, .6) calc(34% + 1px), transparent calc(34% + 1px)); }
.glass::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: linear-gradient(180deg, rgba(255, 252, 240, .62), rgba(255, 255, 255, .3)); transition: opacity .25s; }
.js .win:not(.seen):not(.now) .glass::after { opacity: 1; }
.js .win:not(.seen):not(.now) .glass img { filter: saturate(.62) brightness(1.1); }
.js .win:not(.seen) .w:hover .glass::after, .js .win:not(.seen) .w:focus-visible .glass::after { opacity: 0; }
.js .win:not(.seen) .w:hover .glass img, .js .win:not(.seen) .w:focus-visible .glass img { filter: none; }
.w:hover .pane, .w:focus-visible .pane { box-shadow: 0 0 0 1.5px #6E4F06, 0 0 0 5px var(--gold-hi), 0 14px 26px -10px rgba(23, 33, 61, .6); }
.w:focus-visible { outline-offset: 6px; }
.sill { display: block; align-self: start; height: 11px; margin: 2px -5px 0; background: var(--goldgrad); border-radius: 2px; box-shadow: 0 0 0 1.5px #6E4F06, 0 5px 8px -4px rgba(23, 33, 61, .55); }
.t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; margin-top: .6rem; font: italic 600 1.2rem/1.14 var(--serif); }
.m { display: block; margin-top: .3rem; font: 400 .85rem/1.3 var(--sans); color: var(--ink-soft); }
.op { display: none; margin-top: .2rem; font: 700 .72rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--rose); }
.seen .op { display: block; }
.win.now .op { display: block; font-size: 0; }
.win.now .op::after { content: "Now showing"; font-size: .72rem; }
.win.now .pane { box-shadow: 0 0 0 1.5px #6E4F06, 0 0 0 4px var(--pearl), 0 0 0 7px var(--rose), 0 0 34px 10px rgba(244, 220, 138, .95); }

/* ---- the book ---- */
.book { padding: 2.6rem clamp(.8rem, 3vw, 2.4rem) 3.2rem; background: linear-gradient(180deg, var(--pearl), var(--cream) 30%); }
.kat { max-width: 960px; margin: 0 auto 2.2rem; }
.kat img { display: block; width: 100%; border: 4px solid var(--gold); border-radius: 14px; box-shadow: 0 12px 30px -14px rgba(23, 33, 61, .6); }
.book-in { display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: 1.8rem 2.4rem; max-width: 1000px; margin: 0 auto; align-items: start; }
.cover { margin: 0; }
.cover img { display: block; mix-blend-mode: multiply; }
.book-text h2 { margin: 0; font: 700 clamp(1.4rem, 3vw, 2.1rem)/1.15 var(--cap); color: var(--gold-deep); }
.book-text .by { display: block; margin-top: .3rem; font: italic 600 1.35rem var(--serif); color: var(--ink); }
.book-text .lead { margin: 1rem 0 .8rem; font: italic 600 clamp(1.6rem, 3.2vw, 2.4rem)/1.12 var(--serif); color: var(--rose); }
.book-text p { max-width: 64ch; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.book-text .official, .book-text .cred { text-align: left; hyphens: manual; }
.book-text .cred { margin-top: -.4rem; font-size: .92rem; color: var(--ink-soft); }
.book-text .official { padding: .8rem 1rem; background: #fff; border-left: 5px solid var(--gold); border-radius: 4px; }
.files { max-width: 1000px; margin: 2.2rem auto 0; }
.files h3 { margin: 0 0 .7rem; font: 700 1.05rem var(--cap); color: var(--gold-deep); }
.files ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.files a { display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; padding: .45rem 1.1rem; color: var(--ink); text-decoration: none; background: var(--pearl); border: 2px solid var(--gold-deep); border-radius: 14px; font-weight: 700; }
.files a:hover { background: var(--gold-hi); }
.files a span { font-weight: 400; font-size: .85rem; color: var(--ink-soft); }

/* ---- the foot: the meadow ---- */
.foot { position: relative; min-height: 330px; display: flex; align-items: flex-end; justify-content: center; background: var(--cream) url(meadow.jpg) center bottom / cover no-repeat; }
.foot::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--cream), rgba(242, 233, 210, 0) 42%); }
.foot-in { position: relative; margin: 0 clamp(.6rem, 3vw, 2rem) 1.8rem; padding: .9rem 1.4rem; text-align: center; background: rgba(251, 247, 236, .95); border: 2px solid var(--gold); border-radius: 14px; }
.foot-in p { margin: .2rem 0; }
.opened { font: italic 600 1.25rem var(--serif); }
.linkbtn { min-height: 44px; padding: 0 .6rem; font: 400 1rem var(--sans); color: var(--gold-deep); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.foot-links a { display: inline-block; padding: .6rem .6rem; }

/* ---- small screens ---- */
@media (max-width: 760px) {
  .bar { position: relative; }
  .windows { gap: 1.4rem .8rem; }
  .win { width: calc(50% - .4rem); }
  .w { --k: .8; }
  .pane { border-radius: 70px 70px 3px 3px; }
  .glass { border-radius: 65px 65px 1px 1px; }
  .book-in { grid-template-columns: 1fr; }
  .cover { max-width: 200px; }
  .kk { display: none; }
  .key-menu .kl { display: none; }
  .stage { padding-bottom: 1.4rem; }
}
@media (max-width: 420px) {
  .rv { font-size: 1.05rem; }
  .bar { gap: .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
