/* Ghostty Tomorrow Night / Tomorrow: ANSI palettes with shared UI roles. */
:root {
  color-scheme: dark;
  --ansi-0: #000000; --ansi-1: #cc6666; --ansi-2: #b5bd68; --ansi-3: #f0c674;
  --ansi-4: #81a2be; --ansi-5: #b294bb; --ansi-6: #8abeb7; --ansi-7: #ffffff;
  --ansi-8: #4c4c4c; --ansi-9: #cc6666; --ansi-10: #b5bd68; --ansi-11: #f0c674;
  --ansi-12: #81a2be; --ansi-13: #b294bb; --ansi-14: #8abeb7; --ansi-15: #ffffff;
  --bg: #1d1f21; --panel: #1d1f21; --chrome: #1d1f21;
  --text: #c5c8c6; --cursor: #c5c8c6; --selected: #373b41; --selected-text: #c5c8c6;
  --selection-bg: #373b41; --selection-text: #c5c8c6;
  --line: color-mix(in srgb, var(--text) 30%, var(--bg));
  --row-line: color-mix(in srgb, var(--text) 18%, var(--bg));
  --scrollbar: color-mix(in srgb, var(--text) 55%, var(--bg));
  --muted: color-mix(in srgb, var(--text) 75%, var(--bg)); --dim: var(--muted); --accent: var(--ansi-12);
  --warm: var(--ansi-3); --green: var(--ansi-2); --shortcut: var(--ansi-10);
  --purple: var(--ansi-5); --cyan: var(--ansi-6); --heading: var(--ansi-4);
  --body-text: var(--text); --intro-text: var(--text); --code: var(--ansi-14);
  --code-bg: color-mix(in srgb, var(--selected) 50%, var(--bg)); --pre-bg: var(--code-bg); --notice-bg: var(--code-bg);
  --danger: var(--ansi-1); --error: var(--ansi-9); --number: var(--ansi-11);
  --keyword: var(--ansi-13); --strong: var(--ansi-7);
  --backdrop: rgb(29 31 33 / 80%);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-family: var(--mono); font-size: 13px; font-synthesis: none; -webkit-font-smoothing: antialiased;
}
:root[data-theme="tomorrow"] {
  color-scheme: light;
  --ansi-0: #000000; --ansi-1: #c82829; --ansi-2: #718c00; --ansi-3: #eab700;
  --ansi-4: #4271ae; --ansi-5: #8959a8; --ansi-6: #3e999f; --ansi-7: #bfbfbf;
  --ansi-8: #000000; --ansi-9: #c82829; --ansi-10: #718c00; --ansi-11: #eab700;
  --ansi-12: #4271ae; --ansi-13: #8959a8; --ansi-14: #3e999f; --ansi-15: #ffffff;
  --bg: #ffffff; --panel: #ffffff; --chrome: #ffffff;
  --text: #4d4d4c; --cursor: #4d4d4c; --selected: #d6d6d6; --selected-text: #4d4d4c;
  --selection-bg: #d6d6d6; --selection-text: #4d4d4c;
  /* Keep bright ANSI hues for accents; darken small text roles on white. */
  --green: color-mix(in srgb, var(--ansi-2) 65%, var(--text));
  --cyan: color-mix(in srgb, var(--ansi-6) 60%, var(--text));
  --warm: color-mix(in srgb, var(--ansi-3) 25%, var(--text));
  --muted: color-mix(in srgb, var(--text) 85%, var(--bg)); --dim: var(--muted);
  --number: var(--warm);
  --shortcut: var(--green); --code: var(--cyan);
  --strong: var(--text); --backdrop: rgb(77 77 76 / 35%);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.65; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a:hover, button:hover { color: var(--accent); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--selection-bg); color: var(--selection-text); }
