:root {
  color-scheme: light;
  --ink: #091a29;
  --muted: #526879;
  --line: #c8dce7;
  --paper: #f8fcff;
  --surface: #ffffff;
  --accent: #006fe6;
  --hero-bg: #edf7fb;
  --hero-art: #dceef5;
  --hero-fade: linear-gradient(90deg, #edf7fb 0%, rgba(237, 247, 251, 0.76) 10%, rgba(237, 247, 251, 0) 43%);
  --hero-mobile-fade: linear-gradient(180deg, rgba(237, 247, 251, 0.26), rgba(237, 247, 251, 0.88) 78%, #edf7fb 100%);
  --feature-fade: linear-gradient(90deg, rgba(3, 24, 42, 0.9), rgba(3, 24, 42, 0.48) 58%, rgba(3, 24, 42, 0));
  --feature-text: #f6fcff;
  --feature-muted: #d9efff;
  --cyber-grid: rgba(0, 110, 195, 0.1);
  --toggle-shadow: 0 10px 30px rgba(15, 79, 112, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7f8ff;
  --muted: #9ab5c7;
  --line: #253c50;
  --paper: #050a12;
  --surface: #0a1420;
  --accent: #61e8ff;
  --hero-bg: #050a12;
  --hero-art: #0a1625;
  --hero-fade: linear-gradient(90deg, #050a12 0%, rgba(5, 10, 18, 0.9) 13%, rgba(5, 10, 18, 0.2) 52%, rgba(5, 10, 18, 0) 72%);
  --hero-mobile-fade: linear-gradient(180deg, rgba(5, 10, 18, 0.14), rgba(5, 10, 18, 0.86) 72%, #050a12 100%);
  --feature-fade: linear-gradient(90deg, rgba(0, 13, 26, 0.92), rgba(0, 13, 26, 0.56) 58%, rgba(0, 13, 26, 0.08));
  --feature-text: #eaffff;
  --feature-muted: #a6f6ff;
  --cyber-grid: rgba(97, 232, 255, 0.14);
  --toggle-shadow: 0 12px 38px rgba(0, 196, 255, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Noto Serif SC", "Songti SC", Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 10;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: var(--toggle-shadow);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.page-shell {
  width: min(100% - 40px, 780px);
  margin: 0 auto;
  padding: 88px 0 44px;
}

.hero {
  padding: 0 0 56px;
}

.home-page {
  width: 100%;
  max-width: none;
  padding: 0;
  overflow: clip;
}

.home-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: clamp(96px, 12vw, 180px) max(40px, calc((100vw - 1440px) / 2));
  isolation: isolate;
  overflow: hidden;
  background: var(--hero-bg);
}

.home-hero::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(var(--cyber-grid) 1px, transparent 1px), linear-gradient(90deg, var(--cyber-grid) 1px, transparent 1px);
  background-size: 52px 52px;
  content: "";
  opacity: 0.55;
  pointer-events: none;
}

.home-hero-copy {
  position: relative;
  z-index: 2;
  width: min(48vw, 690px);
}

.home-hero h1 {
  max-width: 100%;
  margin-bottom: 22px;
  font-size: clamp(4.6rem, 10.6vw, 10.5rem);
  letter-spacing: -0.09em;
}

.home-hero .intro {
  max-width: 30rem;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.5vw, 1.38rem);
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  padding: 10px 0;
  border-bottom: 1px solid currentColor;
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.hero-link:hover,
.hero-link:focus-visible {
  color: var(--accent);
}

.hero-link span {
  font-size: 1.1rem;
}

.home-hero-art {
  position: absolute;
  inset: 0 0 0 43%;
  z-index: 0;
  background: var(--hero-art);
}

.home-hero-art::after {
  position: absolute;
  inset: 0;
  background: var(--hero-fade);
  content: "";
}

.home-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero-index {
  position: absolute;
  bottom: 36px;
  left: max(40px, calc((100vw - 1440px) / 2));
  z-index: 2;
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
}

.home-content {
  width: min(100% - 80px, 1440px);
  margin: 0 auto;
  padding: clamp(74px, 10vw, 152px) 0 52px;
}

.home-page .section-heading {
  padding-bottom: 18px;
}

.home-page .section-heading h2 {
  font-size: clamp(2rem, 4.2vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.eyebrow,
.meta,
.section-heading span,
footer {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
}

.eyebrow,
.meta {
  margin: 0 0 12px;
  text-transform: uppercase;
}

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

h1 {
  max-width: 10ch;
  margin-bottom: 14px;
  font-size: clamp(3.1rem, 12vw, 6.6rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.96;
}

.intro,
.lede {
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.16rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 600;
}

.article-list article {
  padding: 32px 0 35px;
  border-bottom: 1px solid var(--line);
}

h3 {
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  font-weight: 500;
  line-height: 1.22;
}

h3 a,
.back-link {
  color: inherit;
  text-decoration: none;
}

h3 a:hover,
h3 a:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  color: var(--accent);
}

.article-list article p:last-child {
  max-width: 37rem;
  margin-bottom: 0;
  color: var(--muted);
}

.topic-gallery {
  margin: 0 0 66px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.topic-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  color: inherit;
  background: var(--surface);
  text-decoration: none;
}

.topic-card:first-child {
  grid-column: 1 / -1;
}

.topic-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  transition: filter 180ms ease, transform 300ms ease;
}

.topic-card-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 15px;
  border-top: 1px solid var(--line);
}

.topic-card-copy strong {
  font-size: 1.08rem;
  font-weight: 500;
}

.topic-card-copy small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  text-align: right;
}

.topic-card:hover img,
.topic-card:focus-visible img {
  filter: saturate(1.12) contrast(1.03);
  transform: scale(1.018);
}

.topic-card:hover .topic-card-copy,
.topic-card:focus-visible .topic-card-copy {
  color: var(--accent);
}

:root[data-theme="dark"] .topic-card img {
  filter: brightness(0.54) contrast(1.28) saturate(1.28);
}

:root[data-theme="dark"] .home-hero-art img {
  filter: brightness(0.46) contrast(1.34) saturate(1.34);
}

:root[data-theme="dark"] .topic-card:hover img,
:root[data-theme="dark"] .topic-card:focus-visible img {
  filter: brightness(0.62) contrast(1.32) saturate(1.42);
}

.home-page .topic-gallery {
  margin-bottom: clamp(92px, 13vw, 184px);
}

.home-page .topic-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 24px);
  margin-top: 30px;
}

.home-page .topic-card {
  grid-column: span 3;
}

.home-page .topic-card:first-child {
  position: relative;
  grid-column: 1 / -1;
}

.home-page .topic-card:first-child img {
  aspect-ratio: 2.45 / 1;
}

.home-page .topic-card:first-child .topic-card-copy {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: clamp(20px, 3vw, 44px);
  border: 0;
  color: var(--feature-text);
  background: var(--feature-fade);
}

.home-page .topic-card:first-child .topic-card-copy strong {
  font-size: clamp(1.7rem, 3vw, 3.2rem);
}

.home-page .topic-card:first-child .topic-card-copy small {
  color: var(--feature-muted);
  font-size: 0.72rem;
}

.home-page .topic-card:not(:first-child) .topic-card-copy {
  align-items: flex-start;
  flex-direction: column;
  min-height: 104px;
}

.home-page .topic-card:not(:first-child) .topic-card-copy small {
  text-align: left;
}

.home-page .home-articles .article-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 72px);
}

