/* ──────────────────────────────────────────────────────────
   George Spyrou — personal page
   Typographic system mirrors the LaTeX CV: navy accent,
   hairline rules under section headings, dates flush right.
   ────────────────────────────────────────────────────────── */

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

:root {
  --paper:      #ffffff;
  --paper-alt:  #f7f7f5;
  --ink:        #16181d;
  --ink-soft:   #545861;
  --ink-faint:  #8b8f97;
  --navy:       #1f3a5f;   /* accent from cv.tex */
  --navy-soft:  #3d5f8a;
  --rule:       #e3e4e6;
  --rule-firm:  #c9ccd1;

  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans:  'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --measure: 700px;
  --nav-h:   52px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 58, 95, 0.28);
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: var(--navy-soft);
  border-bottom-color: var(--navy-soft);
}

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 2px;
}

strong { font-weight: 600; }

.container {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 28px;
}

.mono { font-family: var(--mono); }

/* ── Navigation ───────────────────────────────────────────── */
#navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-name {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: none;
  white-space: nowrap;
}

.nav-name:hover { color: var(--navy); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--navy); }

.nav-links a.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

/* ── Masthead ─────────────────────────────────────────────── */
.masthead {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 36px;
  align-items: start;
  padding: 76px 0 34px;
}

.masthead-photo img,
.masthead-photo .photo-fallback {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: block;
}

.masthead-photo img {
  object-fit: cover;
  border: 1px solid var(--rule);
}

.photo-fallback {
  background: var(--paper-alt);
  border: 1px solid var(--rule-firm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.masthead-id h1 {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.name-greek {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink-faint);
  margin-top: 2px;
}

.role {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-top: 14px;
}

.id-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 14px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.id-links li { display: flex; align-items: center; }

.id-links li + li::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--rule-firm);
  margin-right: 14px;
}

.id-plain { color: var(--ink-faint); }

/* ── Bio ──────────────────────────────────────────────────── */
.bio p {
  font-size: 1rem;
  line-height: 1.78;
  color: var(--ink);
}

.bio p + p { margin-top: 14px; }

/* ── Sections ─────────────────────────────────────────────── */
main section:not(.bio) { padding-top: 54px; }

.section-title {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--navy);
  padding-bottom: 7px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--navy);
}

.section-lede {
  font-size: 0.94rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.section-foot {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-top: 20px;
}

/* ── Entry: title left, date flush right (cv.tex \entry) ──── */
.entry + .entry { margin-top: 20px; }

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.entry-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
}

.entry-title a { border-bottom-color: rgba(31, 58, 95, 0.22); }

.entry-date {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Metadata italics use Spectral, matching .pub-title and the CV's \subentry. */
.entry-sub {
  font-family: var(--serif);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 2px;
}

.entry-body {
  font-size: 0.92rem;
  line-height: 1.72;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* ── News ─────────────────────────────────────────────────── */
.news-list { list-style: none; }

.news-list li {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}

.news-list li:last-child { border-bottom: none; }

.news-date {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  padding-top: 3px;
}

.news-body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.news-body em { color: var(--ink); font-style: italic; }

/* ── Presentations ────────────────────────────────────────── */
.pub-list { list-style: none; counter-reset: pub; }

.pub-list li {
  position: relative;
  counter-increment: pub;
  padding: 0 0 18px 34px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.pub-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.pub-list li::before {
  content: '[' counter(pub) ']';
  position: absolute;
  left: 0;
  top: 0.1em;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
}

.pub-authors {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.pub-title {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 2px 0 4px;
}

.pub-venue {
  font-family: var(--serif);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink-soft);
}

.pub-note { font-style: normal; }

/* ── Projects ─────────────────────────────────────────────── */
.project-list { list-style: none; }

.project-list li {
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
}

.project-list li:last-child { border-bottom: none; }

/* ── Contact ──────────────────────────────────────────────── */
.contact-list {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 9px 18px;
  font-size: 0.92rem;
}

.contact-list dt {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  padding-top: 3px;
}

.contact-list dd { color: var(--ink-soft); }
.contact-list dd.mono { font-size: 0.86rem; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  margin-top: 72px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
}

/* ── Page-load fade ───────────────────────────────────────── */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.masthead  { animation: riseIn 0.5s ease both; }
.bio       { animation: riseIn 0.5s ease both 0.1s; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 620px) {
  .masthead {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 48px;
  }

  .masthead-photo img,
  .masthead-photo .photo-fallback { width: 104px; height: 104px; }
  .photo-fallback { font-size: 2rem; }
  .masthead-id h1 { font-size: 2.05rem; }

  .news-list li,
  .contact-list { grid-template-columns: 1fr; gap: 3px; }

  .news-date { padding-top: 0; }
  .contact-list dt { padding-top: 8px; }

  .entry-head { flex-direction: column; gap: 2px; }

  .nav-name { display: none; }
  .nav-links { width: 100%; justify-content: space-between; }
}

@media (max-width: 500px) {
  :root { --nav-h: 76px; }
  .nav-inner { padding: 0 16px; }
  .nav-links {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    gap: 4px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