[hidden] { display: none !important; }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.desktop { display: flex; flex-direction: column; height: 100dvh; width: 100%; }
.masthead { flex-shrink: 0; min-height: 54px; padding: 0 22px; display: flex; align-items: center; gap: 26px; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 20px; font-weight: 700; letter-spacing: -1px; }
.wordmark > span:first-child { color: var(--cyan); font-weight: 400; }
.cursor { color: var(--cursor); font-size: 19px; margin-left: 9px; }
.masthead-note { color: var(--dim); font-size: 11px; }
.header-actions { display: flex; gap: 22px; font-size: 11px; color: var(--muted); }
.theme-picker { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.theme-picker select { max-width: 210px; min-height: 32px; border: 1px solid var(--line); border-radius: 0; padding: 5px 8px; background: var(--chrome); color: var(--text); cursor: pointer; }
.theme-picker select:hover { border-color: var(--accent); }
.header-actions button { min-height: 44px; padding: 0; }
.header-actions kbd { margin-left: 7px; color: var(--shortcut); }
.terminal { background: var(--panel); flex: 1; min-height: 0; display: flex; flex-direction: column; }
.workspace { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.navigation-bar { display: flex; justify-content: space-between; align-items: stretch; gap: 20px; padding: 0 22px; background: var(--chrome); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.primary-nav { display: flex; gap: 8px; }
.primary-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 2px solid transparent; }
.primary-nav a[aria-current], .primary-nav a.section-active { background: var(--selected); border-bottom-color: var(--accent); color: var(--selected-text); }
.social-links { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 11px; }
.social-links a:first-child { color: var(--purple); }
.social-links a:last-child { color: var(--cyan); }
.social-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.nav-symbol { width: 13px; font-size: 17px; line-height: 1; }
.primary-nav kbd { margin-left: auto; color: var(--dim); font-size: 10px; }
.nav-count { color: var(--warm); font-size: 10px; }
kbd { font-family: inherit; font-weight: 400; }
.reader { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
#view { min-height: 0; flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
#view:focus { outline: none; }
.page-content { width: 100%; max-width: 960px; margin-inline: auto; padding: 40px 48px 32px; }
.page-content.article { max-width: 860px; }
.eyebrow { color: var(--green); font-size: 11px; margin: 0 0 23px; }
.eyebrow .accent { color: var(--shortcut); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 34px; font-weight: 500; letter-spacing: -1.3px; line-height: 1.3; margin-bottom: 20px; }
.home h1 { font-size: clamp(34px, 3.4vw, 49px); line-height: 1.2; letter-spacing: -2px; margin-bottom: 22px; }
.home h1 .accent, .archive h1 .accent { color: var(--danger); }
.locations { color: var(--cyan); font-size: 11px; margin-bottom: 22px; }
.locations span { color: var(--dim); padding: 0 8px; }
.intro-copy { color: var(--intro-text); line-height: 1.9; margin-bottom: 20px; }
.text-link { color: var(--accent); font-size: 12px; }
.text-link span { margin-left: 12px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.recent { margin-top: 45px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.section-heading h2 { color: var(--purple); font-size: 12px; font-weight: 400; margin: 0; }
.section-heading h2 span { margin-right: 7px; }
.section-heading > a { color: var(--muted); font-size: 10px; white-space: nowrap; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { border-bottom: 1px solid var(--row-line); }
.post-item a { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 20px; align-items: baseline; padding: 15px 0; font-size: 12px; line-height: 1.6; }
.post-item time { font-size: 10px; color: var(--warm); }
.post-item a:hover .row-title { color: var(--accent); }
.post-item a.is-selected { background: var(--selected); color: var(--selected-text); box-shadow: -12px 0 var(--selected), 12px 0 var(--selected); }
.post-item a:focus-visible { outline-offset: 4px; }
.list-hint { font-size: 11px; color: var(--muted); margin: 16px 0 10px; }
.list-hint kbd { color: var(--shortcut); }
#post-navigation { display: flex; align-items: center; gap: 20px; padding: 10px 24px; border-top: 1px solid var(--line); font-size: 12px; flex-shrink: 0; }
#post-navigation:empty { display: none; }
#post-navigation a { padding: 5px 9px; border: 1px solid var(--line); white-space: nowrap; }
#post-navigation a:hover { border-color: var(--accent); background: var(--selected); }
#post-navigation kbd { color: var(--shortcut); margin-right: 5px; }
#post-navigation .all-musings { border-color: transparent; padding-left: 0; }
.post-position { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
#post-navigation [aria-disabled] { color: var(--dim); padding: 5px 9px; white-space: nowrap; }
#post-navigation [aria-disabled] kbd { color: inherit; }
.home-signoff { color: var(--dim); font-size: 10px; margin: 25px 0 0; }
.home-signoff span { color: var(--ansi-14); margin-right: 8px; }
#scroll-progress { color: var(--shortcut); min-width: 3ch; text-align: right; }
.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); min-height: 34px; padding: 0 22px; font-size: 11px; flex-shrink: 0; background: var(--chrome); color: var(--muted); }
.statusbar kbd { color: var(--shortcut); }
.statusbar button { margin-left: auto; font-size: 11px; padding: 6px 0; white-space: nowrap; }
#navigation-hint > span { color: var(--dim); padding: 0 10px; }
.lede { color: var(--muted); line-height: 1.9; font-size: 12px; margin-bottom: 32px; }
.archive-tools { display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.search-field { flex: 1; display: flex; gap: 12px; align-items: center; color: var(--shortcut); border: 1px solid var(--line); padding: 8px 12px; }
.search-field:focus-within { border-color: var(--accent); }
.search-field input { min-width: 0; width: 100%; border: 0; background: none; outline: 0; font-size: 11px; }
.search-field input::placeholder { color: var(--muted); }
#result-count { font-size: 10px; white-space: nowrap; color: var(--muted); }
#empty-state { padding: 35px 0; color: var(--danger); }
.end-marker { color: var(--dim); font-size: 10px; margin: 28px 0 0; text-align: center; }
.back-link { display: inline-block; color: var(--muted); font-size: 11px; margin-bottom: 36px; }
.post-header { border-bottom: 1px solid var(--line); padding-bottom: 25px; margin-bottom: 30px; }
.post-header .eyebrow { margin-bottom: 14px; color: var(--warm); }
.post-header time { color: var(--number); }
.post-header .eyebrow > span { margin: 0 8px; color: var(--dim); }
.post-header h1 { font-size: 29px; line-height: 1.4; margin: 0; overflow-wrap: anywhere; }
.acknowledgement { color: var(--muted); margin: 14px 0 0; font-size: 11px; }
.post-body { font-size: 13px; line-height: 1.95; color: var(--body-text); overflow-wrap: anywhere; }
.post-body p, .post-body ul, .post-body ol { margin-bottom: 21px; }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 { color: var(--text); line-height: 1.5; letter-spacing: -.4px; font-weight: 500; margin: 34px 0 14px; }
.post-body h1, .post-body h2 { color: var(--heading); font-size: 21px; }
.post-body h3 { color: var(--keyword); font-size: 17px; }
.post-body h4 { color: var(--green); }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body ul, .post-body ol { padding-left: 25px; }
.post-body li { padding-left: 4px; margin-bottom: 8px; }
.post-body li::marker { color: var(--purple); }
.post-body strong { color: var(--strong); font-weight: 700; }
.post-body code { color: var(--code); font-family: inherit; font-size: .92em; background: var(--code-bg); padding: 2px 5px; }
.post-body pre { overflow: auto; background: var(--pre-bg); border: 1px solid var(--line); padding: 20px; line-height: 1.7; scrollbar-width: thin; }
.post-body pre code { padding: 0; background: none; color: var(--text); white-space: pre; overflow-wrap: normal; }
/* Pygments tokens use the same ANSI roles as the terminal UI. */
.post-body pre :is(.c, .ch, .cm, .cp, .cpf, .c1, .cs) { color: var(--muted); font-style: italic; }
.post-body pre :is(.k, .kc, .kd, .kn, .kp, .kr, .kt, .ow) { color: var(--keyword); }
.post-body pre :is(.s, .sa, .sb, .sc, .dl, .sd, .s2, .sh, .si, .sx, .sr, .s1, .ss) { color: var(--green); }
.post-body pre :is(.m, .mb, .mf, .mh, .mi, .il, .mo, .se) { color: var(--number); }
.post-body pre :is(.nf, .fm, .nc, .nn) { color: var(--accent); }
.post-body pre :is(.nb, .bp, .nv, .vc, .vg, .vi, .vm) { color: var(--cyan); }
.post-body pre :is(.na, .nl) { color: var(--warm); }
.post-body pre :is(.nt, .nd, .gd) { color: var(--danger); }
.post-body pre :is(.err, .gr, .gt) { color: var(--error); }
.post-body pre .gi { color: var(--shortcut); }
.post-body pre :is(.o, .p) { color: var(--strong); }
.post-body pre .gp { color: var(--shortcut); }
.code-block { position: relative; }
.copy-code { position: absolute; top: 1px; right: 1px; background: var(--code-bg); color: var(--muted); font-size: 10px; padding: 4px 8px; }
.code-block pre { padding-top: 32px; }
.post-body img { display: block; max-width: 100%; height: auto; margin: 24px auto; border: 1px solid var(--line); }
.post-body blockquote, .notice { margin: 24px 0; border-left: 2px solid var(--accent); background: var(--notice-bg); padding: 16px 20px; }
.notice p:last-child, .post-body blockquote p:last-child { margin-bottom: 0; }
.notice--warning { border-color: var(--warm); }
.notice--danger { border-color: var(--danger); }
.post-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 11px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 10px 13px; text-align: left; }
.post-body th { background: var(--selected); }
hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.article-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 45px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
dialog { padding: 24px; width: min(470px, calc(100% - 32px)); border: 1px solid var(--accent); background: var(--panel); color: var(--text); }
dialog::backdrop { background: var(--backdrop); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.dialog-header h2 { font-size: 14px; font-weight: 400; margin: 0; }
.dialog-header button { color: var(--muted); font-size: 10px; }
dialog p { font-size: 11px; color: var(--muted); }
.key-list { display: grid; grid-template-columns: 130px 1fr; gap: 12px; margin: 25px 0; font-size: 12px; }
.key-list dt { color: var(--shortcut); }
.key-list dd { margin: 0; }
.sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 10; top: 0; left: 20px; padding: 10px; background: var(--accent); color: var(--bg); transform: translateY(-120%); }
.skip-link:focus { transform: translateY(0); }
@media (max-width: 1100px) {
  .masthead-note { display: none; }
  .page-content { padding: 36px 34px 30px; }
  .post-item a { gap: 12px; }
  .wide-only { display: none; }
}
@media (max-width: 760px) {
  .masthead { min-height: 50px; gap: 2px 14px; padding: 8px 16px 0; display: grid; grid-template-columns: 1fr auto; }
  .wordmark { font-size: 18px; }
  .masthead-note { display: none; }
  .theme-picker { grid-column: 2; grid-row: 1; }
  .theme-picker > span { display: none; }
  .theme-picker select { max-width: 165px; font-size: 10px; }
  .header-actions { grid-column: 1 / -1; justify-content: flex-end; gap: 18px; font-size: 10px; }
  .header-actions button { min-height: 28px; }
  .header-actions kbd { display: none; }
  .workspace { display: flex; flex-direction: column; }
  .navigation-bar { padding: 0 10px; gap: 10px; }
  .primary-nav { gap: 2px; }
  .primary-nav a { padding: 10px 8px; gap: 7px; font-size: 11px; }
  .social-links { gap: 12px; font-size: 9px; }
  .primary-nav kbd { display: none; }
  .nav-count { display: none; }
  .reader { flex: 1; }
  .page-content { padding: 30px 24px; }
  .home h1 { font-size: 39px; }
  .eyebrow { margin-bottom: 22px; }
  .intro-copy { font-size: 12px; }
  .locations { font-size: 10px; line-height: 1.8; }
  .locations span { padding: 0 3px; }
  .recent { margin-top: 36px; }
  .post-item a { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 14px 0; }
  .post-item time { grid-column: 1; }
  .row-title { grid-column: 1; }
  .statusbar { min-height: 32px; padding: 0 16px; font-size: 9px; }
  .statusbar button { display: none; }
  #scroll-progress { display: none; }
  #navigation-hint > span { padding: 0 6px; }
  #post-navigation { padding: 9px 12px; gap: 10px; font-size: 11px; flex-wrap: wrap; }
  #post-navigation a, #post-navigation [aria-disabled] { padding: 7px 5px; }
  #post-navigation .all-musings kbd { display: none; }
  #post-navigation kbd { margin-right: 2px; }
  .post-position { font-size: 9px; }
  .list-hint { font-size: 10px; }
  .post-header h1 { font-size: 25px; }
  .post-body { font-size: 12px; }
  .post-body pre { padding-left: 12px; padding-right: 12px; }
  .back-link { margin-bottom: 28px; }
  .archive-tools { gap: 10px; }
}
@media (max-width: 380px) {
  .page-content { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
@media print {
  :root, :root[data-theme="tomorrow"] { color-scheme: light; --text: #111; --muted: #444; --accent: #333; --line: #bbb; --selected: #eee; --code: #111; --code-bg: #f5f5f5; --notice-bg: #f5f5f5; --heading: #111; --strong: #111; }
  body, .terminal { background: white; color: #111; overflow: visible; }
  .desktop { height: auto; display: block; }
  .desktop, .page-content, .page-content.article { max-width: none; padding: 0; }
  .masthead, .navigation-bar, .statusbar, .back-link, .copy-code, #post-navigation { display: none; }
  .terminal { border: 0; }
  .workspace { display: block; height: auto; min-height: 0; max-height: none; }
  #view { overflow: visible; }
  .post-body { color: #111; }
  .post-body pre { white-space: pre-wrap; background: #f5f5f5; }
  .post-body pre code { white-space: pre-wrap; color: #111; }
  .post-body pre span { color: #111 !important; }
}
