* {
  box-sizing: border-box;
}

:root {
  --bg-main: #0b1220;
  --bg-soft: #111a2b;
  --surface: #ffffff;
  --surface-alt: #f4f7fb;
  --stroke: #d9e3f1;
  --text-main: #162033;
  --text-soft: #5d6a7e;
  --brand: #25a7ff;
  --brand-dark: #1078df;
  --accent: #16c7b8;
  --danger: #dc2626;
  --shadow-lg: 0 20px 50px rgba(10, 28, 52, 0.14);
  --shadow-md: 0 12px 28px rgba(10, 28, 52, 0.10);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top right, rgba(37, 167, 255, 0.12), transparent 18%),
    linear-gradient(180deg, #eef6ff 0%, #f7fbff 35%, #f5f8fc 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

.site-topbar {
  background: rgba(8, 18, 33, 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 18px;
}

.brand-mini {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.4px;
}

.topbar-link {
  color: rgba(255,255,255,0.84);
  text-decoration: none;
  font-weight: 600;
}

.hero {
  padding: 56px 0 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.hero-card,
.dashboard-card,
.resource-shell,
.card-item,
.auth-card,
.sidebar-card,
.comment-box {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
}

.hero-copy {
  padding: 38px;
}

.hero-card {
  padding: 28px;
  background: linear-gradient(180deg, #0d1b31 0%, #132746 100%);
  color: white;
}

.eyebrow,
.section-kicker,
.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.hero-card .section-kicker,
.hero-card .mini-label,
.hero-card .eyebrow {
  color: #7ed4ff;
}

.hero-copy h1,
.section-headline h1,
.section-headline h2,
.auth-card h2,
.card-head h2,
.card-head h3,
.dashboard-card h3,
.resource-copy h1,
.sidebar-card h2,
.comment-box h2 {
  margin: 10px 0 0;
  font-family: 'Poppins', sans-serif;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-copy h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  max-width: 11ch;
}

.hero-copy p,
.hero-card p,
.section-headline p,
.auth-card p,
.dashboard-card p,
.resource-summary,
.resource-body,
.resource-meta-line,
.card-item p,
.loading-card,
.empty-card,
.error-card,
.comment-box p,
.sidebar-post p {
  color: var(--text-soft);
  line-height: 1.72;
  text-wrap: pretty;
}

.hero-card p,
.hero-card li {
  color: rgba(255,255,255,0.88);
}

.hero-card h2 {
  margin: 8px 0 18px;
  font-family: 'Poppins', sans-serif;
}

.hero-card ul,
.modern-list {
  margin: 0;
  padding-left: 20px;
}

.hero-card li,
.modern-list li {
  margin-bottom: 10px;
  line-height: 1.65;
}

.hero-actions,
.resource-actions,
.banner-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.btn-primary,
.btn-ghost,
.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: 0.25s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(16, 120, 223, 0.24);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost,
.btn-soft {
  background: rgba(255,255,255,0.75);
  color: var(--text-main);
  border-color: rgba(16, 120, 223, 0.14);
}

.btn-soft {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fc 100%);
}

.main-space {
  padding: 10px 0 72px;
}

.section-headline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 24px;
  flex-wrap: wrap;
}

.section-headline h1,
.section-headline h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 22px;
}

.card-item {
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 46px rgba(12, 28, 52, 0.16);
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dbe7f3;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  background: rgba(11, 18, 32, 0.82);
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-body {
  padding: 22px;
}

.card-title {
  margin: 8px 0 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  line-height: 1.25;
}

.justified {
  text-align: justify;
  text-justify: inter-word;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef6ff;
  color: #0f62b8;
  font-weight: 700;
}

.read-more {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 800;
}

.inline-back {
  display: inline-flex;
  text-decoration: none;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 18px;
}

.loading-card,
.empty-card,
.error-card {
  background: rgba(255,255,255,0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: 58vh;
}

.auth-card {
  width: min(720px, 100%);
  padding: 30px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
}

.dashboard-wrap {
  display: grid;
  gap: 24px;
}

.dashboard-top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.dashboard-card {
  padding: 24px;
}

.dashboard-card.compact h3 {
  margin: 8px 0 10px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.75fr;
  gap: 22px;
}

.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.card-head.no-margin {
  margin-bottom: 14px;
}

.admin-form,
.comment-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.admin-form label,
.comment-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: var(--text-main);
}

.admin-form input,
.admin-form textarea,
.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text-main);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-form input:focus,
.admin-form textarea:focus,
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: rgba(37, 167, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 167, 255, 0.12);
}