.home-page .home-articles .article-list article {
  padding: 34px 0 38px;
}

.home-page .home-articles h3 {
  max-width: 17ch;
  font-size: clamp(1.8rem, 2.8vw, 3rem);
}

.home-page footer {
  margin-top: clamp(90px, 14vw, 190px);
}

.article-page {
  max-width: 680px;
}

.article-page h1 {
  max-width: 12ch;
  margin-top: 20px;
  font-size: clamp(2.65rem, 8vw, 4.8rem);
}

.article-page article > p:not(.eyebrow):not(.lede) {
  max-width: 38rem;
}

.share-page {
  max-width: 860px;
}

.share-page h1 {
  max-width: 12ch;
}

.share-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  margin: 38px 0 64px;
  background: var(--line);
  border: 1px solid var(--line);
}

.share-summary div {
  padding: 18px;
  background: var(--paper);
}

.share-summary strong,
.share-summary span {
  display: block;
}

.share-summary strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.6rem;
  font-weight: 500;
}

.share-summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -40px 0 64px;
}

.category-nav a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  text-decoration: none;
}

.category-nav a:hover,
.category-nav a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.category-nav span {
  color: var(--muted);
}

.share-section {
  margin: 0 0 64px;
}

.share-section h2 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.share-section > p {
  margin-bottom: 24px;
  color: var(--muted);
}

