:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --ink: #15171a;
  --muted: #656b74;
  --line: #dfe3e8;
  --red: #d34836;
  --blue: #2563eb;
  --green: #0f8f70;
  --yellow: #f4b400;
  --shadow: 0 24px 60px rgba(22, 24, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, Arial, sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
  min-height: 76px;
  max-height: 76px;
  padding: 0 clamp(18px, 5vw, 72px);
  background: rgba(247, 245, 239, 0.88);
  border-bottom: 1px solid rgba(21, 23, 26, 0.08);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
}

.brand-logo {
  display: block;
  width: 150px;
  height: 54px;
  object-fit: contain;
  object-position: left center;
  flex: 0 0 auto;
  max-width: 150px;
  max-height: 54px;
}

.login-logo {
  width: min(100%, 260px);
  height: 150px;
  max-width: 260px;
  max-height: 150px;
  margin: 0 auto;
  object-position: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: calc(100vh - 72px);
  padding: clamp(44px, 7vw, 92px) clamp(18px, 5vw, 72px);
  width: 100%;
  max-width: 100vw;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.hero-text {
  max-width: 640px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: var(--ink);
}

.button.secondary {
  background: transparent;
}

.hero-image {
  display: block;
  width: 100%;
  min-height: 360px;
  max-height: 620px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(21, 23, 26, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.section {
  padding: clamp(52px, 8vw, 96px) clamp(18px, 5vw, 72px);
  width: 100%;
  max-width: 100vw;
}

.section-heading {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin-bottom: 30px;
}

.niche-grid,
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.niche-card,
.article-card {
  min-height: 220px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.niche-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.niche-card:hover {
  border-color: rgba(21, 23, 26, 0.42);
  transform: translateY(-2px);
  transition: 180ms ease;
}

.niche-card.disabled {
  cursor: default;
}

.niche-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.niche-card p,
.article-card p,
.url-list p,
.site-footer p,
.niche-hero p {
  color: var(--muted);
  line-height: 1.65;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  background: #eef4f1;
}

.url-list {
  display: grid;
  gap: 12px;
}

.url-list div {
  padding: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(21, 23, 26, 0.08);
  border-radius: 8px;
}

.url-list span {
  font-weight: 900;
}

.url-list p {
  margin: 6px 0 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  border-top: 1px solid rgba(21, 23, 26, 0.1);
}

.site-footer p {
  margin: 0;
}

.niche-hero {
  min-height: 420px;
  padding: clamp(64px, 9vw, 118px) clamp(18px, 5vw, 72px);
  color: #fff;
  background: var(--ink);
}

.niche-hero h1 {
  max-width: 960px;
}

.niche-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(17px, 2vw, 22px);
}

.niche-hero .eyebrow {
  color: #fff;
}

.ai-theme {
  background:
    radial-gradient(circle at 84% 28%, rgba(244, 180, 0, 0.42), transparent 24%),
    linear-gradient(135deg, #14213d, #0f8f70);
}

.game-theme {
  background:
    radial-gradient(circle at 82% 24%, rgba(244, 180, 0, 0.40), transparent 24%),
    linear-gradient(135deg, #381414, #d34836);
}

.article-card {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: hidden;
}

.article-card h2 {
  font-size: 24px;
  line-height: 1.14;
}

.tag {
  width: fit-content;
  padding: 6px 10px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.card-image {
  width: calc(100% + 48px);
  height: 180px;
  margin: -24px -24px 4px;
  object-fit: cover;
  background: #e9edf2;
  border-bottom: 1px solid var(--line);
}

.muted {
  color: var(--muted);
}

.alert {
  padding: 12px 14px;
  color: #8f1d12;
  background: #ffe8e4;
  border: 1px solid #f3b6ad;
  border-radius: 8px;
}

.admin-body {
  min-height: 100vh;
  background: #eef4f1;
}

.admin-login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.admin-panel,
.admin-form {
  display: grid;
  gap: 18px;
  width: min(100%, 520px);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-panel h1,
.admin-wrap h1,
.post-wrap h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

textarea {
  min-height: 240px;
  resize: vertical;
  line-height: 1.6;
}

.small-textarea {
  min-height: 110px;
}

.admin-wrap,
.post-wrap {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 82px) 0;
}

.admin-wrap.narrow,
.post-wrap {
  width: min(820px, calc(100% - 36px));
}

.admin-wrap.narrow {
  width: min(1180px, calc(100% - 36px));
}

.admin-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-table {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-row h2 {
  margin: 0;
  font-size: 21px;
}

.admin-row p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-two-col,
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.editor-layout {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.post-editor {
  width: 100%;
}

.editor-main,
.editor-side {
  display: grid;
  gap: 18px;
}

.editor-side {
  padding: 18px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-toolbar button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.image-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #e9edf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.button.danger {
  color: #8f1d12;
  border-color: #f3b6ad;
}

.post-meta {
  margin: 18px 0 0;
  color: var(--muted);
}

.post-content {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  line-height: 1.85;
}

.post-content h3 {
  margin: 34px 0 8px;
  font-size: 25px;
}

.post-image {
  width: 100%;
  max-height: 520px;
  margin-top: 28px;
  object-fit: cover;
  background: #e9edf2;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tech-theme {
  background:
    radial-gradient(circle at 84% 28%, rgba(244, 180, 0, 0.38), transparent 24%),
    linear-gradient(135deg, #102034, #2563eb);
}

.finance-theme {
  background:
    radial-gradient(circle at 84% 28%, rgba(244, 180, 0, 0.38), transparent 24%),
    linear-gradient(135deg, #123026, #0f8f70);
}

.lifestyle-theme {
  background:
    radial-gradient(circle at 84% 28%, rgba(244, 180, 0, 0.38), transparent 24%),
    linear-gradient(135deg, #3a1626, #d34836);
}

.education-theme {
  background:
    radial-gradient(circle at 84% 28%, rgba(244, 180, 0, 0.38), transparent 24%),
    linear-gradient(135deg, #302317, #9a6a00);
}

.custom-theme {
  background:
    radial-gradient(circle at 84% 28%, rgba(244, 180, 0, 0.38), transparent 24%),
    linear-gradient(135deg, #15171a, #2563eb);
}

@media (max-width: 860px) {
  .site-header {
    align-items: center;
    flex-direction: row;
    justify-content: center;
    height: auto;
    max-height: none;
    min-height: 74px;
    padding-block: 10px;
  }

  .nav-links {
    width: auto;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .brand-logo {
    width: 132px;
    height: 48px;
  }

  .hero,
  .split-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-image {
    min-height: 280px;
    max-height: 420px;
  }

  .niche-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }

  .admin-title,
  .admin-row,
  .admin-two-col,
  .editor-layout {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .admin-title {
    display: grid;
  }

  .admin-actions .button,
  .form-actions .button {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .hero-actions,
  .button {
    width: 100%;
  }

  .hero-image {
    min-height: 220px;
    border-radius: 12px;
  }
}
