/* ─────────────────────────────────────────────────────────────
   Theocharis Tavantzis — personal site
   Plain CSS, no build step. Edit tokens below to restyle.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:          #fbfaf8;
  --surface:     #ffffff;
  --ink:         #16191c;
  --ink-soft:    #3a4149;
  --muted:       #6a727d;
  --line:        #e7e3dc;
  --accent:      #3a6ea5;
  --accent-ink:  #2f5c8a;
  --accent-soft: #eaf1f8;
  --shadow:      0 1px 2px rgba(20,25,30,.04), 0 8px 24px rgba(20,25,30,.05);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --measure: 68ch;
  --pad: clamp(1.25rem, 5vw, 3rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0f1620;
    --surface:     #16202c;
    --ink:         #e7ecf2;
    --ink-soft:    #c3ccd7;
    --muted:       #8e9aa9;
    --line:        #253141;
    --accent:      #86b3dd;
    --accent-ink:  #a9cbeb;
    --accent-soft: rgba(134,179,221,.12);
    --shadow:      0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--surface); padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 62rem; margin: 0 auto; padding: .85rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-name {
  font-family: var(--serif); font-size: 1.02rem; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: -.01em;
}
.nav nav ul {
  list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0;
  font-size: .84rem; letter-spacing: .01em;
}
.nav nav a {
  color: var(--muted); text-decoration: none; padding-bottom: 2px;
  border-bottom: 1.5px solid transparent; transition: color .15s, border-color .15s;
}
.nav nav a:hover { color: var(--ink); }
.nav nav a.current { color: var(--accent-ink); border-bottom-color: var(--accent); }
@media (max-width: 600px) {
  .nav-inner { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .nav nav ul { gap: .9rem; flex-wrap: wrap; }
}

/* ── Layout ──────────────────────────────────────────────── */
main { max-width: 62rem; margin: 0 auto; padding: 0 var(--pad); }

.section {
  padding: clamp(2.75rem, 6vw, 4.5rem) 0;
  border-top: 1px solid var(--line);
}

.label {
  font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 1.6rem;
  display: flex; align-items: center; gap: .6rem;
}
.label span {
  font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500;
  letter-spacing: .06em;
}
.label::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.group {
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  margin: 2.2rem 0 1rem;
}
.group:first-child { margin-top: 0; }

.section-note { margin: -0.9rem 0 1.6rem; color: var(--muted); font-size: .92rem; }
.muted { color: var(--muted); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 3.5rem); }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; gap: 2rem; } }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 200px 1fr;
  gap: clamp(1.5rem, 5vw, 3rem); align-items: center;
  padding: clamp(2.5rem, 7vw, 4.75rem) 0 clamp(2rem, 5vw, 3.25rem);
}
.hero-photo img {
  width: 100%; height: auto; display: block;
  border-radius: 14px; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 .5rem; font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink);
}
h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.1rem, 6vw, 3.15rem); line-height: 1.05;
  letter-spacing: -.02em; margin: 0 0 .85rem;
}
.lede {
  font-family: var(--serif); font-size: clamp(1.08rem, 2.2vw, 1.3rem);
  line-height: 1.5; color: var(--ink-soft); margin: 0 0 .75rem; max-width: 34em;
}
.hero-meta { margin: 0 0 1.4rem; font-size: .88rem; color: var(--muted); }

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { width: 128px; }
}

/* ── Link pills ──────────────────────────────────────────── */
.links {
  list-style: none; display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 0; padding: 0;
}
.links a {
  display: inline-block; padding: .38rem .8rem;
  font-size: .855rem; font-weight: 500; text-decoration: none;
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.links a:hover {
  color: var(--accent-ink); border-color: var(--accent);
  background: var(--accent-soft); transform: translateY(-1px);
}
.links a.is-accent {
  color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
}

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

.tags {
  list-style: none; display: flex; flex-wrap: wrap; gap: .45rem;
  margin: 1.8rem 0 0; padding: 0;
}
.tags li {
  font-size: .8rem; color: var(--muted);
  padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface);
}

/* ── Publication / service / timeline lists ──────────────── */
.pubs, .service, .timeline { list-style: none; margin: 0; padding: 0; }

