@import url("/assets/css/site.css");

:root {
  --ink: #302e2f;
  --navy: #353e50;
  --muted: #787d86;
  --line: #bbbcbc;
  --paper: #f1f2f2;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --content-width: 760px;
  --wide-width: 1040px;
  --radius-sm: 16px;
  --radius-md: 26px;
  --shadow: 0 18px 50px rgba(48, 46, 47, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

img,
video,
iframe {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--navy);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.17em;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid rgba(53, 62, 80, 0.35);
  outline-offset: 4px;
}

.site-shell {
  position: relative;
  min-height: 100svh;
  overflow-x: clip;
  isolation: isolate;
}

.site-shell::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 5%, rgba(255, 255, 255, 0.95), transparent 35%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.18), transparent 42%);
}

.reading-progress {
  position: fixed;
  z-index: 50;
  inset: 0 auto auto 0;
  width: 0;
  height: 4px;
  background: var(--navy);
  transition: width 80ms linear;
}

.article-topbar {
  width: 100%;
  margin: 0;
  padding: var(--site-header-top) var(--site-gutter) 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.article-logo-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.article-logo {
  width: var(--site-logo-width);
  height: auto;
}

.article-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--site-nav-gap);
}

.article-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--site-nav-height);
  padding: 0 var(--site-nav-padding);
  border: 2px solid rgba(187, 188, 188, 0.72);
  border-radius: 999px;
  background: rgba(241, 242, 242, 0.7);
  color: var(--ink);
  font-size: var(--site-nav-font-size);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.article-nav a:hover,
.article-nav a[aria-current="page"] {
  transform: translateY(-1px);
  border-color: rgba(120, 125, 134, 0.7);
  background: rgba(255, 255, 255, 0.78);
}

.article-header {
  width: min(100% - 40px, var(--wide-width));
  margin: clamp(54px, 8vw, 112px) auto 0;
  text-align: center;
}

.article-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 23px;
  padding: 7px 13px;
  border: 2px solid rgba(187, 188, 188, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.article-kicker[data-kind="announcement"]::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--navy);
}

