:root {
  --navy: #012169;
  --navy-2: #0A2E8A;
  --blue: #1F69FF;
  --link: #1F4FD1;
  --ink: #0B1530;
  --muted: #4A5672;
  --soft: #C9D6F2;
  --kicker: #D5E0F7;
  --bg: #F4F6FA;
  --line: #DCE2EE;
  --chip-line: #CBD3E3;
  --tint: #EAF0FF;
  --pad: clamp(16px, 4vw, 48px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.4; }
a { color: var(--link); }
a:hover { color: var(--navy); }
button { font-family: inherit; }
img { max-width: 100%; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
svg.fill { fill: currentColor; stroke: none; }

/* Header */
.top { background: var(--navy); color: #fff; padding: 14px var(--pad) 0; position: sticky; top: 0; z-index: 20; }
.top-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.brand { display: flex; flex-direction: column; color: #fff; text-decoration: none; min-height: 44px; justify-content: center; }
.brand:hover { color: #fff; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.brand-sub { font-size: 13px; color: var(--soft); }
.search { flex: 1 1 300px; max-width: 620px; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 0 18px; height: 46px; color: var(--muted); }
.search input { border: 0; outline: none; flex: 1; min-width: 0; height: 100%; font: inherit; font-size: 15px; color: var(--ink); background: transparent; }
.logo { height: 48px; width: auto; margin-left: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.tab { min-height: 48px; padding: 0 18px; border: 0; border-bottom: 4px solid transparent; background: none; color: var(--soft); font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.tab small { font-weight: 500; font-size: 14px; color: var(--soft); }
.tab[aria-current="page"] { color: #fff; border-bottom-color: #fff; }
.tab:hover { color: #fff; }
@media (max-width: 720px) {
  .logo { height: 36px; order: -1; margin-left: 0; }
  .brand { order: 0; }
  .tab small { display: none; }
}

/* Layout */
main { min-height: 60vh; padding-bottom: 24px; outline: none; }
.loading, .notice { padding: 48px var(--pad); color: var(--muted); font-size: 16px; }
.banner { margin: 16px var(--pad) 0; padding: 12px 16px; border-radius: 12px; background: #FFF4E5; color: #5C3300; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px var(--pad) 0; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; background: #fff; color: var(--ink); border: 1px solid var(--chip-line); text-decoration: none; display: inline-flex; align-items: center; }
.chip[aria-current="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.section { padding: 28px var(--pad) 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px 16px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.01em; color: var(--navy); }
.section-head h3 { margin: 0; font-size: 19px; font-weight: 800; }
.section-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.more-title { margin: 48px var(--pad) 0; padding-top: 26px; border-top: 1px solid var(--line); font-size: 22px; font-weight: 800; }
.see-all { min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--link); font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn { min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--navy); background: #fff; color: var(--navy); font-size: 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--tint); color: var(--navy); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); color: #fff; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--chip-line); background: #fff; color: var(--navy); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex: 0 0 auto; }
.linkish { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* Hero */
.hero { margin: 24px var(--pad) 0; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; background: #fff; border-radius: 20px; padding: 24px; box-shadow: 0 1px 3px rgba(1, 33, 105, 0.1); }
.hero > .card { flex: 1 1 520px; min-width: 0; }
.hero-info { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.hero-info h1 { margin: 0; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; color: var(--navy); }
.hero-info .line { margin: 0; font-size: 18px; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 15px; font-weight: 600; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.pill { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; background: var(--blue); color: #fff; padding: 4px 10px; border-radius: 999px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 32px 24px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 20px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 256px; gap: 16px; overflow-x: auto; padding: 4px 4px 14px; scroll-snap-type: x proximity; }
.row > * { scroll-snap-align: start; }
.card { background: none; border: 0; padding: 0; margin: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 10px; min-width: 0; text-decoration: none; }
.card:hover .thumb, .card:focus-visible .thumb { outline: 3px solid var(--blue); outline-offset: 3px; }
.card:hover .ctitle { color: var(--navy); text-decoration: underline; }
.thumb { position: relative; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 16 / 9; width: 100%; padding: 14px; border-radius: 12px; color: #fff; overflow: hidden; background: var(--navy); }
.thumb img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.4)); }
.thumb > * { position: relative; z-index: 1; }
.thumb .top-line { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--kicker); }
.has-img .kicker { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.badge { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; background: #fff; color: var(--navy); }
.badge.mov { background: #FFE2C2; color: #6B3A00; }
.thumb .ttl { font-size: 17px; font-weight: 800; line-height: 1.18; }
.has-img .ttl { visibility: hidden; }
.thumb .bottom-line { display: flex; justify-content: space-between; align-items: center; }
.play { width: 32px; height: 32px; border-radius: 999px; background: #fff; color: var(--navy); display: flex; align-items: center; justify-content: center; }
.play svg { width: 14px; height: 14px; }
.size { font-size: 11px; font-weight: 600; background: rgba(0, 0, 0, 0.45); padding: 2px 7px; border-radius: 6px; }
.big .thumb { padding: 18px; border-radius: 14px; }
.big .kicker { font-size: 12px; }
.big .ttl { font-size: 24px; }
.big .play { width: 40px; height: 40px; }
.hero .thumb { padding: 32px; border-radius: 16px; }
.hero .thumb .ttl { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.05; }
.hero .play { width: 80px; height: 80px; align-self: center; }
.hero .play svg { width: 34px; height: 34px; }
.hero .sub { font-size: 20px; font-weight: 500; color: var(--kicker); }
.info { display: flex; flex-direction: column; gap: 3px; }
.ctitle { font-size: 15px; font-weight: 700; line-height: 1.3; }
.big .ctitle { font-size: 17px; }
.byline, .views { font-size: 13px; color: var(--muted); }
.big .byline, .big .views { font-size: 14px; }
.res-note { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--link); }
.res-note svg { width: 13px; height: 13px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Kit and album tiles */
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tile .label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tile h4 { margin: 0; font-size: 17px; font-weight: 800; }
.tile p { margin: 0; font-size: 14px; color: var(--muted); }
.tile .extra { font-size: 13px; font-weight: 600; color: var(--link); }
.tile .push { margin-top: auto; display: flex; gap: 8px; }
.tile .push .btn { flex: 1; }
.kit-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--tint); color: var(--link); display: flex; align-items: center; justify-content: center; }
.mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #E6EBF5; }
.mosaic img, .mosaic span { width: 100%; height: 100%; object-fit: cover; display: block; background: #D9E2F2; }

/* Watch page */
.watch { display: flex; flex-wrap: wrap; gap: 32px; padding: 20px var(--pad) 0; align-items: flex-start; }
.watch-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.player { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.speed { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.speed button { min-width: 52px; min-height: 40px; border-radius: 999px; border: 1px solid var(--chip-line); background: #fff; font-weight: 700; cursor: pointer; color: var(--ink); }
.speed button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.watch h1 { margin: 0; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; font-weight: 800; color: var(--navy); }
.series { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--link); }
.warn { margin: 0; padding: 14px 18px; border-radius: 12px; background: #FFF4E5; color: #5C3300; font-size: 15px; }
.panel { background: #fff; border-radius: 16px; padding: 18px 22px 8px; box-shadow: 0 1px 3px rgba(1, 33, 105, 0.1); }
.panel h2 { margin: 0 0 8px; font-size: 17px; font-weight: 800; }
.res { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid #E6EAF2; }
.res .doc { width: 40px; height: 40px; border-radius: 10px; background: var(--tint); color: var(--link); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.res .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.res .what b { font-size: 15px; font-weight: 600; }
.res .what span { font-size: 13px; color: var(--muted); }
.res .links { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 14px; word-break: break-all; }
.aside { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.aside h2 { margin: 0; font-size: 18px; font-weight: 800; }
.aside > p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.next { display: flex; gap: 12px; align-items: flex-start; padding: 6px; border-radius: 12px; text-decoration: none; color: inherit; }
.next:hover { background: #fff; }
.next .thumb { flex: 0 0 156px; width: 156px; padding: 9px 10px; border-radius: 10px; }
.next .thumb .ttl { font-size: 13px; }
.next .thumb .kicker { font-size: 10px; }
.next .info .ctitle { font-size: 15px; }

/* Modal (albums) */
.modal { position: fixed; inset: 0; background: rgba(5, 12, 35, 0.86); z-index: 40; display: flex; flex-direction: column; }
.modal[hidden] { display: none; }
.modal-bar { display: flex; align-items: center; gap: 12px; padding: 14px var(--pad); color: #fff; }
.modal-bar h2 { margin: 0; font-size: 20px; font-weight: 800; flex: 1; min-width: 0; }
.modal-bar .btn { border-color: #fff; }
.modal-body { flex: 1; overflow: auto; padding: 0 var(--pad) 32px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.photos button { padding: 0; border: 0; background: #1B2440; border-radius: 8px; overflow: hidden; aspect-ratio: 1; cursor: pointer; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px 24px; min-height: 0; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; background: #111; }
.viewer .icon-btn { background: rgba(255, 255, 255, 0.92); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Passcode */
.gate { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.gate form { width: 100%; max-width: 440px; background: #fff; border-radius: 20px; padding: 34px 30px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 1px 3px rgba(1, 33, 105, 0.1); }
.gate h1 { margin: 0; font-size: 26px; color: var(--navy); }
.gate p { margin: 0; color: var(--muted); }
.gate label { font-size: 14px; font-weight: 600; }
.gate input[type="password"] { height: 48px; border: 1px solid #A9B4CA; border-radius: 12px; padding: 0 14px; font: inherit; font-size: 16px; }
.gate .remember { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; color: var(--muted); }
.gate .remember input { width: 18px; height: 18px; }
.gate .err { color: #A3001B; font-weight: 600; min-height: 1.4em; }

.foot { margin-top: 48px; padding: 26px var(--pad) 34px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 14px; color: var(--muted); }
body.locked .tabs, body.locked .search { visibility: hidden; }

/* Refinements */
.mosaic { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.mosaic img:only-child { grid-column: 1 / -1; grid-row: 1 / -1; }
.next .thumb .bottom-line { display: none; }
.next .thumb { justify-content: flex-start; gap: 4px; }
.modal { background: rgba(5, 12, 35, 0.96); }
.play { flex: 0 0 auto; }
@media (max-width: 720px) {
  .top { position: static; padding-top: 10px; }
  .top-row { gap: 10px 16px; }
  .brand-sub { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chip { flex: 0 0 auto; }
  .hero { padding: 14px; gap: 18px; margin-top: 16px; }
  .hero .thumb { padding: 18px; }
  .hero .play { width: 56px; height: 56px; }
  .hero .play svg { width: 24px; height: 24px; }
  .hero .sub { display: none; }
  .section-head h2 { font-size: 24px; }
  .grid { grid-template-columns: 1fr; }
  .watch { padding-top: 12px; }
}
