:root {
  color-scheme: dark;
  --bg: oklch(23.64% 0.0045 248);
  --text: oklch(83.54% 0 264);
  --muted: oklch(70.7% 0.022 261.325);
  --link: oklch(70.44% 0.1133 349);
  --accent: oklch(70.91% 0.1415 163.7);
  --accent-soft: oklch(70.91% 0.1415 163.7 / 0.12);
  --title: oklch(94.66% 0 0);
  --rule: rgba(255, 255, 255, 0.18);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --focus: oklch(94.8% 0.106 136.49);
  --shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.18);
  --left-rail-width: clamp(14rem, 18vw, 19rem);
  --right-rail-width: clamp(11rem, 15vw, 14rem);
  --rail-gutter: clamp(1.25rem, 2vw, 2rem);
  --header-anchor-offset: 2rem;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(98.48% 0 0);
  --text: oklch(26.99% 0.0096 235.05);
  --muted: oklch(44.6% 0.03 256.802);
  --link: oklch(55.44% 0.0431 185.69);
  --accent: oklch(55.27% 0.195 19.06);
  --accent-soft: oklch(55.27% 0.195 19.06 / 0.1);
  --title: oklch(18.15% 0 0);
  --rule: rgba(0, 0, 0, 0.16);
  --surface: rgba(0, 0, 0, 0.025);
  --surface-strong: rgba(0, 0, 0, 0.052);
  --focus: oklch(55.27% 0.195 19.06);
  --shadow: 0 1rem 2.5rem rgba(40, 44, 52, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: var(--header-anchor-offset);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, var(--surface) 0, transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 16px;
  line-height: 1.72;
  transition:
    background-color 300ms ease-in-out,
    color 300ms ease-in-out;
}

a {
  color: var(--text);
  text-decoration-color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--link);
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-180%);
  background: var(--title);
  color: var(--bg);
  padding: 0.35rem 0.6rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell,
.site-footer {
  width: min(
    64rem,
    calc(100vw - var(--left-rail-width) - var(--right-rail-width) - (var(--rail-gutter) * 4))
  );
  margin-left: calc(var(--left-rail-width) + (var(--rail-gutter) * 2));
  margin-right: calc(var(--right-rail-width) + (var(--rail-gutter) * 2));
}

.site-header {
  display: flex;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  isolation: isolate;
  width: var(--left-rail-width);
  flex-direction: column;
  align-items: stretch;
  gap: 2.15rem;
  border-right: 1px solid var(--rule);
  background: var(--bg);
  padding: 2.5rem clamp(1.25rem, 2vw, 2rem);
  overflow-y: auto;
}

.site-header::before {
  content: none;
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: flex-start;
}

.site-title {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  color: var(--title);
  font-weight: 700;
  text-decoration: none;
}

.mark {
  width: 4.4rem;
  height: 4.4rem;
  color: var(--accent);
}

.mark rect {
  fill: currentColor;
}

.mark path {
  fill: var(--bg);
}

.site-title span:last-child {
  color: var(--title);
  font-size: 2.15rem;
  line-height: 1.1;
}

.site-nav,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.site-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  align-self: stretch;
}

.site-nav a + a::before {
  content: none;
  margin-right: 0;
}

.site-nav a,
.rail-social-link {
  color: var(--accent);
  text-decoration: none;
}

.site-nav a:hover,
.rail-social-link:hover {
  color: var(--title);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.rail-contact {
  width: 100%;
  border-top: 1px dashed var(--rule);
  padding-top: 1rem;
}

.rail-contact-title {
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rail-social-list {
  display: grid;
  gap: 0.55rem;
}

.rail-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
}

.social-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  fill: currentColor;
}

