:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #475467;
  --paper: #ffffff;
  --surface: #f2f4f7;
  --accent: #174ea6;
  --accent-dark: #103a7a;
  --visited: #633b80;
  --line: #98a2b3;
  --focus: #182230;
}

/* Follow the device theme unless the reader has explicitly chosen a theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #f2f4f7;
    --muted: #b8c2d0;
    --paper: #111827;
    --surface: #1f2937;
    --accent: #93c5fd;
    --accent-dark: #bfdbfe;
    --visited: #d8b4fe;
    --line: #7c8a9e;
    --focus: #f2f4f7;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f4f7;
  --muted: #b8c2d0;
  --paper: #111827;
  --surface: #1f2937;
  --accent: #93c5fd;
  --accent-dark: #bfdbfe;
  --visited: #d8b4fe;
  --line: #7c8a9e;
  --focus: #f2f4f7;
}

* { box-sizing: border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0;
}

.container { margin: 0 auto; max-width: 1120px; padding: 0 1.5rem; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 1.25rem 0; }
.header-inner { align-items: flex-start; display: flex; flex-direction: column; gap: 1rem; }
.header-top { align-items: center; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; width: 100%; }
.theme-control { color: var(--ink); font-family: Arial, sans-serif; font-size: 1rem; }
.theme-control select { background: var(--paper); border: 1px solid var(--line); border-radius: .25rem; color: var(--ink); font: inherit; margin-left: .35rem; min-height: 44px; padding: .4rem .5rem; }
.brand { color: var(--ink); font-size: 1.3rem; font-weight: bold; text-decoration: none; }
.brand span { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
nav a { border-bottom: 3px solid transparent; color: var(--ink); display: inline-flex; align-items: center; min-height: 44px; padding: .35rem 0; font-family: Arial, sans-serif; font-size: 1rem; text-decoration: none; }
nav a:hover { color: var(--accent-dark); }
nav a[aria-current] { border-bottom-color: currentColor; color: var(--accent-dark); font-weight: bold; }

.content { min-height: calc(100vh - 170px); padding-bottom: 4rem; padding-top: 3rem; overflow-wrap: anywhere; }
h1, h2 { font-weight: normal; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 6vw, 3.5rem); letter-spacing: -.02em; margin: 0 0 1.5rem; }
h2 { font-size: 1.8rem; margin-top: 3rem; }
p { max-width: 80ch; }
.content > p:first-of-type { color: var(--muted); font-size: 1.2rem; max-width: 80ch; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: .08em; }
.content a:visited { color: var(--visited); }
.content a:hover { color: var(--accent-dark); text-decoration-thickness: .15em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[id] { scroll-margin-top: 1.5rem; }
.skip-link { background: var(--paper); color: var(--accent); font-family: Arial, sans-serif; left: 1rem; padding: .75rem 1rem; position: absolute; top: 1rem; transform: translateY(-200%); z-index: 10; }
.skip-link:focus { transform: translateY(0); }
::selection { background: var(--accent-dark); color: var(--paper); }
li { margin: .45rem 0; max-width: 80ch; }
table { border-collapse: collapse; font-size: .95em; margin: 1.5rem 0; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: .65rem .5rem; text-align: left; vertical-align: top; }
th { background: var(--surface); color: var(--ink); font-family: Arial, sans-serif; font-size: 1em; }
tbody tr:nth-child(even) { background: var(--surface); }
.post-list { margin-top: 3rem; }
.post-preview { border-top: 1px solid var(--line); padding: 1.5rem 0 1rem; }
.post-preview h2 { margin: .25rem 0 .5rem; }
.post-date { color: var(--muted); font-family: Arial, sans-serif; font-size: .95rem; margin: 0; }
.post-meta { color: var(--muted); font-family: Arial, sans-serif; font-size: .95rem; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-family: Arial, sans-serif; font-size: .95rem; padding: 1rem 0; }

.project-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 2rem 0; }
.project-card { border: 1px solid var(--line); border-radius: .5rem; padding: 1.25rem 1.5rem; background: var(--surface); }
.project-card h3 { margin: 0 0 .5rem; font-size: 1.25rem; }
.project-card p { margin: 0 0 .75rem; max-width: none; }
.project-status { display: inline-block; font-family: Arial, sans-serif; font-size: .8rem; font-weight: bold; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 1rem; padding: .15rem .6rem; margin-bottom: .75rem; }

.career-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin: 2rem 0; }
.career-card { background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; padding: 1.25rem 1.5rem; }
.career-card h2 { font-size: 1.25rem; font-weight: bold; margin: 0 0 .75rem; }
.career-card p { margin: 0; max-width: none; }

@media (max-width: 600px) {
  .container { padding-left: 1rem; padding-right: 1rem; }
  .content { padding-top: 2rem; }
  th, td { padding: .5rem .35rem; }
}
