:root {
  color-scheme: light;
  --navy: #192d3b;
  --navy-deep: #142632;
  --ink: #1d2b37;
  --muted: #62727f;
  --blue: #087ba7;
  --blue-dark: #056487;
  --pale: #e8f4f9;
  --line: #d7e3e9;
  --white: #fff;
  --shell: 1120px;
  --page-bg: #fff;
  --surface: white;
  --hero-start: #edf8fc;
  --hero-end: #e1f1f8;
  --hero-border: #d5e8f0;
  --hero-subtitle: #4c6575;
  --hero-description: #445e6f;
  --input-border: #bfd2de;
  --search-icon: #718696;
  --placeholder: #778996;
  --pill-bg: #d3ebf5;
  --pill-ink: #076f98;
  --pill-hover-bg: #bedfeb;
  --pill-hover-ink: #075b7d;
  --art-shadow: #c2e1ed;
  --art-caption: #67818f;
  --excerpt: #60717e;
  --outline-border: #a7cedf;
  --card-border: #dbe8ee;
  --card-bg: #f9fcfd;
  --subtle-border: #e1ebef;
  --count: #6a8290;
  --aside-note: #647d8c;
  --hero-note: #546d7c;
  --tile-hover-border: #9dcbdc;
  --tile-hover-bg: #f6fbfd;
  --breadcrumbs: #6d8491;
  --article-meta: #617784;
  --article-ink: #263a46;
  --inline-code-bg: #edf3f6;
  --inline-code-ink: #264657;
  --quote-border: #7abfd9;
  --quote-bg: #f3f9fc;
  --table-border: #d8e4e9;
  --table-header: #e9f4f8;
  --table-stripe: #f8fbfc;
  --button-bg: #087ba7;
  --button-hover: #056487;
  --button-ink: #fff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #14232e;
  --navy-deep: #e5eef5;
  --ink: #dce6ee;
  --muted: #a4b7c5;
  --blue: #79c9e8;
  --blue-dark: #b0e2f5;
  --pale: #172b39;
  --line: #304653;
  --page-bg: #101c26;
  --surface: #192c39;
  --hero-start: #172c3a;
  --hero-end: #142431;
  --hero-border: #2c4352;
  --hero-subtitle: #b9cad5;
  --hero-description: #bdcdd7;
  --input-border: #435c6c;
  --search-icon: #a9bdc9;
  --placeholder: #a9bdc9;
  --pill-bg: #233e50;
  --pill-ink: #8fd4ee;
  --pill-hover-bg: #2e5268;
  --pill-hover-ink: #b9e8f9;
  --art-shadow: #263e4d;
  --art-caption: #9fb5c3;
  --excerpt: #a9bdc9;
  --outline-border: #486c80;
  --card-border: #304653;
  --card-bg: #172833;
  --subtle-border: #2c414e;
  --count: #a9bdc9;
  --aside-note: #a9bdc9;
  --hero-note: #b4c6d1;
  --tile-hover-border: #608ca4;
  --tile-hover-bg: #1a3444;
  --breadcrumbs: #a9bdc9;
  --article-meta: #a9bdc9;
  --article-ink: #d1dce4;
  --inline-code-bg: #243b4b;
  --inline-code-ink: #c4e7f7;
  --quote-border: #68b9d7;
  --quote-bg: #1a2e3b;
  --table-border: #3a5261;
  --table-header: #253f50;
  --table-stripe: #172b38;
  --button-bg: #69c5e8;
  --button-hover: #91d6f1;
  --button-ink: #10212c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration-thickness: .075em; text-underline-offset: .18em; }
a:hover { color: var(--blue-dark); }
button, input { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #2ba5d0; outline-offset: 3px; border-radius: 3px; }
.shell { width: min(var(--shell), calc(100% - 3rem)); margin: 0 auto; }
.narrow { max-width: 820px; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus { position: fixed; top: .7rem; left: .7rem; z-index: 20; padding: .6rem 1rem; background: var(--surface); color: var(--ink); }

.site-header { background: var(--navy); color: white; }
.header-inner { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: flex; align-items: center; gap: 1.4rem; color: white; text-decoration: none; flex-shrink: 0; }
.brand:hover, .footer-brand:hover { color: white; }
.brand-name, .footer-brand { font: 700 2rem/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.brand-motto { border-left: 1px solid #60707c; padding-left: 1.2rem; color: #d7e4ea; font-size: .79rem; line-height: 1.35; }
.desktop-nav { margin-left: auto; display: flex; align-items: center; gap: 2rem; }
.desktop-nav > a, .translate-menu > summary { color: #edf5f8; text-decoration: none; font-size: .95rem; font-weight: 600; }
.desktop-nav > a:hover, .translate-menu > summary:hover { color: #8bd1ee; }
.translate-menu { position: relative; }
.translate-menu > summary, .mobile-nav > summary { list-style: none; }
.translate-menu > summary::-webkit-details-marker, .mobile-nav > summary::-webkit-details-marker { display: none; }
.translate-menu > div {
  position: absolute; z-index: 5; right: 0; top: calc(100% + 1rem); width: 200px; padding: .75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 15px 40px #0e25341f;
}
.translate-menu > div span { display: block; padding: .25rem .5rem .5rem; color: var(--muted); font-size: .8rem; }
.translate-menu > div a { display: block; padding: .4rem .5rem; text-decoration: none; border-radius: 4px; }
.translate-menu > div a:hover { background: var(--pale); }
.mobile-nav { display: none; position: relative; }
.mobile-nav > summary { width: 46px; height: 46px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 10px; }
.mobile-nav > summary span { display: block; height: 2px; width: 25px; background: white; border-radius: 3px; }
.mobile-nav nav { position: absolute; z-index: 6; right: 0; top: calc(100% + .6rem); width: min(295px, calc(100vw - 3rem)); padding: .9rem; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 15px 45px #0e253429; border-radius: 9px; }
.mobile-nav nav > a { display: block; padding: .55rem .6rem; color: var(--ink); font-weight: 600; text-decoration: none; }
.mobile-translate-label { display: block; margin: .55rem .6rem .15rem; color: var(--muted); font-size: .85rem; }
.mobile-languages { display: flex; flex-wrap: wrap; gap: .25rem .8rem; padding: .3rem .6rem; }
.mobile-languages a { font-size: .9rem; text-decoration: none; }

.hero { background: linear-gradient(110deg, var(--hero-start), var(--hero-end)); border-bottom: 1px solid var(--hero-border); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 3rem; align-items: center; padding-top: 4rem; padding-bottom: 4rem; }
.eyebrow { margin: 0 0 .65rem; color: var(--blue); font-size: .79rem; font-weight: 800; letter-spacing: .12em; line-height: 1.3; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.16; letter-spacing: -.028em; }
.hero h1 { margin: 0; color: var(--navy-deep); font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 750; }
.hero h1 span { display: block; margin-top: .55rem; color: var(--hero-subtitle); font-size: clamp(1.13rem, 2.2vw, 1.48rem); font-weight: 500; letter-spacing: -.015em; }
.hero-description { max-width: 650px; margin: 1.3rem 0 1.45rem; color: var(--hero-description); font-size: 1.05rem; }
.search-form { display: flex; align-items: center; min-height: 58px; max-width: 665px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); overflow: hidden; box-shadow: 0 5px 16px #26506b0a; }
.search-form:focus-within { outline: 3px solid #2ba5d050; border-color: var(--blue); }
.search-form svg { flex: 0 0 auto; width: 22px; height: 22px; margin-left: 1rem; fill: none; stroke: var(--search-icon); stroke-width: 1.8; }
.search-form input { width: 100%; min-width: 0; border: 0; padding: .8rem .85rem; background: transparent; color: var(--ink); outline: none; }
.search-form input::placeholder { color: var(--placeholder); opacity: 1; }
.search-form button { align-self: stretch; min-width: 91px; border: 0; background: var(--button-bg); color: var(--button-ink); font-weight: 700; }
.search-form button:hover { background: var(--button-hover); }
.topic-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.topic-pill { display: inline-flex; align-items: center; min-height: 32px; border-radius: 20px; padding: .18rem .8rem; background: var(--pill-bg); color: var(--pill-ink); font-size: .87rem; font-weight: 650; text-decoration: none; }
.topic-pill:hover { background: var(--pill-hover-bg); color: var(--pill-hover-ink); }
.hero-art { position: relative; align-self: center; padding-bottom: 1.25rem; }
.terminal-window { position: relative; width: 225px; height: 155px; border-radius: 13px; overflow: hidden; background: #183044; box-shadow: 12px 12px 0 var(--art-shadow), 0 15px 35px #26495e19; transform: rotate(-2deg); }
.terminal-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px; background: #294357; }
.terminal-bar i { width: 7px; height: 7px; border-radius: 50%; background: #a0bbcb; }
.terminal-body { padding: 1rem 1.2rem; }
.terminal-prompt { color: #75d1f4; font: 700 2rem/1 Consolas, monospace; }
.terminal-line { display: block; width: 70%; height: 5px; margin: .75rem 0; background: #47687a; border-radius: 4px; }
.terminal-line.short { width: 45%; margin-top: 0; }
.terminal-cursor { display: block; width: 9px; height: 5px; background: #75d1f4; border-radius: 3px; }
.art-caption { margin: 1.55rem 0 0; color: var(--art-caption); font-size: .8rem; font-weight: 650; letter-spacing: .02em; text-align: center; }

.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 4rem; padding-top: 4.1rem; padding-bottom: 5rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.section-heading h2, .aside-card h2 { margin: 0; color: var(--navy-deep); font-size: 1.65rem; }
.section-heading .text-link { margin-bottom: .15rem; white-space: nowrap; }
.text-link { color: var(--blue); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.article-row { padding: 1.45rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.row-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .84rem; }
.row-meta time { flex: 0 0 auto; }
.row-category { color: var(--blue); font-weight: 750; text-transform: uppercase; letter-spacing: .055em; }
.article-row h3 { margin: .45rem 0 .4rem; font-size: clamp(1.16rem, 1.8vw, 1.38rem); }
.article-row h3 a { color: var(--ink); text-decoration: none; }
.article-row h3 a:hover { color: var(--blue); }
.article-row p { overflow-wrap: anywhere; margin: 0; color: var(--excerpt); font-size: .96rem; line-height: 1.6; }
.outline-button { display: inline-flex; align-items: center; min-height: 46px; margin-top: 1.75rem; padding: .55rem 1rem; color: var(--blue); border: 1px solid var(--outline-border); border-radius: 6px; font-size: .94rem; font-weight: 700; text-decoration: none; }
.outline-button:hover { background: var(--hero-start); }
.home-aside { padding-top: .15rem; }
.aside-card { margin-bottom: 1.1rem; padding: 1.5rem; border: 1px solid var(--card-border); border-radius: 10px; background: var(--card-bg); }
.aside-card h2 { font-size: 1.16rem; }
.category-links, .related-list, .toc { list-style: none; padding: 0; margin: 1rem 0; }
.category-links li + li, .related-list li + li, .toc li + li { border-top: 1px solid var(--subtle-border); }
.category-links a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .62rem 0; text-decoration: none; }
.count { min-width: 2rem; color: var(--count); font-size: .83rem; text-align: right; }
.aside-note { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem .25rem; color: var(--aside-note); font-size: .9rem; }
.aside-note p { margin: 0; }
.note-icon { color: var(--blue); font-size: 1.15rem; }

.page-hero, .article-hero { padding: 3.4rem 0; background: var(--pale); border-bottom: 1px solid var(--hero-border); }
.page-hero h1, .article-hero h1 { margin: 0; color: var(--navy-deep); font-size: clamp(2.15rem, 4.5vw, 3.4rem); }
.page-hero p:not(.eyebrow) { margin: .9rem 0 0; color: var(--hero-note); }
.page-hero .search-form { margin-top: 1.6rem; }
.content-block { padding-top: 3.2rem; padding-bottom: 5rem; min-height: 38vh; }
.results-count { margin: 0 0 1.25rem; color: var(--muted); font-size: .92rem; }
.archive-year + .archive-year { margin-top: 2.5rem; }
.archive-year h2 { margin: 0; padding-bottom: .75rem; border-bottom: 1px solid var(--line); font-size: 1.45rem; }
.archive-year .article-row { padding: 1rem 0; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.category-tile { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 75px; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.category-tile:hover { border-color: var(--tile-hover-border); background: var(--tile-hover-bg); color: var(--blue); }
.category-tile span { flex-shrink: 0; color: var(--muted); font-size: .8rem; }

.article-hero { padding: 2.5rem 0 3.2rem; }
.breadcrumbs { display: flex; gap: .6rem; align-items: center; margin-bottom: 1.35rem; color: var(--breadcrumbs); font-size: .9rem; }
.breadcrumbs a { text-decoration: none; }
.article-hero h1 { max-width: 900px; }
.article-meta { margin: 1rem 0 0; color: var(--article-meta); font-size: .92rem; }
.article-meta span { margin: 0 .3rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 735px) minmax(210px, 285px); gap: 4rem; align-items: start; padding-top: 3.4rem; }
.article-content { min-width: 0; color: var(--article-ink); font-size: 1.06rem; line-height: 1.8; overflow-wrap: anywhere; }
.article-content > :first-child { margin-top: 0; }
.article-content p { margin: 0 0 1.3rem; }
.article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6 { margin: 2.1rem 0 .85rem; color: var(--navy-deep); line-height: 1.3; overflow-wrap: anywhere; }
.article-content h2 { font-size: 1.65rem; }
.article-content h3 { font-size: 1.3rem; }
.article-content h4, .article-content h5, .article-content h6 { font-size: 1.1rem; }
.article-content ul, .article-content ol { padding-left: 1.6rem; margin: 0 0 1.35rem; }
.article-content li { padding-left: .15rem; }
.article-content hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.article-content :not(pre) > code { padding: .1em .3em; border-radius: 3px; background: var(--inline-code-bg); color: var(--inline-code-ink); font-family: Consolas, "Courier New", monospace; font-size: .9em; }
.article-content blockquote { margin: 1.6rem 0; padding: .9rem 1.25rem; border-left: 4px solid var(--quote-border); background: var(--quote-bg); }
.article-content blockquote p:last-child { margin-bottom: 0; }
.code-block { margin: 1.6rem 0; border-radius: 9px; overflow: hidden; background: #142b3a; box-shadow: 0 5px 14px #18394a16; }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem .8rem .55rem 1rem; background: #233f52; color: #d4e5ed; font-size: .84rem; }
.copy-code { min-height: 36px; border: 1px solid #607c8e; border-radius: 5px; padding: .25rem .75rem; background: #38586c; color: white; font-size: .84rem; }
.copy-code:hover { background: #496d82; }
.code-block pre { margin: 0; padding: 1.1rem 1.2rem 1.25rem; overflow-x: auto; color: #f3fbff; font: .9rem/1.7 Consolas, "Courier New", monospace; white-space: pre; overflow-wrap: normal; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 1.5rem 0; }
.article-content table { border-collapse: collapse; min-width: 100%; font-size: .9rem; line-height: 1.5; }
.article-content th, .article-content td { padding: .65rem .8rem; border: 1px solid var(--table-border); text-align: left; vertical-align: top; }
.article-content th { background: var(--table-header); }
.article-content tbody tr:nth-child(even) { background: var(--table-stripe); }
.article-aside .aside-card { padding: 1.25rem; }
.related-list a, .toc a { display: block; padding: .65rem 0; line-height: 1.45; text-decoration: none; font-size: .91rem; }
.article-end { padding-top: 2rem; padding-bottom: 4.5rem; }

.site-footer { background: var(--navy); color: #c2d4df; }
.footer-inner { display: flex; align-items: start; justify-content: space-between; gap: 2rem; padding-top: 2.3rem; padding-bottom: 2.3rem; }
.footer-brand { color: white; font-size: 1.55rem; text-decoration: none; }
.footer-inner p { margin: .55rem 0 0; font-size: .87rem; }
.footer-inner nav { display: flex; gap: 1.3rem; }
.footer-inner nav a { color: #d5e4ec; font-size: .9rem; text-decoration: none; }

@media (max-width: 850px) {
  .brand-motto { display: none; }
  .home-layout, .article-layout { gap: 2rem; }
  .home-layout { grid-template-columns: minmax(0, 1fr) 235px; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 220px; }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 2rem, var(--shell)); }
  .header-inner { min-height: 74px; gap: 1rem; }
  .brand-name { font-size: 1.75rem; }
  .brand { display: block; }
  .brand-motto { display: block; border: 0; margin-top: .35rem; padding: 0; font-size: .75rem; line-height: 1.25; }
  .desktop-nav { display: none; }
  .mobile-nav { display: block; }
  .hero-grid { display: block; padding-top: 2.75rem; padding-bottom: 2.6rem; }
  .hero h1 { font-size: clamp(2.5rem, 10.5vw, 3.4rem); }
  .hero h1 span { font-size: 1.05rem; }
  .hero-description { margin: 1.1rem 0 1.25rem; font-size: .98rem; }
  .hero-art { display: none; }
  .search-form { min-height: 54px; }
  .search-form button { min-width: 73px; padding: .4rem .6rem; }
  .topic-list { margin-top: 1rem; }
  .topic-pill { font-size: .83rem; }
  .home-layout, .article-layout { display: block; padding-top: 2.75rem; }
  .home-layout { padding-bottom: 3.5rem; }
  .section-heading h2 { font-size: 1.55rem; }
  .section-heading > .text-link { display: none; }
  .article-row { padding: 1.25rem 0; }
  .article-row h3 { font-size: 1.18rem; }
  .home-aside { margin-top: 3rem; }
  .aside-note { display: none; }
  .page-hero, .article-hero { padding: 2.2rem 0 2.45rem; }
  .page-hero h1, .article-hero h1 { font-size: clamp(2.1rem, 8.5vw, 2.75rem); }
  .article-hero h1 { overflow-wrap: anywhere; }
  .category-grid { grid-template-columns: 1fr; }
  .content-block { padding-top: 2.4rem; padding-bottom: 3.5rem; }
  .article-content { font-size: 1rem; }
  .article-aside { margin-top: 3rem; }
  .article-end { padding-bottom: 3.5rem; }
  .footer-inner { display: block; }
  .footer-inner nav { margin-top: 1.2rem; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }


.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  flex-shrink: 0; min-height: 44px; padding: .5rem .75rem;
  border: 1px solid #718b9c; border-radius: 7px; background: transparent;
  color: #edf5f8; font-size: .875rem; font-weight: 600;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: #294357; color: white; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
@media (min-width: 851px) and (max-width: 1100px) {
  .brand-motto { display: none; }
  .header-inner { gap: 1.25rem; }
  .desktop-nav { gap: 1.25rem; }
}
@media (max-width: 850px) {
  .desktop-nav { display: none; }
  .mobile-nav { display: block; }
  .theme-toggle { margin-left: auto; }
  .header-inner { gap: .75rem; }
}
@media (max-width: 680px) {
  .theme-toggle { width: 44px; padding: .5rem; }
  .theme-toggle-label { display: none; }
}
@media (max-width: 380px) {
  .header-inner { gap: .5rem; }
  .brand-name { font-size: 1.5rem; }
  .brand-motto { max-width: 155px; }
}


.article-toc { margin: 1.5rem 0 2rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card-bg); }
.article-toc > summary { color: var(--ink); font-weight: 700; }
.article-toc > summary::marker { color: var(--blue); }
.article-content .article-toc .toc { padding: 0; margin: .75rem 0 0; }
.article-toc .toc li { padding-left: 0; }

.row-date { display: inline-flex; flex-direction: column; flex-shrink: 0; text-align: right; line-height: 1.45; }
.updated-label { color: var(--blue); font-size: .78rem; font-weight: 600; }
.pinned-card h2 { display: flex; align-items: center; gap: .55rem; }
.pinned-card h2 svg { width: 20px; height: 20px; fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pinned-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.pinned-list a { display: block; font-size: 1rem; font-weight: 600; line-height: 1.5; text-decoration: none; }
.pinned-list a:hover { text-decoration: underline; }
.pinned-list p { margin: .55rem 0 0; color: var(--muted); font-size: .86rem; line-height: 1.6; }

.pinned-list li + li { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--subtle-border); }
