/* KGame – k-game-web.quest */
:root {
  --bg: #eef3f7;
  --bg-deep: #d9e6ef;
  --surface: #ffffff;
  --ink: #102033;
  --ink-soft: #3d5166;
  --muted: #6b7f93;
  --line: #c9d7e4;
  --brand: #0b6e63;
  --brand-dark: #085249;
  --brand-soft: #d7f0ec;
  --accent: #e4572e;
  --accent-soft: #ffe3da;
  --hero-a: #063d48;
  --hero-b: #0b6e63;
  --hero-c: #1a8f7f;
  --shadow: 0 12px 40px rgba(16, 32, 51, 0.08);
  --radius: 14px;
  --nav-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;
  padding-top: var(--nav-h);
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(11, 110, 99, 0.12), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(228, 87, 46, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, #f7fafc 45%, var(--bg-deep) 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
}

ul, ol {
  color: var(--ink-soft);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Header / Nav —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 215, 228, 0.85);
  box-shadow: 0 4px 24px rgba(16, 32, 51, 0.04);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  max-width: 48%;
}

.brand-link img {
  height: 40px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem 1.1rem;
}

.nav-desktop a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  position: relative;
}

.nav-desktop a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform 0.25s ease;
  transform-origin: left;
}

.nav-desktop a:hover,
.nav-desktop a.is-active {
  color: var(--brand-dark);
}

.nav-desktop a:hover::after,
.nav-desktop a.is-active::after {
  transform: scaleX(1);
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #c94822;
  color: #fff;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: var(--brand-soft);
  border: none;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font-body);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle.is-open .icon-menu {
  display: none;
}

.menu-toggle.is-open .icon-close {
  display: block;
}

.nav-mobile {
  display: none;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem 0 1.25rem;
}

.nav-mobile.is-open {
  display: block;
}

.nav-mobile .container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-mobile a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding: 0.75rem 0.25rem;
  border-bottom: 1px solid #eef2f6;
}

.nav-mobile .mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
}

.nav-mobile .mobile-auth .btn {
  width: 100%;
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }

  .nav-desktop,
  .nav-actions {
    display: flex;
  }

  .nav-mobile {
    display: none !important;
  }

  .brand-link {
    max-width: none;
  }
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: clamp(420px, 72vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b) 55%, var(--hero-c));
}

.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(6, 40, 48, 0.88) 0%, rgba(6, 40, 48, 0.55) 48%, rgba(6, 40, 48, 0.25) 100%),
    linear-gradient(0deg, rgba(6, 40, 48, 0.75) 0%, transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3.5rem 0 3rem;
  color: #fff;
  max-width: 640px;
  animation: riseIn 0.8s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.35em;
  color: #fff;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Sections —— */
.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  margin-bottom: 0.4rem;
}

.section-head p {
  margin: 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
  border-block: 1px solid rgba(201, 215, 228, 0.6);
}

.prose {
  max-width: 46rem;
}

.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;
}

/* —— Category grid —— */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 700px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cat-item {
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
}

.cat-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.cat-item span {
  display: block;
  padding: 0.75rem 0.9rem 1rem;
  font-weight: 650;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
}

/* —— Article cards —— */
.card-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.article-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s ease;
}

.article-card:hover {
  transform: translateY(-3px);
}

.article-card a.cover {
  display: block;
  overflow: hidden;
}

.article-card .cover img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.article-card:hover .cover 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.8rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

.article-card h3 a {
  text-decoration: none;
  color: var(--ink);
}

.article-card h3 a:hover {
  color: var(--brand);
}

.article-card p {
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
  flex: 1;
}

.article-card .read-more {
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--brand);
}

/* —— Guide list —— */
.guide-list {
  display: grid;
  gap: 1rem;
}

.guide-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.guide-row:hover {
  transform: translateX(4px);
}

.guide-row img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
}

.guide-row h3 {
  font-size: 1rem;
  margin: 0 0 0.3rem;
}

.guide-row p {
  margin: 0;
  font-size: 0.9rem;
}

@media (min-width: 700px) {
  .guide-row {
    grid-template-columns: 120px 1fr;
  }

  .guide-row img {
    width: 120px;
    height: 90px;
  }
}

/* —— Brand strip —— */
.brand-intro {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 860px) {
  .brand-intro {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.brand-visual {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(145deg, var(--hero-a), var(--brand));
}

.brand-visual img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin-top: 1.25rem;
}

.logo-row img {
  height: 28px;
  width: auto;
  opacity: 0.85;
  filter: grayscale(0.2);
}

/* —— FAQ —— */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 720px;
}

.faq-item {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 650;
  font-family: var(--font-display);
  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 .faq-a {
  padding: 0 1.15rem 1.1rem;
  margin: 0;
  font-size: 0.95rem;
}

/* —— Page hero (inner) —— */
.page-hero {
  padding: 2.5rem 0 1.5rem;
  background:
    linear-gradient(120deg, rgba(11, 110, 99, 0.12), rgba(228, 87, 46, 0.06)),
    rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 0.5rem;
}

.page-hero p {
  max-width: 40rem;
  margin: 0;
}

.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);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb span[aria-hidden="true"] {
  opacity: 0.5;
}

/* —— Article detail —— */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 3.5rem;
}

@media (min-width: 920px) {
  .article-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.article-main .cover-xl {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.article-main .cover-xl img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.sidebar-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.sidebar-box h2 {
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.related-list a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  align-items: center;
}

.related-list img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.related-list span {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}

/* —— Error pages —— */
.error-page {
  min-height: calc(100vh - var(--nav-h) - 200px);
  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: 800;
  color: var(--brand);
  line-height: 1;
  margin: 0;
}

.error-page h1 {
  margin-top: 0.4rem;
}

/* —— Footer —— */
.site-footer {
  background: #0c1c28;
  color: rgba(255, 255, 255, 0.82);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
}

.footer-brand strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
}

.footer-grid h3 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

/* —— Utilities —— */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
