:root {
  --blue: #1f7ae0;
  --blue-deep: #0d4f9e;
  --teal: #0f9d8a;
  --ink: #152033;
  --muted: #5a6a7f;
  --line: rgba(21, 32, 51, 0.12);
  --surface: #ffffff;
  --bg: #eef3f9;
  --bg-soft: #f7fafc;
  --nav-h: 72px;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(13, 40, 80, 0.1);
  --max: 1120px;
  --font-display: "Sora", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", 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(31, 122, 224, 0.18), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(15, 157, 138, 0.12), transparent 55%),
    linear-gradient(180deg, #e8f0fa 0%, var(--bg) 28%, #f4f7fb 100%);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Fixed header */
.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 var(--line);
  box-shadow: 0 4px 20px rgba(15, 40, 80, 0.06);
}

.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.65rem;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.brand img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-desktop a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: rgba(31, 122, 224, 0.1);
  color: var(--blue-deep);
  text-decoration: none;
}

.auth-desktop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 122, 224, 0.28);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-teal {
  background: linear-gradient(135deg, var(--teal), #0b7d6e);
  color: #fff;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 0.75rem 1rem 1.1rem;
  z-index: 999;
}

.nav-mobile.open {
  display: block;
}

.nav-mobile a {
  display: block;
  padding: 0.75rem 0.5rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.nav-mobile .auth-mobile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

main {
  padding-top: var(--nav-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: clamp(420px, 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-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 22, 42, 0.88) 0%, rgba(8, 22, 42, 0.55) 48%, rgba(8, 22, 42, 0.25) 100%),
    linear-gradient(0deg, rgba(8, 22, 42, 0.75) 0%, transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.2rem;
  max-width: 640px;
  animation: rise 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.6rem;
  line-height: 1.05;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  margin: 0 0 0.85rem;
  line-height: 1.3;
}

.hero p {
  margin: 0 0 1.4rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.55);
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 680px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.prose {
  max-width: 720px;
}

.prose p {
  margin: 0 0 1rem;
  color: #2a3749;
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  margin: 1.8rem 0 0.7rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.intro-visual {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0b1a2e;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 1rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.cat-item img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 0.7rem;
}

.cat-item span {
  font-weight: 700;
  font-size: 0.95rem;
}

.cat-item small {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Cards for interactive lists */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.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;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: #0d1b2e;
  overflow: hidden;
}

.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: 1rem 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.article-card .tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue-deep);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.35;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
  max-width: 800px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.faq-item h3 {
  font-size: 1rem;
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Page chrome */
.page-hero {
  padding: 2.5rem 0 1.5rem;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.page-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 640px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  opacity: 0.5;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-row img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.2);
}

.promo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #12345a, #1f7ae0 55%, #0f9d8a);
  color: #fff;
}

.promo-strip img {
  height: 48px;
  width: auto;
}

.related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.article-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.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 0 0.4rem;
  letter-spacing: -0.04em;
}

.error-page p {
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto 1.4rem;
}

/* Footer */
.site-footer {
  background: #0d1a2c;
  color: rgba(255, 255, 255, 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 {
  font-family: var(--font-display);
  color: #fff;
  margin: 0 0 0.9rem;
  font-size: 1rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal {
  animation: fade-in 0.7s ease both;
}

@media (max-width: 960px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 64px;
  }

  .nav-desktop,
  .auth-desktop {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .brand img {
    height: 34px;
    max-height: 34px;
  }

  .hero {
    min-height: 520px;
  }

  .hero-content {
    padding: 3.2rem 0 2.4rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .cat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cat-item img {
    width: 72px;
    height: 72px;
  }
}
