/* ────────────────────────────────────────────────────────────
   Thomas Kelly — "full Michaillat" tech variant
   Inter (Latin) + Noto Sans (Greek fallback). Cool palette.
   System-aware dark mode. Tight, engineered vertical rhythm.
   ──────────────────────────────────────────────────────────── */

:root {
  --bg:        #ffffff;
  --text:      #1f2328;
  --heading:   #0d1117;
  --muted:     #656d76;
  --accent:    #2563a8;     /* cool blue */
  --accent-2:  #1a4a82;
  --rule:      #e4e7eb;
  --chip-bg:   #f4f6f8;
  --chip-br:   #e0e4e8;

  --content-max: 660px;
  --pad-y: 4rem;
  --pad-x: 1.5rem;

  --font: 'Inter', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --size: 1.0625rem;        /* 17px — smaller, denser than the serif version */
  --leading: 1.6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0d1117;
    --text:     #c9d1d9;
    --heading:  #f0f6fc;
    --muted:    #8b949e;
    --accent:   #6cb0ff;
    --accent-2: #92c5ff;
    --rule:     #21262d;
    --chip-bg:  #161b22;
    --chip-br:  #30363d;
  }
}

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

html { font-size: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--size);
  line-height: var(--leading);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "cv05" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.003em;       /* Inter looks best very slightly tightened */
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x);
}

/* Off-centre layout: ~700px content column + ~200px right rail.
   justify-content:start left-aligns the used width within the
   centred container, so extra whitespace pools on the right. */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 700px) 200px;
  column-gap: 56px;
  justify-content: start;
}

.layout > .full   { grid-column: 1 / -1; }
.layout > main    { grid-column: 1; }
.layout > .rail   { grid-column: 2; }

/* The right-margin rail: portrait + icon row, aligned to the bio top */
.rail {
  padding-top: 0.3rem;
}
.rail .portrait {
  float: none;
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 1rem;
  border-radius: 8px;
  border: 1px solid var(--rule);
}
.rail .iconrow {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  margin: 0;
}
.rail .iconrow a { justify-content: flex-start; }

/* Euclid construction row — FIXED pixel size, never scales with the
   page (like text). The window clips a wide SVG left-aligned, so the
   number of constructions visible = viewport width / construction width.
   Soft right-edge fade hides the clip. */
/* ── PER-PAGE BANNER ─────────────────────────────────────────────
   Each inner page has ONE static banner. Fixed-aspect box. Euclid
   clips-to-width (responsive reveal); manuscript panels are accent
   boxes revealed through a duotone alpha mask (recolour in dark mode);
   the tube map is an inline SVG that hides its labels on mobile. */
.banner {
  position: relative;
  width: 100%;
  aspect-ratio: 1180 / 300;
  margin-bottom: 2rem;
  overflow: hidden;
  color: var(--accent);
}
.banner svg { display: block; }

/* Euclid: fixed-height row clipped to width, soft right-edge fade */
.banner.euclid {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%);
          mask-image: linear-gradient(to right, #000 90%, transparent 100%);
}
.banner.euclid svg { width: auto; height: 88%; max-width: none; flex: 0 0 auto; }

/* Tube map: inline SVG fitted; labels hide on narrow screens */
.banner.tube { display: flex; align-items: center; justify-content: center; }
.banner.tube svg { width: 100%; height: 100%; }

/* Manuscript banners: accent box revealed through duotone alpha mask */
.banner.mask { background: currentColor; }
.banner.ptolemy {
  -webkit-mask: url(mask-ptolemy.png) center/cover no-repeat;
          mask: url(mask-ptolemy.png) center/cover no-repeat;
  -webkit-mask-mode: alpha; mask-mode: alpha;
}
.banner.tiro {
  -webkit-mask: url(mask-tiro.png) center/cover no-repeat;
          mask: url(mask-tiro.png) center/cover no-repeat;
  -webkit-mask-mode: alpha; mask-mode: alpha;
}

@media (max-width: 640px) {
  .banner.tube .maplabels { display: none; }
}

/* ── HEADER ─────────────────────────────────────────────────── */

header.site-header {
  margin-bottom: 2.5rem;
}

header.site-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.2rem;
  line-height: 1.1;
}

header.site-header h1 a { color: var(--heading); border: none; }
header.site-header h1 a:hover { color: var(--accent); }

header.site-header .tagline {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 450;
}

/* nav as a horizontal row of restrained links */
header.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

header.site-header nav a {
  color: var(--muted);
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

header.site-header nav a:hover { color: var(--accent); }
header.site-header nav a.current { color: var(--heading); }

/* ── ICON ROW ───────────────────────────────────────────────── */

.iconrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
}