.article-title {
  max-width: 900px;
  margin: 0 auto;
  font-size: clamp(2.15rem, 4.25vw, 3.75rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.98;
  text-wrap: balance;
}

.article-deck {
  max-width: 720px;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.65vw, 1.28rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.48;
  text-wrap: balance;
}

.article-meta {
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 18px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.article-meta span + span::before,
.article-meta time + span::before {
  content: "·";
  margin-right: 18px;
  color: var(--line);
}

.article-hero-media {
  width: min(100% - 40px, var(--wide-width));
  margin: clamp(40px, 6vw, 72px) auto 0;
}

.article-layout {
  width: min(100% - 40px, var(--wide-width));
  margin: clamp(54px, 7vw, 86px) auto 0;
  display: grid;
  grid-template-columns: minmax(0, var(--content-width)) 210px;
  justify-content: space-between;
  align-items: start;
  gap: 68px;
}

.article-body {
  min-width: 0;
  font-size: 1.05rem;
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body > p:first-child {
  font-size: 1.23rem;
  line-height: 1.64;
  letter-spacing: -0.018em;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin: 0 0 1.55em;
}

.article-body h2,
.article-body h3 {
  line-height: 1.14;
  letter-spacing: -0.045em;
  scroll-margin-top: 28px;
  text-wrap: balance;
}

.article-body h2 {
  margin: 2.35em 0 0.7em;
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
}

.article-body h3 {
  margin: 1.9em 0 0.65em;
  font-size: clamp(1.3rem, 2.4vw, 1.72rem);
}

.article-body li + li {
  margin-top: 0.55em;
}

.article-body code {
  padding: 0.14em 0.38em;
  border-radius: 6px;
  background: rgba(53, 62, 80, 0.08);
  font-size: 0.88em;
}

.article-body hr {
  height: 1px;
  margin: 3.2rem 0;
  border: 0;
  background: rgba(120, 125, 134, 0.28);
}

.article-body blockquote {
  margin: 2.3rem 0;
  padding: 4px 0 4px 24px;
  border-left: 5px solid var(--navy);
  color: var(--navy);
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.42;
}

.article-body blockquote cite {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
}

.article-figure,
.article-media {
  margin: 2.5rem 0;
}

.article-figure.is-wide,
.article-media.is-wide {
  width: min(var(--wide-width), calc(100vw - 40px));
  margin-left: calc((min(var(--wide-width), calc(100vw - 40px)) - 100%) / -2);
}

.article-figure img,
.article-media video,
.youtube-embed,
.media-placeholder {
  width: 100%;
  overflow: hidden;
  border: 2px solid rgba(187, 188, 188, 0.72);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-figure img {
  height: auto;
}

.article-media video {
  height: auto;
  background: var(--ink);
}

figcaption,
.media-caption {
  margin-top: 11px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.45;
}

.article-audio {
  margin: 2rem 0;
  padding: 20px;
  border: 2px solid rgba(187, 188, 188, 0.72);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.article-audio strong,
.article-audio span {
  display: block;
}

.article-audio span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.article-audio audio {
  width: 100%;
  margin-top: 15px;
}

.youtube-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.8), transparent 35%),
    var(--navy);
}

.youtube-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.youtube-load {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.youtube-load::before {
  content: "▶";
  font-size: 0.8rem;
}

.article-callout {
  margin: 2rem 0;
  padding: 22px 24px;
  border: 2px solid rgba(187, 188, 188, 0.72);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  box-shadow: 0 10px 30px rgba(48, 46, 47, 0.06);
}

.article-callout strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.article-callout p:last-child {
  margin-bottom: 0;
}

.article-callout[data-tone="announcement"] {
  border-color: rgba(53, 62, 80, 0.5);
  background: rgba(53, 62, 80, 0.075);
}

.article-table-wrap {
  max-width: 100%;
  margin: 2rem 0;
  overflow-x: auto;
  border: 2px solid rgba(187, 188, 188, 0.72);
  border-radius: var(--radius-sm);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.9rem;
}

.article-table th,
.article-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(120, 125, 134, 0.2);
  text-align: left;
  vertical-align: top;
}

.article-table th {
  background: rgba(53, 62, 80, 0.06);
  font-weight: 900;
}

.article-table tr:last-child td {
  border-bottom: 0;
}

.article-aside {
  position: sticky;
  top: var(--site-header-top);
  align-self: start;
  max-height: calc(100svh - (var(--site-header-top) * 2));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 4px;
  scrollbar-width: thin;
}

.article-aside-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.article-toc {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-toc li + li {
  margin-top: 9px;
}

.article-toc a {
  display: block;
  padding-left: 12px;
  border-left: 2px solid rgba(120, 125, 134, 0.22);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.article-toc a:hover {
  border-color: var(--navy);
  color: var(--ink);
}

.article-footer {
  width: min(100% - 40px, var(--wide-width));
  margin: 80px auto 0;
  padding: 32px 0 180px;
  border-top: 1px solid rgba(120, 125, 134, 0.25);
}

.article-footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
}

.article-footer-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.article-footer h2 {
  max-width: 540px;
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.back-to-articles {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 17px;
  border: 2px solid rgba(187, 188, 188, 0.72);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.footer-pattern {
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: 150px;
  opacity: 0.5;
  background: url("/assets/patterns/footer-pattern.svg") center top / 220px 220px repeat;
  mask-image: linear-gradient(to bottom, transparent, black 68%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 68%);
}

.articles-index {
  width: min(100% - 40px, var(--wide-width));
  margin: clamp(34px, 4.5vw, 62px) auto 150px;
}

.articles-index-header {
  max-width: 760px;
}

.articles-index h1 {
  margin: 0;
  font-size: clamp(2.25rem, 3.8vw, 3.25rem);
  letter-spacing: -0.065em;
  line-height: 1;
}

.articles-index-intro {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.35vw, 1.12rem);
  font-weight: 600;
}

.article-card-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.article-card {
  min-height: 210px;
  padding: 25px;
  border: 2px solid rgba(187, 188, 188, 0.72);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(120, 125, 134, 0.75);
  background: var(--surface-strong);
}

.article-card-kind {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-card h2 {
  margin: 13px 0 9px;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: -0.05em;
  line-height: 1.08;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.article-card-meta {
  margin-top: auto;
  padding-top: 24px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.article-empty {
  margin-top: 55px;
  padding: clamp(30px, 5vw, 52px);
  border: 2px dashed rgba(187, 188, 188, 0.82);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.article-empty h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  letter-spacing: -0.045em;
}

.article-empty p {
  max-width: 520px;
  margin: 10px auto 0;
  font-weight: 600;
}

.article-card-grid:has(.article-card) + .article-empty {
  display: none;
}

@media (max-width: 860px) {
  .article-layout {
    display: block;
    width: min(100% - 40px, var(--content-width));
  }

  .article-aside {
    display: none;
  }

  .article-figure.is-wide,
  .article-media.is-wide {
    margin-left: calc((min(var(--wide-width), calc(100vw - 40px)) - 100%) / -2);
  }
}

@media (max-width: 620px) {
  .article-topbar {
    padding: var(--site-header-top) var(--site-gutter) 16px;
  }

  .article-nav a {
    padding-inline: var(--site-nav-padding);
  }

  .article-header,
  .article-hero-media,
  .article-layout,
  .article-footer,
  .articles-index {
    width: min(100% - 28px, var(--wide-width));
  }

  .article-header {
    margin-top: 44px;
  }

  .article-meta span + span::before,
  .article-meta time + span::before {
    display: none;
  }

  .article-meta {
    display: grid;
    gap: 1px;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-figure.is-wide,
  .article-media.is-wide {
    width: calc(100vw - 28px);
    margin-left: calc((calc(100vw - 28px) - 100%) / -2);
  }

  .article-footer-row {
    display: block;
  }

  .back-to-articles {
    margin-top: 24px;
  }

  .article-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
