:root {
  --ink: #000000;
  --paper: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --muted-2: rgba(255, 255, 255, 0.42);
  --line: rgba(255, 255, 255, 0.12);
  --surface: rgba(255, 255, 255, 0.035);
  --accent: #ff2e8c;
  --accent-2: #ffb838;
  --grad: linear-gradient(135deg, var(--accent-2) 0%, #ff5973 48%, var(--accent) 100%);
  --display: "Plus Jakarta Sans", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --prose: 38rem;
  --shell: 72rem;
  --ratio: 3 / 2;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--paper);
  font-family: var(--body);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.7;
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) clamp(16px, 4vw, 40px) 12px;
  background: rgba(9, 8, 10, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.topnav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topnav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.topnav .cta {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

/* ——— Journal index ——— */
.journal-hero {
  width: min(var(--shell), calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(48px, 9vh, 96px) 0 36px;
}

.journal-hero h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 14ch;
}

.journal-hero .lede {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  max-width: 40ch;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.featured {
  width: min(var(--shell), calc(100% - 32px));
  margin: 0 auto 28px;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0;
  text-decoration: none;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.25s ease;
}

.featured-card:hover {
  border-color: rgba(255, 77, 122, 0.4);
  transform: translateY(-2px);
}

.featured-media {
  position: relative;
  aspect-ratio: var(--ratio);
  background: #141216;
  overflow: hidden;
}

.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.featured-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: clamp(24px, 4vw, 40px);
}

.featured-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.featured-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.grid {
  width: min(var(--shell), calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: clamp(64px, 10vh, 100px);
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, transform 0.25s ease;
  min-height: 100%;
}

.card:hover {
  border-color: rgba(255, 77, 122, 0.4);
  transform: translateY(-3px);
}

.card-media {
  position: relative;
  aspect-ratio: var(--ratio);
  background: #141216;
  overflow: hidden;
}

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

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 20px;
  flex: 1;
}

.card-body h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ——— Article ——— */
.article-shell {
  width: min(var(--shell), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.article-head {
  width: min(44rem, 100%);
  margin: 0 auto 28px;
}

.breadcrumbs {
  margin: 0 0 18px;
  font-size: 0.8rem;
  color: var(--muted-2);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.article-head h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.article-head .dek {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
}

.meta {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.86rem;
}

.cover {
  margin: 0 0 36px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #120f14;
}

.cover-frame {
  aspect-ratio: var(--ratio);
  width: 100%;
  overflow: hidden;
}

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cover figcaption {
  padding: 12px 16px 14px;
  font-size: 0.84rem;
  color: var(--muted-2);
  line-height: 1.45;
  border-top: 1px solid var(--line);
}

.prose {
  width: min(var(--prose), 100%);
  margin: 0 auto;
}

.prose > * {
  margin-inline: 0;
}

.answer {
  margin: 0 0 24px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255, 77, 122, 0.09);
  border: 1px solid rgba(255, 77, 122, 0.22);
  color: var(--paper);
  font-size: 1.02rem;
  line-height: 1.55;
}

.keypoints {
  margin: 0 0 28px;
  display: grid;
  gap: 10px;
}

.keypoint {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 138, 61, 0.08);
  border: 1px solid rgba(255, 138, 61, 0.2);
  color: var(--paper);
  font-size: 0.95rem;
}

.prose h2 {
  margin: 40px 0 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--paper);
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose p {
  margin: 0 0 1em;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
  margin: 0 0 1.2em;
}

.prose li {
  margin-bottom: 8px;
}

.prose a {
  color: var(--paper);
  text-underline-offset: 3px;
}

.inline-figure {
  margin: 28px 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #120f14;
}

.inline-figure .cover-frame {
  border-radius: 0;
}

.inline-figure figcaption {
  padding: 12px 16px 14px;
  font-size: 0.84rem;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
}

.table-wrap {
  margin: 20px 0 28px;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 520px;
}

table.data th,
table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: -0.02em;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
}

table.data td {
  color: var(--muted);
}

table.data tr:last-child td {
  border-bottom: none;
}

.sample {
  margin: 20px 0 28px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.sample h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--paper);
}

.sample ol,
.sample ul {
  margin: 0;
}

.faq {
  margin-top: 40px;
  padding-top: 8px;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-family: var(--display);
  letter-spacing: -0.02em;
  color: var(--paper);
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details p {
  margin: 10px 0 0;
}

.related {
  width: min(var(--shell), 100%);
  margin: 48px auto 0;
}

.related h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}

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

.related-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.2s ease;
}

.related-card:hover {
  border-color: rgba(255, 77, 122, 0.4);
}

.related-card .thumb {
  aspect-ratio: var(--ratio);
  border-radius: 12px;
  overflow: hidden;
  background: #141216;
}

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

.related-card strong {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.related-card span {
  color: var(--muted-2);
  font-size: 0.82rem;
}

.cta-band {
  width: min(var(--prose), 100%);
  margin: 48px auto 0;
  padding: 28px 24px;
  border-radius: 20px;
  background:
    radial-gradient(500px 200px at 100% 0%, rgba(255, 77, 122, 0.22), transparent 60%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.cta-band h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.cta-band p {
  margin: 0 0 18px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 calc(28px + var(--safe-bottom));
  color: var(--muted-2);
  font-size: 0.82rem;
}

.footer-inner {
  width: min(var(--shell), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 960px) {
  .featured-card {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

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

  .related-card {
    grid-template-columns: 112px 1fr;
  }

  .article-shell {
    padding-top: 20px;
  }
}
