/* batakis.eu: olive ink on warm paper.
   Didact Gothic (SIL OFL 1.1, via @fontsource/didact-gothic 5.3.0) is self-hosted and only used
   when the visitor doesn't have Century Gothic installed. */
@font-face {
  font-family: "Didact Gothic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/didact-gothic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Didact Gothic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/didact-gothic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #F3F0E7;
  --ink: #0F140F;
  --olive: #2F3D2E;
  --line: #DCD8CC;
  --muted: #687064;
  --on-olive-muted: #C9CCBE;

  --font: "Century Gothic", CenturyGothic, "Didact Gothic", "AppleGothic", sans-serif;
  --gutter: clamp(16px, 5vw, 56px);
  --max: 68rem;
  --label: .72rem;
  --track: .22em;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: 400; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--olive); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: color-mix(in srgb, var(--olive) 40%, transparent); }
a:hover { text-decoration-color: var(--olive); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
::selection { background: var(--olive); color: var(--paper); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.label {
  font-size: var(--label);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }

.skip { position: absolute; left: -999px; top: 0; background: var(--olive); color: var(--paper); padding: .5rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

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

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 3.75rem; }
.mark { font-size: .78rem; letter-spacing: .28em; text-transform: uppercase; text-decoration: none; color: var(--ink); white-space: nowrap; }
.nav { display: flex; gap: clamp(1rem, 2.4vw, 2rem); overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font-size: var(--label); letter-spacing: .18em; text-transform: uppercase; text-decoration: none; color: var(--muted); white-space: nowrap; padding-block: .4rem; }
.nav a:hover { color: var(--ink); }

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

.hero { padding-block: clamp(5rem, 14vh, 9rem) clamp(4rem, 10vh, 6.5rem); }
.name {
  font-size: clamp(1.7rem, 1.2rem + 2.6vw, 3rem);
  letter-spacing: var(--track);
  text-transform: uppercase;
  line-height: 1.15;
  margin-block: 1.25rem 2.25rem;
}
.statement {
  font-size: clamp(1.45rem, 1.1rem + 1.7vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  max-width: 32ch;
}
.hero .sub { margin-top: 1.5rem; max-width: 46ch; color: var(--muted); font-size: 1.05em; }

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

.section { padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.section-grid { display: grid; gap: 1.25rem 3rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .section-grid { grid-template-columns: 11rem minmax(0, 1fr); } }
.section-head h2 { font-size: var(--label); letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); padding-top: .45rem; }
.section-head .note { display: block; margin-top: .5rem; font-size: .8rem; color: var(--muted); }

.body { max-width: 44rem; }
.lead { font-size: clamp(1.2rem, 1.02rem + .8vw, 1.55rem); line-height: 1.4; letter-spacing: -.005em; }
.body > * + * { margin-top: 1.1em; }
.body > .lead + * { margin-top: 1.75rem; }
.body > * + .block { margin-top: 2.75rem; }
.more { display: inline-block; margin-top: 2rem; }

/* definition rows (Now, Outside work) */
.rows > div { display: grid; gap: .15rem 2rem; grid-template-columns: minmax(0, 1fr); padding-block: 1rem; border-top: 1px solid var(--line); }
.rows > div:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .rows > div { grid-template-columns: 9rem minmax(0, 1fr); } }
.rows dt { font-size: var(--label); letter-spacing: var(--track); text-transform: uppercase; color: var(--olive); padding-top: .3rem; }

/* receipts: numbers first */
.receipts li { display: grid; gap: .25rem 2rem; grid-template-columns: minmax(0, 1fr); padding-block: 1.1rem; border-top: 1px solid var(--line); }
.receipts li:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .receipts li { grid-template-columns: 9rem minmax(0, 1fr); align-items: baseline; } }
.figure { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); line-height: 1.1; letter-spacing: -.02em; color: var(--olive); white-space: nowrap; }
.receipts p { color: var(--muted); }
.receipts strong { display: block; font-weight: 400; color: var(--ink); }

