/* annamlnk.com — one stylesheet for the whole site.
   Dark by default; prefers-color-scheme picks light; ☼ overrides either. */

:root {
  --bg:     #171A17;
  --fg:     #EEECE5;
  --dim:    #BFC2B9;
  --accent: #7899AE;
  --rule:   #2C302B;

  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --measure: 34rem;              /* ~70 characters */
  --gutter:  clamp(1.25rem, 5vw, 2.5rem);
  --stack:   clamp(2.5rem, 8vw, 4.5rem);   /* space between major blocks */

  color-scheme: dark;
}

/* Light palette. Declared twice on purpose: once for the system preference,
   once for the manual override. Same six values, no indirection. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:#F3F0E8; --fg:#1D2A22; --dim:#55604F; --accent:#3F6076; --rule:#DEDACE;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg:#F3F0E8; --fg:#1D2A22; --dim:#55604F; --accent:#3F6076; --rule:#DEDACE;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0 auto;
  padding: 0 var(--gutter) var(--stack);
  max-width: 62rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

/* ---------- links ---------- */

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-color: var(--accent); }
:where(main, footer) a { text-decoration-color: color-mix(in srgb, var(--accent) 65%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--bg); color: var(--fg);
  padding: .6rem .9rem; border: 1px solid var(--rule);
}
.skip:focus { left: var(--gutter); top: .5rem; z-index: 2; }

/* ---------- masthead ---------- */

.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: .5rem 1rem;
  padding: clamp(1.5rem, 5vw, 2.5rem) 0 1rem;
  margin-bottom: var(--stack);
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-family: var(--serif);
  font-size: 1.0625rem;
  letter-spacing: .04em;
  text-decoration: none;
}
.brand:hover { text-decoration: underline; text-underline-offset: .25em; }

/* ☼ — the site's only ornament, and its theme switch */
.sun {
  background: none; border: 0; padding: .1em .25em; margin: -.1em -.25em;
  color: var(--dim); font: inherit; font-size: 1.25rem; line-height: 1;
  cursor: pointer;
}
.sun:hover { color: var(--accent); }

.masthead nav { grid-column: 1 / -1; margin-top: .35rem; }
.masthead ul {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .15rem .6rem;
  list-style: none; margin: 0; padding: 0;
  font-size: .9375rem;
}
.masthead li + li::before { content: "·"; color: var(--rule); margin-right: .6rem; }
.masthead a { color: var(--dim); text-decoration: none; }
.masthead a:hover { color: var(--fg); }
.masthead a[aria-current="page"] { color: var(--fg); }

/* ---------- headings & prose ---------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; }

h1 {
  font-size: clamp(2.125rem, 4.5vw, 3rem);
  letter-spacing: -.015em;
  margin: 0 0 1rem;
}
h2 {
  font-size: clamp(1.375rem, 2.5vw, 1.625rem);
  letter-spacing: -.01em;
  margin: var(--stack) 0 .85rem;
}
h3 { font-size: 1.125rem; margin: 2rem 0 .4rem; }

main > :first-child, section > :first-child { margin-top: 0; }
p, li { max-width: var(--measure); }
p { margin: 0 0 1.1rem; }

.lede { font-size: 1.125rem; }
.dim  { color: var(--dim); }

/* strapline under the name: research fields */
.fields {
  font-size: .9375rem; letter-spacing: .02em; color: var(--dim);
  margin-bottom: 1.6rem;
}

/* inline link rows (ORCID · Scholar · …) */
.inline-links {
  display: flex; flex-wrap: wrap; gap: .15rem .6rem;
  list-style: none; margin: 1.6rem 0 0; padding: 0;
  font-size: .9375rem;
}
.inline-links li + li::before { content: "·"; color: var(--rule); margin-right: .6rem; }

/* ---------- home: intro + portrait ---------- */

.intro { display: grid; gap: var(--stack); }

@media (min-width: 46rem) {
  /* desktop is simply more spacious: text left, portrait right */
  .intro { grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: 3.5rem; align-items: start; }
  .intro h1 { font-size: clamp(3rem, 5.5vw, 4rem); }
}

.portrait { margin: 0; }
.portrait img {
  display: block; width: 100%; height: auto;
  background: var(--rule);
}
.portrait figcaption { font-size: .8125rem; color: var(--dim); margin-top: .6rem; }

.prompt { margin: var(--stack) 0 0; font-size: .9375rem; }

/* ---------- lists of work ---------- */

.entries { list-style: none; margin: 0; padding: 0; }
.entries > li {
  max-width: var(--measure);
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
}
.entries > li:last-child { border-bottom: 1px solid var(--rule); }
.entries .title { display: block; }
.entries .meta { display: block; font-size: .9375rem; color: var(--dim); margin-top: .2rem; }

/* dated entries (Notes) */
.entries time { display: block; font-size: .8125rem; letter-spacing: .04em; color: var(--dim); margin-bottom: .3rem; }

/* ---------- footer ---------- */

footer {
  margin-top: var(--stack);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: .875rem;
  color: var(--dim);
}
footer p { margin: 0 0 .4rem; max-width: var(--measure); }
