:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-dark: #0f172a;
  --line: #e5e7eb;
  --text: #0f172a;
  --text-soft: #475569;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --tag: #e2e8f0;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --container: 1300px;
  --grid-gap: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.container {
  width: min(100% - 24px, var(--container));
  margin: 0 auto;
}

/* =========================
   HEADER
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  font-weight: 800;
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 1rem;
}

.brand-text small {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.96rem;
}

.site-nav a:hover {
  color: #fff;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
  border-radius: 2px;
}

/* =========================
   HERO SLIDER
========================= */

.hero-slider {
  padding: 16px 0 22px;
  background:
    radial-gradient(circle at right top, rgba(37, 99, 235, 0.12), transparent 25%),
    radial-gradient(circle at left bottom, rgba(20, 184, 166, 0.10), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.hero-slider-shell {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  height: clamp(180px, 18vw, 220px);
  background: #e5e7eb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
}

.hero-slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.hero-slide-bg {
  position: absolute;
  inset: 0;
}

.hero-bg-1 {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.82)),
    radial-gradient(circle at right top, rgba(37, 99, 235, 0.24), transparent 28%),
    linear-gradient(120deg, #eef6ff 0%, #f8fbff 50%, #edfdfb 100%);
}

.hero-bg-2 {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
    radial-gradient(circle at left center, rgba(20, 184, 166, 0.18), transparent 30%),
    linear-gradient(120deg, #f4f7ff 0%, #eef2ff 55%, #f8fafc 100%);
}

.hero-bg-3 {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.80)),
    radial-gradient(circle at right bottom, rgba(59, 130, 246, 0.16), transparent 30%),
    linear-gradient(120deg, #f8fbff 0%, #eef6ff 55%, #f0fdfa 100%);
}

.hero-slide-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  padding: 30px 60px 34px;
}

.hero-kicker,
.section-kicker {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-slider h1,
.section-head h2,
.about-box h2 {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 1.8vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-slider h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-text,
.section-head p,
.about-box p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  transition: 0.18s ease;
}

.hero-btn:hover {
  transform: translateY(-2px);
}

.hero-btn-primary {
  background: var(--primary);
  color: #fff;
}

.hero-btn-primary:hover {
  background: var(--primary-dark);
}

.hero-btn-secondary {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.hero-btn-secondary:hover {
  background: rgba(15, 23, 42, 0.10);
}

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-nav:hover {
  background: rgba(15, 23, 42, 0.92);
}

.hero-nav-prev {
  left: 12px;
}

.hero-nav-next {
  right: 12px;
}

.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.20);
  cursor: pointer;
  padding: 0;
}

.hero-dot.is-active {
  background: var(--primary);
}

/* =========================
   ARCHIVE / GRID
========================= */

.archive-section {
  padding: 28px 0 70px;
}

.section-head {
  margin-bottom: 26px;
}

.meme-grid {
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: var(--grid-gap);
  align-items: start;
}

.meme-grid.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.meme-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.meme-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meme-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meme-grid.cols-1 {
  grid-template-columns: 1fr;
}

.meme-col {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  min-width: 0;
}

.meme-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.meme-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-preview {
  position: relative;
  width: 100%;
  background: #e2e8f0;
  overflow: hidden;
}

.preview-image {
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(20, 184, 166, 0.18)),
    linear-gradient(180deg, #dbeafe, #eef2ff);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 18px;
}

.preview-video {
  aspect-ratio: 16 / 11;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 40%),
    linear-gradient(135deg, #0f172a, #334155);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-video::before {
  content: "▶";
  width: 70px;
  height: 70px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  backdrop-filter: blur(6px);
}

.preview-app {
  aspect-ratio: 1 / 1.15;
  background:
    linear-gradient(180deg, #0f172a 0 20%, #f8fafc 20% 100%);
  padding: 16px;
}

.preview-app-window {
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cbd5e1;
  display: grid;
  grid-template-rows: 42px 1fr;
}

.preview-app-top {
  background: #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
}

.preview-app-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.preview-app-line {
  height: 14px;
  border-radius: 999px;
  background: #dbeafe;
}

.preview-game {
  aspect-ratio: 4 / 5.2;
  background: linear-gradient(180deg, #020617, #111827);
  padding: 18px;
  color: #fff;
}

.preview-game-screen {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 16px;
  min-height: 280px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.preview-data {
  aspect-ratio: 4 / 4.4;
  background: #f8fafc;
  padding: 18px;
}

.chart-box {
  height: 240px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  padding: 18px;
}

.chart-bar {
  width: 18%;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.preview-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 700;
}

.card-body {
  padding: 18px;
}

.card-type {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-body h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  line-height: 1.35;
  font-weight: 700;
}

.card-body p {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--tag);
  color: #334155;
  font-size: 0.82rem;
}

/* =========================
   ABOUT
========================= */

.about-section {
  padding: 0 0 80px;
}

.about-box {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  border-radius: 28px;
  padding: 32px;
}

.about-box p.section-kicker {
  color: #93c5fd;
}

.about-box p:last-child {
  color: rgba(255, 255, 255, 0.82);
}

/* =========================
   MODAL / FLOATING WIDGET
========================= */

.meme-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
}

.meme-modal.open {
  display: block;
}

.meme-modal-dim {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.meme-modal-panel {
  position: relative;
  z-index: 1;
  width: clamp(720px, 80vw, 1200px);
  max-height: calc(100vh - 120px);
  min-height: 500px;
  margin: 60px auto;
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.35);
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.84);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-info-toggle {
  position: absolute;
  top: 12px;
  right: 64px;
  z-index: 5;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.84);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  transition: grid-template-columns 0.25s ease;
}