.resource-list {
  margin: 0;
  padding-left: 2.2rem;
}

.resource-list li {
  padding: 16px 0 17px 7px;
  border-top: 1px solid var(--line);
}

.resource-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.resource-list a {
  color: inherit;
  font-size: 1.08rem;
  font-weight: 600;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.resource-list a:hover,
.resource-list a:focus-visible {
  color: var(--accent);
}

.resource-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hardware-section {
  margin-bottom: 0;
}

.hardware-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 30px;
}

.hardware-card,
.purchase-timeline article {
  padding: 22px;
  border: 1px solid var(--line);
}

.card-kicker,
.timeline-date {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.hardware-card h3,
.purchase-timeline h3,
.timeline-heading {
  margin-bottom: 13px;
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.hardware-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hardware-list a {
  color: inherit;
  font-weight: 600;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.hardware-list a:hover,
.hardware-list a:focus-visible {
  color: var(--accent);
}

.hardware-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.timeline-heading {
  margin-top: 56px;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.purchase-timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.purchase-timeline article {
  background: var(--paper);
  border: 0;
}

.purchase-timeline article p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.purchase-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 44px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
}

footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 78px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

footer > span:nth-child(2) {
  text-align: right;
}

.site-records {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 4px;
}

.site-records a {
  display: inline-flex;
  align-items: center;
  color: inherit;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}

.site-records a:hover,
.site-records a:focus-visible {
  color: var(--accent);
}

.public-security-record {
  gap: 5px;
}

.public-security-record img {
  width: 18px;
  height: 20px;
  object-fit: contain;
}

@media (max-width: 1050px) {
  .home-hero {
    padding-right: 40px;
    padding-left: 40px;
  }

  .home-hero-copy {
    width: min(58vw, 620px);
  }

  .home-hero-art {
    left: 35%;
  }

  .home-hero-index {
    left: 40px;
  }

  .home-page .topic-card {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .home-hero {
    align-items: flex-end;
    min-height: 100svh;
    padding: 72px 24px 94px;
  }

  .home-hero-copy {
    width: 100%;
  }

  .home-hero h1 {
    font-size: clamp(4.2rem, 20vw, 6.4rem);
  }

  .home-hero-art {
    inset: 0;
    opacity: 0.48;
  }

  .home-hero-art::after {
    background: var(--hero-mobile-fade);
  }

  .home-hero-index {
    bottom: 30px;
    left: 24px;
    max-width: calc(100% - 48px);
  }

  .home-content {
    width: min(100% - 32px, 1440px);
    padding-top: 70px;
  }

  .home-page .topic-grid,
  .home-page .home-articles .article-list {
    grid-template-columns: 1fr;
  }

  .home-page .topic-card,
  .home-page .topic-card:first-child {
    grid-column: auto;
  }

  .home-page .topic-card:first-child img {
    aspect-ratio: 2 / 1;
  }

  .home-page .topic-card:first-child .topic-card-copy {
    padding: 22px;
    background: var(--feature-fade);
  }

  .home-page .topic-card:first-child .topic-card-copy small {
    display: none;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 32px, 780px);
    padding-top: 56px;
  }

  .page-shell.home-page {
    width: 100%;
    padding: 0;
  }

  .hero {
    padding-bottom: 44px;
  }

  .share-summary {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .topic-card:first-child {
    grid-column: auto;
  }

  .topic-card-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .topic-card-copy small {
    text-align: left;
  }

  .hardware-grid,
  .purchase-timeline {
    grid-template-columns: 1fr;
  }

  body {
    font-size: 17px;
  }

  footer {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  footer > span:nth-child(2) {
    text-align: center;
  }

  .site-records {
    grid-column: auto;
  }
}
