:root {
  --bg: #0e1624;
  --surface: #162033;
  --text: #e6ebf2;
  --muted: #93a1b5;
  --border: #25324a;
  --accent: #4da3ff;
  --accent-soft: #14294a;
  --radius: 12px;
  --sidebar: 340px;   /* includes the 80px space before the vertical line */
  --measure: 720px;   /* width of the text column: tabs line, dividers and text all end here (wide enough for all 8 tabs on one line) */
  --gutter: 80px;     /* space between the vertical line and the text */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1d1d1b;
    --text: #f0eee6;
    --muted: #a8a69d;
    --border: #34332f;
    --accent: #8aa9ff;
    --accent-soft: #232b40;
  }
}

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

.photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;              /* fills the circle without stretching the photo */
  object-position: center 30%;    /* which part stays visible: lower % = more of the top */
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;   /* no grey flash when you tap something on a phone */
}

a { color: inherit; text-decoration: none; }

/* Layout: photo on the left | vertical line | tabs and content on the right.
   The right column is exactly as wide as the text, and both columns together
   are centered on the page. */
.layout {
  padding: 0 16px;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, calc(var(--measure) + var(--gutter)));
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;   /* phones: the height you can actually see, without the address bar */
}

/* Left side */
/* The top padding lines the photo up with the first heading on the right
   (77px tabs bar + 128px panel padding). tabs.js fine-tunes it to the
   heading's letters and updates it when the tabs wrap onto two rows. */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 205px 80px 48px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
}

.photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-bottom: 8px;
}

.sidebar h1 { font-size: 1.6rem; line-height: 1.2; }

/* Degrees: one short list in a neutral color (blue is kept for links) */
.degrees { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.degrees li {
  color: var(--text);
  font-size: 0.95rem;
  padding-left: 14px;
  position: relative;
}

.degrees li::before {   /* small accent dot in front of each degree */
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.sidebar p { color: var(--muted); font-size: 0.95rem; }

.socials { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.socials a {
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}


/* Right side, with the vertical line on its left edge */
.content {
  border-left: 1px solid var(--border);
  padding: 0 0 0 var(--gutter);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Tabs */
.tabs-bar {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.tabs {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;   /* never a scrollbar: if a window is too narrow, the tabs go onto a second line */
}

.tabs a {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}


.tabs a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}

/* Panels: only the active one is shown */
.content > main { flex: 1; }

.panel {
  padding: 128px 0 64px;   /* top space: moves the photo down too (tabs.js) */
  position: relative;
  isolation: isolate;
}

/* A soft backdrop behind the text, so the cubes and code lines stay faint there.
   It is a little wider than the text and fades out just below the last line. */
.panel::before {
  content: "";
  position: absolute;
  inset: 96px -24px 0;
  z-index: -1;
  border-radius: 16px;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg) 85%, transparent) calc(100% - 64px),
    transparent
  );
}

.panel[hidden] { display: none; }

/* A new tab fades in (no movement). It's a fade only, so it stays on for
   people who turn animations off: nothing moves on screen.
   @starting-style gives the opacity a value to start from when the panel
   appears, so clicking tabs quickly never restarts the fade from zero. */
.panel {
  transition: opacity 200ms cubic-bezier(0.23, 1, 0.32, 1);   /* strong ease-out */
}

@starting-style {
  .panel { opacity: 0; }
}

h2 { font-size: 1.8rem; margin-bottom: 24px; }

.lead {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  margin-bottom: 24px;
}

/* "Hello · Γεια σου · Bonjour · 你好": one font for all four, colors fading to the accent */
.greeting {
  font-family: "Noto Sans", "Noto Sans SC", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);   /* a bit smaller than .lead, so all four fit on one line */
}

.greeting span { white-space: nowrap; }   /* never break "Γεια σου" in the middle */
.greeting span:nth-of-type(1) { color: var(--text); }
.greeting span:nth-of-type(3) { color: color-mix(in srgb, var(--text) 67%, var(--accent)); }
.greeting span:nth-of-type(5) { color: color-mix(in srgb, var(--text) 33%, var(--accent)); }
.greeting span:nth-of-type(7) { color: var(--accent); }

.greeting .greeting-dot {
  color: var(--muted);
  opacity: 0.5;
  font-weight: 400;
  margin: 0 0.1em;
}

/* Typing animation (static/js/greeting.js): one greeting at a time with a blinking cursor */
.greeting.typing { display: block; }

