/* ============================================================
   Denise J. Roth — personal academic site
   Modern, accessible, self-contained stylesheet
   (replaces the skel.js / Twenty theme)
   ============================================================ */

/* ---- Tokens: light (bare :root defines the full palette) ---- */
:root {
  --paper:      #f4f2ec;
  --surface:    #fffdf9;
  --surface-2:  #efece3;
  --ink:        #1d2b31;
  --body:       #3f4b50;
  --muted:      #6c767a;
  --accent:     #0e6b74;
  --accent-ink: #0a555c;
  --accent-soft:#dcebe9;
  --line:       #e2ded4;
  --line-strong:#d3cdbf;
  --shadow:     0 1px 2px rgba(29,43,49,.05), 0 8px 24px -12px rgba(29,43,49,.18);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 62rem;
  --measure: 40rem;
  --radius: 12px;
}

/* ---- Tokens: dark via OS (only when no explicit light choice) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #13191b;
    --surface:    #1a2225;
    --surface-2:  #212b2e;
    --ink:        #eef2f0;
    --body:       #c4cdcd;
    --muted:      #8a9698;
    --accent:     #58bcc6;
    --accent-ink: #7fd0d8;
    --accent-soft:#12312f;
    --line:       #2a3538;
    --line-strong:#374448;
    --shadow:     0 1px 2px rgba(0,0,0,.3), 0 12px 30px -14px rgba(0,0,0,.6);
  }
}

/* ---- Tokens: dark via explicit toggle (wins both directions) ---- */
:root[data-theme="dark"] {
  --paper:      #13191b;
  --surface:    #1a2225;
  --surface-2:  #212b2e;
  --ink:        #eef2f0;
  --body:       #c4cdcd;
  --muted:      #8a9698;
  --accent:     #58bcc6;
  --accent-ink: #7fd0d8;
  --accent-soft:#12312f;
  --line:       #2a3538;
  --line-strong:#374448;
  --shadow:     0 1px 2px rgba(0,0,0,.3), 0 12px 30px -14px rgba(0,0,0,.6);
}

/* ---- Reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ---- Skip link ---- */
.skip {
  position: absolute; left: 12px; top: -3rem;
  background: var(--accent); color: #fff; padding: .55rem .9rem;
  border-radius: 8px; z-index: 100; transition: top .15s ease; font-weight: 600;
}
.skip:focus { top: 12px; color:#fff; }

/* ---- Shared layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 5vw, 2.5rem); }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.brand {
  font-family: var(--serif); font-weight: 500; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; letter-spacing: .01em; margin-right: auto;
}
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-block; padding: .4rem .7rem; border-radius: 8px;
  font-size: .82rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface);
  color: var(--ink); cursor: pointer; padding: 0; transition: background .15s ease, transform .15s ease;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun,
:root:not([data-theme="light"]) .theme-toggle .sun { }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* ---- Eyebrow / section heading ---- */
.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .6rem;
}
.section { padding-block: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--line); }
.section-head { max-width: var(--measure); margin-bottom: 2rem; }
.section h2 {
  font-family: var(--serif); font-weight: 500; color: var(--ink);
  font-size: clamp(1.7rem, 3.4vw, 2.25rem); line-height: 1.15; margin: 0; text-wrap: balance;
}
.section-head p { color: var(--muted); margin: .75rem 0 0; }

