/* Nostroid core styles. Cascade order: core < theme < site, regardless of selector specificity.
   Themes restyle via tokens (custom properties) first, then rules in @layer theme. */
@layer core, theme, site;

@layer core {
:root {
  --bg: #fafaf8; --fg: #1b1b1b; --muted: #6b6b6b; --line: #e4e4e0; --accent: #6d3fd1;
  --code-bg: color-mix(in srgb, var(--fg) 6%, transparent);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: inherit;
  --font-mono: monospace;
  --font-size: 17px; --line-height: 1.65;
  --measure: 42rem; --radius: 6px; --avatar-radius: 50%;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #121212; --fg: #ececec; --muted: #9a9a9a; --line: #2a2a2a; --accent: #a98bff; }
}
:root[data-theme="dark"] { --bg: #121212; --fg: #ececec; --muted: #9a9a9a; --line: #2a2a2a; --accent: #a98bff; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: var(--font-size)/var(--line-height) var(--font-body); }
a { color: var(--accent); text-underline-offset: 2px; }
img, video { max-width: 100%; height: auto; border-radius: var(--radius); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem; }

.site-header, main, .site-footer { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }
.site-header { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; padding-top: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.site-title { font-weight: 700; color: var(--fg); text-decoration: none; margin-right: auto; }
.site-header nav { display: flex; gap: 1rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--fg); }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 999px; width: 2rem; height: 2rem; cursor: pointer; }

main { padding-top: 2rem; padding-bottom: 3rem; }
h1, h2, h3 { font-family: var(--font-heading); }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 .75rem; }
h1 small { font-size: 1rem; color: var(--muted); font-weight: 400; }
h2 { line-height: 1.3; }
.section-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 2.5rem; }
.meta { color: var(--muted); font-size: .9rem; margin: .25rem 0 0; }
.meta a { color: inherit; }

