:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --ink: #111111;
  --ink-soft: #3f3f46;
  --ink-muted: #71717a;
  --black: #050505;
  --rail: #0a0a0a;
  --line: #d4d4d8;
  --line-dark: #27272a;
  --blue: #38bdf8;
  --blue-dark: #0369a1;
  --max-page: 1120px;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.62;
  letter-spacing: 0;
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--blue-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: #075985; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.05;
  letter-spacing: 0;
}

p { margin: 0 0 1rem; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .94rem;
}

th, td {
  border: 1px solid var(--line);
  padding: .7rem .75rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #111111;
  color: #ffffff;
  font-weight: 800;
}

code {
  padding: .1rem .3rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f4f4f5;
}

::selection { background: var(--blue); color: #050505; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--black);
  border-bottom: 1px solid #3f3f46;
}

.site-header-inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: #ffffff;
  text-decoration: none;
}

.site-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #111111;
}

.site-brand-text {
  display: grid;
  color: #ffffff;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.05;
}

.site-brand-text small {
  max-width: 34ch;
  color: #a1a1aa;
  font-weight: 650;
  font-size: .7rem;
  line-height: 1.18;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.site-nav a {
  color: #f4f4f5;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 800;
  padding: .45rem .65rem;
  border: 1px solid #3f3f46;
  border-radius: 6px;
}

.site-nav a:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.site-nav a.nav-featured-app {
  background: var(--blue);
  border-color: var(--blue);
  color: #050505;
}

.site-nav a.nav-featured-app:hover {
  background: #7dd3fc;
  border-color: #7dd3fc;
  color: #050505;
}

.site-frame {
  max-width: 1680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 250px;
  gap: 1.25rem;
  padding: 1.25rem;
  align-items: start;
}

.site-left-rail,
.site-right-rail,
.article-sidebar {
  position: sticky;
  top: 84px;
}

.left-nav {
  background: var(--rail);
  color: #ffffff;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: .85rem;
}

.left-nav-title {
  color: var(--blue);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 .75rem;
}

.left-nav a {
  display: block;
  color: #e4e4e7;
  text-decoration: none;
  font-weight: 800;
  font-size: .88rem;
  line-height: 1.2;
  padding: .55rem .45rem;
  border-top: 1px solid #27272a;
}

.left-nav a:hover {
  color: var(--blue);
  background: #111111;
}

.featured-app-card {
  background: #111111;
  color: #f4f4f5;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.featured-app-card img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin-bottom: .8rem;
}

.featured-app-kicker {
  color: var(--blue);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 .3rem;
}

.featured-app-card a {
  display: inline-block;
  color: #ffffff;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.15;
  text-decoration-color: var(--blue);
  margin-bottom: .5rem;
}

.featured-app-card p:last-child {
  color: #c4c4c7;
  font-size: .86rem;
  line-height: 1.45;
  margin: 0;
}

.page-shell,
.article-shell {
  min-width: 0;
}

.home-page { padding: 0 0 2rem; }

.home-banner {
  min-height: 430px;
  display: grid;
  align-content: end;
  padding: clamp(1.5rem, 5vw, 4.5rem);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #050505 url("/hero-images/homepage.webp") center / cover no-repeat;
  border: 1px solid #27272a;
}

.home-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .54);
}