.theme-toggle {
  display: inline-flex;
  width: 4rem;
  min-height: 2.2rem;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.18rem;
  background: var(--surface-strong);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.theme-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.theme-icon {
  position: relative;
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0.25rem 0.7rem rgba(0, 0, 0, 0.2);
  transition:
    box-shadow 180ms ease,
    transform 180ms ease;
}

.theme-icon-image {
  grid-area: 1 / 1;
  width: 1.48rem;
  height: 1.48rem;
  object-fit: contain;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.theme-icon-light {
  opacity: 0;
  transform: scale(0.8);
}

html[data-theme="light"] .theme-icon {
  box-shadow: 0 0.25rem 0.7rem rgba(40, 44, 52, 0.18);
  transform: translateX(1.85rem);
}

html[data-theme="light"] .theme-icon-dark {
  opacity: 0;
  transform: scale(0.8);
}

html[data-theme="light"] .theme-icon-light {
  opacity: 1;
  transform: scale(1);
}

.page-toc {
  position: fixed;
  top: 2.5rem;
  right: var(--rail-gutter);
  z-index: 8;
  width: var(--right-rail-width);
  max-height: calc(100vh - 5rem);
  border-left: 1px solid var(--rule);
  color: var(--muted);
  overflow-y: auto;
  padding-left: 1rem;
}

.page-toc p {
  margin-bottom: 0.65rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-toc nav {
  display: grid;
  gap: 0.55rem;
}

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

.page-toc a:hover {
  color: var(--title);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.intro {
  display: grid;
  gap: 1.1rem;
  padding-bottom: 3.2rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--title);
  line-height: 1.22;
}

h1 {
  max-width: 58rem;
  margin-bottom: 0;
  font-size: 3.55rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 700;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.08rem;
  font-weight: 700;
}

.intro-kicker,
.case-meta,
.topic,
.note-status {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro p {
  max-width: 49rem;
  margin-bottom: 0;
  color: var(--text);
  font-size: 1.05rem;
}

.signal-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal-list li,
.case-study,
.map-grid article,
.note-list article {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}

.signal-list li {
  min-height: 9rem;
  padding: 1rem;
}

.signal-list strong,
.signal-list span {
  display: block;
}

.signal-list strong {
  margin-bottom: 0.4rem;
  color: var(--title);
}

.signal-list span,
.section-heading p,
.case-study p,
.case-points,
.map-grid p,
.note-list p,
.entry-list p {
  color: var(--muted);
}

.content-section {
  padding-block: 2.25rem;
  border-top: 1px dashed var(--rule);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(10rem, 0.55fr) minmax(0, 1fr);
  gap: 1rem 2rem;
  align-items: start;
  margin-bottom: 1.35rem;
}

.section-heading p {
  max-width: 42rem;
  margin-bottom: 0;
}

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

.case-study {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.case-study h3 a {
  color: var(--title);
}

.case-study p {
  margin-bottom: 0.9rem;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.95rem;
}

.case-points {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding-left: 1.1rem;
}

.tag-row {
  gap: 0.45rem;
  margin-top: auto;
}

.tag-row span {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--text);
  padding: 0.16rem 0.48rem;
  font-size: 0.78rem;
  line-height: 1.5;
}

.map-grid,
.note-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.map-grid article,
.note-list article {
  padding: 1rem;
}

.map-grid p,
.note-list p {
  margin: 0.55rem 0 0;
}

.map-grid a {
  display: inline-block;
  margin-top: 0.9rem;
  font-weight: 700;
}

.note-list {
  align-items: stretch;
}

.note-list article {
  background: var(--surface-strong);
}

.note-list h3 {
  margin-top: 0.35rem;
}

.note-list time {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 3rem 2.5rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1180px) {
  :root {
    --header-anchor-offset: 11rem;
  }

  .site-header,
  .page-shell,
  .site-footer {
    width: min(100% - 2rem, 64rem);
    margin-inline: auto;
  }

  .site-header {
    position: sticky;
    bottom: auto;
    left: auto;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    border-right: 0;
    padding: 2.5rem 0 3.25rem;
    overflow: visible;
  }

  .site-header::before {
    content: "";
    position: absolute;
    inset: 0 calc(50% - 50vw);
    z-index: -1;
    border-bottom: 1px solid var(--rule);
    background: var(--bg);
    box-shadow: 0 0.7rem 1.6rem rgba(0, 0, 0, 0.08);
    pointer-events: none;
  }

  .header-brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem 1.4rem;
    align-items: center;
  }

  .site-title {
    display: contents;
  }

  .mark {
    grid-row: span 2;
  }

  .site-title span:last-child {
    align-self: end;
  }

  .site-nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    align-self: start;
  }

  .rail-contact {
    grid-column: 1 / -1;
    max-width: 22rem;
  }

  .rail-social-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
  }

  .site-nav a + a::before {
    content: "|";
    margin-right: 0.85rem;
    color: var(--accent);
    font-weight: 400;
  }

  .page-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .signal-list,
  .case-grid,
  .map-grid,
  .note-list {
    grid-template-columns: 1fr;
  }

  .signal-list li {
    min-height: auto;
  }

  h1 {
    font-size: 2.8rem;
  }
}

@media (max-width: 680px) {
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    padding-block: 1.5rem 2.4rem;
  }

  .header-brand {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .mark {
    width: 3.35rem;
    height: 3.35rem;
  }

  .site-title span:last-child {
    font-size: 1.75rem;
  }

  .site-nav {
    gap: 0.5rem 0.72rem;
  }

  .site-nav a + a::before {
    content: none;
    margin-right: 0;
  }

  h1 {
    font-size: 2.25rem;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .case-meta {
    display: grid;
  }
}