.greeting-cursor {
  display: inline-block;
  width: 3px;
  height: 0.9em;
  margin-left: 0.08em;
  vertical-align: -0.08em;
  background: var(--accent);
  animation: cursor-blink 1s steps(1) infinite;
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

/* Narrow screens: the greetings wrap, so drop the dots (no dot left hanging at a line end) */
@media (max-width: 700px) {
  .greeting { display: flex; flex-wrap: wrap; column-gap: 0.45em; }
  .greeting .greeting-dot { display: none; }
}

.text p { color: var(--muted); font-size: 1.05rem; max-width: var(--measure); margin-bottom: 16px; }

.subhead {
  font-size: 1.2rem;
  margin: 40px 0 12px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  max-width: var(--measure);
}

/* Research and Others lists */
.item-list { list-style: none; border-top: 1px solid var(--border); }

.item-list li { padding: 20px 0; border-bottom: 1px solid var(--border); }

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

.item-title { font-weight: 500; font-size: 1.05rem; }

.item-year { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

.item-meta { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

.item-text { color: var(--muted); font-size: 0.95rem; margin-top: 8px; max-width: var(--measure); }

.item-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.item-list .tags { margin-top: 10px; }

.item-links a {
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}


/* Blog cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-image {
  aspect-ratio: 16 / 9;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.9rem;
}

img.card-image { display: block; width: 100%; object-fit: cover; }   /* a real picture fills the same box */

.card-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card-date { color: var(--muted); font-size: 0.85rem; }

.card h3 { font-size: 1.15rem; line-height: 1.35; }

.card p { color: var(--muted); font-size: 0.95rem; flex: 1; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
}

/* Teaching */
.total {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.total-number { font-size: 2.4rem; font-weight: 600; color: var(--accent); }

.total-label { color: var(--muted); }

.teaching-list { list-style: none; border-top: 1px solid var(--border); }

.teaching-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.teaching-title { font-weight: 500; }

.teaching-meta { color: var(--muted); font-size: 0.9rem; }

.teaching-hours { font-weight: 600; color: var(--accent); white-space: nowrap; }

/* Interests (Home tab): the usual tags, two per line in lined-up columns.
   The second column may shrink, so a long tag wraps instead of sticking out. */
.tags-stack {
  display: grid;
  grid-template-columns: max-content minmax(0, max-content);
  justify-items: start;
}

/* A framed box with a small title (Interests on the Research tab), like the Teaching total */
.frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px 16px;
}

.frame-title { font-size: 1.1rem; margin-bottom: 8px; }

.frame .tags { gap: 6px; }

/* Research tab only: the content starts higher up.
   It's pulled up with a negative margin rather than a smaller panel padding, because
   tabs.js places the photo from the padding: this way the photo stays where it is. */
#tab-research .frame { margin-top: -56px; }   /* full column width, like the tabs line */
#tab-research.panel::before { top: 40px; }

/* Skills tab only: the content starts higher up too (the photo doesn't move, tabs.js
   lines it up with the Home tab) */
#tab-skills.panel { padding-top: 72px; }
#tab-skills.panel::before { top: 40px; }

/* Home tab only: the content starts a little lower. A margin on the heading, not the
   panel padding, because tabs.js places the photo from the Home panel's padding */
#tab-home .greeting { margin-top: 24px; }

@media (max-width: 700px) {
  #tab-home .greeting { margin-top: 0; }
  #tab-skills.panel { padding-top: 32px; }
  #tab-skills.panel::before { top: 12px; }
  #tab-research .frame { margin-top: 0; }
  #tab-research.panel::before { top: 12px; }
}

/* A second title further down a tab (Research, under the Interests frame): space above, no line */
.section-title { margin-top: 28px; margin-bottom: 16px; }

/* Phones: one per line, two don't fit side by side */
@media (max-width: 700px) {
  .tags-stack { grid-template-columns: minmax(0, max-content); }
}

/* Skills tab: one tile per tool, the logo drawn in the text color */
.tools-group:first-of-type .subhead { margin-top: 0; padding-top: 0; border-top: 0; }

.tools {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}

.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

/* The logo file is used as a stencil (mask), so every logo takes the same color */
.tool-icon {
  width: 32px;
  height: 32px;
  background-color: var(--text);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  transition: background-color 150ms ease;
}

/* SQL has no logo: a simple database cylinder */
.tool-icon-sql {
  --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C7.6 2 4 3.3 4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5c0-1.7-3.6-3-8-3zm0 2c3.9 0 6 1.1 6 1s-2.1 1-6 1-6-.9-6-1 2.1-1 6-1zM6 8.4C7.5 9.1 9.6 9.5 12 9.5s4.5-.4 6-1.1V12c0 .5-2.1 1.5-6 1.5S6 12.5 6 12V8.4zm0 6c1.5.7 3.6 1.1 6 1.1s4.5-.4 6-1.1V19c0 .5-2.1 1.5-6 1.5S6 19.5 6 19v-4.6z'/></svg>");
}

/* SHAP has no logo: feature-importance bars, the chart SHAP is known for */
.tool-icon-shap {
  --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='3' y='3' width='2' height='18' rx='1'/><rect x='7' y='4' width='14' height='3' rx='1.5'/><rect x='7' y='9' width='10' height='3' rx='1.5'/><rect x='7' y='14' width='6' height='3' rx='1.5'/><rect x='7' y='19' width='3' height='2' rx='1'/></svg>");
}

@media (hover: hover) and (pointer: fine) {
  .tool:hover .tool-icon { background-color: var(--accent); }
  .tool:hover { color: var(--text); }
}

/* "Under construction" stamp (Others tab): a rubber stamp in the accent blue,
   two rings and a slight tilt, like it was pressed onto the page by hand */
.stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 16px 8px 32px;
  padding: 14px 26px;
  color: var(--accent);
  border: 3px solid var(--accent);
  border-radius: 10px;
  outline: 1px solid var(--accent);
  outline-offset: 4px;
  transform: rotate(-5deg);
  opacity: 0.9;
  text-align: center;
}

.stamp-main {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.1;
}

.stamp-sub {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

@media (max-width: 700px) {
  .stamp { padding: 12px 18px; }
  .stamp-main { font-size: 1.2rem; }
}

/* Contact */
.buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 500;
  border: 1px solid var(--border);
}

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }


button.btn { font: inherit; font-weight: 500; cursor: pointer; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: var(--measure);
  margin-top: 8px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label { font-size: 0.9rem; font-weight: 500; }

.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}

.field textarea { resize: vertical; min-height: 140px; }

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.7; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.field-error { color: #e06c75; font-size: 0.85rem; }

/* Spam trap field: moved off screen so people never see it */
.field-trap { position: absolute; left: -9999px; }

/* "Message sent" / "could not send" note above the form */
.form-status {
  max-width: var(--measure);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
}

.form-status.error { border-color: #e06c75; background: transparent; }

.contact-form .btn { align-self: flex-start; }

.text .contact-other { margin: 40px 0 4px; font-size: 0.95rem; }

/* Copyright: fixed in the bottom-right corner, takes no space in the page */
footer {
  position: fixed;
  right: 16px;
  bottom: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
  z-index: 20;
}

/* Tablet: smaller sidebar */
@media (max-width: 960px) {
  :root { --sidebar: 240px; }
  :root { --gutter: 28px; }
  .sidebar { padding-right: 28px; }
  .cards { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }
}

/* Phone: stack, the vertical line becomes a horizontal one */
@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
    padding: 32px 0 24px;
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: center;
    column-gap: 20px;
    row-gap: 4px;
  }

  .photo { grid-row: span 2; margin-bottom: 0; font-size: 0.75rem; }

  .sidebar > p, .socials { grid-column: 1 / -1; }

  .sidebar > p { margin-top: 12px; }

  .content { border-left: none; border-top: 1px solid var(--border); padding-left: 0; }

  .form-row { grid-template-columns: 1fr; }

  .tabs { padding-top: 12px; flex-wrap: wrap; gap: 4px; }

  .tabs a { padding: 5px 11px; font-size: 0.88rem; }

  .panel { padding: 32px 0 48px; }
  .panel::before { inset: 12px -12px 0; }

  /* The copyright goes at the end of the page, instead of floating over the text */
  footer { position: static; background: none; text-align: center; padding: 24px 16px; }
}

/* Language flags at the top of the contact form */
.contact-intro { margin-bottom: 0; }

.flags { display: flex; gap: 10px; border: 0; padding: 0; margin: 0; }

.flag { cursor: pointer; line-height: 0; }

.flag input { position: absolute; opacity: 0; }   /* the round radio button itself stays hidden */

.flag img {
  width: 30px;
  height: 20px;
  border-radius: 3px;
  opacity: 0.5;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: opacity 0.15s;
}

.flag input:checked + img { opacity: 1; outline-color: var(--accent); }
.flag input:focus-visible + img { outline-color: var(--accent); }

/* Things you tap: no double-tap-zoom wait on phones, and a small press-down
   so you feel the tap (the grey flash is turned off above) */
.tabs a, .socials a, .item-links a, .btn, .flag {
  touch-action: manipulation;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.tabs a:active, .socials a:active, .item-links a:active, .btn:active { transform: scale(0.97); }

/* Hover: only on devices with a real mouse. On phones a tap would leave the
   hover look stuck on until you tap somewhere else. */
@media (hover: hover) and (pointer: fine) {
  .tabs a:hover { color: var(--text); }
  .socials a:hover { color: var(--text); }
  .item-links a:hover { background: var(--accent-soft); }
  .btn:hover { opacity: 0.85; }
  .flag:hover img { opacity: 0.85; }
}

/* Text for screen readers only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
