/* ============================================================
   Thanos Drossos — personal site
   Self-hosted fonts · light/dark themes · minimal & professional
   ============================================================ */

/* ---------- Fonts (self-hosted, GDPR-friendly) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-var.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/fraunces-var.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --ink: #1b1a17;
  --ink-soft: #3c3a34;
  --muted: #6f6c64;
  --line: #e7e3da;
  --line-strong: #d8d3c7;
  --accent: #2b4d6f;
  --accent-soft: #eef2f6;
  --accent-ink: #213c57;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 8px 28px -16px rgba(27, 26, 23, .22);
  --shadow-lg: 0 24px 60px -28px rgba(27, 26, 23, .35);

  --maxw: 1080px;
  --pad: clamp(1.15rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 9px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="dark"] {
  --bg: #15140f;
  --surface: #1c1b16;
  --surface-2: #211f19;
  --ink: #f3f0e8;
  --ink-soft: #d9d5c9;
  --muted: #a09c8f;
  --line: #2e2c24;
  --line-strong: #3a382f;
  --accent: #8fb9d9;
  --accent-soft: #20262d;
  --accent-ink: #cfe0ee;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -18px rgba(0, 0, 0, .7);
  --shadow-lg: 0 28px 64px -28px rgba(0, 0, 0, .8);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.075rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 460; line-height: 1.12; letter-spacing: -.01em; color: var(--ink); margin: 0; }
p { margin: 0 0 1rem; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

.skip-link {
  position: absolute; left: 50%; top: -100px; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 8px;
  z-index: 200; transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 66px; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 600; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff; font-family: var(--font-serif);
  font-weight: 600; font-size: .9rem; letter-spacing: .02em;
}
[data-theme="dark"] .brand__mark { color: #15140f; }
.brand__name { font-size: 1.02rem; letter-spacing: -.01em; }

.nav { margin-left: auto; }
.nav__menu { display: flex; align-items: center; gap: clamp(.3rem, 1.4vw, 1.1rem); }
.nav__menu a {
  display: inline-block; color: var(--ink-soft); font-size: .92rem; font-weight: 500;
  padding: .45rem .55rem; border-radius: 8px; position: relative;
}
.nav__menu a:hover { color: var(--ink); }
.nav__menu a.is-active { color: var(--accent); }
.nav__menu a.is-active::after {
  content: ""; position: absolute; left: .55rem; right: .55rem; bottom: .15rem; height: 2px;
  background: var(--accent); border-radius: 2px;
}

.nav__toggle { display: none; }

.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  color: var(--ink-soft); cursor: pointer; transition: color .2s, border-color .2s, background-color .2s, transform .2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); transform: translateY(-1px); }
.theme-toggle__icon--moon { display: none; }
[data-theme="dark"] .theme-toggle__icon--sun { display: none; }
[data-theme="dark"] .theme-toggle__icon--moon { display: block; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font-family: var(--font-sans); font-weight: 550; font-size: .95rem; line-height: 1;
  padding: .72rem 1.15rem; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: var(--accent); box-shadow: var(--shadow); }
[data-theme="dark"] .btn--primary { --btn-fg: #15140f; }
.btn--primary:hover { box-shadow: var(--shadow-lg); }
.btn--ghost { --btn-bg: transparent; }
.btn--ghost:hover { border-color: var(--muted); background: var(--surface); }
.btn--small { padding: .5rem .8rem; font-size: .85rem; border-radius: 8px; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(2.5rem, 7vw, 5rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.hero__inner {
  display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 1rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.hero__name { font-size: clamp(2.6rem, 6vw, 4.25rem); font-weight: 480; letter-spacing: -.025em; }
.hero__role { font-size: clamp(1.05rem, 1rem + .6vw, 1.3rem); color: var(--accent-ink); font-weight: 550; margin: .65rem 0 1.25rem; }
.hero__intro { color: var(--ink-soft); max-width: 60ch; font-size: 1.06rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.6rem 0 1.25rem; }

.hero__socials { display: flex; gap: .4rem; }
.hero__socials a {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
  color: var(--ink-soft); border: 1px solid transparent; transition: color .2s, background-color .2s, border-color .2s, transform .2s;
}
.hero__socials a:hover { color: var(--accent); background: var(--surface); border-color: var(--line); transform: translateY(-2px); }

.hero__aside { display: flex; justify-content: center; }
.portrait { position: relative; width: min(320px, 78vw); aspect-ratio: 1; }
.portrait::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  background: conic-gradient(from 140deg, var(--accent), color-mix(in srgb, var(--accent) 35%, var(--bg)), var(--accent));
  opacity: .18; filter: blur(2px);
}
.portrait__img {
  position: relative; width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 5px solid var(--surface); box-shadow: var(--shadow-lg);
}

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding-top: 2rem; border-top: 1px solid var(--line);
}
.stats__item { margin: 0; }
.stats__num { font-family: var(--font-serif); font-size: clamp(1.9rem, 1.4rem + 1.5vw, 2.7rem); font-weight: 500; color: var(--accent-ink); }
.stats__label { margin: .25rem 0 0; font-size: .9rem; color: var(--muted); line-height: 1.4; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; scroll-margin-top: 80px; }
.section--alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section__head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__eyebrow { font-size: .8rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .6rem; }
.section__title { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.7rem); font-weight: 460; }
.section__note { margin-top: 2rem; color: var(--muted); font-size: .98rem; }
.section__note strong { color: var(--ink-soft); }

/* ---------- Timeline / entries ---------- */
.timeline { display: grid; gap: 0; }
.entry { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.75rem; }
.entry__meta { display: flex; flex-direction: column; gap: .15rem; text-align: right; padding-top: .15rem; }
.entry__date { font-weight: 600; font-size: .9rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.entry__place { font-size: .82rem; color: var(--muted); }
.entry__body {
  position: relative; padding: 0 0 2.5rem 1.75rem; border-left: 2px solid var(--line-strong);
}
.entry:last-child .entry__body { border-left-color: transparent; padding-bottom: .25rem; }
.entry__body::before {
  content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); box-sizing: content-box;
}
.section--alt .entry__body::before { border-color: var(--surface-2); }
.entry__role { font-size: 1.18rem; font-weight: 500; }
.entry__org { margin: .15rem 0 .65rem; color: var(--accent-ink); font-weight: 550; font-size: .98rem; }
.entry__points { display: grid; gap: .4rem; }
.entry__points li { position: relative; padding-left: 1.1rem; color: var(--ink-soft); font-size: .98rem; }
.entry__points li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.about__lead p { font-size: 1.08rem; color: var(--ink-soft); }
.about__lead p:last-child { margin-bottom: 0; }
.about__side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.about__side-title { font-family: var(--font-sans); font-size: .82rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.about__side p { font-size: .98rem; color: var(--ink-soft); }

/* ---------- FAQ / quick answers ---------- */
.faq__list { margin: 0; display: grid; gap: 1.6rem 2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.faq__item { margin: 0; }
.faq__q { font-family: var(--font-serif); font-size: 1.08rem; font-weight: 500; line-height: 1.3; color: var(--ink); margin-bottom: .45rem; }
.faq__a { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- Awards ---------- */
.awards { margin-top: 3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2rem); box-shadow: var(--shadow); }
.awards__title { font-family: var(--font-sans); font-size: .82rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.awards__list { display: grid; gap: .7rem; grid-template-columns: repeat(2, 1fr); }
.awards__list li { position: relative; padding-left: 1.5rem; color: var(--ink-soft); font-size: .96rem; }
.awards__list li::before { content: "★"; position: absolute; left: 0; top: 0; color: var(--accent); font-size: .85rem; }

/* ---------- Research / paper ---------- */
.paper { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow); max-width: 820px; }
.paper__venue { font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: .7rem; }
.paper__title { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); font-weight: 480; }
.paper__authors { margin: .8rem 0 0; font-weight: 550; color: var(--ink); font-size: .98rem; }
.paper__authors::after { content: ""; }
.paper__abstract { margin: 1rem 0 1.5rem; color: var(--ink-soft); font-size: 1rem; }
.paper__links { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn--bibtex { font-family: var(--font-sans); }
.bibtex {
  margin: 1.25rem 0 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; overflow-x: auto; font-size: .82rem; line-height: 1.6;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace; color: var(--ink-soft);
}
.bibtex code { font: inherit; white-space: pre; }

/* ---------- Cards (projects) ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .65rem; }
.card__title { font-size: 1.18rem; font-weight: 500; line-height: 1.25; }
.card__link { color: var(--muted); flex: none; transition: color .2s, transform .2s; }
.card__link:hover { color: var(--accent); transform: translate(2px, -2px); }
.card__badge { flex: none; font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: .22rem .5rem; border-radius: 999px; }
.card__desc { color: var(--ink-soft); font-size: .95rem; margin-bottom: 1.1rem; flex: 1; }
.card__desc code { font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tags li {
  font-size: .8rem; font-weight: 550; color: var(--accent-ink); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  padding: .3rem .65rem; border-radius: 999px;
}
.tags .tags--muted, .tags li.tags--muted { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.tags--soft { margin-top: 1rem; }
.tags--soft li { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }

/* ---------- Skills & languages ---------- */
.skills { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.skills__group { font-family: var(--font-sans); font-size: .82rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 1.6rem 0 .8rem; }
.skills__col > .skills__group:first-child { margin-top: 0; }
.skills__hint { margin-top: 1rem; font-size: .85rem; color: var(--muted); }

.langs { display: grid; gap: 1.05rem; }
.lang { display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: center; gap: 1rem; }
.lang__name { font-weight: 550; font-size: .95rem; }
.lang__bar { position: relative; height: 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.lang__bar > span { position: absolute; inset: 0; width: var(--lvl); border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 75%, var(--bg)), var(--accent)); transform-origin: left; }
.lang__level { font-size: .82rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Contact ---------- */
.section--contact { text-align: center; }
.contact { max-width: 640px; margin-inline: auto; }
.section--contact .section__eyebrow { /* centered */ }
.contact__lead { color: var(--ink-soft); font-size: 1.08rem; margin: 1rem 0 1.75rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; background: var(--surface-2); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem; }
.site-footer__name { font-family: var(--font-serif); font-weight: 500; margin: 0; font-size: 1.05rem; }
.site-footer__meta { margin: 0; color: var(--muted); font-size: .88rem; }
.site-footer__top { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-soft); font-weight: 550; font-size: .9rem; }
.site-footer__top:hover { color: var(--accent); }

/* ---------- Reveal on scroll (JS-gated so no-JS crawlers/agents see all content) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero__inner { grid-template-columns: 1fr; text-align: left; }
  .hero__aside { grid-row: 1; justify-content: flex-start; }
  .portrait { width: min(180px, 42vw); }
  .about { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .nav { margin-left: auto; }
  .nav__toggle {
    position: relative; display: inline-block; width: 42px; height: 42px;
    border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer;
  }
  .nav__toggle-bar {
    position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; margin: -1px 0 0 -9px;
    background: var(--ink); border-radius: 2px;
    transition: transform .25s var(--ease), opacity .2s var(--ease);
  }
  .nav__toggle-bar:nth-child(1) { transform: translateY(-6px); }
  .nav__toggle-bar:nth-child(3) { transform: translateY(6px); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: rotate(-45deg); }

  .nav__menu {
    position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem var(--pad) 1rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: transform .25s var(--ease), opacity .25s var(--ease);
  }
  .nav__menu.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__menu a { padding: .85rem .25rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav__menu a.is-active::after { display: none; }
  .nav__menu li:last-child a { border-bottom: 0; }

  .entry { grid-template-columns: 1fr; gap: .35rem; }
  .entry__meta { flex-direction: row; gap: .75rem; text-align: left; align-items: baseline; }
  .entry__body { border-left: 0; padding-left: 0; padding-bottom: 2rem; }
  .entry__body::before { display: none; }
  .entry { border-left: 2px solid var(--line-strong); padding-left: 1.3rem; position: relative; }
  .entry::before { content: ""; position: absolute; left: -7px; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); box-sizing: content-box; }
  .section--alt .entry::before { border-color: var(--surface-2); }
  .entry:last-child { border-left-color: transparent; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
  .cards { grid-template-columns: 1fr; }
  .awards__list { grid-template-columns: 1fr; }
  .lang { grid-template-columns: 4.5rem 1fr auto; gap: .75rem; }
}

@media (max-width: 380px) {
  .lang { grid-template-columns: 1fr; gap: .3rem; }
  .lang__level { text-align: left; }
}
