/* KGame – k-gm.autos */
:root {
  --bg: #f4f7fb;
  --bg-alt: #e8eef6;
  --surface: #ffffff;
  --ink: #152033;
  --ink-soft: #4a5a72;
  --line: #d5dee9;
  --brand: #1a6ef0;
  --brand-deep: #0d4bb8;
  --brand-soft: #e8f1ff;
  --navy: #0b1628;
  --navy-2: #132238;
  --accent: #00c2a8;
  --warn: #c0392b;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(15, 35, 70, 0.08);
  --header-h: 72px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", 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: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-deep);
}

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;
}

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(11, 22, 40, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
  max-height: var(--header-h);
  padding: 0.4rem 0;
}

.brand-link img {
  height: 40px;
  width: auto;
  max-height: calc(var(--header-h) - 24px);
  object-fit: contain;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
  font-family: var(--font-body);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-deep);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}

.btn-outline:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-mobile {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 999;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.nav-mobile.open {
  display: flex;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-mobile a {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-weight: 500;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-mobile .mobile-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-mobile .mobile-auth .btn {
  width: 100%;
}

body.menu-open {
  overflow: hidden;
}

/* Main offset for fixed header */
.site-main {
  padding-top: var(--header-h);
  min-height: 60vh;
}

/* Hero */
.hero {
  position: relative;
  min-height: clamp(420px, 78vh, 640px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  background: var(--navy);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 16, 32, 0.35) 0%, rgba(8, 16, 32, 0.82) 70%, rgba(8, 16, 32, 0.95) 100%),
    linear-gradient(90deg, rgba(8, 16, 32, 0.75) 0%, rgba(8, 16, 32, 0.25) 55%, rgba(8, 16, 32, 0.45) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3.5rem 0 3rem;
  max-width: 640px;
  animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.35em;
  color: #fff;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.7em;
}

.hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  max-width: 36em;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-dark {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
}

.section-dark h2,
.section-dark h3 {
  color: #fff;
}

.section-dark p,
.section-dark li {
  color: rgba(255, 255, 255, 0.84);
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section-head p {
  color: var(--ink-soft);
  margin: 0;
}

.section-dark .section-head p {
  color: rgba(255, 255, 255, 0.75);
}

.lead-block {
  display: grid;
  gap: 1.5rem;
}

.lead-block p a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.cat-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1rem 1.2rem;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  color: inherit;
  text-decoration: none;
}

.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #b8cceb;
  color: inherit;
}

.cat-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 0.8rem;
  transition: transform 0.35s ease;
}

.cat-item:hover img {
  transform: scale(1.06);
}

.cat-item h3 {
  font-size: 1rem;
  margin: 0 0 0.35em;
}

.cat-item p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* Cards / articles */
.card-grid {
  display: grid;
  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, box-shadow 0.25s;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: var(--navy);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  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;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.article-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45em;
}

.article-card p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 0;
  flex: 1;
}

/* Intro / brand */
.brand-intro {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.brand-intro-visual {
  background: radial-gradient(circle at 30% 30%, #1a3a6e, var(--navy));
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.brand-intro-visual img {
  max-height: 240px;
  width: auto;
  object-fit: contain;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-family: var(--font-display);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--brand);
  font-weight: 500;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.15rem;
  color: var(--ink-soft);
}

/* Page hero (inner) */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3358 55%, #0f4f9a 100%);
  color: #fff;
  padding: 2.75rem 0 2.4rem;
}

.page-hero h1 {
  color: #fff;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 0.4em;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 40rem;
  margin: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.65);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.85);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Article detail */
.article-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}

.article-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
}

.article-content .cover {
  background: var(--navy);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.article-content .cover img {
  max-height: 280px;
  width: auto;
  object-fit: contain;
}

.article-content h2 {
  font-size: 1.35rem;
  margin-top: 1.6rem;
}

.article-content h3 {
  font-size: 1.1rem;
  margin-top: 1.3rem;
}

.article-content a {
  font-weight: 600;
}

.sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.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.8rem;
}

.side-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.side-links a {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.side-links a:hover {
  color: var(--brand);
}

/* Related */
.related-grid {
  display: grid;
  gap: 1rem;
}

/* Legal / about prose */
.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  margin: 2rem 0 3.5rem;
}

.prose h2 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
}

.prose h2:first-child {
  margin-top: 0;
}

/* Error pages */
.error-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 3rem 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(26, 110, 240, 0.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0, 194, 168, 0.12), transparent 35%),
    var(--bg);
}

.error-box {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 6.5rem);
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.3em;
}

.error-box h1 {
  font-size: 1.6rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Brands strip */
.brand-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.brand-strip img {
  max-height: 42px;
  width: auto;
  margin: 0 auto;
  opacity: 0.85;
  filter: grayscale(0.2);
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.78);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 0.8rem;
}

.footer-brand p {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-col h3 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: #fff;
}

.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.55);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  justify-content: space-between;
}

/* Guide list */
.guide-list {
  display: grid;
  gap: 1rem;
}

.guide-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, transform 0.25s;
}

.guide-row:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: inherit;
}

.guide-row img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  background: var(--navy);
  border-radius: 8px;
  padding: 0.35rem;
}

.guide-row h3 {
  font-size: 1.02rem;
  margin-bottom: 0.25em;
}

.guide-row p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Promo band */
.promo-band {
  display: grid;
  gap: 1rem;
  align-items: center;
}

.promo-band img {
  max-height: 80px;
  width: auto;
  margin: 0 auto;
}

/* Utilities */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

@media (min-width: 640px) {
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .brand-strip {
    grid-template-columns: repeat(8, 1fr);
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .nav-desktop,
  .header-actions {
    display: flex;
  }
  .menu-toggle {
    display: none;
  }
  .nav-mobile {
    display: none !important;
  }
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .brand-intro {
    grid-template-columns: 1fr 1.15fr;
  }
  .article-layout {
    grid-template-columns: 1fr 300px;
  }
  .article-content {
    padding: 2rem 2.2rem;
  }
  .prose {
    padding: 2rem 2.2rem;
  }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
  .promo-band {
    grid-template-columns: 1fr auto;
  }
  .guide-row {
    grid-template-columns: 100px 1fr;
  }
}

@media (max-width: 899px) {
  :root {
    --header-h: 64px;
  }
  .brand-link img {
    height: 34px;
  }
}
