:root {
  --brand-900: #1a3a5c;
  --brand-800: #124f88;
  --brand-700: #1661a6;
  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4;
  --accent-600: #ff5200;
  --ink-900: #0b1220;
  --ink-700: #26344d;
  --ink-500: #5d6b85;
  --surface-0: #ffffff;
  --surface-1: #f7f9fc;
  --border: rgba(26, 58, 92, 0.14);
  --shadow-sm: 0 10px 25px rgba(11, 18, 32, 0.08);
  --shadow-md: 0 20px 45px rgba(11, 18, 32, 0.14);
  --container: 1120px;
  --gutter: 22px;
  --radius-md: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Rubik", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
  color: var(--ink-900);
  background: #ffffff;
}

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

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

.container {
  width: min(var(--container), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
}

.blog-hero {
  padding: 58px 0 34px;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 12px;
  padding: 7px 11px;
  border: 1px solid rgba(34, 211, 238, 0.7);
  border-radius: 999px;
  color: var(--brand-800);
  background: rgba(34, 211, 238, 0.1);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.blog-hero h1 {
  max-width: 880px;
  margin: 0;
  color: var(--brand-900);
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--ink-500);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
}

.posts-section {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 8vw, 110px) 0 clamp(76px, 8vw, 120px);
  background: #ffffff;
}

.posts-section::after {
  content: "";
  position: absolute;
  top: clamp(28px, 4vw, 58px);
  right: max(-120px, calc((100vw - var(--container)) / 2 - 130px));
  width: clamp(260px, 34vw, 450px);
  aspect-ratio: 1;
  border: 2px solid #ff5200;
  border-radius: 54px;
  opacity: 0.95;
  transform: rotate(45deg);
  pointer-events: none;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
  position: relative;
  z-index: 1;
}

.section-head h2 {
  margin: 0;
  color: #1a3a5c;
  font-size: 31px;
  font-weight: 400;
  letter-spacing: 0.399em;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 3px 8px rgba(26, 58, 92, 0.24);
}

.section-head p {
  max-width: 68ch;
  margin: 8px 0 0;
  color: var(--ink-500);
}

.new-post-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 12px;
  color: #ffffff;
  background: #004174;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(0, 65, 116, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.new-post-btn:hover {
  transform: translateY(-1px);
  background: #06375f;
  box-shadow: 0 18px 34px rgba(0, 65, 116, 0.26);
}

.posts-grid {
  --posts-gap: clamp(24px, 2.4vw, 38px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--posts-gap);
  align-items: stretch;
  position: relative;
  z-index: 1;
  padding: 30px 6px 34px;
  overflow-x: visible;
  overflow-y: visible;
}

.post-card {
  position: relative;
  display: flex;
  min-height: 366px;
  flex-direction: column;
  overflow: visible;
  margin-top: 0;
  padding-top: 150px;
  border: 0;
  border-radius: 0 0 14px 14px;
  background: var(--surface-0);
  box-shadow: 0 24px 42px rgba(26, 58, 92, 0.12);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 54px rgba(26, 58, 92, 0.16);
}

.post-card:focus-visible {
  outline: 3px solid rgba(26, 58, 92, 0.24);
  outline-offset: 4px;
}

.post-card-image {
  position: absolute;
  top: -28px;
  left: 50%;
  width: calc(100% - 5px);
  height: 174px;
  transform: translateX(-50%);
  object-fit: cover;
  border-radius: 8px;
  background: #e8eef3;
}

.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 24px 26px 24px;
}

.post-category {
  display: none;
}

.post-card h3 {
  margin: 0;
  color: var(--brand-900);
  font-size: 15px;
  line-height: 1.18;
  letter-spacing: 0;
  font-weight: 700;
}

.post-excerpt {
  margin: 0;
  color: #000000;
  font-size: 15px;
  line-height: 1.32;
}

.post-date {
  margin-top: auto;
  color: #2b5f91;
  font-size: 14px;
  font-weight: 400;
}

@media (max-width: 980px) {
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

.status-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(15, 66, 113, 0.12);
  border-radius: var(--radius-md);
  color: var(--ink-500);
  background: var(--surface-0);
}

.post-detail {
  max-width: 880px;
  padding-top: 48px;
  padding-bottom: 80px;
}

.post-detail-header {
  margin-bottom: 28px;
}

.post-detail h1 {
  margin: 12px 0 14px;
  color: var(--brand-900);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  color: var(--ink-500);
  font-weight: 700;
}

.post-hero-image {
  width: 100%;
  max-height: 470px;
  margin: 26px 0 32px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.post-content {
  color: var(--ink-700);
  font-size: 18px;
  line-height: 1.78;
}

.post-content h2,
.post-content h3 {
  color: var(--brand-900);
  line-height: 1.2;
  letter-spacing: 0;
}

.post-content h2 {
  margin-top: 34px;
  font-size: 30px;
}

.post-content h3 {
  margin-top: 28px;
  font-size: 23px;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin: 0 0 18px;
}

.post-content a {
  color: var(--brand-700);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.72);
  text-underline-offset: 4px;
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head h2 {
    letter-spacing: 0.22em;
  }

  .blog-hero {
    padding-top: 42px;
  }

  .post-card-body {
    padding: 22px;
  }
}

.generator-hero {
  padding: 54px 0 22px;
}

.generator-hero h1 {
  max-width: 820px;
  margin: 0;
  color: var(--brand-900);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.generator-section {
  padding: 18px 0 74px;
}

.generator-card {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface-0);
  box-shadow: var(--shadow-sm);
}

.generator-card h2 {
  margin: 0 0 16px;
  color: var(--brand-900);
  font-size: 26px;
  letter-spacing: 0;
}

.auth-card {
  max-width: 460px;
}

.post-generator {
  display: grid;
  gap: 18px;
}

.generator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.generator-head p {
  margin: 6px 0 0;
  color: var(--ink-500);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.generator-card label {
  display: grid;
  gap: 8px;
  color: var(--ink-700);
  font-size: 14px;
  font-weight: 800;
}

.generator-card input,
.generator-card textarea {
  width: 100%;
  border: 1px solid rgba(15, 66, 113, 0.18);
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--ink-900);
  background: #ffffff;
  font: inherit;
}

.generator-card textarea {
  resize: vertical;
  min-height: 320px;
  line-height: 1.55;
}

.generator-card input:focus,
.generator-card textarea:focus {
  outline: none;
  border-color: var(--cyan-400);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.22);
}

.inline-images,
.generator-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
}

.inline-images label {
  flex: 1 1 320px;
}

.generator-btn {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  color: #ffffff;
  background: var(--accent-600);
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.generator-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(255, 82, 0, 0.22);
}

.generator-btn.secondary {
  color: var(--brand-900);
  border-color: rgba(34, 211, 238, 0.7);
  background: rgba(34, 211, 238, 0.12);
  box-shadow: none;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--ink-500);
  font-weight: 800;
}

.is-hidden {
  display: none;
}

@media (max-width: 720px) {
  .generator-head,
  .inline-images,
  .generator-actions {
    align-items: stretch;
    flex-direction: column;
  }

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