/* ---------------------------------------------------------------
   yannispolitis.info
   One accent hue (violet) over black, white and grey. Sans only.
   --------------------------------------------------------------- */

:root {
  color-scheme: light;

  --bg:        #ffffff;
  --bg-tint:   #f5f5f6;
  --surface:   #ffffff;
  --text:      #111113;
  --muted:     #56565c;
  --faint:     #6b6b72;
  --border:    #e4e4e7;
  --border-strong: #cfcfd4;

  --accent:       #8a0fbf;
  --accent-hover: #6f0c9a;
  --accent-soft:  #f7eafe;
  --on-accent:    #ffffff;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07), 0 12px 32px rgba(0,0,0,.06);

  --radius:    12px;
  --radius-lg: 18px;

  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", system-ui, -apple-system, sans-serif;

  --measure: 66ch;
  --wrap: 1060px;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg:        #0c0c0e;
  --bg-tint:   #141416;
  --surface:   #151518;
  --text:      #f2f2f4;
  --muted:     #a1a1a8;
  --faint:     #8b8b93;
  --border:    #262629;
  --border-strong: #3a3a3f;

  --accent:       #c56cff;
  --accent-hover: #d68cff;
  --accent-soft:  #241033;
  --on-accent:    #14071f;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 6px 20px rgba(0,0,0,.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg:        #0c0c0e;
    --bg-tint:   #141416;
    --surface:   #151518;
    --text:      #f2f2f4;
    --muted:     #a1a1a8;
    --faint:     #8b8b93;
    --border:    #262629;
    --border-strong: #3a3a3f;

    --accent:       #c56cff;
    --accent-hover: #d68cff;
    --accent-soft:  #241033;
    --on-accent:    #14071f;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow-md: 0 6px 20px rgba(0,0,0,.55);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3, h4 { font-weight: 700; line-height: 1.18; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 1.5rem + 2.2vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 1.15rem + .9vw, 1.7rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p  { margin: 0 0 1.05em; }

.wrap   { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.prose  { max-width: var(--measure); }
.lede   { font-size: 1.08rem; color: var(--muted); max-width: var(--measure); }
.muted  { color: var(--muted); }
.small  { font-size: .92rem; }

.vh {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: .7em 1.1em;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 60px; }


.nav { margin-left: 0; }
.nav ul { display: flex; align-items: center; gap: clamp(.7rem, 2vw, 1.5rem); list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-block; color: var(--muted); text-decoration: none; font-size: .94rem; padding: .3rem 0; position: relative; }
.nav a:hover { color: var(--text); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .18s ease;
}
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 700; }
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.theme-toggle {
  margin-left: auto;
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  cursor: pointer; padding: 0;
  transition: color .2s ease, border-color .2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-strong); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* ---------- hero ---------- */

.hero { padding: clamp(2.2rem, 5vw, 3.6rem) 0 clamp(1.2rem, 3vw, 2rem); }
.hero-grid { display: grid; gap: clamp(1.4rem, 3.5vw, 2.6rem); grid-template-columns: 176px 1fr; align-items: center; }
@media (max-width: 680px) { .hero-grid { grid-template-columns: 1fr; justify-items: start; } }

.avatar {
  width: 176px; height: 176px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
}
@media (max-width: 680px) { .avatar { width: 124px; height: 124px; } }

.eyebrow {
  font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .6rem;
}
.hero h1 { margin-bottom: .3em; }
.hero .role { font-size: 1.08rem; color: var(--muted); margin-bottom: .9em; }
.hero .role strong { color: var(--text); font-weight: 700; }

/* ---------- buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: inherit; font-size: .94rem; font-weight: 600;
  padding: .6rem 1.1rem; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--border-strong); color: var(--text); background: var(--surface);
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- sections ---------- */

.section { padding: clamp(1.9rem, 4vw, 2.9rem) 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.section-head h2 { margin: 0; }
.section-head .more { font-size: .93rem; }

/* ---------- at a glance ---------- */

.facts { display: grid; grid-template-columns: 10.5rem 1fr; gap: 0; margin: 0; max-width: 46rem; }
.facts dt {
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); padding: .75rem 1rem .75rem 0; border-top: 1px solid var(--border);
}
.facts dd { margin: 0; padding: .75rem 0; border-top: 1px solid var(--border); }
.facts dt:first-of-type, .facts dd:first-of-type { border-top: 0; }
@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: .1rem; }
  .facts dd { border-top: 0; padding-top: 0; padding-bottom: .8rem; }
}


