﻿@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700&display=swap');

:root {
  --green: #0b8e36;
  --brown: #a75319;
  --blue: #263489;
  --dark: #0b0b0b;
  --light: #f7f7f2;
  --edge: 20px;
  --band-height: 80px;
  --band-logo-size: 168px;
  --nav-logo-size: 68px;
  --band-center-y: calc(var(--edge) + (var(--band-logo-size) / 2));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Baloo 2", system-ui, sans-serif;
  background: var(--blue);
  color: var(--light);
  padding-top: calc(var(--band-center-y) + (var(--band-height) / 2) + 24px);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--light);
}

.brand img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 6px 12px rgba(0,0,0,0.35);
}

.brand span {
  font-size: 22px;
  letter-spacing: 0.04em;
}

.nav-band {
  background: #ffffff;
  height: calc(var(--band-center-y) + (var(--band-height) / 2));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 3;
  overflow: visible;
}

.nav-logo {
  position: static;
  width: 112px;
  height: 112px;
  margin-left: 3rem;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  flex: 0 0 auto;
}

.nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
  border-radius: 0;
}

.nav-logo:hover {
  transform: none;
}

.nav {
  display: flex;
  justify-content: space-between;
  gap: 0;
  padding: 0 24px;
  width: 100%;
  height: 100%;
  margin-top: 0;
  align-items: center;
}

.nav a {
  display: flex;
  align-items: center;
  color: var(--blue);
  text-decoration: none;
  font-size: clamp(18px, 2.8vw, 28px);
  letter-spacing: 0.04em;
  padding: 0;
  border-radius: 0;
  border: none;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
  flex: 0 0 auto;
  text-align: left;
  line-height: 1;
}

.nav a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

.nav a.active {
  color: var(--green);
}

.nav a:first-child {
  margin-left: 0;
}

.nav .nav-logo:first-child {
  margin-left: 3rem;
}

.nav a:last-child {
  margin-right: 5rem;
}

.page {
  width: min(1100px, 92vw);
  margin: 0 auto 60px;
  display: grid;
  gap: 20px;
}

.player {
  display: grid;
  place-items: center;
}

.video-frame {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
  padding: 12px;
  width: min(1008px, 90vw);
}

.video-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.video-frame video {
  width: 100%;
  height: min(504px, 49vh);
  object-fit: cover;
  border-radius: 12px;
  background: #000;
}

.video-caption {
  margin-top: 6px;
  font-size: 13px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  color: var(--brown);
}

.panel {
  background: rgba(11, 11, 11, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 16px;
}

.status {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.85);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.video-card {
  background: var(--green);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.video-card video {
  width: 100%;
  border-radius: 10px;
  background: #000;
}

.video-card img {
  width: 100%;
  border-radius: 10px;
  display: block;
  background: #000;
}

.video-title {
  font-weight: 700;
}

.video-link {
  color: var(--light);
  text-decoration: none;
  font-size: 14px;
}

.note {
  background: rgba(11, 11, 11, 0.35);
  border-radius: 18px;
  padding: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

pre {
  background: rgba(0,0,0,0.4);
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
  margin: 10px 0 0;
  color: var(--light);
}

code {
  color: var(--light);
}

@media (max-width: 860px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
  }

  .page {
    width: min(96vw, 520px);
  }

  .video-frame {
    width: clamp(240px, 88vw, 425px);
    max-width: 100%;
    padding: 8px;
    margin: 0 auto;
  }

  .video-frame::before {
    inset: 6px;
  }

  .video-frame video {
    height: auto;
    max-height: 32vh;
    aspect-ratio: 16 / 9;
    object-fit: contain;
  }

  .nav-band {
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 8px;
    width: 100%;
    height: auto;
  }

  .nav a {
    font-size: clamp(12px, 3vw, 15px);
    line-height: 1.1;
    padding: 8px 4px;
    text-align: center;
    white-space: nowrap;
  }

  .nav a:first-child,
  .nav a:last-child {
    margin-left: 0;
    margin-right: 0;
  }

  .nav-logo {
    margin-left: 0;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  body {
    padding-top: 86px;
    overflow-x: hidden;
  }

  .nav-band {
    left: 8px;
    right: 8px;
    top: max(8px, env(safe-area-inset-top));
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 6px 8px;
  }

  .nav a {
    font-size: 11px;
    letter-spacing: 0.01em;
    padding: 6px 4px;
  }

  .page {
    width: calc(100vw - 12px);
    max-width: 980px;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }

  .player {
    grid-column: auto;
  }

  .video-frame {
    width: min(94vw, 760px);
    max-width: 100%;
    padding: 8px;
  }

  .video-frame video {
    max-height: 38vh;
    aspect-ratio: 16 / 9;
    object-fit: contain;
  }

  .hero {
    grid-column: auto;
  }

  .panel {
    grid-column: auto;
    max-width: 100%;
  }

  .note {
    grid-column: auto;
    grid-row: auto;
    max-width: 100%;
    max-height: none;
    overflow: auto;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 740px) and (max-height: 420px) and (orientation: landscape) {
  body {
    padding-top: 74px;
  }

  .nav-band {
    left: 6px;
    right: 6px;
    top: max(6px, env(safe-area-inset-top));
  }

  .nav {
    gap: 6px;
    padding: 5px 6px;
  }

  .nav a {
    font-size: 10px;
    padding: 5px 3px;
  }

  .page {
    width: calc(100vw - 10px);
    gap: 8px;
  }

  .video-frame {
    width: min(92vw, 620px);
    padding: 6px;
  }

  .video-frame::before {
    inset: 5px;
  }

  .video-frame video {
    max-height: 34vh;
  }
}
