/* emrox.de — single hand-written stylesheet, no build step.
   Light/dark via prefers-color-scheme; rem-based sizing so user font-size
   settings are honored; WCAG AA contrast in both schemes. */

/* ---------- Self-hosted font: Source Sans 3 (variable, OFL) ---------- */

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/assets/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("/assets/fonts/source-sans-3-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/assets/fonts/source-sans-3-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("/assets/fonts/source-sans-3-latin-ext-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Design tokens ---------- */

:root {
  color-scheme: light dark;

  --color-bg: #fcfcfa;
  --color-text: #20242a;
  --color-muted: #565e68;
  --color-link: #0b5cc2;
  --color-border: #d8dbe0;
  --color-mark-bg: #20242a;
  --color-mark-text: #fcfcfa;

  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --width-content: 70ch;
  --width-page: 75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #15181c;
    --color-text: #e6e9ec;
    --color-muted: #a3adb8;
    --color-link: #7db4f5;
    --color-border: #303841;
    --color-mark-bg: #e6e9ec;
    --color-mark-text: #15181c;
  }
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

html {
  /* 100% respects the user's browser font-size setting */
  font-size: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--color-link);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

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

h1, h2, h3, h4 {
  line-height: 1.25;
  text-wrap: balance;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

img {
  max-width: 100%;
  height: auto;
}

code, pre {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
}

.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

.placeholder {
  color: var(--color-muted);
  font-style: italic;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Header / footer ---------- */

.site-header,
.site-footer,
main {
  width: 100%;
  max-width: var(--width-page);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.site-header {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text);
  text-decoration: none;
}

.site-brand:hover .site-title {
  text-decoration: underline;
}

/* Simple text logo for v1 — replace with a real logo later */
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--color-mark-bg);
  color: var(--color-mark-text);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.site-title {
  font-weight: 600;
  font-size: 1.25rem;
}

main {
  flex: 1;
  padding-block: 2rem 3rem;
}

.site-footer {
  padding-block: 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.95rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  color: inherit;
}

/* ---------- Home page: two-column grid per PRD sketch ---------- */

.home-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 52rem) {
  .home-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: clamp(2rem, 5vw, 4rem);
  }
}

.home-col {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  min-width: 0;
}

.home-section > h1,
.home-section > h2 {
  margin-top: 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border);
}

/* ---------- Profile links ---------- */

.profile-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-block: 0.25rem;
}

.profile-list .icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

/* ---------- Item lists (articles, shared links) ---------- */

.item-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-list > li {
  padding-block: 0.5rem;
}

.item-list > li + li {
  border-top: 1px solid var(--color-border);
}

.item-list time,
.item-list .item-meta {
  display: block;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.more-link {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.link-comment {
  margin: 0.15rem 0;
  font-size: 0.95rem;
}

.link-month h2 {
  margin-top: 2rem;
}

.year-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.year-nav [aria-current="page"] {
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
}

/* ---------- Content pages (articles, legal pages) ---------- */

.prose {
  max-width: var(--width-content);
}

.article-header h1 {
  margin-bottom: 0.25rem;
}

.article-meta {
  margin-top: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.prose blockquote {
  margin-inline: 0;
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--color-border);
  color: var(--color-muted);
}
