/* KGame – kkgame.quest */
:root {
  --bg: #eef3f7;
  --bg-alt: #e4ecf3;
  --surface: #ffffff;
  --ink: #142033;
  --ink-soft: #3d4f63;
  --muted: #6b7c8f;
  --line: #cfd9e4;
  --accent: #0b7a66;
  --accent-deep: #065a4b;
  --accent-soft: #d7f0ea;
  --warm: #d4550a;
  --warm-deep: #a84100;
  --hero-veil: rgba(8, 22, 40, 0.72);
  --shadow: 0 12px 32px rgba(20, 32, 51, 0.08);
  --radius: 14px;
  --nav-h: 68px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Sora", sans-serif;
  --max: 1120px;
}

*,
*::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%, #d9ebe6 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #dce6f2 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  background-attachment: fixed;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-deep);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--warm);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.6em;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

ul,
ol {
  color: var(--ink-soft);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(10, 22, 40, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(8, 16, 28, 0.35);
}

.header-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  max-height: calc(var(--nav-h) - 20px);
  overflow: hidden;
  border-radius: 8px;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 0.02em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-desktop a {
  padding: 0.45rem 0.7rem;
  color: rgba(245, 248, 251, 0.82);
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 8px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #7fd4c3;
  background: rgba(127, 212, 195, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(11, 122, 102, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0d8f78 0%, var(--accent) 100%);
}

.btn-outline {
  background: transparent;
  color: var(--ink) !important;
  border: 1.5px solid var(--line);
}

.header-actions .btn-outline,
.nav-mobile-actions .btn-outline {
  color: #f5f8fb !important;
  border-color: rgba(255, 255, 255, 0.35);
}

.header-actions .btn-outline:hover,
.nav-mobile-actions .btn-outline:hover {
  border-color: #7fd4c3;
  color: #7fd4c3 !important;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-deep) !important;
}

.btn-warm {
  background: linear-gradient(135deg, var(--warm) 0%, var(--warm-deep) 100%);
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(212, 85, 10, 0.25);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: #f5f8fb;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: #0c1a2b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  padding: 0.75rem 1rem 1.25rem;
  z-index: 999;
  flex-direction: column;
  gap: 0.25rem;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}

.nav-mobile.is-open {
  display: flex;
}

.nav-mobile a {
  padding: 0.75rem 0.85rem;
  color: rgba(245, 248, 251, 0.85);
  font-weight: 500;
  border-radius: 8px;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  background: rgba(127, 212, 195, 0.12);
  color: #7fd4c3;
}

.nav-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-mobile-actions .btn {
  width: 100%;
}

body.menu-open {
  overflow: hidden;
}

main {
  padding-top: var(--nav-h);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 22, 40, 0.35) 0%, var(--hero-veil) 70%, #081628 100%),
    linear-gradient(90deg, rgba(8, 22, 40, 0.55) 0%, transparent 55%);
}

.hero-content {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 3.5rem 0 3rem;
  color: #fff;
  animation: rise 0.8s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hero-content h1 {
  color: #f5f8fb;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 600;
  max-width: 36ch;
  margin-bottom: 0.75rem;
}

.hero-content p {
  color: rgba(245, 248, 251, 0.88);
  max-width: 48ch;
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== Sections ===== */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
  border-block: 1px solid rgba(207, 217, 228, 0.6);
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 62ch;
}

.section-head p {
  margin-bottom: 0;
}

.lead {
  font-size: 1.05rem;
}

/* Brand intro */
.intro-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.intro-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: fade-in 1s ease 0.2s both;
}

.intro-visual img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.intro-points {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.intro-points li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.intro-points img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  min-height: 160px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
}

.cat-item img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: -2;
}

.cat-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 30%, rgba(8, 22, 40, 0.85) 100%);
}

.cat-item span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  right: 1rem;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

/* Cards / articles */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 8px rgba(20, 32, 51, 0.04);
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card h3 a {
  color: var(--ink);
}

.article-card h3 a:hover {
  color: var(--accent);
}

.article-card p {
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 0.85rem;
}

.article-card .read-more {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent-deep);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.15rem;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-display);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--accent);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Page hero (inner) */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid rgba(207, 217, 228, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, transparent 100%);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span[aria-hidden] {
  opacity: 0.5;
}

/* Article detail */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
  padding: 2.5rem 0 3.5rem;
}

.article-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 2rem;
  box-shadow: 0 2px 10px rgba(20, 32, 51, 0.04);
}

.article-cover {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.prose h2 {
  margin-top: 1.75rem;
}

.prose h3 {
  margin-top: 1.35rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose a.ext-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar {
  display: grid;
  gap: 1.25rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
}

.side-box h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.side-list a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.65rem;
  align-items: center;
  color: var(--ink);
}

.side-list img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.side-list span {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Brands strip */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.brand-strip img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.75;
  filter: grayscale(0.2);
  transition: opacity 0.2s;
}

.brand-strip img:hover {
  opacity: 1;
}

/* Promo band */
.promo-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.promo-band img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  background: #0c1a2b;
  color: rgba(245, 248, 251, 0.82);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.site-footer p,
.site-footer a {
  color: rgba(245, 248, 251, 0.75);
  font-size: 0.92rem;
}

.site-footer a:hover {
  color: #7fd4c3;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: rgba(245, 248, 251, 0.55);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Forms note blocks */
.note-box {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.15rem;
  border-radius: 0 10px 10px 0;
  margin: 1.25rem 0;
}

.note-box p {
  margin: 0;
  color: var(--ink);
}

/* Responsive */
@media (max-width: 960px) {
  .intro-grid,
  .article-layout,
  .promo-band,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-desktop,
  .header-actions {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 60px;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }

  .brand-text {
    font-size: 1rem;
  }

  .card-grid,
  .cat-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: min(70vh, 520px);
  }

  .article-main {
    padding: 1.15rem;
  }

  .section {
    padding: 2.5rem 0;
  }
}
