/* Shared minimal stylesheet for case-study pages. Matches the index aesthetic.
   Auto light/dark, system fonts, no animation. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #5f5f5f;
  --rule: #e2e2e2;
  --accent: #0b62c4;
  --code-bg: #f3f3f3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #e8e8e8;
    --muted: #a0a0a0;
    --rule: #2e2e2e;
    --accent: #8ab8f0;
    --code-bg: #1f1f1f;
  }
}

/* Explicit overrides from the toggle (beat the media query by specificity). */
:root[data-theme="light"] {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #5f5f5f;
  --rule: #e2e2e2;
  --accent: #0b62c4;
  --code-bg: #f3f3f3;
}

:root[data-theme="dark"] {
  --bg: #121212;
  --text: #e8e8e8;
  --muted: #a0a0a0;
  --rule: #2e2e2e;
  --accent: #8ab8f0;
  --code-bg: #1f1f1f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 5rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--muted);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.back-link {
  display: inline-block;
  padding: 0.15rem 0;
  margin-bottom: 3rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.hero {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.hero-meta {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-sub {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.action-btn {
  display: inline-block;
  padding: 0.15rem 0;
  color: var(--muted);
}

.action-btn.primary {
  color: var(--text);
  font-weight: 600;
}

.content-section {
  margin-bottom: 3rem;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
}

p strong,
li strong {
  font-weight: 600;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.dateline {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.bullets,
.numbered {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.bullets li,
.numbered li {
  margin-bottom: 0.6rem;
}

.quote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--rule);
}

.quote blockquote {
  margin: 0;
}

.quote p {
  font-style: italic;
  margin-bottom: 0.35rem;
}

.quote figcaption {
  font-size: 0.875rem;
  color: var(--muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.9375rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.data-table th {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.embed-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.embed-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.credits p {
  font-size: 0.9375rem;
  color: var(--muted);
}

.credits p strong {
  color: var(--text);
}

.page-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}

.page-footer p {
  margin: 0;
}

/* Theme fade for elements that set their own color/border (body's color fade
   in toggle.css covers everything that inherits). */
h1,
h2,
h3,
p,
li,
code,
.hero,
.hero-meta,
.hero-sub,
.dateline,
.quote,
.quote figcaption,
.data-table,
.data-table th,
.data-table td,
.embed-container,
.credits p,
.page-footer {
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}