/* two lists side by side */
.pair { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.pair h3 { margin-bottom: .75rem; }
.pair li { padding-block: .35rem; border-bottom: 1px solid var(--line); }
.pair li span { color: var(--muted); }

/* ---------- built: a notebook index ---------- */

.group + .group { margin-top: 3rem; }
.group > h3 { margin-bottom: .6rem; }
.entry { border-top: 1px solid var(--line); }
.group .entry:last-child { border-bottom: 1px solid var(--line); }
.entry summary {
  list-style: none; cursor: pointer;
  display: grid; gap: .1rem 1.5rem; align-items: baseline;
  grid-template-columns: minmax(0, 1fr) 1.25rem;
  padding-block: 1rem;
}
.entry summary::-webkit-details-marker { display: none; }
@media (min-width: 720px) { .entry summary { grid-template-columns: 12rem minmax(0, 1fr) 1.25rem; } }
.entry .title { font-size: 1.15rem; letter-spacing: -.005em; }
.entry .gist { color: var(--muted); grid-column: 1; }
@media (min-width: 720px) { .entry .gist { grid-column: 2; grid-row: 1; } }
.entry summary::after {
  content: "+"; grid-column: -2; grid-row: 1;
  justify-self: end; color: var(--olive); font-size: 1.25rem; line-height: 1;
  transition: transform .2s ease;
}
.entry[open] summary::after { transform: rotate(45deg); }
.entry summary:hover .title { color: var(--olive); }
.entry .detail { padding: 0 0 1.4rem; max-width: 40rem; }
@media (min-width: 720px) { .entry .detail { margin-left: 13.5rem; } }
.entry .detail > * + * { margin-top: .8rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: .15rem .55rem; border-radius: 99px; }
.quote { color: var(--olive); }

/* principles */
.principles { counter-reset: p; }
.principles li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .5rem; padding-block: 1.1rem; border-top: 1px solid var(--line); }
.principles li:last-child { border-bottom: 1px solid var(--line); }
.principles li::before { counter-increment: p; content: "0" counter(p); font-size: var(--label); letter-spacing: .16em; color: var(--olive); padding-top: .4rem; }
.principles h3 { font-size: 1.15rem; }
.principles p { color: var(--muted); margin-top: .25rem; }

