/* ============================================================
   Charalampos Anagnostakis — personal site
   Plain HTML/CSS/JS. No build step.

   Visual language follows Apple: neutral greys, one blue reserved
   for things you can click, light-grey rounded tiles, a frosted
   navigation bar, heavy and tightly tracked headlines.
   ============================================================ */

:root {
  --bg:        #ffffff;
  --tile:      #f5f5f7;
  --chip:      #ffffff;
  --fg:        #1d1d1f;
  --fg-2:      #424245;
  --muted:     #6e6e73;
  --line:      #d2d2d7;
  --link:      #0b3a82;
  --btn:       #0b3a82;
  --btn-hover: #174c9c;

  /* iOS-style glass */
  --glass-bg:        linear-gradient(180deg, rgba(255, 255, 255, .68), rgba(255, 255, 255, .42));
  --glass-edge:      rgba(255, 255, 255, .72);
  --glass-highlight: rgba(255, 255, 255, .95);
  --glass-hairline:  rgba(0, 0, 0, .08);
  --glass-shadow:    0 10px 34px rgba(0, 0, 0, .10), 0 2px 8px rgba(0, 0, 0, .05);
  --glass-selected:  rgba(0, 0, 0, .065);

  /* Helvetica throughout. Arial is the metric-compatible stand-in off macOS. */
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;

  --gutter: clamp(22px, 5vw, 44px);
  --wide:   980px;   /* nav + opener */
  --col:    760px;   /* reading column */
  --bar:    52px;    /* nav capsule height */
  --bar-gap: 12px;   /* capsule floats this far below the top */
  --radius: 18px;    /* tiles */
  --ease:   cubic-bezier(.25, .1, .25, 1);

  color-scheme: light;
}

/* Optional graphite theme — only when the visitor picks it with the toggle. */
:root[data-theme="dark"] {
  --bg:        #232325;
  --tile:      #2c2c2e;
  --chip:      #3a3a3c;
  --fg:        #f5f5f7;
  --fg-2:      #d1d1d6;
  --muted:     #98989d;
  --line:      #424245;
  --link:      #7ea6ec;
  --btn:       #1d4f9e;
  --btn-hover: #2860b5;
  --glass-bg:        linear-gradient(180deg, rgba(74, 74, 78, .58), rgba(44, 44, 48, .42));
  --glass-edge:      rgba(255, 255, 255, .14);
  --glass-highlight: rgba(255, 255, 255, .22);
  --glass-hairline:  rgba(0, 0, 0, .3);
  --glass-shadow:    0 10px 34px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .2);
  --glass-selected:  rgba(255, 255, 255, .1);
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.005em;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul  { list-style: none; padding: 0; }
a   { color: inherit; text-decoration: none; }
/* width/height attributes are presentational hints; without height:auto they beat aspect-ratio */
img { display: block; max-width: 100%; height: auto; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 30;
  background: var(--fg); color: var(--bg);
  padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

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

.dim { color: var(--muted); }

/* ---------- links & buttons ---------- */

.btn {
  /* solid dark blue — no sheen */
  background: var(--btn);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--btn) 30%, transparent);
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover  { background: var(--btn-hover); }
.btn:active { transform: scale(.97); }

.btn {
  display: inline-block;
  color: #fff;
  font-size: 17px;
  line-height: 1.18;
  padding: 12px 22px;
  border-radius: 980px;
}

.link, .arrow { color: var(--link); }
.link::after, .arrow::after {
  content: "›";
  display: inline-block;
  margin-left: .3em;
  font-size: 1.1em;
  line-height: 1;
  transition: transform .25s var(--ease);
}
.link:hover, .arrow:hover { text-decoration: underline; text-underline-offset: .2em; }
.link:hover::after, .arrow:hover::after { transform: translateX(3px); }

/* Drawn, not typed: Helvetica has no ↗ glyph, so a character would fall back to another font. */
.ext::after {
  content: "";
  display: inline-block;
  width: .56em;
  height: .56em;
  margin-left: .34em;
  vertical-align: .1em;
  background: var(--link);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 9.5l7-7M3.8 2.5h5.7v5.7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 9.5l7-7M3.8 2.5h5.7v5.7'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .25s var(--ease);
}
.ext:hover { color: var(--link); }
.ext:hover::after { transform: translate(2px, -2px); }

/* ============================================================
   1 — opener
   ============================================================ */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: calc(var(--wide) + var(--gutter) * 2);
  margin-inline: auto;
  padding: clamp(64px, 11vh, 112px) var(--gutter);
}

.hero-in { display: grid; gap: 32px; width: 100%; }

@media (min-width: 880px) {
  .hero-in {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 34vw, 380px);
    gap: clamp(48px, 6vw, 80px);
    align-items: center;
  }
}
@media (max-width: 879px) {
  .hero { padding-block: 48px 64px; }
}

