/* ==============================
   common variables / base
============================== */

:root {
  --primary: #191970;
  --primary-dark: #10104f;
  --primary-light: #e6f7ff;
  --accent: #00a1e9;
  --accent-light: #7ddcff;
  --red: #e74c3c;

  --bg: #f4f9ff;
  --text: #111827;
  --muted: #5b6472;

  --card: rgba(255, 255, 255, 0.86);
  --border: rgba(255, 255, 255, 0.78);
  --line: rgba(25, 25, 112, 0.12);
  --shadow: 0 18px 50px rgba(25, 25, 112, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background:
    radial-gradient(circle at 8% 4%, rgba(0, 161, 233, 0.26), transparent 34%),
    radial-gradient(circle at 100% 18%, rgba(25, 25, 112, 0.18), transparent 36%),
    radial-gradient(circle at 45% 100%, rgba(0, 161, 233, 0.16), transparent 38%),
    linear-gradient(135deg, #f8fcff 0%, #eef7ff 48%, #e8f4ff 100%);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page {
  min-height: calc(100vh - 74px);
  overflow: hidden;
  position: relative;
}

/* ==============================
   common header
============================== */

.nav {
  width: min(100% - 28px, 1120px);
  margin: 0 auto;
  padding: 16px 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.nav-link:hover {
  background: rgba(0, 161, 233, 0.12);
}

/* ==============================
   common buttons
============================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  transition: 0.2s ease;
  border: none;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 14px 32px rgba(0, 161, 233, 0.26);
}

.btn-secondary {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(25, 25, 112, 0.12);
}

.btn-x {
  color: white;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.btn-x:hover {
  background: #1a1a1a;
}

.btn-youtube {
  color: white;
  background: linear-gradient(135deg, #ff0033, #cc0000);
  box-shadow: 0 14px 32px rgba(255, 0, 51, 0.22);
}

/* ==============================
   common cards / status
============================== */

.hidden {
  display: none !important;
}

.status-card,
.error-card,
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.error-card {
  color: var(--primary-dark);
  text-align: center;
  font-weight: 800;
}

/* ==============================
   common footer
============================== */

.footer {
  width: min(100% - 28px, 1120px);
  margin: 0 auto;
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: rgba(17, 24, 39, 0.52);
  font-size: 0.78rem;
  font-weight: 700;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--primary);
}

@media (max-width: 640px) {
  .nav {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    gap: 8px;
    padding: 12px 0 6px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .logo-img {
    height: 34px;
  }

  .nav-links {
    width: auto;
    flex: 0 1 auto;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: nowrap;
  }

  .nav-link {
    min-height: 30px;
    padding: 0 7px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
}

/* ==============================
   404 page
============================== */

.not-found {
  width: min(100% - 28px, 760px);
  margin: 0 auto;
  padding: 60px 0;
  position: relative;
  z-index: 2;
}

.not-found-card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 34px 22px;
  text-align: center;
  backdrop-filter: blur(18px);
}

.not-found-code {
  margin: 0 0 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(3.4rem, 18vw, 6rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.not-found h1 {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  line-height: 1.3;
  font-weight: 900;
}

.not-found p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.8;
  font-weight: 500;
}

.not-found-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 430px) {
  .not-found {
    padding: 42px 0;
  }

  .not-found-card {
    padding: 28px 16px;
  }

  .not-found-actions {
    flex-direction: column;
  }
}

.youtube-section {
  margin-top: 56px;
}

.section-header {
  margin-bottom: 20px;
}

.section-kicker {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #2b6f8f;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: 0.04em;
}

.youtube-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.youtube-card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(20, 55, 75, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 14px 36px rgba(15, 45, 65, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.youtube-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(15, 45, 65, 0.14);
}

.youtube-thumb-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e6f2f7;
}

.youtube-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.youtube-card-body {
  padding: 14px 16px 16px;
}

.youtube-date {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: #6a7f89;
}

.youtube-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.youtube-loading {
  grid-column: 1 / -1;
  margin: 0;
  color: #6a7f89;
}

@media (max-width: 800px) {
  .youtube-grid {
    grid-template-columns: 1fr;
  }
}