.toggle-wrap {
  align-content: start;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 4px;
  font-weight: 600;
}

.downloads-box {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef5fd 100%);
  border: 1px solid var(--stroke);
}

.form-message {
  min-height: 24px;
  font-weight: 700;
  color: var(--brand-dark);
}

.hidden {
  display: none !important;
}

.full-btn {
  width: 100%;
}

.admin-heading {
  margin-bottom: 18px;
}

.resource-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.resource-main-column {
  display: grid;
  gap: 22px;
}

.resource-shell-vertical {
  display: block;
  overflow: hidden;
}

.resource-media-top {
  width: 100%;
  background: linear-gradient(180deg, #eef6ff 0%, #f7fbff 100%);
  padding: 24px;
  border-bottom: 1px solid rgba(15, 98, 184, 0.08);
}

.resource-media-top img {
  width: 100%;
  max-height: 520px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 18px;
  background: #edf4fb;
}

.resource-copy-vertical {
  padding: 32px;
}

.resource-copy-vertical h1 {
  margin-top: 12px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 10px;
}

.resource-text-block {
  margin-top: 28px;
}

.resource-subtitle {
  margin: 0 0 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  color: var(--text-main);
}

.resource-summary,
.resource-body {
  margin: 0;
  line-height: 1.85;
  color: var(--text-soft);
  text-align: justify;
  white-space: pre-line;
}

.download-section {
  margin-top: 34px;
}

.banner-downloads-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.banner-downloads-inline .download-banner {
  flex: 0 1 210px;
  width: 210px;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.banner-downloads-inline .download-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(10, 28, 52, 0.15);
}

.banner-downloads-inline .download-banner img {
  width: 100%;
  height: auto;
  display: block;
}

.sidebar-card {
  padding: 22px;
  position: sticky;
  top: 92px;
}

.sidebar-card h2 {
  margin-bottom: 16px;
  font-size: 1.35rem;
}

.sidebar-list {
  display: grid;
  gap: 14px;
}

.sidebar-post {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: start;
  text-decoration: none;
  padding: 10px;
  border-radius: 16px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-post:hover {
  background: rgba(37, 167, 255, 0.06);
  transform: translateY(-1px);
}

.sidebar-thumb {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  background: #e7eef7;
}

.sidebar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-category {
  display: inline-flex;
  margin-bottom: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.sidebar-post h3 {
  margin: 0 0 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.98rem;
  line-height: 1.25;
}

.sidebar-post p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.comment-box {
  padding: 28px;
}

.comment-box h2 {
  margin-bottom: 12px;
}

.comment-box p {
  margin: 0 0 20px;
}

.comment-form .btn-primary {
  width: fit-content;
  min-width: 210px;
}

@media (max-width: 1080px) {
  .hero-grid,
  .admin-layout,
  .auth-card,
  .dashboard-top,
  .resource-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .hero-copy,
  .hero-card,
  .dashboard-card,
  .resource-copy-vertical,
  .auth-card,
  .sidebar-card,
  .comment-box {
    padding: 24px;
  }

  .form-grid.two-col {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    min-height: 64px;
  }

  .resource-media-top {
    padding: 14px;
  }

  .resource-media-top img {
    max-height: 280px;
  }

  .banner-downloads-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .banner-downloads-inline .download-banner {
    width: 100%;
    flex-basis: auto;
  }

  .comment-form .btn-primary {
    width: 100%;
  }
}
