:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --max: 820px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a {
  color: var(--accent);
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--muted);
}

.site-nav a + a {
  margin-left: 1.25rem;
}

.site-nav a:hover {
  color: var(--accent);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* Homepage: full-width article grid (not narrow article column) */
main.page-home {
  max-width: 1100px;
}

main.page-home .home-hero {
  max-width: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

main.page-home .post-grid {
  max-width: none;
  margin: 0;
  padding: 0;
}

article h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.article-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.hero-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow);
  display: block;
}

.toc {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.toc h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc a {
  text-decoration: none;
}

article h2 {
  margin-top: 2.5rem;
  font-size: 1.45rem;
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: 0.35rem;
}

article h3 {
  margin-top: 1.75rem;
  font-size: 1.15rem;
}

article p,
article li {
  color: #334155;
}

article ul,
article ol {
  padding-left: 1.35rem;
}

.callout {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

code {
  font-family: Consolas, "Courier New", monospace;
}

.faq-item {
  margin-bottom: 1.25rem;
}

.faq-item strong {
  display: block;
  margin-bottom: 0.35rem;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer p {
  margin: 0.35rem 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}

.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.post-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

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

.post-card-body {
  padding: 1rem;
}

.post-card h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  border: none;
  padding: 0;
}

.post-card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.home-hero {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 0 1.25rem;
  text-align: center;
}

.home-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-top: 0;
}

.home-hero p {
  color: var(--muted);
  max-width: 42rem;
  margin: 0.75rem auto 0;
}

/* AdSense-ready ad regions (paste ad code inside .ad-slot-inner after approval) */
.ad-slot {
  margin: 2rem auto;
  text-align: center;
  clear: both;
}

.ad-label {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ad-slot-inner {
  min-height: 90px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-top .ad-slot-inner {
  min-height: 100px;
}

.ad-slot-in-article .ad-slot-inner {
  min-height: 250px;
}

.ad-slot-home .ad-slot-inner {
  min-height: 120px;
  max-width: 728px;
  margin: 0 auto;
}

.ad-slot-home .ad-slot-inner-gpt {
  min-height: 320px;
  max-width: 100%;
  overflow-x: auto;
  border: none;
  background: transparent;
  padding: 0;
}

.ad-slot-home .gpt-ad-unit {
  margin: 0 auto;
  max-width: 100%;
}

.site-disclaimer {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 36rem;
  margin: 0.75rem auto 0;
  line-height: 1.5;
}

.editorial-bar {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.content-example {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.content-example pre {
  margin: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
}

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

article table th,
article table td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  text-align: left;
}

article table th {
  background: var(--accent-soft);
}

.legal-page h2 {
  font-size: 1.2rem;
  margin-top: 2rem;
}

.legal-page ul {
  padding-left: 1.35rem;
  color: #334155;
}

/* Study / media frame on s/player.html (HTML + CSS only) */
.media-player {
  position: relative;
  max-width: 100%;
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0f172a;
}

.media-player img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}

.media-player-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1rem 0.85rem;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.85));
  color: #e2e8f0;
  font-size: 0.9rem;
}

.media-player-badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 600px) {
  .site-nav a + a {
    margin-left: 0.75rem;
  }

  .site-logo {
    font-size: 1rem;
  }

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

  .ad-slot-in-article .ad-slot-inner {
    min-height: 200px;
  }
}