.pubs > li, .service > li, .timeline > li {
  display: grid; grid-template-columns: 4.25rem 1fr; gap: 1rem;
  padding: 1.05rem 0; border-top: 1px solid var(--line);
}
.pubs > li:first-child, .service > li:first-child, .timeline > li:first-child {
  border-top: none; padding-top: .25rem;
}

.year {
  font-size: .82rem; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
  padding-top: .18rem; white-space: nowrap;
}

.pubs h3 {
  font-family: var(--serif); font-size: 1.09rem; font-weight: 500;
  line-height: 1.35; margin: 0 0 .3rem; letter-spacing: -.005em;
}
.authors { margin: 0 0 .12rem; font-size: .9rem; color: var(--ink-soft); }
.authors b { font-weight: 600; color: var(--ink); }
.venue { margin: 0; font-size: .875rem; color: var(--muted); }

/* venue badges */
.badges { margin: 0 0 .35rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.badge {
  font-size: .68rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: .1rem .45rem; border-radius: 4px; white-space: nowrap;
}
.badge-oa {
  color: var(--muted); background: transparent; border-color: var(--line);
}

/* publication counts */
.counts {
  display: flex; flex-wrap: wrap; gap: 2.25rem;
  margin: -0.4rem 0 1.5rem;
}
.counts div { display: flex; align-items: baseline; gap: .5rem; }
.counts b {
  font-family: var(--serif); font-size: 2rem; font-weight: 500;
  line-height: 1; color: var(--accent-ink); letter-spacing: -.02em;
}
.counts span { font-size: .84rem; color: var(--muted); }

/* expandable abstracts */
.abstract { margin: .5rem 0 0; }
.abstract summary {
  cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); transition: color .15s;
}
.abstract summary::-webkit-details-marker { display: none; }
.abstract summary::before {
  content: "▸"; font-size: .7em; transition: transform .15s; display: inline-block;
}
.abstract[open] summary::before { transform: rotate(90deg); }
.abstract summary:hover { color: var(--accent-ink); }
.abstract p {
  margin: .55rem 0 0; padding: .8rem 1rem;
  font-size: .875rem; line-height: 1.6; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0;
  max-width: 62ch;
}

.pub-links { margin: .55rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pub-links a {
  font-size: .78rem; font-weight: 500; text-decoration: none;
  color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  padding: .13rem .55rem; border-radius: 5px; transition: background .15s;
}
.pub-links a:hover { background: var(--accent-soft); }
.oa {
  font-size: .74rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}

.service > li div, .timeline > li div { font-size: .92rem; color: var(--ink-soft); }
.service b, .timeline b { color: var(--ink); font-weight: 600; }
.timeline .muted { font-size: .87rem; }

@media (max-width: 520px) {
  .pubs > li, .service > li, .timeline > li { grid-template-columns: 1fr; gap: .3rem; }
}

/* ── Buttons & contact ───────────────────────────────────── */
.cta { margin: 2.25rem 0 0; }
.button {
  display: inline-block; padding: .62rem 1.15rem;
  font-size: .9rem; font-weight: 600; text-decoration: none;
  color: var(--bg); background: var(--accent);
  border-radius: 8px; transition: filter .15s, transform .15s;
}
.button:hover { filter: brightness(1.08); transform: translateY(-1px); color: var(--bg); }

.contact-line { margin: 1.1rem 0 .4rem; }
.mail {
  font-family: var(--serif); font-size: clamp(1.25rem, 3.5vw, 1.7rem);
  font-weight: 500; text-decoration: none; letter-spacing: -.01em;
  border-bottom: 2px solid var(--accent-soft); padding-bottom: 2px;
  transition: border-color .15s;
}
.mail:hover { border-bottom-color: var(--accent); }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  max-width: 62rem; margin: 0 auto;
  padding: 2rem var(--pad) 3rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
  font-size: .84rem; color: var(--muted);
}
footer p { margin: 0; }

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .nav, .links, .cta, .skip { display: none; }
  body { background: #fff; color: #000; }
  .section { border-color: #ccc; page-break-inside: avoid; }
}
