/* lorenzo.mastro.tax — plain old-school homepage.
   No framework, no build step. Edit by hand. */

/* EB Garamond, self-hosted (variable, weights 400–800).
   Served from /fonts so the page makes no request to Google on every visit —
   faster, and no third-party transfer to justify under the GDPR. */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/ebgaramond-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;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/ebgaramond-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: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/ebgaramond-italic-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;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/ebgaramond-italic-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;
}

/* Bebas Neue: the display face of the floating menu, now of the whole page. */
@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/bebasneue-latin.woff2') format('woff2');
}

/* The page wears the floating menu's clothes: warm sand, near-black ink,
   one yellow. Everything below reads these variables, so the hacker palette
   only has to swap them. */
:root {
  --ink: #242424;
  --muted: rgba(36, 36, 36, .58);
  --link: #242424;
  --link-visited: #242424;
  --rule: rgba(36, 36, 36, .1);
  --bg: #ede8e4;
  --card: rgba(255, 255, 255, .6);
  --card-edge: rgba(255, 255, 255, .5);
  --accent: #ffe862;
  --accent-edge: #d1bb3b;
  --cream: #f7f1ed;
  --dark: #242424;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* Terminal palette. Only the variables change, plus a monospace face. Set on
   <html> by a tiny inline script so it never flashes the light page first. */
html.hacker {
  --ink: #c9ffd4;
  --muted: #5f9e6b;
  --link: #7ee787;
  --link-visited: #58c26a;
  --rule: #1e3d26;
  --bg: #0a0e0a;
  --card: #10180f;
  --card-edge: #1e3d26;
  --accent: #1f4a24;
  --accent-edge: #2e6b35;
  --cream: #c9ffd4;
  --dark: #10180f;
  --display: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --sans: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
html.hacker body { font-size: 15.5px; line-height: 1.7; }
html.hacker h1 { font-size: 30px; letter-spacing: 0; text-transform: none; }
html.hacker h2 { font-size: 20px; letter-spacing: 0; text-transform: none; }
html.hacker .photo { filter: grayscale(1) contrast(1.15) brightness(.92); }
html.hacker a { background-image: none; text-decoration: underline; text-decoration-color: var(--rule); }
html.hacker a:hover { background: #10240f; }

html { -webkit-text-size-adjust: 100%; }

::selection { background: rgba(255, 232, 98, .55); color: #242424; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -.011em;
  margin: 0;
  padding: 0 20px 80px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; animation: rise .6s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Links: ink with a yellow marker underneath that fills in on hover. */
a, a:visited {
  color: var(--link);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% .38em;
  transition: background-size .35s var(--ease);
}
a:hover { background-size: 100% 100%; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 0 0;
}
.topbar nav a { margin-right: 14px; }
.topbar nav a.here { font-weight: 600; background-size: 100% 100%; }

/* The two switches. Added by site.js, so they never show up dead when
   JavaScript is off. Small pills: tools, not navigation. */
.tools { margin-left: auto; display: flex; gap: 6px; }
.switch {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  line-height: 1.4;
  transition: transform .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease);
}
.switch:hover { transform: scale(1.05); }
.switch:active { transform: scale(.98); }
.switch[aria-pressed="true"] { background: var(--dark); color: var(--cream); border-color: var(--dark); }

/* Markdown view: the same dark card the menu opens into. */
.mdview {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 26px 0 0;
  padding: 26px 28px;
  border-radius: 28px;
  background: var(--dark);
  color: var(--cream);
}
.mdbar { margin: 14px 0 0; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 22px 0 36px;
}

/* ---- header block ---- */
.photo {
  float: left;
  width: 170px;
  margin: 6px 26px 14px 0;
  border-radius: 28px;
}
h1 {
  font-family: var(--display);
  font-size: 76px;
  font-weight: 400;
  line-height: .92;
  letter-spacing: -.02em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.tagline { color: var(--muted); font-size: 17px; margin: 0 0 20px; }

h2 {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
  margin: 56px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  clear: both;
}
h3 { font-size: 18px; font-weight: 600; margin: 24px 0 4px; }

/* Hand-drawn 16x16 pixel icons, inline next to a few headings.
   Sized in em so they follow the type, never taller than a capital. */
.mc {
  width: .72em;
  height: .72em;
  vertical-align: .02em;
  margin-right: .14em;
  image-rendering: pixelated;
}

p { margin: 0 0 14px; }
strong { font-weight: 600; }

ul { padding-left: 20px; margin: 0 0 14px; }
li { margin-bottom: 7px; }
li::marker { color: var(--muted); }

.dim { color: var(--muted); }
.date {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- entry lists (posts, talks) ---- */
.entries { list-style: none; padding: 0; }
.entries li { margin-bottom: 16px; }
.entries .meta { display: block; }
.entries .sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 15.5px;
}

/* the 404 hole */
.void { display: block; margin: 30px 0 26px; max-width: 100%; height: auto; border-radius: 16px; }

/* ---- cards ----
   Advancements, résumé rows and the empty state share one surface: white at
   60% over the sand, soft corners, a thin light edge. */
.adv, .cv-row, .empty {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 20px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.adv:hover, .cv-row:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -18px rgba(36, 36, 36, .35); }

/* ---- advancements ---- */
.advancements { list-style: none; padding: 0; margin: 18px 0 0; }
.adv {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: baseline;
  gap: 2px 12px;
  margin: 0 0 10px;
  padding: 16px 20px;
}
/* Sits next to the title, not floating in the middle of a two-line row. */
.adv .mc { grid-row: span 2; align-self: start; margin: 2px 0 0; width: 20px; height: 20px; }
.adv-title { font-weight: 600; }
.adv-when { justify-self: end; white-space: nowrap; }
.adv-what { grid-column: 2 / -1; color: var(--muted); }

@media (max-width: 480px) {
  .adv { grid-template-columns: 24px 1fr; }
  .adv-when { grid-column: 2; justify-self: start; }
  .adv-what { grid-column: 1 / -1; margin-top: 4px; }
}

/* ---- résumé rows ---- */
.cv-row { margin-bottom: 12px; padding: 18px 22px; }
.cv-row .role { font-weight: 600; }
.cv-row .when { float: right; margin-left: 12px; line-height: 1.9; }
.cv-row .what { color: var(--muted); margin: 4px 0 0; }
.cv-row::after { content: ""; display: block; clear: both; }

/* a plain line of measured numbers, as a quiet strip */
.stats {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--muted);
  background: var(--card);
  border-radius: 16px;
  padding: 12px 18px;
  margin: 0 0 20px;
}

/* empty-state block: a page with nothing on it should still look designed */
.empty { margin: 26px 0 0; padding: 28px 30px; }
.empty p:last-child { margin-bottom: 0; }

blockquote {
  margin: 0 0 14px;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent-edge);
  color: var(--ink);
}

code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .86em;
  background: rgba(36, 36, 36, .07);
  border-radius: 6px;
  padding: 2px 6px;
}
html.hacker code { background: var(--card); }

footer {
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}

@media print {
  body { font-size: 11pt; padding: 0; background: #fff; }
  .topbar, footer { display: none; }
  a { background: none; }
  .wrap { animation: none; }
  .adv, .cv-row, .empty { background: none; border: 1px solid #ddd; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .photo { width: 116px; margin-right: 16px; border-radius: 22px; }
  h1 { font-size: 52px; }
  h2 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .wrap { animation: none; }
  a, .switch, .adv, .cv-row { transition: none; }
}

/* Floating menu (React, built from /menu into /menu/menu.js). It reads the
   links from the topbar <nav>, which stays in the HTML for no-JS visitors
   and is hidden only once the menu has mounted. */
html.fm-on .topbar nav { display: none; }
html.fm-on body { padding-bottom: 130px; }
@media print { #fm-root { display: none; } }
/* The menu draws its own links: no yellow marker in there. */
#fm-root a, #fm-root a:hover { background: none; }
