:root {
  --ink: #0a0b0d;
  --muted: #53555a;
  --line: #dedfe1;
  --soft: #f5f5f5;
  --paper: #ffffff;
  --footer: #0c1014;
  --content: 1140px;
  --wide: 1430px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

body, button, input, textarea { letter-spacing: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.site-header {
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #e7e7e7;
  box-shadow: 0 5px 17px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav {
  align-items: center;
  display: flex;
  height: 61px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--wide);
  padding: 0;
  width: calc(100% - 48px);
}

.brand {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.brand span { display: none; }

.nav-links {
  align-items: stretch;
  display: flex;
  gap: 38px;
  height: 100%;
}

.nav-links a {
  align-items: center;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  display: flex;
  font-size: 15px;
  font-weight: 500;
  min-height: auto;
  padding: 2px 2px 0;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { border-bottom-color: var(--ink); }

.home-hero {
  background: linear-gradient(90deg, #f7f7f7 0%, #fff 51%, #f8f8f8 100%);
  border-bottom: 1px solid #f0f0f0;
}

.hero-inner {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(440px, 0.9fr) minmax(540px, 1.1fr);
  margin: 0 auto;
  max-width: var(--wide);
  min-height: 370px;
  overflow: hidden;
  padding: 20px 0 0;
  width: calc(100% - 48px);
}

.hero-content {
  align-self: center;
  max-width: 635px;
  padding-left: 2px;
  position: relative;
  z-index: 2;
}

.hero-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  margin: 0 0 13px;
  text-transform: uppercase;
}

.hero-kicker span { letter-spacing: 1px; }

.hero-content h1 {
  font-size: 49px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0;
  max-width: 610px;
  text-wrap: balance;
}

.hero-content > p:not(.hero-kicker) {
  color: #484a4f;
  font-size: 16px;
  line-height: 1.45;
  margin: 20px 0;
  max-width: 530px;
}

.hero-button,
.button.primary {
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 3px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 10px 26px;
  text-decoration: none;
  text-transform: uppercase;
}

.hero-button span { font-size: 18px; margin-left: 8px; }
.hero-button:hover, .button.primary:hover { background: #2d3034; }

.hero-visual { align-self: end; margin-left: -5px; max-width: 740px; }
.hero-visual img { height: auto; object-fit: contain; width: 100%; }

.articles-section { padding: 16px 24px 10px; }

.content-layout {
  align-items: start;
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 3.45fr) minmax(210px, 1fr);
  margin: 0 auto;
  max-width: var(--content);
}

.section-title-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title-row h2,
.categories h2 { font-size: 22px; line-height: 1.15; margin: 0; }
.section-title-row > a { font-size: 11px; text-decoration: none; }

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

.article-card {
  border: 1px solid #d9dadc;
  border-radius: 6px;
  min-width: 0;
  overflow: hidden;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.article-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.article-image { background: #202329; display: block; overflow: hidden; }
.article-image img { aspect-ratio: 2.06 / 1; height: auto; object-fit: cover; width: 100%; }

.article-body {
  display: flex;
  flex-direction: column;
  min-height: 111px;
  padding: 8px 12px 9px;
}

.article-body h3 { font-size: 14px; line-height: 1.22; margin: 0; }
.article-body h3 a { text-decoration: none; }

.article-body p {
  color: #5f6165;
  font-size: 10px;
  line-height: 1.45;
  margin: 6px 0 10px;
}

.article-meta {
  color: #62656a;
  display: flex;
  flex-wrap: wrap;
  font-size: 9px;
  gap: 14px;
  margin-top: auto;
}

.article-meta time::before { content: "▣"; margin-right: 6px; }
.article-meta span::before { content: "•"; margin-right: 8px; }

.categories { margin-top: 24px; }
.categories h2 { font-size: 17px; margin-bottom: 9px; }

.category-list {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.category-list a {
  align-items: center;
  background: #f0f0f1;
  border: 1px solid transparent;
  border-radius: 5px;
  display: flex;
  font-size: 11px;
  font-weight: 700;
  gap: 9px;
  justify-content: center;
  min-height: 31px;
  padding: 6px 10px;
  text-decoration: none;
}

.category-list a:hover { border-color: #b8b9bb; }
.category-list span { font-size: 16px; line-height: 1; }

.newsletter {
  background: #fafafa;
  margin-top: 1px;
  min-height: 295px;
  padding: 28px 22px;
}

.newsletter h2 {
  font-size: 17px;
  line-height: 1.35;
  margin: 0 0 20px;
  max-width: 180px;
}

.newsletter > p { font-size: 11px; line-height: 1.55; margin: 0 0 17px; }

.newsletter input {
  background: #fff;
  border: 1px solid #cfd0d2;
  border-radius: 4px;
  min-height: 38px;
  padding: 9px 12px;
  width: 100%;
}

.newsletter input::placeholder { color: #96989c; font-size: 10px; }

.newsletter button {
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  margin-top: 9px;
  min-height: 40px;
  text-transform: uppercase;
  width: 100%;
}

.newsletter button:hover { background: #2d3034; }
.newsletter small { color: #67696d; display: block; font-size: 9px; margin-top: 15px; text-align: center; }
.form-status { color: #1f6a3a; font-size: 10px; margin: 8px 0 0; min-height: 0; }

.site-footer {
  background: var(--footer);
  color: #eceef0;
  margin-top: 0;
  padding: 27px 24px 22px;
}

.footer-inner {
  display: grid;
  gap: 66px;
  grid-template-columns: 1.25fr 0.9fr 1fr 1.1fr;
  margin: 0 auto;
  max-width: var(--content);
}

.footer-brand strong { display: block; font-size: 21px; margin-bottom: 10px; }

.footer-brand p,
.footer-social p {
  color: #bfc3c7;
  font-size: 11px;
  line-height: 1.6;
  margin: 0;
  max-width: 240px;
}

.footer-column h2 { font-size: 10px; letter-spacing: 1px; margin: 0 0 11px; text-transform: uppercase; }
.footer-links { display: grid; gap: 4px; }
.split-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-links a { color: #d4d6d8; font-size: 11px; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

.social-links { display: flex; gap: 9px; margin-bottom: 15px; }

.social-links a {
  align-items: center;
  border: 1px solid #e8eaec;
  border-radius: 50%;
  display: flex;
  font-size: 10px;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  text-decoration: none;
  width: 28px;
}

/* Post and editor pages */
.post-shell,
.editor-shell { margin: 0 auto; max-width: 1120px; padding: 56px 24px; }
.post-shell { max-width: 860px; }

.post-article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 46px;
}

.post-meta { color: var(--muted); font-size: 13px; font-weight: 700; margin: 0; }
.post-article h1 { font-size: 48px; line-height: 1.08; margin: 12px 0 18px; }
.post-description { color: var(--muted); font-size: 19px; margin: 0 0 36px; }
.post-content { font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.75; }
.post-content h2 { font-family: Arial, Helvetica, sans-serif; font-size: 30px; line-height: 1.2; margin: 36px 0 12px; }

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

.post-content blockquote { border-left: 4px solid var(--ink); color: #34363a; font-size: 21px; padding-left: 20px; }

.editor-shell {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.editor-panel,
.preview-panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 24px; }

.eyebrow { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 1px; margin: 0 0 8px; text-transform: uppercase; }
.editor-panel h1, .preview-panel h2 { line-height: 1.1; margin: 0; }
.editor-panel h1 { font-size: 42px; }

label { color: var(--muted); display: block; font-size: 12px; font-weight: 800; margin: 18px 0 8px; text-transform: uppercase; }

.editor-panel input,
.editor-panel textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.editor-panel textarea { min-height: 270px; resize: vertical; }
.help { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
#cardHint { white-space: pre-wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

.button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  min-height: 40px;
  padding: 9px 14px;
  text-decoration: none;
}

.code-output {
  background: #17191c;
  border-radius: 5px;
  color: #fff;
  display: block;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  max-height: 380px;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
}

@media (max-width: 1050px) {
  .hero-inner { grid-template-columns: 1fr 1fr; }
  .hero-content h1 { font-size: 42px; }
  .content-layout { gap: 28px; }
}

@media (max-width: 850px) {
  .nav-links { gap: 20px; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 50px; }
  .hero-content { max-width: 680px; }
  .hero-visual { margin: 24px auto 0; max-width: 700px; }
  .content-layout, .editor-shell { grid-template-columns: 1fr; }
  .newsletter { min-height: 0; }
  .footer-inner { gap: 30px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header { position: static; }
  .nav { align-items: flex-start; flex-direction: column; height: auto; padding: 18px; width: 100%; }
  .brand { font-size: 23px; }

  .nav-links {
    gap: 20px;
    height: auto;
    margin-top: 17px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
  }

  .nav-links a { flex: 0 0 auto; font-size: 13px; padding-bottom: 7px; }
  .hero-inner { min-height: auto; padding: 45px 18px 0; width: 100%; }
  .hero-kicker { font-size: 10px; letter-spacing: 2px; }
  .hero-content h1 { font-size: 40px; text-wrap: wrap; }
  .hero-content > p:not(.hero-kicker) { font-size: 15px; }
  .hero-button { padding: 10px 16px; width: 100%; }
  .hero-visual { margin-left: -28px; margin-right: -28px; width: calc(100% + 56px); }
  .articles-section { padding: 28px 18px 32px; }
  .section-title-row { align-items: flex-start; gap: 12px; }
  .section-title-row h2 { font-size: 21px; }
  .featured-grid { grid-template-columns: 1fr; }
  .article-body { min-height: 150px; padding: 15px; }
  .article-body h3 { font-size: 18px; }
  .article-body p { font-size: 13px; }
  .article-meta { font-size: 11px; }
  .category-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .newsletter { padding: 25px 20px; }
  .newsletter h2 { max-width: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .post-shell, .editor-shell { padding: 32px 18px; }
  .post-article { padding: 25px 20px; }
  .post-article h1, .editor-panel h1 { font-size: 36px; }
}
