@font-face {
  font-family: "Pretendard";
  src: url("./assets/fonts/pretendard/PretendardVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg-main: #f8fbff;
  --bg-soft: #edf5ff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-strong: #ffffff;
  --ink-1: #111827;
  --ink-2: #42526b;
  --line-soft: rgba(23, 42, 74, 0.14);
  --line-mid: rgba(23, 42, 74, 0.22);
  --accent: #f45b27;
  --accent-2: #0c84d9;
  --accent-soft: rgba(12, 132, 217, 0.12);
  --badge-game: #f45b27;
  --badge-story: #1d8f61;
  --badge-video: #006ad8;
  --focus: #1749b1;
  --shadow-md: 0 14px 28px rgba(16, 33, 62, 0.12);
  --shadow-sm: 0 8px 14px rgba(16, 33, 62, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink-1);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: radial-gradient(circle at 2% 10%, #d8efff 0%, transparent 45%),
    radial-gradient(circle at 90% 0%, #ffe6d4 0%, transparent 40%),
    linear-gradient(160deg, var(--bg-main), var(--bg-soft));
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.55), transparent 48%),
    radial-gradient(circle at 88% 70%, rgba(255, 255, 255, 0.45), transparent 38%);
}

.app-layout {
  position: relative;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  padding: 24px 14px;
}

.brand-block {
  display: block;
  text-decoration: none;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(130deg, #0e2138, #153b69);
  color: #f3f8ff;
}

.brand-eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 248, 255, 0.84);
}

.brand-title {
  margin: 8px 0 0;
  font-weight: 760;
  font-size: 22px;
}

.side-nav-links {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.side-nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-radius: 12px;
  text-decoration: none;
  padding: 10px 12px;
  color: var(--ink-2);
  font-weight: 600;
}

.side-nav-link:hover {
  background: var(--accent-soft);
  color: #0b3e82;
}

.side-nav-link.is-active {
  background: rgba(17, 84, 165, 0.14);
  color: #0d3f84;
}

.content-shell {
  padding: 20px 20px 28px;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.top-title {
  margin: 0;
  font-size: 24px;
  font-weight: 760;
}

.top-subtitle {
  margin: 8px 0 0;
  color: var(--ink-2);
}

.top-meta {
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(19, 94, 175, 0.14);
  color: #0c4078;
  font-size: 14px;
  font-weight: 700;
}

.home-main {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 16px;
}

.feed-panel,
.theme-rail {
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.feed-panel {
  padding: 20px;
}

.theme-rail {
  padding: 18px;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 31px);
  font-weight: 760;
  letter-spacing: -0.01em;
}

.section-head h2 {
  font-size: clamp(20px, 2vw, 26px);
}

.section-head p {
  margin: 8px 0 0;
  color: var(--ink-2);
  line-height: 1.5;
}

.chip-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 44px;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: var(--bg-card-strong);
  padding: 10px 14px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
}

.chip:hover {
  border-color: rgba(12, 132, 217, 0.38);
  color: #11498f;
}

.chip.is-active {
  border-color: transparent;
  background: linear-gradient(120deg, #0f78c6, #0f57b7);
  color: #ffffff;
}

.feed-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feed-card {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--bg-card-strong);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transform: translateY(8px);
  opacity: 0;
  animation: feed-in 220ms ease forwards;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.feed-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.feed-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.feed-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.feed-cover-image,
.feed-cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feed-cover-fallback {
  background: linear-gradient(130deg, #ddeafc, #f4f8ff);
}

.feed-cover-fallback[data-tone="space"] {
  background: radial-gradient(circle at 72% 12%, rgba(175, 213, 255, 0.7), transparent 38%),
    linear-gradient(130deg, #0c1b3a, #1c3f7b 56%, #4f75b3);
}

.feed-cover-fallback[data-tone="wave"] {
  background: radial-gradient(circle at 78% 20%, rgba(167, 235, 255, 0.58), transparent 40%),
    linear-gradient(130deg, #005f86, #1f9dc5 58%, #6ad4f3);
}

.feed-cover-fallback[data-tone="volcano"] {
  background: radial-gradient(circle at 22% 80%, rgba(255, 190, 139, 0.55), transparent 35%),
    linear-gradient(130deg, #59210f, #ae4018 56%, #fa8c3d);
}

.type-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.type-badge[data-type="game"] {
  background: var(--badge-game);
}

.type-badge[data-type="story"] {
  background: var(--badge-story);
}

.type-badge[data-type="video"] {
  background: var(--badge-video);
}

.feed-body {
  padding: 14px;
}

.feed-theme {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #205c97;
}

.feed-title {
  margin: 8px 0 0;
  font-size: 21px;
  line-height: 1.35;
}

.feed-summary {
  margin: 8px 0 0;
  color: var(--ink-2);
  line-height: 1.55;
}

.feed-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feed-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: #f5f9ff;
  color: #24466c;
  font-size: 12px;
  padding: 4px 8px;
}

.theme-jump {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-mid);
  text-decoration: none;
  color: #124b91;
  font-weight: 700;
  padding: 8px 11px;
  background: #f7fbff;
}

.theme-jump:hover {
  border-color: #2265b0;
  background: #eaf4ff;
}

.theme-rail-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.theme-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--bg-card-strong);
  padding: 12px;
}

.theme-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1b5893;
}

.theme-title {
  margin: 8px 0 0;
  font-size: 19px;
}

.theme-desc {
  margin: 8px 0 0;
  color: var(--ink-2);
  line-height: 1.5;
  font-size: 14px;
}

.theme-stats {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.theme-stats div {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 7px;
  background: #f6faff;
}

.theme-stats dt {
  margin: 0;
  font-size: 11px;
  color: var(--ink-2);
}

.theme-stats dd {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.theme-link {
  margin-top: 10px;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(120deg, #fe6e2f, #ff9348);
  padding: 8px 10px;
}

.empty,
.error {
  margin: 0;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: #ffffff;
}

.error {
  color: #8d1f1f;
}

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  gap: 8px;
  z-index: 20;
}

.mobile-tab {
  flex: 1;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-mid);
  border-radius: 10px;
  background: #ffffff;
  color: #2d4d73;
  font-weight: 700;
  text-decoration: none;
  padding: 8px;
}

.mobile-tab.is-active {
  border-color: transparent;
  background: linear-gradient(120deg, #0f78c6, #0f57b7);
  color: #ffffff;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@keyframes feed-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1260px) {
  .home-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-rail {
    padding-top: 16px;
  }

  .theme-rail-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 1023px) {
  .app-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .brand-block {
    min-width: 220px;
  }

  .side-nav-links {
    margin-top: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .side-nav-link {
    justify-content: center;
  }

  .content-shell {
    padding: 14px;
  }

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

@media (max-width: 767px) {
  .side-nav {
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-block {
    min-width: 0;
  }

  .side-nav-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .top-nav {
    padding: 14px;
  }

  .top-title {
    font-size: 21px;
  }

  .feed-panel,
  .theme-rail {
    border-radius: 16px;
    padding: 14px;
  }

  .section-head h1 {
    font-size: 25px;
  }

  .feed-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-rail-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-tabbar {
    display: flex;
  }

  body {
    padding-bottom: 84px;
  }
}