.profile .avatar { border-radius: var(--avatar-radius); width: 96px; height: 96px; object-fit: cover; }
.card { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.card h2 { font-size: 1.25rem; margin: 0; }
.card h2 a { color: var(--fg); text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.note { padding: 1rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.note p { margin: 0 0 .5rem; }
.note-single { font-size: 1.15rem; border: 0; }

.post .hero { width: 100%; margin: 1rem 0; }
.prose { overflow-wrap: break-word; }
.prose pre { overflow-x: auto; padding: 1rem; background: var(--code-bg); border-radius: var(--radius); }
.prose code, .prose pre { font-family: var(--font-mono); }
.prose code { font-size: .9em; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .6rem; text-align: left; }
.tags span { color: var(--muted); margin-right: .5rem; font-size: .9rem; }

.links ul { padding-left: 1.1rem; }
.show-art { width: 160px; height: 160px; object-fit: cover; margin-bottom: 1rem; }
audio { display: block; width: 100%; margin: 1.25rem 0; }
.pager { display: flex; justify-content: space-between; margin-top: 2rem; color: var(--muted); font-size: .9rem; }
.site-footer { border-top: 1px solid var(--line); padding-top: 1rem; padding-bottom: 2rem; color: var(--muted); font-size: .9rem; }
.site-footer a { color: inherit; }
}

/* theme: styles.css */
@layer theme {
@font-face { font-family: "Cormorant Garamond"; src: url(theme/cormorant-garamond.woff2) format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(theme/cormorant-garamond-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root, :root[data-theme] {
  color-scheme: dark;
  --bg: #08060d; --fg: #ebe6f3; --muted: #8e86a3; --line: #221a33; --accent: #c9a8ff; --rim: #7b45c9;
  --code-bg: rgba(123, 69, 201, .12);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: Georgia, "Times New Roman", serif;
  --font-heading: var(--font-display);
  --font-size: 18px; --line-height: 1.7;
  --measure: 40rem; --radius: 2px;
}
html { background: var(--bg); overflow-x: clip; }
body { min-height: 100vh; position: relative; background:
  radial-gradient(60rem 30rem at 70% -10%, rgba(78, 40, 140, .28), transparent 60%),
  radial-gradient(30rem 20rem at 10% 110%, rgba(78, 40, 140, .16), transparent 60%),
  var(--bg); }
body > * { position: relative; }
a { text-decoration: none; }
a:hover { color: #fff; }

.site-header { padding-top: 2.5rem; border-bottom: 0; align-items: baseline; }
.site-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; letter-spacing: .06em; display: inline-flex; align-items: baseline; gap: .6rem; }
.site-title .mark { color: var(--accent); font-size: 1.5rem; }
.site-header nav { gap: 1.4rem; font-size: .95rem; font-style: italic; }
.theme-toggle { display: none; }

main { padding-top: 3.5rem; padding-bottom: 4rem; }
h1 { font-weight: 400; font-size: 4rem; line-height: 1; letter-spacing: -.01em; margin: 0 0 1.25rem; }
h1 small { display: block; font-family: var(--font-body); font-size: 1.1rem; color: var(--muted); font-style: italic; letter-spacing: 0; margin-top: .5rem; }
h2 { font-weight: 400; }
.section-title { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .22em; color: var(--muted); margin: 3.5rem 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.meta { font-style: italic; font-size: .85rem; }

.profile p { margin: 0 0 .75rem; max-width: 34rem; }
.profile .lede { font-style: italic; font-size: 1.25rem; color: #d8cfea; border-left: 1px solid var(--rim); padding-left: 1rem; }
/* Ghost portrait: real braille text behind the profile, bleeding off the right edge. */
@font-face { font-family: "Aether Braille"; src: url(theme/aether-braille.woff2) format("woff2"); unicode-range: U+2800-28FF; font-display: block; }
.profile { position: relative; }
.profile > :not(.hero-ascii) { position: relative; z-index: 1; }
.hero-ascii { position: absolute; z-index: 0; top: -4.5rem; right: -12rem; margin: 0; padding: 0; border: 0; background: none;
  pointer-events: none; white-space: pre; overflow: visible;
  font-family: "Aether Braille"; font-size: 13px; line-height: 1.465; letter-spacing: 0; font-kerning: none;
  color: var(--accent); opacity: .32;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%); mask-image: linear-gradient(90deg, transparent, #000 35%); }
@media (max-width: 600px) { .hero-ascii { top: -3.5rem; right: -6.5rem; font-size: 8.6px; opacity: .34; } }

.profile .sigil { color: var(--accent); font-size: 1.6rem; margin-top: 1.5rem; display: inline-block; opacity: .9; }

.card { padding: 1.25rem 0; }
.card h2 { font-size: 1.75rem; line-height: 1.15; }
.card p { color: #c2b9d4; }
.note { padding: 1.1rem 0; }
.note-single { font-size: 1.3rem; }

.post header h1 { font-size: 3rem; }
.prose { font-size: 1.05rem; }
.prose h1 { font-size: 2rem; margin: 2rem 0 .5rem; }
.prose h2 { font-size: 1.6rem; }
.prose pre { border: 1px solid var(--line); }
.prose blockquote { border-left-color: var(--rim); font-style: italic; }
.pager { font-style: italic; }
.site-footer { padding-top: 1.5rem; padding-bottom: 3rem; font-size: .85rem; font-style: italic; }

@media (max-width: 480px) { h1 { font-size: 2.8rem; } .post header h1 { font-size: 2.2rem; } :root { --font-size: 17px; } }

/* Buidlberg (NIP-F4) */
.show-art { border: 1px solid var(--line); border-radius: var(--radius); }
.show h1 { font-size: 3rem; }
.episode h2 { font-size: 1.5rem; }
.episode-single header .meta:first-child { font-family: var(--font-display); font-style: normal; letter-spacing: .18em; text-transform: uppercase; font-size: .9rem; }
.episode-single header h1 { font-size: 2.6rem; }
audio { filter: invert(1) hue-rotate(180deg) saturate(.6); border-radius: 999px; }
}