.iconrow a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--chip-br);
  background: var(--chip-bg);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
}

.iconrow a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.iconrow svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── BIO ────────────────────────────────────────────────────── */

.bio { display: flow-root; margin-bottom: 1.5rem; }

/* ── MAIN ───────────────────────────────────────────────────── */

main p { margin: 0 0 1rem; }
main p:last-child { margin-bottom: 0; }

main h2 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 2.5rem 0 1rem;
}

main h2:first-child { margin-top: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 100ms, color 100ms;
}
a:hover { border-bottom-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

em, i { font-style: italic; }
strong, b { font-weight: 600; }

/* Greek runs use Noto Sans (polytonic). Wrap Greek in <span lang="grc"> */
[lang="grc"], [lang="el"] {
  font-family: 'Noto Sans', sans-serif;
  letter-spacing: 0;
}

/* ── LISTS ──────────────────────────────────────────────────── */

ul.entries, ul.plain { list-style: none; padding: 0; margin: 0; }

ul.entries li {
  margin: 0 0 0.8rem;
  padding-left: 1.4em;
  text-indent: -1.4em;
  color: var(--text);
}
ul.entries li:last-child { margin-bottom: 0; }

ul.plain li { margin: 0 0 0.6rem; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--chip-br);
  background: var(--chip-bg);
  border-radius: 5px;
  padding: 0.05rem 0.4rem;
  margin-left: 0.4rem;
  vertical-align: 1px;
  text-indent: 0;
}

.sep { color: var(--muted); margin: 0 0.35em; }

/* ── FOOTER ─────────────────────────────────────────────────── */

.footer {
  margin-top: 5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.footer p { margin: 0.2rem 0; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── MOBILE ─────────────────────────────────────────────────── */

@media (max-width: 820px) {
  :root { --pad-y: 2.5rem; --size: 1rem; }
  .container { max-width: 640px; }
  .layout {
    display: flex;
    flex-direction: column;
  }
  .layout > .headerart     { order: 1; }
  .layout > .site-header   { order: 2; }
  .rail                    { order: 3; padding-top: 0; margin-bottom: 1.5rem; }
  .layout > main           { order: 4; }
  .layout > footer         { order: 5; }
  .rail .portrait { width: 120px; margin: 0 0 1rem; }
  .rail .iconrow { flex-direction: row; flex-wrap: wrap; }

  header.site-header h1 { font-size: 1.5rem; }
  header.site-header nav { gap: 0.9rem; }
}

@media print {
  header.site-header nav, .iconrow, .headerart, .footer { display: none; }
  :root { --bg: #fff; --text: #000; }
  .container { max-width: none; padding: 0; }
  a { color: inherit; border: none; }
}

/* ════════════════════════════════════════════════════════════════
   MINIMALIST HOME (centred nameplate). Applies only to body.home.
   ════════════════════════════════════════════════════════════════ */
body.home {
  min-height: 100vh;
  display: flex;
  align-items: center;       /* true vertical centre */
  justify-content: center;
}
.nameplate {
  max-width: 460px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.np-portrait {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.6rem;
  border: 1px solid var(--rule);
}
.np-name {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
  line-height: 1.1;
}
.np-name a { color: var(--heading); border: none; }
.np-name a:hover { color: var(--accent); }
.np-role {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 1.6rem;
  letter-spacing: 0.01em;
  line-height: 1.5;
  max-width: 34ch;
}
.np-line {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 1.9rem;
  max-width: 34ch;
}
.np-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4rem;
  margin-bottom: 1.8rem;
}
.np-nav a {
  color: var(--text);
  border: none;
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.np-nav a:hover { color: var(--accent); }
.np-contact {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
}
.np-contact a {
  color: var(--muted);
  border: none;
  display: inline-flex;
}
.np-contact a:hover { color: var(--accent); }
.np-contact svg { width: 19px; height: 19px; }

@media (max-width: 600px) {
  .np-name { font-size: 1.6rem; }
  .np-portrait { width: 112px; height: 112px; }
}

/* Research page: the collaboration invitation (sits near the top) */
.collab {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 0.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

/* Misc: Greek karaoke as a collapsible section. The summary is styled to
   match the h2 section headings, with a rotating disclosure marker. */
details.karaoke {
  margin: 2.5rem 0 1rem;
}
details.karaoke summary {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 120ms;
}
details.karaoke summary:hover { color: var(--accent); }
details.karaoke summary::-webkit-details-marker { display: none; }
details.karaoke summary::before {
  content: "";
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 150ms ease;
}
details.karaoke[open] summary::before { transform: rotate(90deg); }
details.karaoke ul.plain { margin-top: 1rem; }

