/* The Professional Paradox — anonymous dispatches from inside the corporate machine */

:root {
  color-scheme: light;
  --paper: #faf9f5;
  --ink: #1c1b18;
  --muted: #757269;
  --line: #e4e1d8;
  --accent: #2c4a3b;
}

/* Explicit choice via the toggle wins; otherwise follow the system. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171613;
  --ink: #e9e6df;
  --muted: #9a968b;
  --line: #2e2d27;
  --accent: #a3c4b2;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #171613;
    --ink: #e9e6df;
    --muted: #9a968b;
    --line: #2e2d27;
    --accent: #a3c4b2;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: Baskerville, 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 41rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Masthead */
.site-head {
  text-align: center;
  padding: 5rem 1.5rem 3.25rem;
}
.site-title {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.site-title a { color: var(--ink); }
.site-title a:hover { text-decoration: none; color: var(--accent); }
.site-tagline {
  margin-top: 1rem;
  font-style: italic;
  color: var(--muted);
  font-size: 0.98rem;
}
.site-nav {
  margin-top: 1.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.site-nav a { color: var(--muted); margin: 0 0.85rem; }
.site-nav a[aria-current="page"] { color: var(--ink); }

/* Theme toggle — a small icon button in the top-right corner, distinct from the nav */
.theme-toggle {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Moon shows when a click would switch to dark; sun when it would switch to light. */
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  max-width: 8rem;
  margin: 0 auto;
}

/* Post index */
.dispatches { padding-block: 3.5rem 2rem; }
.dispatch { margin-bottom: 4.25rem; }
.dispatch-meta,
.post-meta {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.dispatch-title {
  font-size: clamp(1.6rem, 4.5vw, 2.1rem);
  font-weight: 500;
  line-height: 1.25;
  margin-top: 0.6rem;
}
.dispatch-title a { color: var(--ink); }
.dispatch-title a:hover { color: var(--accent); text-decoration: none; }
.dispatch-excerpt { margin-top: 0.85rem; color: var(--muted); }
.dispatch-more {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Single post */
.post { padding-block: 3.75rem 2rem; }
.post-title {
  font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  font-weight: 500;
  line-height: 1.2;
  margin-top: 0.7rem;
}
.post-body { margin-top: 2.25rem; }
.post-body p { margin-bottom: 1.4rem; }
.post-end {
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.5em;
  margin: 2.75rem 0 0.5rem;
}
.post-back {
  margin-top: 2.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* About */
.page { padding-block: 3.75rem 2rem; }
.page h1 {
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  font-weight: 500;
  line-height: 1.25;
}
.page p { margin-top: 1.4rem; }

/* Footer */
.site-foot {
  text-align: center;
  padding: 4rem 1.5rem 3.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}
.site-foot .colophon {
  margin-top: 0.8rem;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
