/* KGame – k-game-web.sbs */
:root {
  --bg: #0b1220;
  --bg-soft: #121a2b;
  --bg-card: #162033;
  --surface: #1a2740;
  --line: rgba(148, 176, 220, 0.16);
  --text: #e8eef8;
  --muted: #9aa8c2;
  --brand: #3ba3ff;
  --brand-2: #1e7fe0;
  --accent: #5ee0c4;
  --warn: #ffb454;
  --danger: #ff6b7a;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --nav-h: 72px;
  --container: 1120px;
  --font-display: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(59, 163, 255, 0.18), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(94, 224, 196, 0.1), transparent 50%),
    linear-gradient(180deg, #0a101c 0%, var(--bg) 40%, #0d1524 100%);
  min-height: 100vh;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--accent);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Fixed header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(11, 18, 32, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-bar {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  max-height: calc(var(--nav-h) - 20px);
}

.brand img {
  height: 42px;
  width: auto;
  max-height: 42px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--white);
  letter-spacing: 0.04em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: rgba(59, 163, 255, 0.12);
  color: var(--brand);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.7rem 1.15rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--white);
}

.btn-primary:hover {
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(12, 19, 33, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 1rem;
  z-index: 999;
}

.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: var(--text);
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.mobile-actions .btn {
  width: 100%;
}

main {
  padding-top: var(--nav-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 12, 22, 0.35) 0%, rgba(8, 12, 22, 0.72) 48%, rgba(8, 12, 22, 0.96) 100%),
    linear-gradient(90deg, rgba(8, 12, 22, 0.75) 0%, rgba(8, 12, 22, 0.2) 55%, rgba(8, 12, 22, 0.55) 100%);
}

.hero-content {
  padding: 4.5rem 0 3.2rem;
  max-width: 680px;
}

.hero-content .brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.65rem;
  letter-spacing: -0.03em;
}

.hero-content h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.9rem;
}

.hero-content p {
  font-size: 1.05rem;
  max-width: 34rem;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  color: var(--white);
}

.section-head p {
  max-width: 46rem;
}

.prose {
  max-width: 720px;
}

.prose h2 {
  margin-top: 2rem;
  color: var(--white);
}

.prose h3 {
  margin-top: 1.4rem;
  color: var(--text);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* Category tiles – interaction containers */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-card);
  min-height: 160px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 163, 255, 0.45);
}

.cat-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.cat-item span {
  display: block;
  padding: 0.85rem 1rem 1rem;
  font-weight: 700;
  color: var(--white);
}

/* Article cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 163, 255, 0.4);
}

.article-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--surface);
}

.article-card .body {
  padding: 1.05rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  color: var(--white);
  margin-bottom: 0.55rem;
}

.article-card p {
  font-size: 0.92rem;
  flex: 1;
}

.article-card .more {
  margin-top: 0.75rem;
  font-weight: 700;
  color: var(--brand);
}

/* Intro / brand block */
.intro-block {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.75rem;
  align-items: center;
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-card);
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.feature-list li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.5rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

/* Brands strip */
.brand-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.brand-strip img {
  width: 100%;
  height: 52px;
  object-fit: contain;
  filter: grayscale(0.2) brightness(1.05);
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 0.4rem;
  border: 1px solid var(--line);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.faq-item h3 {
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 0.45rem;
}

.faq-item p {
  margin: 0;
  font-size: 0.95rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(59, 163, 255, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  color: var(--white);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.25rem 0 3.5rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-body {
  font-size: 1.02rem;
}

.article-body h2 {
  color: var(--white);
  margin-top: 1.8rem;
}

.article-body h3 {
  color: var(--text);
  margin-top: 1.25rem;
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  align-self: start;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.sidebar-box h3 {
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 0.85rem;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-list li {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.related-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.related-list a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}

.related-list a:hover {
  color: var(--brand);
}

/* Promo / app */
.promo-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
  align-items: center;
}

.promo-row img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: #070c16;
  padding: 3rem 0 1.75rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.site-footer h3 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.site-footer p,
.site-footer a {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a {
  display: block;
  margin-bottom: 0.45rem;
}

.site-footer a:hover {
  color: var(--brand);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page h1 {
  font-size: clamp(3rem, 10vw, 5.5rem);
  color: var(--brand);
  margin-bottom: 0.4rem;
}

.error-page p {
  max-width: 28rem;
  margin-inline: auto;
  margin-bottom: 1.5rem;
}

/* Utilities */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.muted-box {
  background: rgba(59, 163, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
}

.muted-box p {
  margin: 0;
}

.split-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.split-media img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .hero-content {
    animation: fadeUp 0.7s ease both;
  }
  .cat-item,
  .article-card {
    animation: fadeUp 0.55s ease both;
  }
  .cat-item:nth-child(2),
  .article-card:nth-child(2) { animation-delay: 0.05s; }
  .cat-item:nth-child(3),
  .article-card:nth-child(3) { animation-delay: 0.1s; }
  .cat-item:nth-child(4),
  .article-card:nth-child(4) { animation-delay: 0.15s; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1024px) {
  .cat-grid,
  .card-grid,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4,
  .brand-strip {
    grid-template-columns: repeat(4, 1fr);
  }
  .article-layout,
  .intro-block,
  .promo-row,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 860px) {
  .nav-desktop,
  .nav-actions {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .brand img {
    height: 36px;
    max-height: 36px;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 64px;
  }
  .cat-grid,
  .card-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .brand-strip,
  .split-media {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: 70vh;
  }
  .hero-content {
    padding: 3.2rem 0 2.4rem;
  }
  .section {
    padding: 2.5rem 0;
  }
  .brand-text {
    display: none;
  }
}
