/* KGame — kgamec.pics | Editorial gaming portal */
:root {
  --bg: #f3f6fb;
  --bg-elevated: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --line: #d8e0ec;
  --brand: #1d4ed8;
  --brand-deep: #0b2a6b;
  --accent: #c9a227;
  --accent-soft: #f4e7b5;
  --nav-h: 72px;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --max: 1120px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", 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(29, 78, 216, 0.12), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(201, 162, 39, 0.1), transparent 55%),
    linear-gradient(180deg, #eef3fb 0%, var(--bg) 28%, #e9eef7 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(8, 20, 48, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.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;
  text-decoration: none;
  max-height: calc(var(--nav-h) - 20px);
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f8fafc;
  font-size: 1.15rem;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
}

.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.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-ghost {
  background: transparent;
  color: #e2e8f0;
  border-color: rgba(226, 232, 240, 0.35);
}

.btn-gold {
  background: linear-gradient(135deg, #e6c35c, #c9a227);
  color: #1a1405;
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.28);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid rgba(226, 232, 240, 0.28);
  color: #f1f5f9;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-panel {
  display: none;
  position: fixed;
  top: var(--nav-h);
  right: 0;
  left: 0;
  background: #0b1733;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.25rem 1.4rem;
  z-index: 999;
}

.mobile-panel.open {
  display: block;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-panel ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.mobile-panel a {
  display: block;
  color: #e2e8f0;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  font-weight: 500;
}

.mobile-actions {
  display: grid;
  gap: 0.6rem;
}

.mobile-actions .btn {
  width: 100%;
}

/* —— Hero —— */
.page-main {
  padding-top: var(--nav-h);
}

.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 14, 35, 0.88) 0%, rgba(6, 14, 35, 0.55) 48%, rgba(6, 14, 35, 0.35) 100%),
    linear-gradient(180deg, rgba(6, 14, 35, 0.2) 0%, rgba(6, 14, 35, 0.75) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.5rem;
  max-width: 640px;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  line-height: 1.1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 600;
  margin: 0 0 0.9rem;
  line-height: 1.35;
  color: #e2e8f0;
}

.hero p {
  margin: 0 0 1.5rem;
  color: #cbd5e1;
  font-size: 1.02rem;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* —— Sections —— */
.section {
  padding: 3.5rem 0;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 42rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
}

.section-head p {
  margin: 0;
  color: var(--ink-soft);
}

.prose {
  max-width: 48rem;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  color: var(--brand-deep);
  margin: 1.8rem 0 0.7rem;
}

.prose ul {
  color: var(--ink-soft);
  padding-left: 1.2rem;
}

.prose a.ext-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.intro-block {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1224;
  min-height: 220px;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 240px;
}

/* —— Category grid —— */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.cat-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0b1224;
  min-height: 180px;
  text-decoration: none;
  color: #fff;
  isolation: isolate;
  transition: transform 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  text-decoration: none;
}

.cat-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 180px;
  opacity: 0.85;
  transition: transform 0.45s ease, opacity 0.3s ease;
}

.cat-item:hover img {
  transform: scale(1.05);
  opacity: 1;
}

.cat-item span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.1rem 1rem 0.95rem;
  background: linear-gradient(transparent, rgba(5, 12, 30, 0.92));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  z-index: 1;
}

/* —— Cards / articles —— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.article-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.article-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0b1224;
}

.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.05rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.article-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.35;
}

.article-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--brand);
}

.article-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  flex: 1;
}

.article-card .more {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--brand);
  margin-top: 0.35rem;
}

/* —— FAQ —— */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.2rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.95rem 0;
  list-style: none;
  color: var(--brand-deep);
}

.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 {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

/* —— Page banner —— */
.page-banner {
  padding: 2.6rem 0 1.6rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.08), transparent);
}

.page-banner h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  margin: 0 0 0.55rem;
  color: var(--brand-deep);
}

.page-banner p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 40rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: #64748b;
}

.breadcrumb span {
  color: #94a3b8;
}

/* —— Article layout —— */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.2rem 0 3.5rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #0b1224;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.sidebar-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.sidebar-box h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--brand-deep);
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-list li {
  border-bottom: 1px solid var(--line);
}

.side-list a {
  display: block;
  padding: 0.7rem 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.side-list a:hover {
  color: var(--brand);
}

/* —— Brands strip —— */
.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-strip img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2);
}

/* —— 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-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  margin: 0;
  color: var(--brand-deep);
}

.error-page p {
  color: var(--ink-soft);
  max-width: 28rem;
  margin: 0.75rem auto 1.5rem;
}

/* —— Footer —— */
.site-footer {
  background: #08122b;
  color: #94a3b8;
  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: #f8fafc;
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 0.9rem;
}

.site-footer a {
  color: #94a3b8;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-brand img {
  height: 38px;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  margin: 0;
  font-size: 0.92rem;
  max-width: 28rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.1rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

/* —— Motion —— */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: revealUp 0.7s ease forwards;
  }

  .reveal-delay-1 {
    animation-delay: 0.12s;
  }

  .reveal-delay-2 {
    animation-delay: 0.24s;
  }

  .reveal-delay-3 {
    animation-delay: 0.36s;
  }

  @keyframes revealUp {
    to {
      opacity: 1;
      transform: none;
    }
  }

  .hero-content {
    animation: revealUp 0.8s ease both;
  }
}

/* —— Responsive —— */
@media (max-width: 960px) {
  .cat-grid,
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-block,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-box {
    position: static;
  }
}

@media (max-width: 800px) {
  .nav-desktop,
  .nav-actions {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 64px;
  }

  .cat-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 70vh;
  }

  .hero-content {
    padding: 3rem 0 2.4rem;
  }

  .section {
    padding: 2.5rem 0;
  }
}
