/* KGame – k-g-game.beauty */
:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --ink: #142033;
  --muted: #5a6b7f;
  --line: #d7e0ea;
  --brand: #2b6cef;
  --brand-deep: #1a4fbf;
  --navy: #0e1a2b;
  --accent: #0ea5a4;
  --warm: #e8f0ff;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(14, 26, 43, 0.08);
  --header-h: 72px;
  --max: 1120px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Sora", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(43, 108, 239, 0.12), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(14, 165, 164, 0.1), transparent 55%),
    linear-gradient(180deg, #eef3f9 0%, var(--bg) 28%, #e9eef5 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.6em;
  color: var(--navy);
}

p {
  margin: 0 0 1em;
}

ul {
  padding-left: 1.2em;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(14, 26, 43, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-link img {
  height: 40px;
  width: auto;
  max-height: calc(var(--header-h) - 24px);
  max-width: min(148px, 42vw);
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: rgba(43, 108, 239, 0.22);
  color: #fff;
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.1rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 8px 20px rgba(43, 108, 239, 0.28);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.btn-outline {
  background: transparent;
  color: var(--brand-deep);
  border: 1px solid var(--brand);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-panel {
  display: none;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: #0e1a2b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0 1.1rem;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.22s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-panel a {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 500;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.mobile-actions .btn {
  width: 100%;
}

/* Hero */
.hero {
  position: relative;
  min-height: clamp(420px, 72vh, 620px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  background: var(--navy);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 16, 28, 0.88) 0%, rgba(8, 16, 28, 0.55) 48%, rgba(8, 16, 28, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 16, 28, 0.75) 0%, transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.2rem;
  max-width: 640px;
  animation: fadeUp 0.7s ease both;
}

.brand-mark {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.55rem;
  background: linear-gradient(180deg, #ffffff 20%, #b8c9e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.02rem;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.6rem;
  max-width: 42rem;
}

.section-head h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
  border-block: 1px solid rgba(215, 224, 234, 0.7);
}

.prose {
  max-width: 48rem;
}

.prose h2 {
  margin-top: 1.6em;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.3em;
  font-size: 1.12rem;
}

.prose a {
  font-weight: 600;
}

/* Intro / brand */
.intro-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--navy);
}

.intro-visual img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.cat-item {
  position: relative;
  display: block;
  text-decoration: none;
  color: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 150px;
  isolation: isolate;
  transition: transform 0.2s ease;
}

.cat-item:hover {
  transform: translateY(-3px);
}

.cat-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.35s ease;
}

.cat-item:hover img {
  transform: scale(1.05);
}

.cat-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 20%, rgba(8, 16, 28, 0.88) 100%);
}

.cat-item span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  right: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  gap: 1.1rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(14, 26, 43, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card a.thumb {
  display: block;
  overflow: hidden;
  background: #dbe4f0;
}

.article-card .thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}

.tag {
  color: var(--brand-deep);
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card h3 a {
  color: inherit;
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--brand);
}

.article-card p {
  color: var(--muted);
  font-size: 0.93rem;
  margin-bottom: 0.9rem;
  flex: 1;
}

.read-more {
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--brand-deep);
}

/* Brands strip */
.brand-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.brand-row img {
  width: 100%;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem;
  filter: grayscale(0.15);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 48rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.2rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 650;
  font-family: var(--font-display);
  padding: 0.9rem 0;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--brand);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  color: var(--muted);
  padding-bottom: 0.9rem;
  margin: 0;
}

/* Page hero compact */
.page-hero {
  padding: 2.4rem 0 1.4rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(43, 108, 239, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  margin-bottom: 0.45rem;
}

.page-hero p {
  color: var(--muted);
  max-width: 42rem;
  margin: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article detail */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2rem 0 3rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.4rem;
  background: #dbe4f0;
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-list {
  display: grid;
  gap: 0.85rem;
}

.related-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  align-items: center;
}

.related-item img {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: 8px;
  background: #dbe4f0;
}

.related-item strong {
  display: block;
  font-size: 0.92rem;
  color: var(--navy);
}

.related-item span {
  font-size: 0.8rem;
  color: var(--muted);
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.side-box h2 {
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h) - 180px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.4rem;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.82);
  padding: 2.8rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.7rem;
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.7rem;
}

.footer-brand p {
  margin: 0;
  font-size: 0.92rem;
  max-width: 28rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, #12305a, #1a4fbf 55%, #0ea5a4);
  color: #fff;
  border-radius: calc(var(--radius) + 4px);
  padding: 1.6rem 1.4rem;
  display: grid;
  gap: 1rem;
  align-items: center;
}

.cta-band h2 {
  color: #fff;
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.cta-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.notice {
  background: var(--warm);
  border-left: 3px solid var(--brand);
  padding: 0.9rem 1rem;
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  font-size: 0.94rem;
}

/* Desktop */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }

  .nav-desktop {
    display: flex;
    flex: 1;
    justify-content: center;
  }

  .header-actions {
    display: flex;
  }

  .mobile-panel {
    display: none !important;
  }

  .intro-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid.three {
    grid-template-columns: repeat(3, 1fr);
  }

  .brand-row {
    grid-template-columns: repeat(8, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .cta-band {
    grid-template-columns: 1fr auto;
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (min-width: 1024px) {
  .cat-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .card-grid.three {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .brand-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-content {
    padding-top: 3.5rem;
  }
}