.home-banner > * {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.home-eyebrow,
.subject-kicker,
.article-kicker,
.featured-article-label,
.recent-card-cat {
  margin: 0 0 .7rem;
  color: var(--blue);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-banner h1 {
  color: #ffffff;
  font-size: clamp(2.4rem, 6vw, 5.7rem);
  max-width: 980px;
}

.home-tagline {
  margin: .9rem 0 .3rem;
  color: #e4e4e7;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 750;
}

.home-lead {
  max-width: 760px;
  color: #d4d4d8;
  font-size: 1.05rem;
}

.home-section {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
}

.home-section > h2 {
  padding-bottom: .85rem;
  border-bottom: 3px solid #111111;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.subjects-list,
.recent-grid {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.subjects-list > li,
.recent-card,
.featured-article {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.subject-image {
  display: block;
  background: #050505;
  border-bottom: 1px solid var(--line);
}

.subject-image img,
.recent-card-image img,
.featured-article img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.subject-card-body,
.recent-card-body {
  padding: 1rem;
}

.subject-meta-pill {
  display: inline-block;
  margin-bottom: .65rem;
  color: #111111;
  border: 1px solid #111111;
  border-radius: 999px;
  padding: .15rem .55rem;
  font-size: .72rem;
  font-weight: 850;
}

.subject-meta-pill.is-empty { color: var(--ink-muted); border-color: var(--line); }

.subjects-list h3 {
  font-size: 1.22rem;
  line-height: 1.12;
  margin-bottom: .6rem;
}

.subjects-list h3 a,
.recent-card h4,
.featured-article h3 a {
  color: #111111;
  text-decoration: none;
}

.subject-desc { color: var(--ink-soft); font-size: .92rem; }

.subject-hub-link {
  display: inline-block;
  font-weight: 850;
  font-size: .87rem;
}

.subject-articles {
  padding: 0 1rem 1rem;
}

.subject-articles h4 {
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-muted);
  margin-bottom: .4rem;
}

.subject-article-list,
.subject-suggested {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: .88rem;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 820px) 260px;
  gap: 1.25rem;
  align-items: start;
}

.article-main,
.subject-page,
.legal-page,
.about-page {
  min-width: 0;
}

.breadcrumb {
  margin-bottom: .9rem;
  font-size: .84rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
}

.breadcrumb li::after { content: "/"; margin-left: .4rem; color: var(--ink-muted); }
.breadcrumb li:last-child::after { content: ""; }

.article,
.subject-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  background: #050505;
}

.article-hero {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.article-hero figcaption {
  padding: .55rem 1.25rem;
  color: var(--ink-muted);
  font-size: .82rem;
  border-top: 1px solid var(--line);
}

.article-header,
.article-body,
.summary-box,
.faq,
.see-also,
.resources {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.article-header {
  padding: 2rem 1.25rem 1rem;
}

.article-header h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.byline {
  margin: 1rem 0 0;
  color: var(--ink-muted);
  font-weight: 700;
}

.summary-box {
  margin-top: .5rem;
  padding: 1rem 1.25rem;
  border-top: 3px solid #111111;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.summary-box h2 {
  font-size: .86rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .45rem;
}

.summary-box p { margin: 0; color: var(--ink-soft); font-weight: 650; }

.article-body {
  padding: 1.5rem 1.25rem 2rem;
}

.article-body h2 {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1.65rem;
}

.article-body h3 {
  margin-top: 1.4rem;
  font-size: 1.15rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.25rem;
}

.article-body li { margin-bottom: .45rem; }

.article-sidebar {
  display: grid;
  gap: 1rem;
}

.toc,
.sidebar-meta,
.subject-sidebar,
.forthcoming,
.resources,
.faq,
.see-also {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toc {
  padding: 1rem;
}

.toc-header {
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue-dark);
  margin-bottom: .5rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.1rem;
  font-size: .86rem;
}

.toc li { margin-bottom: .4rem; }

.sidebar-meta {
  padding: 1rem;
  font-size: .85rem;
}

.sidebar-meta-row {
  display: grid;
  gap: .25rem;
  padding: .65rem 0;
  border-top: 1px solid var(--line);
}

.sidebar-meta-row:first-child { border-top: 0; padding-top: 0; }
.sidebar-meta-row span:first-child { color: var(--ink-muted); font-weight: 900; }

.author-card {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.author-card img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #111111;
}

.author-card-copy {
  display: grid;
  line-height: 1.2;
}

.author-card-copy em {
  color: var(--ink-muted);
  font-style: normal;
  font-size: .78rem;
}

.faq,
.see-also,
.resources {
  margin-top: 1rem;
  padding: 1.25rem;
}

.faq h2,
.see-also h2,
.resources h2 {
  font-size: 1.35rem;
  margin-bottom: .8rem;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding: .8rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 900;
}

.subject-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 38%);
  gap: 1.25rem;
  padding: 1.25rem;
  background: #111111;
  color: #ffffff;
}

.subject-header h1,
.subject-header p {
  color: #ffffff;
}

.subject-intro { color: #d4d4d8; max-width: 68ch; }

.subject-header-image {
  margin: 0;
}

.subject-header-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #3f3f46;
  background: #050505;
}

.subject-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 1.25rem;
  padding: 1.25rem;
}

.subject-body {
  max-width: 760px;
}

.subject-body h2 {
  margin-top: 1.6rem;
  font-size: 1.5rem;
}

.subject-sidebar,
.forthcoming {
  padding: 1rem;
}

.subject-sidebar .featured-app-card {
  margin: 1rem -1rem -1rem;
  border-radius: 0 0 8px 8px;
  border-width: 1px 0 0;
}

.sidebar-articles h2,
.forthcoming h3 {
  font-size: .84rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--blue-dark);
  margin-bottom: .7rem;
}

.sidebar-articles ol,
.forthcoming-list {
  margin: 0;
  padding-left: 1.1rem;
}

.sidebar-articles li,
.forthcoming-list li {
  margin-bottom: .55rem;
}

.site-footer {
  margin-top: 1.5rem;
  background: var(--black);
  color: #d4d4d8;
}

.footer-inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.footer-copy { margin: 0; font-size: .86rem; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

.footer-links a { color: #f4f4f5; }

@media (max-width: 1180px) {
  .site-frame {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .site-right-rail {
    display: none;
  }

  .article-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-sidebar {
    position: static;
  }

  .subject-sidebar .featured-app-card {
    margin: 1rem 0 0;
    border: 1px solid #27272a;
    border-radius: 8px;
  }
}

@media (max-width: 820px) {
  .site-header-inner {
    padding: .45rem .65rem;
    align-items: center;
    flex-direction: row;
    gap: .55rem;
  }

  .site-brand {
    flex: 0 0 auto;
    gap: .45rem;
  }

  .site-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 6px;
  }

  .site-brand-text {
    font-size: .88rem;
  }

  .site-brand-text small {
    display: none;
  }

  .site-nav {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    justify-content: flex-end;
    gap: .3rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: .76rem;
    padding: .32rem .48rem;
    border-radius: 5px;
  }

  .site-frame {
    display: block;
    padding: .85rem;
  }

  .site-left-rail {
    position: static;
    margin-bottom: .85rem;
  }

  .left-nav {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding: .65rem;
  }

  .left-nav-title {
    flex: 0 0 auto;
    margin: 0;
    align-self: center;
  }

  .left-nav a {
    flex: 0 0 auto;
    border: 1px solid #27272a;
    border-radius: 6px;
    padding: .45rem .6rem;
  }

  .subjects-list,
  .recent-grid,
  .subject-header,
  .subject-layout {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
