/* milanambroz.net */

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/literata-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: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/literata-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/literata-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;
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/literata-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/*
 * Colours: each token has a light and a dark value (light-dark()). Light is paper and ink with an
 * oxblood (book cloth) accent and gold rules; dark is a warm, leather-brown night version.
 * Dark is the default for everyone; the header toggle switches to light (html[data-theme="light"]).
 */
:root {
  color-scheme: dark;
  --bg: light-dark(#f6f1e7, #15120e);              /* page (paper) */
  --surface: light-dark(#fffcf6, #1e1a15);         /* cards, header */
  --alt-bg: light-dark(#eee6d6, #1a1611);          /* alternate sections */
  --text: light-dark(#3d362d, #d3cabb);
  --heading: light-dark(#1f1a14, #f3ecdf);
  --muted: light-dark(#685f52, #a59b8a);
  --accent: light-dark(#8a2c22, #eb9b8a);          /* links, eyebrow, icons */
  --accent-hover: light-dark(#5e1c15, #f6c3b7);
  --btn: light-dark(#7a2419, #a8402f);             /* button background (light text) */
  --btn-hover: light-dark(#561911, #8e3324);
  --btn-text: #fffaf2;
  --gold: light-dark(#b08530, #c9a65c);            /* decorative rules only, not for text */
  --border: light-dark(#e1d6c2, #352e25);
  --border-strong: light-dark(#c8b99e, #4d4336);
  --tint: light-dark(rgba(138, 44, 34, .08), rgba(235, 155, 138, .12));
  --shadow: light-dark(rgba(60, 40, 20, .1), rgba(0, 0, 0, .5));
  --cover-shadow: light-dark(rgba(50, 30, 10, .35), rgba(0, 0, 0, .7));
  --shelf-top: light-dark(#a8784f, #5e4430);
  --shelf-front: light-dark(#7d5434, #3f2c1e);
  --card-line: light-dark(rgba(70, 110, 160, .16), rgba(140, 170, 210, .1));   /* index-card ruling */
  --card-margin: light-dark(rgba(190, 60, 50, .45), rgba(235, 120, 100, .35));
  --me: light-dark(#1f1a14, #fff6e8);
  --mark: light-dark(rgba(176, 133, 48, .28), rgba(201, 166, 92, .3));
  --footer-bg: #1c1611;
  --footer: #140f0b;
  --radius: 4px;
  --cover-ratio: 100 / 146;                        /* every cover is shown at this width/height; scans differ slightly */
  --container: 1160px;
  --section-space: clamp(56px, 7vw, 96px);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

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

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

body {
  margin: 0;
  font-family: "Literata", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-variant-numeric: oldstyle-nums proportional-nums;
}
main { flex: 1; }

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

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); transition: color .2s, text-decoration-color .2s; }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

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

::selection { background: var(--mark); color: var(--heading); }

/* Typography */
h1, h2, h3, h4 { color: var(--heading); margin: 0 0 .6em; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(34px, 1.5rem + 2.2vw, 54px); line-height: 1.1; letter-spacing: -.015em; font-weight: 500; }
h2 { font-size: clamp(26px, 1.2rem + 1.2vw, 36px); line-height: 1.2; letter-spacing: -.01em; font-weight: 500; }
h3 { font-size: 20px; line-height: 1.35; }
p { margin: 0 0 1em; text-wrap: pretty; }

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 15px; font-weight: 600;
  font-variant-caps: all-small-caps; letter-spacing: .12em;
  margin: 0 0 10px;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 600px) { .container { padding: 0 24px; } }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 200;
  background: var(--btn); color: var(--btn-text); padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: var(--btn-text); }

.icon { width: 24px; height: 24px; flex: none; }
.icon-inline { width: 1em; height: 1em; vertical-align: -.12em; }
.nowrap { white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--btn); color: var(--btn-text);
  font-family: inherit; font-weight: 500; font-size: 16px; line-height: 1.2;
  padding: 13px 22px;
  border: 1px solid var(--btn); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.btn:hover, .btn:focus-visible { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--btn-text); }
.btn .icon-inline { transition: transform .2s; }
.btn:hover .icon-inline { transform: translateX(3px); }
.btn.ghost { background: transparent; color: var(--heading); border-color: var(--border-strong); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

.more-link { font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.more-link:hover { text-decoration: underline; }
.more-link .icon-inline { transition: transform .2s; }
.more-link:hover .icon-inline { transform: translateX(3px); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background-color .25s, box-shadow .25s;
}
/* After scrolling: slightly translucent with a blur, plus a soft shadow. Solid without blur support. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header.scrolled {
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
  }
}
.site-header.scrolled { box-shadow: 0 6px 20px var(--shadow); }
@media (prefers-reduced-transparency: reduce) {
  .site-header.scrolled { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 24px; }

.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--heading); }
.logo:hover { color: var(--heading); }
.logo-icon { width: 44px; height: auto; flex: none; color: var(--accent); }
.logo-ribbon { fill: var(--gold); }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-tag { font-size: 14px; font-variant-caps: all-small-caps; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.logo-name { font-size: 24px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 20px; }
.main-nav a {
  color: var(--heading); text-decoration: none;
  font-size: 16px; padding: 6px 0;
  position: relative;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent); transform: scaleX(0); transition: transform .25s;
}
.main-nav a:hover, .main-nav a[aria-current] { color: var(--accent); }
.main-nav a:hover::after, .main-nav a[aria-current]::after { transform: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch, .theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: none; border: 1px solid var(--border); color: var(--heading); cursor: pointer;
  font: 600 13px/1 var(--sans); letter-spacing: .04em; text-decoration: none;
  transition: border-color .2s, color .2s;
}
.lang-switch:hover, .theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .icon-moon { stroke: none; display: none; }
.theme-toggle .icon-sun { fill: none; }
.theme-toggle .icon-sun circle { fill: currentColor; stroke: none; }
/* Light theme only: moon icon (switch to dark) instead of sun */
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; margin-right: -8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--heading); margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1199px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 16px 24px var(--shadow);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 4px 16px 16px; max-width: var(--container); margin: 0 auto; }
  .main-nav li a { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 18px; }
  .main-nav li:last-child a { border-bottom: 0; }
  .main-nav a::after { display: none; }
}
@media (max-width: 420px) {
  .site-header .container { gap: 10px; min-height: 68px; }
  .logo { gap: 9px; }
  .logo-icon { width: 36px; }
  .logo-name { font-size: 20px; }
  .logo-tag { font-size: 13px; margin-bottom: 2px; }
  .header-actions { gap: 6px; }
  .lang-switch, .theme-toggle { width: 36px; height: 36px; }
}
@media (max-width: 350px) {
  .logo-icon { display: none; }
}

/* Sections and their titles */
.section { padding: var(--section-space) 0; }
.section-alt { background: var(--alt-bg); }
.sec-title { max-width: 720px; margin-bottom: 40px; }
.sec-title h2 { margin: 0; }
.sec-title h2::after {
  content: ""; display: block; width: 56px; height: 2px; margin-top: 18px;
  background: linear-gradient(90deg, var(--gold) 0 70%, transparent 70% 80%, var(--gold) 80%);
}
.sec-title p:not(.eyebrow) { font-size: 18px; margin: 16px 0 0; }
.sec-title-row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.sec-title-row > div { max-width: 720px; }

/* Hero */
.hero { padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 7vw, 96px); position: relative; overflow: hidden; }
.hero::before {
  /* faint ruled lines, like a notebook page */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 35px, var(--border) 35px 36px);
  opacity: .45;
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
}
.hero .container { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero h1 .honorific { display: block; font-size: .42em; font-variant-caps: all-small-caps; letter-spacing: .12em; color: var(--muted); font-weight: 500; margin-bottom: .35em; }
.hero-lead { font-size: clamp(18px, 1rem + .35vw, 21px); line-height: 1.6; max-width: 600px; margin-bottom: 30px; color: var(--heading); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-fields { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; color: var(--accent); font-size: 15px; font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: .12em; }
.hero-fields li:not(:last-child)::after { content: "·"; margin: 0 .6em; color: var(--gold); }

/* Portrait in a book-plate frame */
.portrait { margin: 0; justify-self: center; }
.portrait-frame {
  position: relative; padding: 10px; background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 40px var(--shadow);
  transform: rotate(1.2deg);
}
.portrait-frame::before { content: ""; position: absolute; inset: 4px; border: 1px solid var(--gold); opacity: .6; pointer-events: none; }
.portrait img { width: 239px; background: #000; }
.portrait figcaption { margin-top: 18px; text-align: center; font-style: italic; color: var(--muted); font-size: 15px; }

/* Welcome letter */
.letter { max-width: 760px; }
.letter p { font-size: 18px; }
.dropcap::first-letter {
  float: left; font-size: 4.1em; line-height: .82; font-weight: 600;
  padding: .06em .1em 0 0; color: var(--accent);
}
.signature { margin-top: 28px; font-style: italic; color: var(--heading); }
.signature::before { content: ""; display: block; width: 40px; height: 1px; background: var(--gold); margin-bottom: 14px; }

/* Bookshelf: covers stand on a wooden shelf; cells touch horizontally so the shelf looks continuous */
.shelf {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  column-gap: 0; row-gap: 48px;
}
.shelf-book a { display: flex; flex-direction: column; height: 100%; color: var(--heading); text-decoration: none; }
.shelf-book .cover {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  height: 320px; padding: 0 18px;
}
.shelf-book .cover::after {
  /* the shelf board */
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px;
  background: linear-gradient(var(--shelf-top) 0 4px, var(--shelf-front) 4px);
  box-shadow: 0 8px 12px -6px var(--cover-shadow);
}
.shelf-book img, .cover-blank {
  position: relative; z-index: 1;
  width: 100%; max-width: 196px; height: auto; aspect-ratio: var(--cover-ratio); object-fit: cover;
  box-shadow: 2px 0 0 rgba(0, 0, 0, .08), 8px 8px 18px var(--cover-shadow);
  transform-origin: bottom center;
  transition: transform .25s ease, box-shadow .25s ease;
}
.cover-blank {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
  width: 136px; aspect-ratio: var(--cover-ratio); padding: 14px 12px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .28) 0 7px, rgba(255, 255, 255, .06) 7px 9px, transparent 9px), #5e1c15;
  color: #e9cf8f; text-align: center; line-height: 1.25;
}
.cover-blank::before { content: ""; position: absolute; inset: 9px 7px 9px 15px; border: 1px solid rgba(233, 207, 143, .45); pointer-events: none; }
.cb-title { font-size: 14px; font-weight: 600; text-wrap: balance; }
.cb-author { font-size: 11px; font-variant-caps: all-small-caps; letter-spacing: .1em; }
.cb-year { font-size: 11px; opacity: .8; }
.cover-blank.cover-large { width: 100%; max-width: 300px; padding: 28px 26px; gap: 14px; box-shadow: 12px 16px 30px var(--cover-shadow); }
.cover-large .cb-title { font-size: 24px; }
.cover-large .cb-author, .cover-large .cb-year { font-size: 15px; }
.cover-large::before { inset: 14px 12px 14px 24px; }
.cover-blank.cover-small { width: 110px; padding: 10px 8px; box-shadow: 5px 6px 14px var(--cover-shadow); }
.cover-small .cb-title { font-size: 11px; }
.cover-small .cb-author, .cover-small .cb-year { font-size: 9px; }
@media (max-width: 500px) { .cover-blank.cover-small { width: 80px; } .cover-small .cb-title { font-size: 9px; } }
.shelf-book a:hover img, .shelf-book a:focus-visible img { transform: translateY(-6px); box-shadow: 2px 0 0 rgba(0, 0, 0, .08), 10px 14px 22px var(--cover-shadow); }
.shelf-book .cover-blank { width: min(196px, 100%); padding: 18px 16px; gap: 10px; }
.shelf-book .cb-title { font-size: 17px; }
.shelf-book .cb-author, .shelf-book .cb-year { font-size: 13px; }
.shelf-title { font-size: 17px; font-weight: 500; line-height: 1.35; margin: 30px 18px 4px; text-wrap: balance; }
.shelf-book a:hover .shelf-title { color: var(--accent); }
.shelf-year { margin: 0 18px; color: var(--muted); font-size: 15px; }
@media (max-width: 420px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .shelf-book .cover { height: 250px; padding: 0 10px; }
  .shelf-book img { max-width: 156px; }
  .shelf-book .cb-title { font-size: 14px; }
  .shelf-book .cb-author, .shelf-book .cb-year { font-size: 11px; }
  .shelf-title { font-size: 15px; margin: 28px 10px 2px; }
  .shelf-year { margin: 0 10px; }
}

/* Key numbers */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
.stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 26px 22px; }
.stats > div + div { border-left: 1px solid var(--border); }
.stats dd { margin: 0 0 6px; font-size: clamp(40px, 2rem + 1.5vw, 58px); line-height: 1; font-weight: 500; color: var(--accent); font-variant-numeric: lining-nums; }
.stats dt { color: var(--heading); font-size: 16px; line-height: 1.4; }
.stats-source { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 400px) { .stats > div { padding: 20px 14px; } }

/* Index cards (research areas) */
.index-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 22px; }
.index-card {
  position: relative;
  background:
    linear-gradient(90deg, transparent 0 34px, var(--card-margin) 34px 35px, transparent 35px),
    repeating-linear-gradient(180deg, transparent 0 27px, var(--card-line) 27px 28px) 0 64px / 100% calc(100% - 64px) no-repeat,
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 0 var(--border), 0 10px 24px -14px var(--shadow);
  padding: 22px 22px 18px 50px;
}
.index-card h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 0 0 14px; min-height: 28px; }
.index-card h3 .icon { width: 20px; height: 20px; color: var(--accent); margin-left: -30px; }
.index-card ul { list-style: none; margin: 0; padding: 0; line-height: 28px; font-size: 16px; }

/* Cards (seminars, projects) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 22px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--btn);
  padding: 26px 26px 22px;
  transition: border-color .2s, box-shadow .2s;
}
.card h3 { margin-bottom: 10px; }
.card h3 a { color: var(--heading); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }  /* whole card clickable */
.card:has(a:hover) { box-shadow: 0 14px 30px -12px var(--shadow); border-color: var(--border-strong); border-top-color: var(--btn); }
.card:has(a:hover) h3 a { color: var(--accent); }
.card p { margin: 0 0 16px; }
.card .card-icon { color: var(--accent); margin-bottom: 14px; width: 28px; height: 28px; }
.card .more-link { margin-top: auto; }

/* Page title (subpages) */
.page-title { padding: clamp(36px, 5vw, 64px) 0 clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--border); background: var(--surface); }
.page-title h1 { margin: 0; max-width: 900px; }
.title-sub { display: block; margin-top: .35em; font-size: .5em; font-style: italic; font-weight: 400; color: var(--muted); letter-spacing: 0; line-height: 1.3; }
.page-lead { font-size: clamp(18px, 1rem + .3vw, 20px); max-width: 720px; margin: 18px 0 0; }
.crumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 .55em; color: var(--border-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current] { color: var(--heading); }

/* Prose */
.prose { max-width: 720px; }
.prose h2 { font-size: clamp(23px, 1.1rem + .8vw, 29px); margin: 1.8em 0 .6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.6em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--gold); }
.prose .lead { font-size: 20px; color: var(--heading); }
.prose sup { line-height: 0; }
.prose sup a { text-decoration: none; padding: 0 2px; font-weight: 600; }
blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--gold);
  font-style: italic; color: var(--heading);
}
blockquote p { margin-bottom: .6em; }
blockquote footer { font-style: normal; font-size: 15px; color: var(--muted); }
blockquote footer::before { content: "— "; }
.footnotes { margin-top: 2.4em; padding-top: 1em; border-top: 1px solid var(--border); font-size: 15px; color: var(--muted); }
.footnotes a { font-weight: 600; margin-right: 6px; text-decoration: none; }

/* Two-column layout with a sidebar */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(40px, 6vw, 80px); align-items: start; }
.aside-box { background: var(--surface); border: 1px solid var(--border); padding: 24px; position: sticky; top: 100px; }
.aside-box h2 { font-size: 19px; margin-bottom: 14px; }
.aside-box dl { margin: 0; font-size: 16px; }
.aside-box dt { color: var(--muted); font-size: 14px; font-variant-caps: all-small-caps; letter-spacing: .1em; font-weight: 600; }
.aside-box dd { margin: 0 0 14px; color: var(--heading); }
.aside-box dd:last-child { margin-bottom: 0; }
.aside-photo { margin: 0 0 22px; }
.aside-photo img { width: 100%; max-width: 239px; background: #000; margin: 0 auto; }
@media (max-width: 900px) {
  .with-aside { grid-template-columns: minmax(0, 1fr); }
  .aside-box { position: static; }
  .with-aside > aside { order: -1; }
}

/* Book page */
.book { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(36px, 6vw, 72px); align-items: start; }
.book-cover { position: sticky; top: 100px; }
.book-cover img { width: 100%; max-width: 300px; aspect-ratio: var(--cover-ratio); object-fit: cover; box-shadow: 3px 0 0 rgba(0, 0, 0, .08), 12px 16px 30px var(--cover-shadow); }
.book-meta { margin: 30px 0 0; font-size: 15px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; }
.book-meta dt { color: var(--muted); }
.book-meta dd { margin: 0; color: var(--heading); overflow-wrap: anywhere; }
.book-authors { font-size: 19px; color: var(--heading); margin-bottom: 28px; }
.book-authors .role { color: var(--muted); font-style: italic; font-size: .9em; }
.book-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 16px; }
.book-nav a { text-decoration: none; display: flex; flex-direction: column; max-width: 48%; }
.book-nav a:hover span:last-child { text-decoration: underline; }
.book-nav .next { text-align: right; margin-left: auto; }
.book-nav small { color: var(--muted); font-size: 14px; }
.other-lang { margin-top: 28px; font-size: 16px; }
@media (max-width: 760px) {
  .book { grid-template-columns: minmax(0, 1fr); }
  .book-cover { position: static; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: start; }
  .book-meta { margin: 0; font-size: 14px; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .book-meta dd { margin-bottom: 8px; }
}
@media (max-width: 400px) { .book-cover { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; } }

/* Book list (books page) */
.book-list { list-style: none; margin: 0; padding: 0; }
.book-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 28px; padding: 30px 0; border-bottom: 1px solid var(--border); }
.book-row:first-child { padding-top: 0; }
.book-row img { width: 110px; aspect-ratio: var(--cover-ratio); object-fit: cover; box-shadow: 5px 6px 14px var(--cover-shadow); }
.book-row h3 { font-size: 23px; margin: 0 0 6px; }
.book-row h3 a { color: var(--heading); text-decoration: none; }
.book-row h3 a:hover { color: var(--accent); text-decoration: underline; }
.book-row .meta { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.book-row p { margin: 0; font-size: 16px; }
@media (max-width: 500px) { .book-row { grid-template-columns: 80px minmax(0, 1fr); gap: 18px; } .book-row img { width: 80px; } .book-row h3 { font-size: 20px; } }
.view-switch { display: flex; gap: 8px; }

/* Bibliography */
.bib-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
.bib-toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; font-size: 15px; padding-right: 6px; }
.bib-toc h2 { font-size: 15px; font-variant-caps: all-small-caps; letter-spacing: .1em; color: var(--muted); margin: 18px 0 6px; font-weight: 600; }
.bib-toc h2:first-child { margin-top: 0; }
.bib-toc ul { list-style: none; margin: 0; padding: 0; }
.bib-toc a { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; color: var(--text); text-decoration: none; line-height: 1.4; }
.bib-toc a:hover { color: var(--accent); }
.bib-toc .n { color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.bib-search { display: none; margin-bottom: 32px; }
.js .bib-search { display: block; }
.bib-search label { display: block; font-weight: 600; color: var(--heading); margin-bottom: 6px; }
.bib-search input {
  width: 100%; font: inherit; font-size: 17px; padding: 12px 14px 12px 44px;
  background: var(--surface) no-repeat 14px 50% / 20px; color: var(--heading);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.bib-search .field { position: relative; }
.bib-search .field .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.bib-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.bib-search .hint { font-size: 14px; color: var(--muted); margin: 8px 0 0; min-height: 1.5em; }
.bib-group > h2 { font-size: clamp(24px, 1.1rem + .9vw, 30px); padding-bottom: 12px; border-bottom: 3px double var(--border-strong); margin: 56px 0 0; }
.bib-group:first-child > h2 { margin-top: 0; }
.bib-type h3 { font-size: 18px; margin: 32px 0 12px; display: flex; gap: 10px; align-items: baseline; }
.bib-type h3 .code { color: var(--accent); font-variant-numeric: lining-nums tabular-nums; font-weight: 600; font-size: 15px; }
.bib-type h3 .n { color: var(--muted); font-weight: 400; font-size: 15px; }
.bib-type ol { margin: 0; padding-left: 3.2em; font-size: 16px; line-height: 1.6; }
.bib-type li { margin-bottom: 12px; padding-left: 4px; overflow-wrap: anywhere; }
.bib-type li::marker { color: var(--muted); font-size: 14px; font-variant-numeric: lining-nums tabular-nums; }
.bib-type .me { font-variant-caps: normal; font-weight: 600; color: var(--me); }
.bib-type mark { background: var(--mark); color: inherit; border-radius: 2px; }
.bib-type[hidden], .bib-group[hidden], .bib-type li[hidden] { display: none; }
.bib-empty { display: none; }
.bib-empty.show { display: block; color: var(--muted); font-style: italic; }
.bib-note { font-size: 14px; color: var(--muted); margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); }
@media (max-width: 900px) {
  .bib-layout { grid-template-columns: minmax(0, 1fr); }
  .bib-toc { position: static; max-height: none; border: 1px solid var(--border); background: var(--surface); padding: 16px 18px; }
  .bib-toc details summary { cursor: pointer; font-weight: 600; color: var(--heading); }
}
@media (max-width: 500px) { .bib-type ol { padding-left: 2.4em; font-size: 15px; } }
.bib-toc details > summary { list-style: none; }
.bib-toc details > summary::-webkit-details-marker { display: none; }
@media (min-width: 901px) { .bib-toc details > summary { display: none; } }

/* Projects */
.project-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin: 0; }
.project { padding: 22px 0; border-top: 1px solid var(--border); break-inside: avoid; }
.project h2 { font-size: 15px; font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: .1em; color: var(--accent); margin: 0 0 6px; }
.project p { margin: 0; font-size: 16px; }
.project .org { color: var(--heading); font-style: italic; }
@media (max-width: 760px) { .project-list { grid-template-columns: minmax(0, 1fr); } }

/* Research page lists */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 12px 0 12px 28px; border-bottom: 1px solid var(--border); position: relative; }
.plain-list li::before { content: ""; position: absolute; left: 4px; top: 1.15em; width: 8px; height: 8px; transform: rotate(45deg); border: 1px solid var(--gold); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.two-col h2 { font-size: 24px; }
@media (max-width: 760px) { .two-col { grid-template-columns: minmax(0, 1fr); gap: 36px; } }

/* Contact */
.contact-card { max-width: 640px; background: var(--surface); border: 1px solid var(--border); padding: clamp(24px, 4vw, 40px); box-shadow: 0 16px 40px -20px var(--shadow); }
.contact-card .email-big { font-size: clamp(20px, 1rem + 1vw, 26px); margin: 4px 0 24px; overflow-wrap: anywhere; }
.contact-card .email-big a { font-weight: 500; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.contact-list .icon { color: var(--accent); margin-top: 3px; }
.at { color: var(--muted); }

/* 404 */
.not-found { text-align: center; padding: clamp(72px, 10vw, 120px) 0; }
.not-found .code { font-size: clamp(90px, 15vw, 140px); font-weight: 300; line-height: 1; color: var(--border-strong); margin-bottom: 10px; font-variant-numeric: lining-nums; }
.not-found p { max-width: 520px; margin: 0 auto 28px; }

/* Footer (dark leather in both themes) */
.site-footer { background: var(--footer-bg); color: #cfc3b0; font-size: 16px; margin-top: auto; }
.site-footer a { color: #efe4d1; text-decoration-color: rgba(239, 228, 209, .35); }
.site-footer a:hover { color: #f3c9a8; }
.footer-top { padding: 56px 0 44px; border-top: 3px double #5a4633; }
.footer-top .container { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.footer-top h2 { color: #fff6e8; font-size: 15px; font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: .12em; margin-bottom: 14px; }
.footer-logo { margin-bottom: 16px; }
.footer-logo .logo, .footer-logo .logo:hover { color: #fff6e8; }
.footer-logo .logo-icon { color: #eb9b8a; }
.footer-logo .logo-ribbon { fill: #c9a65c; }
.footer-logo .logo-tag { color: #a99c88; }
.footer-about p { max-width: 360px; }
.footer-links { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.site-footer .at { color: #a99c88; }
.footer-bottom { background: var(--footer); padding: 18px 0; font-size: 14px; color: #a99c88; }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.footer-bottom ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; }
@media (max-width: 860px) { .footer-top .container { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 560px) { .footer-top .container { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* Back to top */
.to-top {
  position: fixed; right: 18px; bottom: 22px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--btn); color: var(--btn-text); border: 0; cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .3s, background .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--btn-hover); }
.to-top svg { width: 18px; height: 18px; fill: currentColor; }

/* Reveal on scroll (only with JS, so content never stays hidden) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .shelf-book img { transition: none; }
}

/* Responsive */
@media (max-width: 860px) {
  .hero .container { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .portrait { order: -1; justify-self: start; }
  .portrait img { width: 160px; }
  .portrait-frame { padding: 7px; }
  .portrait figcaption { display: none; }
}
@media (max-width: 560px) {
  .hero-actions .btn { flex: 1 1 auto; }
  .footer-bottom .container { flex-direction: column; align-items: flex-start; }
}

@media print {
  :root, :root[data-theme] { color-scheme: light; }
  .site-header, .site-footer, .to-top, .bib-toc, .bib-search, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
  .page-title { background: none; border: 0; padding: 0 0 12pt; }
  .bib-layout, .book, .with-aside { display: block; }
}

/* Small additions */
.h3 { font-size: 20px; line-height: 1.35; font-weight: 600; letter-spacing: 0; }
.after-cards { margin: 32px 0 0; }
.aside-links { list-style: none; margin: 0 0 18px; padding: 0; font-size: 16px; }
.aside-links li { padding: 8px 0; border-bottom: 1px solid var(--border); line-height: 1.4; }
.aside-links a { text-decoration: none; }
.aside-links a:hover { text-decoration: underline; }
.aside-links a[aria-current] { color: var(--heading); font-weight: 600; }
.aside-contact { font-size: 15px; margin: 0; overflow-wrap: anywhere; }
.not-found-actions { justify-content: center; }

/* Book orders: buy box, order form, payment page */
.buy-box { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 24px; margin: 0 0 32px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--gold); }
.buy-price { margin: 0; font-size: 28px; font-weight: 600; color: var(--heading); font-variant-numeric: lining-nums; white-space: nowrap; }
.buy-price span { font-size: 15px; font-weight: 400; color: var(--muted); }
.buy-text { margin: 0; font-size: 15px; grid-column: 2; grid-row: 1 / span 2; }
.buy-box .btn { justify-self: start; }
@media (max-width: 600px) { .buy-box { grid-template-columns: minmax(0, 1fr); } .buy-text { grid-column: 1; grid-row: auto; } }

.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 5vw, 64px); align-items: start; }
.order-form { max-width: 640px; }
.order-form fieldset { border: 0; padding: 0; margin: 0 0 28px; }
.order-form legend { font-size: 21px; font-weight: 600; color: var(--heading); margin-bottom: 8px; padding: 0; }
.order-form label { display: block; margin: 16px 0 6px; font-weight: 500; color: var(--heading); font-size: 16px; }
.order-form input:not([type="checkbox"]), .order-form select, .order-form textarea {
  width: 100%; font: inherit; font-size: 17px; padding: 11px 13px; color: var(--heading);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.order-form textarea { resize: vertical; }
.order-form input:focus, .order-form select:focus, .order-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.order-form [aria-invalid="true"] { border-color: var(--accent); }
.order-form .narrow-field { max-width: 160px; }
.field-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0 16px; }
.field-error { color: var(--accent); font-size: 15px; margin: 6px 0 0; font-weight: 500; }
.field-hint, .small { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.optional { font-weight: 400; color: var(--muted); font-size: 14px; }
.form-alert, .notice { padding: 14px 16px; margin-bottom: 24px; border: 1px solid var(--accent); border-left-width: 3px; background: var(--tint); color: var(--heading); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.order-form .check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 24px 0 0; }
.order-form .check input { width: 20px; height: 20px; margin-top: 4px; flex: none; accent-color: var(--btn); }
.order-form .btn { margin-top: 24px; }
.order-form details.company { margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface); }
.order-form details.company summary { cursor: pointer; font-weight: 500; color: var(--heading); }
.order-book { display: flex; gap: 18px; align-items: center; margin: 8px 0 4px; }
.order-cover { width: 84px; aspect-ratio: var(--cover-ratio); object-fit: cover; box-shadow: 4px 5px 12px var(--cover-shadow); }
.order-book-title { margin: 0 0 4px; font-weight: 600; color: var(--heading); font-size: 18px; line-height: 1.3; }
.order-book-meta { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.order-book-price { margin: 0; font-size: 20px; font-weight: 600; color: var(--heading); font-variant-numeric: lining-nums; }
.order-book-price span { font-size: 14px; font-weight: 400; color: var(--muted); }
.order-aside .aside-box { top: 100px; }
.steps-list { margin: 0 0 18px; padding-left: 1.3em; font-size: 16px; }
.steps-list li { margin-bottom: 8px; }
.steps-list li::marker { color: var(--accent); font-weight: 600; }
.price-list { display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 4px 16px; margin: 0 0 12px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 16px; }
.price-list dt { color: var(--muted); font-variant-caps: normal; letter-spacing: 0; font-size: 16px; font-weight: 400; }
.price-list dd { margin: 0; text-align: right; color: var(--heading); font-variant-numeric: lining-nums; }
@media (max-width: 900px) { .order-layout { grid-template-columns: minmax(0, 1fr); } .order-aside { order: -1; } }
@media (max-width: 420px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

.order-done { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
.pay-card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--btn); padding: 24px; }
.pay-card h2 { font-size: 22px; margin-bottom: 10px; }
.qr-box { background: #fff; padding: 6px; margin: 18px auto; max-width: 300px; border-radius: var(--radius); }
.qr-box svg { display: block; width: 100%; height: auto; }
.pay-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 12px 0 0; font-size: 15px; }
.pay-rows dt { color: var(--muted); }
.pay-rows dd { margin: 0; color: var(--heading); font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: lining-nums; }
@media (max-width: 860px) { .order-done { grid-template-columns: minmax(0, 1fr); } }

.form-sample { border: 1px dashed var(--border-strong); padding: 18px 20px; background: var(--surface); font-size: 16px; }
.form-sample p { margin: 0 0 10px; }
@media print { .qr-box { break-inside: avoid; } }
.page-note { margin: 10px 0 0; font-size: 16px; color: var(--muted); }

/* New book on the home page */
.new-book { padding: clamp(48px, 6vw, 80px) 0; border-top: 1px solid var(--border); background:
    radial-gradient(ellipse 50% 80% at 18% 50%, var(--tint), transparent 70%), var(--surface); }
.new-book .container { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.new-book-cover img { width: 100%; max-width: 260px; aspect-ratio: var(--cover-ratio); object-fit: cover; box-shadow: 3px 0 0 rgba(0, 0, 0, .08), 14px 18px 34px var(--cover-shadow); transform: rotate(-1.5deg); transition: transform .3s; }
.new-book-cover:hover img { transform: rotate(0deg) translateY(-4px); }
.new-book h2 { margin-bottom: 14px; }
.new-book h2 .title-sub { font-size: .55em; }
.new-book-lead { font-size: 18px; max-width: 620px; color: var(--heading); }
.new-book-price { font-size: 26px; font-weight: 600; color: var(--heading); margin: 6px 0 22px; font-variant-numeric: lining-nums; }
.new-book-price span { font-size: 15px; font-weight: 400; color: var(--muted); }
.badge-new { display: inline-block; background: var(--btn); color: var(--btn-text); font-variant-caps: normal; letter-spacing: .06em; font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 3px 8px 2px; border-radius: 3px; margin-right: 8px; vertical-align: 1px; }
@media (max-width: 700px) {
  .new-book .container { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .new-book-cover img { max-width: 180px; }
  .new-book-price span { display: block; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) { .new-book-cover img { transition: none; } }

/* Covers: one ratio for all; which part of a taller scan to keep */
.cover-img { object-position: 50% 50%; }
.cover-img.keep-top { object-position: 50% 0; }
.cover-img.keep-bottom { object-position: 50% 100%; }

/* Blog */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 24px; }
.post-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, box-shadow .2s; }
.post-card:has(a:hover) { border-color: var(--border-strong); box-shadow: 0 14px 30px -12px var(--shadow); }
.post-card-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px; }
.post-card time { font-size: 14px; color: var(--muted); margin-bottom: 8px; font-variant-numeric: lining-nums; }
.post-card h2, .post-card h3 { font-size: 21px; line-height: 1.3; margin: 0 0 10px; }
.post-card h2 a, .post-card h3 a { color: var(--heading); text-decoration: none; }
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; }   /* whole card clickable */
.post-card:has(a:hover) h2 a, .post-card:has(a:hover) h3 a { color: var(--accent); }
.post-card p { margin: 0 0 16px; font-size: 16px; }
.post-card .more-link { margin-top: auto; }
.post-layout { display: block; }
.post-body { margin: 0; }
.post-meta { color: var(--muted); font-size: 15px; margin-bottom: 24px; font-variant-numeric: lining-nums; }
.post-image { margin: 0 0 28px; }
.post-image img { width: 100%; }
.post-body img { max-width: 100%; height: auto; }
.post-body figure { margin: 28px 0; }
.post-body figcaption { font-size: 15px; color: var(--muted); margin-top: 8px; font-style: italic; }
.post-sign { margin-top: 32px; font-style: italic; color: var(--heading); }
.preview-banner { background: var(--gold); color: #1f1a14; text-align: center; padding: 10px 16px; font-weight: 600; font-size: 15px; }

/* Gallery */
.g-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 28px; }
.g-cat a { display: block; color: var(--heading); text-decoration: none; }
.g-cat-img { display: block; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.g-cat-img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .4s ease; }
.g-cat a:hover .g-cat-img img { transform: scale(1.03); }
.g-cat h2 { font-size: 22px; margin: 14px 0 2px; }
.g-cat a:hover h2 { color: var(--accent); }
.g-cat-count, .g-count { font-size: 15px; color: var(--muted); }
.g-count { margin: 0 0 18px; }
.g-cat p { margin: 8px 0 0; font-size: 16px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 46%), 1fr)); gap: 10px; }
.g-thumb { display: block; overflow: hidden; background: var(--surface); }
.g-thumb img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .35s ease, opacity .2s; }
.g-thumb:hover img, .g-thumb:focus-visible img { transform: scale(1.04); }
.g-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .g-thumb img, .g-cat-img img { transition: none; } }

.photo-section { padding-top: 32px; }
.photo-view { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.photo-main { margin: 0; }
.photo-main img { width: 100%; height: auto; max-height: 82vh; object-fit: contain; background: #0c0a08; }
.photo-main figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.photo-info h2 { font-size: 18px; margin-bottom: 12px; }
.exif { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0 0 18px; font-size: 15px; }
.exif dt { color: var(--muted); }
.exif dd { margin: 0; color: var(--heading); font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.photo-count { font-size: 15px; color: var(--muted); }
.photo-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-nav .btn { padding: 9px 16px; font-size: 15px; }
@media (max-width: 860px) { .photo-view { grid-template-columns: minmax(0, 1fr); } }

/* Lightbox (always dark) */
.lightbox { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(8, 7, 6, .96); color: #e9e2d6; overflow: hidden; }
.lightbox::backdrop { background: rgba(8, 7, 6, .96); }
.lightbox[open] { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 56px 64px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 112px); width: auto; height: auto; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.lb-panel { background: #15120e; border-left: 1px solid #2c261f; padding: 64px 24px 24px; overflow-y: auto; }
.lb-title { font-size: 21px; color: #fff6e8; margin: 0 0 6px; font-weight: 600; }
.lb-counter { font-size: 14px; color: #a99c88; margin: 0 0 20px; }
.lb-panel .exif dt { color: #a99c88; }
.lb-panel .exif dd { color: #f3ecdf; }
.lb-panel a { color: #f3c9a8; }
.lb-btn { position: absolute; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(30, 26, 21, .8); color: #f3ecdf; border: 1px solid #3a3229; cursor: pointer; font: 400 24px/1 var(--sans); }
.lb-btn:hover, .lb-btn:focus-visible { background: #2a241d; border-color: #c9a65c; }
.lb-btn:disabled { opacity: .3; cursor: default; }
.lb-close { top: 12px; right: 12px; position: fixed; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 860px) {
  .lightbox[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; overflow-y: auto; }
  .lb-stage { padding: 56px 8px 8px; }
  .lb-stage img { max-height: calc(100vh - 220px); }
  .lb-panel { border-left: 0; border-top: 1px solid #2c261f; padding: 16px 16px 24px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; width: 44px; height: 44px; }
}
html.lb-open { overflow: hidden; }

/* Footer credit: website by UgodneStrani.si (their logo icon, monochrome to suit this site) */
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.made-by { display: inline-flex; align-items: center; gap: 7px; color: #a99c88 !important; text-decoration: none; }
.made-by-icon { width: 22px; height: auto; color: #e3e7ee; flex: none; }
.made-by-name { color: #e3e7ee; letter-spacing: .02em; }
.made-by:hover .made-by-name { color: #f3c9a8; text-decoration: underline; text-underline-offset: .18em; }