.modal-grid.modal-grid--info-hidden {
  grid-template-columns: minmax(0, 1fr) 0px;
}

.modal-view {
  position: relative;
  background: #0f172a;
  padding: 24px;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-demo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-demo > * {
  max-width: 100%;
  max-height: 100%;
}

.modal-demo.image-demo,
.modal-demo.video-demo,
.modal-demo.app-demo,
.modal-demo.game-demo,
.modal-demo.data-demo {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  overflow: hidden;
}

.modal-demo.image-demo {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(20, 184, 166, 0.25)),
    linear-gradient(180deg, #dbeafe, #f8fafc);
  padding: 24px;
  color: #0f172a;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  aspect-ratio: auto;
}

.modal-demo.video-demo {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.10), transparent 40%),
    linear-gradient(135deg, #0f172a, #334155);
  color: #fff;
  font-size: 4rem;
}

.modal-demo.app-demo {
  background: #fff;
}

.modal-demo.app-demo .app-top {
  height: 52px;
  background: #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
}

.modal-demo.app-demo .app-body {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.modal-demo.app-demo .app-line {
  height: 16px;
  background: #dbeafe;
  border-radius: 999px;
}

.modal-demo.game-demo {
  background: linear-gradient(180deg, #020617, #111827);
  color: #fff;
  padding: 26px;
}

.modal-demo.data-demo {
  background: #fff;
  padding: 24px;
}

.modal-chart {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  padding: 20px;
  background: #f8fafc;
}

.modal-chart .bar {
  width: 14%;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.modal-info {
  border-left: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  min-width: 0;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal-grid.modal-grid--info-hidden .modal-info {
  opacity: 0;
  pointer-events: none;
  border-left: 0;
}

.modal-info-inner {
  height: 100%;
  overflow-y: auto;
  padding: 36px 28px 28px;
}

.modal-type {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.modal-info h3 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  line-height: 1.25;
}

.modal-desc {
  margin: 0 0 18px;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.meta-list {
  display: grid;
  gap: 10px;
}

.meta-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #f8fafc;
}

.meta-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.meta-item span {
  display: block;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* =========================
   HEIGHT-BASED RESPONSIVE
========================= */

@media (max-height: 619px) {
  .meme-modal {
    position: absolute;
    min-height: 100%;
  }

  .meme-modal-panel {
    max-height: none;
    min-height: 500px;
    margin: 24px auto;
  }

  .modal-grid {
    min-height: 500px;
    height: auto;
    flex: 0 0 auto;
  }

  .modal-view,
  .modal-info {
    overflow-y: visible;
  }
}

/* =========================
   WIDTH-BASED RESPONSIVE
========================= */

@media (max-width: 960px) {
  .hero-slider-shell {
    height: clamp(170px, 22vw, 210px);
  }

  .hero-slide-content {
    max-width: 100%;
    padding: 26px 40px;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-grid.modal-grid--info-hidden {
    grid-template-columns: 1fr;
  }

  .modal-info {
    position: absolute;
    top: 0;
    right: 0;
    width: min(380px, 88vw);
    height: 100%;
    z-index: 4;
    box-shadow: -12px 0 24px rgba(15, 23, 42, 0.14);
  }

  .modal-grid.modal-grid--info-hidden .modal-info {
    transform: translateX(100%);
    opacity: 1;
    pointer-events: none;
    border-left: 1px solid var(--line);
  }

  .modal-info {
    transform: translateX(0);
    transition: transform 0.25s ease;
  }
}

@media (max-width: 760px) {
  :root {
    --grid-gap: 14px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 20px 20px;
  }

  .site-nav.open {
    display: flex;
  }

  .hero-slider {
    padding: 14px 0 18px;
  }

  .hero-slider-shell {
    height: clamp(150px, 28vw, 190px);
    border-radius: 18px;
  }

  .hero-slide-content {
    padding: 20px 18px;
  }

  .hero-slider h1 {
    font-size: clamp(1rem, 4vw, 1.3rem);
  }

  .hero-text {
    font-size: 0.88rem;
  }

  .hero-nav {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .hero-nav-prev {
    left: 8px;
  }

  .hero-nav-next {
    right: 8px;
  }

  .archive-section {
    padding-top: 20px;
  }

  .meme-modal-panel {
    width: 94vw;
    max-height: calc(100vh - 60px);
    min-height: 500px;
    margin: 30px auto;
    border-radius: 20px;
  }

  .modal-view {
    padding: 16px;
  }

  .modal-close {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .modal-info-toggle {
    right: 56px;
    height: 38px;
    padding: 0 12px;
    font-size: 0.84rem;
  }

  .modal-info-inner {
    padding: 24px 18px 18px;
  }
}