/* ---- Hero ---- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0,1fr) 15rem; gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
}
.hero-copy .eyebrow { margin-bottom: 1rem; }
.hero h1 {
  font-family: var(--serif); font-weight: 500; color: var(--ink);
  font-size: clamp(2.5rem, 6vw, 3.9rem); line-height: 1.02; letter-spacing: -.01em;
  margin: 0 0 .5rem; text-wrap: balance;
}
.hero .role {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  color: var(--accent); font-size: clamp(1.15rem, 2.4vw, 1.4rem); margin: 0 0 1.25rem;
}
.hero .lede { max-width: 34rem; margin: 0 0 1.75rem; color: var(--body); font-size: 1.09rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }

.portrait {
  width: 100%; max-width: 15rem; aspect-ratio: 1; border-radius: 50%;
  object-fit: cover; justify-self: center;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: .92rem; font-weight: 600; line-height: 1;
  padding: .72rem 1.15rem; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn svg { width: 1rem; height: 1rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; transform: translateY(-1px); }
:root[data-theme="dark"] .btn-primary { color: #06211f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #06211f; } }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); transform: translateY(-1px); }

/* ---- About prose ---- */
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---- Publications ---- */
.pub-group { margin-top: 2.4rem; }
.pub-group:first-of-type { margin-top: 0; }
.pub-group-title {
  display: flex; align-items: baseline; gap: .8rem; margin: 0 0 1.1rem;
  padding-bottom: .55rem; border-bottom: 1px solid var(--line);
}
.pub-group-title h3 {
  font-family: var(--sans); font-weight: 600; font-size: .95rem; letter-spacing: .02em;
  color: var(--ink); margin: 0; text-transform: none;
}
.pub-group-title .count {
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
}
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.pub-item {
  display: grid; grid-template-columns: 3.4rem 1fr; gap: 1rem;
  padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); transition: border-color .15s ease, box-shadow .15s ease;
}
.pub-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.pub-year {
  font-family: var(--mono); font-size: .82rem; color: var(--accent); font-weight: 500;
  padding-top: .1rem; font-variant-numeric: tabular-nums;
}
.pub-year.tbd { color: var(--muted); }
.pub-body { min-width: 0; }
.pub-title { color: var(--ink); font-weight: 600; margin: 0 0 .3rem; line-height: 1.4; }
.pub-authors { color: var(--body); font-size: .95rem; margin: 0 0 .55rem; }
.pub-authors strong { color: var(--ink); }
.pub-venue { color: var(--muted); font-style: italic; }
.pub-links { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .55rem; }
.doi-btn, .status-tag {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  padding: .28rem .6rem; border-radius: 999px; text-decoration: none; line-height: 1;
}
.doi-btn { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); font-weight: 600; }
.doi-btn:hover { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .doi-btn:hover { color:#06211f; }
.status-tag { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); text-transform: uppercase; }

/* ---- Connect ---- */
.connect-card {
  max-width: var(--measure);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem); box-shadow: var(--shadow);
}
.connect-card p { margin: 0 0 1.4rem; color: var(--body); }
.contact-line { display:flex; align-items:center; gap:.55rem; font-family: var(--mono); font-size:.9rem; margin-bottom:1.4rem; }
.contact-line a { text-decoration: none; }

/* ---- Social icons ---- */
.socials { display: flex; flex-wrap: wrap; gap: .55rem; list-style: none; margin: 0; padding: 0; }
.socials a {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem;
  border: 1px solid var(--line-strong); border-radius: 50%; color: var(--ink);
  background: var(--surface); transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.socials a:hover { transform: translateY(-2px); background: var(--accent); color: #fff; border-color: var(--accent); }
:root[data-theme="dark"] .socials a:hover { color: #06211f; }
.socials svg { width: 1.2rem; height: 1.2rem; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between; }
.site-footer .socials a { width: 2.3rem; height: 2.3rem; }
.footer-meta { font-size: .82rem; line-height: 1.6; }
.footer-meta a { text-decoration: none; }

/* ---- Responsive ---- */
@media (max-width: 780px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy .eyebrow, .hero .lede { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .portrait { grid-row: 1; max-width: 11rem; margin-bottom: .5rem; }
  .nav-links a { padding: .35rem .5rem; }
}
@media (max-width: 560px) {
  .nav { flex-wrap: wrap; min-height: 0; padding-block: .7rem; gap: .5rem .75rem; }
  .brand { margin-right: 0; width: 100%; }
  .nav-links { flex-wrap: wrap; }
  .theme-toggle { position: absolute; top: .8rem; right: clamp(1rem,5vw,2.5rem); }
  .site-header { position: static; }
  .pub-item { grid-template-columns: 1fr; gap: .35rem; padding: .95rem 1rem; }
  .pub-year { padding-top: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