.eyebrow {
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.name {
  font-size: clamp(44px, 6.4vw, 76px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.hero-meta {
  margin-top: 18px;
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.33;
  color: var(--muted);
  letter-spacing: -0.012em;
}

.hero-links {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}

.hero-photo {
  width: min(62vw, 260px);
  justify-self: start;
  order: -1;               /* stacked: face first, then the name */
}
@media (min-width: 880px) {
  .hero-photo { width: 100%; justify-self: end; order: 0; }
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 28px;
  background: var(--tile);
}
@media (max-width: 879px) {
  .hero-photo img { border-radius: 22px; }
}

/* ============================================================
   2 — frosted sticky nav
   ============================================================ */

/* The bar is an invisible sticky rail; the capsule inside it is the glass. */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: var(--bar-gap) var(--gutter) 0;
  pointer-events: none;
}

.bar-in {
  pointer-events: auto;
  position: relative;
  isolation: isolate;
  max-width: var(--wide);
  margin-inline: auto;
  height: var(--bar);
  padding-inline: 22px 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 980px;
}

/* Glass material — shared by the nav capsule and the theme button. */
.bar-in, .theme {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  backdrop-filter: blur(22px) saturate(190%);
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 0 0 .5px var(--glass-hairline),
    var(--glass-shadow);
}

/* a faint specular sheen, as light catches the upper-left of the glass */
.bar-in::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(120% 160% at 10% -40%, rgba(255, 255, 255, .6), transparent 55%);
  opacity: .55;
  pointer-events: none;
}
:root[data-theme="dark"] .bar-in::before { opacity: .12; }

.bar-name {
  flex: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.bar-links {
  margin-left: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bar-links::-webkit-scrollbar { display: none; }

.bar-links a {
  flex: none;
  font-size: 12.5px;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 980px;
  transition: color .2s var(--ease), background-color .25s var(--ease);
}
.bar-links a:hover { color: var(--fg); }
/* the current section sits in a lozenge, like the selected tab in an iOS tab bar */
.bar-links a.on { color: var(--fg); background: var(--glass-selected); }


@media (max-width: 819px) {
  .bar-name  { display: none; }
  .bar-in    { padding-inline: 8px; }
  .bar-links {
    margin-left: 0;
    flex: 1;
    padding-right: 20px;
    /* links that scroll under the CV button fade out instead of being cut */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
}

/* ============================================================
   3 — content
   ============================================================ */

.main {
  padding-inline: var(--gutter);
  padding-bottom: clamp(72px, 10vw, 120px);
}

.col { max-width: var(--col); margin-inline: auto; }

.sec {
  padding-top: clamp(56px, 8vw, 96px);
  /* land the heading just under the nav rather than showing the section's top padding */
  scroll-margin-top: calc(var(--bar) + var(--bar-gap) + 22px - clamp(56px, 8vw, 96px));
}

.sec-h {
  font-size: clamp(30px, 3.8vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.028em;
  margin-bottom: clamp(20px, 3vw, 28px);
}

/* about */

.prose {
  display: grid;
  gap: 18px;
  font-size: clamp(19px, 2vw, 21px);
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--fg-2);
}
.prose .ul { color: var(--fg); font-weight: 500; }

/* tiles */

.item {
  background: var(--tile);
  border-radius: var(--radius);
  padding: clamp(22px, 3.4vw, 34px);
}
.item + .item { margin-top: 12px; }

.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 20px;
}

.item h3 {
  font-size: clamp(19px, 2vw, 21px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.018em;
}
.item h3 a { transition: color .2s var(--ease); }

.when {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.where {
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
}

.note {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-2);
}
.note em { color: var(--fg); }

.badge {
  display: inline-block;
  margin-left: 10px;
  vertical-align: 3px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--link);
  background: color-mix(in srgb, var(--btn) 11%, transparent);
  padding: 3px 10px;
  border-radius: 980px;
  white-space: nowrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.meta li {
  font-size: 13px;
  color: var(--fg-2);
  background: var(--chip);
  padding: 5px 12px;
  border-radius: 980px;
}

/* skills */

.cols { display: grid; gap: 12px; }
@media (min-width: 600px) { .cols { grid-template-columns: 1fr 1fr; } }

.cols-c {
  background: var(--tile);
  border-radius: var(--radius);
  padding: clamp(22px, 3.4vw, 34px);
}
.cols-c h4 {
  font-size: clamp(19px, 2vw, 21px);
  font-weight: 600;
  letter-spacing: -0.018em;
  margin-bottom: 6px;
}

.plain li {
  padding: 11px 0;
  font-size: 16px;
  border-bottom: 1px solid var(--line);
}
.plain li:last-child { border-bottom: 0; padding-bottom: 0; }

/* contact */

.say {
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--muted);
  max-width: 30ch;
  margin-bottom: 26px;
  text-wrap: balance;
}

.links { display: grid; gap: 10px; }
.links a { font-size: 17px; }

/* footer */

.foot { background: var(--tile); }
.foot-in {
  max-width: calc(var(--wide) + var(--gutter) * 2);
  margin-inline: auto;
  padding: 18px var(--gutter) 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  font-size: 12px;
  color: var(--muted);
}

/* ============================================================
   4 — theme toggle
   ============================================================ */

.theme {
  position: fixed;
  bottom: clamp(16px, 3vw, 24px);
  right: clamp(16px, 3vw, 24px);
  z-index: 10;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 980px;
  color: var(--fg-2);
  cursor: pointer;
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.theme:active { transform: scale(.94); }
.theme:hover { color: var(--fg); }
.theme .t-moon { display: none; }
:root[data-theme="dark"] .theme .t-sun  { display: none; }
:root[data-theme="dark"] .theme .t-moon { display: block; }

/* ============================================================
   5 — motion
   ============================================================ */

.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ============================================================
   6 — print
   ============================================================ */

@media print {
  .theme, .bar, .skip, .hero-links { display: none !important; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .hero { min-height: 0; max-width: none; padding: 0 0 16pt; display: block; }
  .hero-photo { width: 34mm; }
  .main { padding: 0; }
  .col  { max-width: none; }
  .sec  { padding-top: 14pt; }
  .item, .cols-c { background: none; padding: 8pt 0; border-radius: 0; break-inside: avoid; }
  .foot { background: none; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  a { color: #000; }
  .link::after, .arrow::after, .ext::after { content: ""; display: none; }
}
