/* tilde — minimal static dev-blog styles (Arch-inspired layout).
   No imports, no web fonts, no JS. Theme toggle is pure CSS (:has + checkbox). */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #333333;
  --muted: #66696d;
  --rule: #dddddd;
  --link: #0088cc;
  --accent: #1793d1;
  --code-bg: #f7f7f7;
  --nav-bg: #333333;
  --nav-fg: #eaeaea;
  --nav-muted: #b8bcc1;
  --nav-rule: rgba(255, 255, 255, .14);
}

/* manual dark option: toggled by the checkbox in the header (no JS) */
:root:has(#theme-toggle:checked) {
  color-scheme: dark;
  --bg: #16181b;
  --fg: #e6e8eb;
  --muted: #9aa0a6;
  --rule: #2b3036;
  --link: #4aa8d8;
  --accent: #4aa8d8;
  --code-bg: #1c2025;
  --nav-bg: #111315;
  --nav-fg: #eaeaea;
  --nav-muted: #9aa0a6;
  --nav-rule: rgba(255, 255, 255, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* wide, page-filling container (not a narrow centered column) */
.wrap { width: min(100% - 2rem, 80rem); margin-inline: auto; }

header.site { background: var(--nav-bg); }
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem 1.25rem; padding: .8rem 0; flex-wrap: wrap;
}
.brand {
  font-weight: 600; letter-spacing: .02em; text-decoration: none; color: var(--nav-fg);
  transition: color .15s ease;
}
.brand .mark { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

nav { display: flex; align-items: center; gap: .9rem 1.1rem; flex-wrap: wrap; justify-content: flex-end; }
nav a { color: var(--nav-muted); text-decoration: none; font-size: .95rem; transition: color .15s ease; }
nav a:hover, nav a:focus-visible { color: var(--nav-fg); }
nav a.on { color: var(--nav-fg); font-weight: 600; }
.langs { display: inline-flex; gap: .5rem; padding-left: .75rem; border-left: 1px solid var(--nav-rule); }
.langs a { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.langs a.on { text-decoration: underline; text-underline-offset: 3px; }
.theme-btn { cursor: pointer; color: var(--nav-muted); user-select: none; line-height: 1; transition: color .15s ease; }
.theme-btn:hover { color: var(--nav-fg); }

main { padding: 2.25rem 0 3rem; }

h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); line-height: 1.25; margin: .2rem 0 1rem; }
h2 { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); margin: 2rem 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: var(--link); }

.lead { color: var(--muted); font-size: 1.05rem; }

ul.posts { list-style: none; padding: 0; margin: 1.75rem 0 0; }
ul.posts li { padding: 1.05rem 0; border-bottom: 1px solid var(--rule); }
ul.posts .date {
  color: var(--muted); font-size: .8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
ul.posts a.title { font-weight: 600; text-decoration: none; display: inline-block; margin-top: .15rem; transition: color .15s ease; }
ul.posts a.title:hover { text-decoration: underline; text-underline-offset: 3px; }
ul.posts p { margin: .35rem 0 0; color: var(--muted); }

article .meta {
  color: var(--muted); font-size: .85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-bottom: 1.5rem;
}
article img { max-width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--rule); }

pre {
  background: var(--code-bg); padding: .9rem 1rem;
  overflow: auto; border-radius: 4px; border: 1px solid var(--rule);
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
:not(pre) > code { background: var(--code-bg); padding: .12em .35em; border-radius: 3px; }

blockquote { border-left: 3px solid var(--rule); margin: 1.25rem 0; padding: .1rem 1rem; color: var(--muted); }

table { border-collapse: collapse; width: 100%; margin: 1.25rem 0; font-size: .95rem; }
th, td { border: 1px solid var(--rule); padding: .4rem .6rem; text-align: left; }
th { background: var(--code-bg); }

hr.sep { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

footer.site { border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }
footer.site .wrap { padding: 1.25rem 0; }
footer.site a { color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
