/* KGame – k-games.xyz | Ocean editorial portal */
:root {
  --bg: #eef4f7;
  --bg-deep: #061820;
  --surface: #ffffff;
  --ink: #0b1c28;
  --muted: #5c7383;
  --line: #d4e2ea;
  --teal: #0b8f7f;
  --teal-dark: #06695e;
  --aqua: #1bb8a8;
  --gold: #d4a017;
  --coral: #c45c3e;
  --nav-h: 68px;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(6, 40, 48, 0.08);
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", system-ui, sans-serif;
  --max: 1120px;
}

*,
*::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(27, 184, 168, 0.12), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(212, 160, 23, 0.08), transparent 50%),
    linear-gradient(180deg, #e8f3f5 0%, var(--bg) 28%, #e9f0f3 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
}

.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(6, 24, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-bar {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-height: calc(var(--nav-h) - 20px);
  text-decoration: none;
}

.brand img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle.is-open .icon-menu {
  display: none;
}

.nav-toggle.is-open .icon-close {
  display: block;
}

.nav-toggle .label-close {
  display: none;
}

.nav-toggle.is-open .label-menu {
  display: none;
}

.nav-toggle.is-open .label-close {
  display: inline;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--aqua);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--aqua), var(--teal));
  color: #fff;
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.btn-ghost:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--bg-deep);
  color: #fff;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  animation: heroDrift 18s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(100deg, rgba(4, 18, 26, 0.88) 0%, rgba(4, 18, 26, 0.55) 48%, rgba(4, 18, 26, 0.25) 100%),
    linear-gradient(0deg, rgba(4, 18, 26, 0.75) 0%, transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4.5rem 0 3.2rem;
  max-width: 640px;
  animation: riseIn 0.9s ease-out both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.55rem;
  background: linear-gradient(90deg, #fff 0%, #b8fff4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.75rem;
}

.hero-lead {
  color: rgba(230, 245, 248, 0.88);
  font-size: 1.05rem;
  max-width: 36em;
  margin-bottom: 1.4rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

@keyframes heroDrift {
  from { transform: scale(1.05) translate(0, 0); }
  to { transform: scale(1.12) translate(-1.5%, 1%); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Sections ===== */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
  border-block: 1px solid rgba(212, 226, 234, 0.7);
}

.section-head {
  margin-bottom: 1.8rem;
  max-width: 42rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  margin-bottom: 0.4rem;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.prose {
  max-width: 68ch;
}

.prose a.ext {
  font-weight: 600;
}

.prose h2 {
  margin-top: 1.6em;
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.25em;
  font-size: 1.1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 0.4em;
}

/* ===== Category grid ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  display: block;
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: transform 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
}

.cat-visual {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, #0a2a33, #0d4a48);
  margin-bottom: 0.65rem;
  box-shadow: var(--shadow);
}

.cat-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cat-item:hover .cat-visual img {
  transform: scale(1.06);
}

.cat-item h3 {
  font-size: 1rem;
  margin: 0 0 0.2rem;
}

.cat-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ===== Article cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  animation: fadeUp 0.6s ease both;
}

.article-card:nth-child(2) { animation-delay: 0.08s; }
.article-card:nth-child(3) { animation-delay: 0.16s; }
.article-card:nth-child(4) { animation-delay: 0.24s; }
.article-card:nth-child(5) { animation-delay: 0.32s; }
.article-card:nth-child(6) { animation-delay: 0.4s; }

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(11, 143, 127, 0.35);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a2a33;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.05);
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  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;
}

.article-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.45rem;
}

.article-card p {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
}

/* ===== Brand / intro split ===== */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.split-visual {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-deep);
}

.split-visual img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.2rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0 0;
  opacity: 0.85;
}

.brand-row img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.2);
}

/* ===== FAQ ===== */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--teal);
  font-weight: 700;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-a {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  margin: 0;
}

/* ===== Page hero (inner) ===== */
.page-hero {
  padding: 2.4rem 0 1.6rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(11, 143, 127, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  margin-bottom: 0.45rem;
}

.page-hero p {
  color: var(--muted);
  max-width: 52ch;
  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(--teal);
}

.breadcrumb span[aria-hidden] {
  opacity: 0.5;
}

/* ===== Article layout ===== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  padding: 2.2rem 0 3.5rem;
  align-items: start;
}

.article-cover {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #0a2a33;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.article-meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.sidebar-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.sidebar-block h2 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.related-list a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  align-items: center;
}

.related-list a:hover h3 {
  color: var(--teal);
}

.related-list img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.related-list h3 {
  font-size: 0.88rem;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
}

/* ===== Promo strip ===== */
.promo-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: center;
  background: linear-gradient(120deg, #063445, #0a5c55);
  color: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  overflow: hidden;
}

.promo-strip h2 {
  color: #fff;
  margin-bottom: 0.4rem;
}

.promo-strip p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1rem;
}

.promo-strip img {
  max-height: 120px;
  margin-inline: auto;
  object-fit: contain;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-deep);
  color: rgba(255, 255, 255, 0.78);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  font-size: 0.92rem;
  margin: 0;
  max-width: 28ch;
}

.site-footer h3 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--aqua);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.2rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ===== Error pages ===== */
.error-page {
  min-height: calc(100vh - var(--nav-h));
  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;
  line-height: 1;
  background: linear-gradient(135deg, var(--teal), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.4rem;
}

/* ===== Misc ===== */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: rgba(11, 143, 127, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.65rem;
}

.list-page .card-grid {
  margin-top: 1.5rem;
}

.guide-steps {
  display: grid;
  gap: 1rem;
  counter-reset: step;
}

.guide-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.guide-step::before {
  counter-increment: step;
  content: counter(step);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.guide-step h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.guide-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split,
  .article-layout,
  .promo-strip,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .article-layout {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-panel {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    left: 0;
    background: rgba(6, 24, 32, 0.98);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 1.4rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.28s ease;
  }

  .nav-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-links a {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-actions {
    flex-direction: column;
    width: 100%;
  }

  .nav-actions .btn {
    width: 100%;
  }

  .hero {
    min-height: min(70vh, 520px);
  }

  .hero-content {
    padding: 3.2rem 0 2.4rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    max-width: calc(100% - 110px);
  }

  .brand img {
    height: 34px;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .cat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .section {
    padding: 2.5rem 0;
  }
}