/* writing */
.posts { border-top: 1px solid var(--line); }
.post a { display: grid; gap: .2rem; padding-block: 1.1rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.post-date { font-size: var(--label); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.post-title { font-size: 1.12rem; line-height: 1.4; }
.post a:hover .post-title { color: var(--olive); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.post-desc { color: var(--muted); font-size: .95em; }
.subscribe { display: flex; flex-wrap: wrap; gap: .75rem; max-width: 32rem; }
.subscribe label { flex-basis: 100%; }
.subscribe input {
  flex: 1 1 14rem; min-width: 0; font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--muted); padding: .7rem 0; border-radius: 0;
}
.subscribe input::placeholder { color: var(--muted); }
.subscribe input:focus { outline: none; border-bottom-color: var(--olive); }
.btn {
  font: inherit; font-size: .76rem; letter-spacing: .18em; text-transform: uppercase;
  background: var(--olive); color: var(--paper); border: 1px solid var(--olive);
  padding: .8rem 1.4rem; cursor: pointer; transition: background .2s ease, color .2s ease;
}
.btn:hover { background: transparent; color: var(--olive); }
.form-note { flex-basis: 100%; font-size: .9em; color: var(--muted); min-height: 1.6em; }

/* facts (About, CV) */
.facts { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.facts h3 { margin-bottom: .75rem; }
.facts li + li { margin-top: .7rem; }
.facts li span { display: block; color: var(--muted); font-size: .9em; }

/* ---------- contact: the olive band ---------- */

.band { background: var(--olive); color: var(--paper); padding-block: clamp(4rem, 9vw, 6.5rem) 2rem; }
.band a { color: var(--paper); text-decoration-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.band a:hover { text-decoration-color: var(--paper); }
.band .label, .band .section-head h2, .band .muted { color: var(--on-olive-muted); }
.band .intro { margin-bottom: .6rem; }
.band .big { display: inline-block; font-size: clamp(1.5rem, 1rem + 2.6vw, 2.75rem); letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.band .links { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin-top: 2rem; }
.band .links a { font-size: var(--label); letter-spacing: .18em; text-transform: uppercase; text-decoration: none; }
.band .links a:hover { text-decoration: underline; }
.band .links a::after { content: " ↗"; }
.band .foot {
  margin-top: clamp(4rem, 9vw, 6rem); padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
}

/* ---------- cv page ---------- */

.page-head { padding-block: clamp(4rem, 11vh, 7rem) clamp(2.5rem, 6vh, 4rem); }
.page-head .name { margin-block: 1rem 1rem; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin-top: 1.75rem; }
.timeline li { display: grid; gap: .15rem 2rem; grid-template-columns: minmax(0, 1fr); padding-block: 1.1rem; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .timeline li { grid-template-columns: 8.5rem minmax(0, 1fr); } }
.when { font-size: .85rem; color: var(--muted); padding-top: .15rem; font-variant-numeric: tabular-nums; }
.timeline h3 { font-size: 1.1rem; line-height: 1.4; }
.timeline .org { color: var(--muted); }
.timeline p { color: var(--muted); margin-top: .25rem; }
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }

/* ---------- 404 ---------- */

.notfound { min-height: 100vh; display: flex; align-items: center; }

.print-only { display: none; }

@media (max-width: 720px) {
  .nav { -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent); mask-image: linear-gradient(90deg, #000 80%, transparent); padding-right: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .entry summary::after { transition: none; }
}

/* ---------- print (the CV PDF is rendered from /cv/ with these rules) ---------- */

@media print {
  @page { size: A4; margin: 15mm 16mm 16mm; }
  :root { --paper: #fff; }
  html { scroll-padding-top: 0; }
  body { background: #fff; font-size: 9.5pt; line-height: 1.45; }
  a { text-decoration: none; color: var(--ink); }
  .wrap { max-width: none; padding-inline: 0; }
  .site-header, .skip, .subscribe, .posts, .more, .actions, .site-footer, .band, .no-print { display: none !important; }
  .print-only { display: block; }

  .page-head, .hero { padding: 0 0 5mm; }
  .name { font-size: 20pt; margin-block: 0 2mm; }
  .page-head .statement, .statement { font-size: 12pt; max-width: none; }
  .section { padding-block: 4mm; }
  /* Block flow, not grid: Chrome moves a whole grid block to the next page instead of splitting it */
  .section-grid { display: block; }
  .section-grid::after { content: ""; display: block; clear: both; }
  .section-head { float: left; width: 28mm; }
  .section-head h2 { padding-top: .5mm; }
  .section-grid > .body { margin-left: 34mm; }
  .body { max-width: none; }
  .lead { font-size: 11pt; }
  .body > * + * { margin-top: 2.5mm; }
  .body > .lead + * { margin-top: 3mm; }
  .body > * + .block { margin-top: 4mm; }

  .timeline li, .receipts li { padding-block: 1.4mm; gap: 0 4mm; }
  .timeline li { grid-template-columns: 24mm minmax(0, 1fr); }
  .receipts li { grid-template-columns: 22mm minmax(0, 1fr); }
  .timeline h3 { font-size: 10pt; }
  .timeline p { margin-top: .5mm; font-size: 9pt; }
  .figure { font-size: 14pt; }
  .pair { grid-template-columns: 1fr 1fr; gap: 0 8mm; }
  .pair li { padding-block: .8mm; font-size: 9pt; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3mm 8mm; }
  .facts li { font-size: 9pt; }
  .facts li + li { margin-top: 1.2mm; }

  .timeline li, .receipts li, .pair li, .facts > div { break-inside: avoid; }
  .section-head, h3 { break-after: avoid; }
}