/* ---------- timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.1rem; padding: .9rem 0; border-top: 1px solid var(--border); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline .when { color: var(--faint); font-size: .89rem; font-variant-numeric: tabular-nums; padding-top: .15rem; }
.timeline .what strong { font-weight: 700; }
.timeline .what .where { color: var(--muted); }
.timeline .what p { margin: .15rem 0 0; color: var(--muted); font-size: .94rem; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: .15rem; } }


/* ---------- how I work ---------- */

.approach-intro { margin-bottom: 1.6rem; }
.approach {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  column-gap: clamp(2rem, 4vw, 3.5rem);
}
.approach-item {
  display: grid; grid-template-columns: 2.4rem 1fr; gap: .9rem;
  padding: 1.35rem 0; border-top: 1px solid var(--border);
}
.approach-n {
  font-size: .8rem; font-weight: 700; letter-spacing: .06em;
  color: var(--accent); padding-top: .4rem; font-variant-numeric: tabular-nums;
}
.approach-item h3 { font-size: 1.1rem; margin: 0 0 .35rem; }
.approach-item p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 520px) {
  .approach-item { grid-template-columns: 1fr; gap: .2rem; }
  .approach-n { padding-top: 0; }
}

/* ---------- cards ---------- */

.cards { display: grid; gap: clamp(1rem, 2.2vw, 1.5rem); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); list-style: none; margin: 0; padding: 0; }
.card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); color: var(--text); }
.card .thumb { aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-tint); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: .9rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: .25rem; }
.card .kicker { font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.card .title { font-size: 1rem; line-height: 1.35; margin: 0; }

/* ---------- article ---------- */

.article { padding: clamp(1.6rem, 3.5vw, 2.6rem) 0 1rem; }
.article-head { max-width: var(--measure); margin-bottom: 1.6rem; }
.article-head h1 { font-size: clamp(1.7rem, 1.35rem + 1.4vw, 2.3rem); }

.article-body { max-width: var(--measure); }
.article-body > figure:first-child { margin-top: 0; }
.article-body h2 { margin-top: 2em; }
.article-body h3 { margin-top: 1.8em; margin-bottom: .45em; }
.article-body ul { padding-left: 1.1em; }
.article-body li { margin-bottom: .45em; }
.article-body ul.plain { list-style: none; padding-left: 0; }
.article-body ul.plain li { padding-left: 1.3em; position: relative; }
.article-body ul.plain li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

figure { margin: 1.6em 0; }
figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
figure figcaption { font-size: .87rem; color: var(--faint); margin-top: .55em; }

.credits {
  margin-top: 2.2rem; padding-top: 1.1rem; border-top: 1px solid var(--border);
  font-size: .9rem; color: var(--muted); line-height: 1.7;
}
.credits b { color: var(--text); font-weight: 700; }

.pager {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  max-width: var(--measure); margin: 2.4rem 0 0; padding-top: 1.3rem;
  border-top: 1px solid var(--border); font-size: .93rem;
}
.pager a { text-decoration: none; color: var(--muted); }
.pager a:hover { color: var(--accent); }

/* ---------- links page ---------- */

.linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; max-width: 44rem; }
.linklist a {
  display: flex; align-items: center; gap: 1rem; padding: .95rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  transition: border-color .2s ease;
}
.linklist a:hover { border-color: var(--accent); }
.linklist .lt { font-weight: 700; }
.linklist .ld { color: var(--muted); font-size: .91rem; }
.linklist .arrow { margin-left: auto; color: var(--faint); }
.linklist a:hover .arrow { color: var(--accent); }


/* ---------- footer ---------- */

.site-footer { margin-top: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--border); background: var(--bg-tint); padding: 2.1rem 0 2.3rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.2rem 2.2rem; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .copy { color: var(--faint); font-size: .86rem; margin: 0; }

/* ---------- back to top ---------- */

.back-to-top {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 40;
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); text-decoration: none;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s, color .2s ease, border-color .2s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { color: var(--accent); border-color: var(--accent); }
.back-to-top svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }


/* ---------- print ---------- */

@media print {
  .site-header, .back-to-top, .theme-toggle, .pager { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
}
