/* =============================================================================
   Marcos Lázaro Romão Silveira · portfolio
   Editorial layout: a twelve column grid, serif display type, hairline rules
   and a single cold blue accent. Dark is the default theme.
   ========================================================================== */

/* Fonts ---------------------------------------------------------------------- */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-roman.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Tokens --------------------------------------------------------------------- */

:root {
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* dark (default) */
  --bg: #0d0e0f;
  --bg-raised: #151618;
  --fg: #ebe8e1;
  --fg-muted: #a3a09a;
  --fg-faint: #817e78;
  --rule: #232427;
  --rule-strong: #36383c;
  --accent: #6ec3d8;
  --accent-soft: rgba(110, 195, 216, 0.12);
  --selection: rgba(110, 195, 216, 0.3);
  --flag-ring: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  --photo-filter: saturate(0.92) contrast(1.03);

  --maxw: 76rem;
  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
  --col-gap: clamp(1rem, 2.2vw, 2rem);
  --label-col: 8rem;
  --label-gap: clamp(1rem, 2vw, 1.75rem);
  --header-h: 4rem;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f2ed;
  --bg-raised: #fbfaf7;
  --fg: #151515;
  --fg-muted: #55534e;
  --fg-faint: #6c6963;
  --rule: #dcd8cf;
  --rule-strong: #c2bdb2;
  --accent: #0e7490;
  --accent-soft: rgba(14, 116, 144, 0.09);
  --selection: rgba(14, 116, 144, 0.2);
  --flag-ring: rgba(0, 0, 0, 0.12);
  --shadow: 0 18px 40px rgba(40, 34, 24, 0.12);
  --photo-filter: none;

  color-scheme: light;
}

/* Base ----------------------------------------------------------------------- */

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  font-kerning: normal;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: opacity 0.2s ease;
}

.lang-pending body { opacity: 0; }

.theme-anim,
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, fill 0.4s ease !important;
}

h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule-strong);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { text-decoration-color: currentColor; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
}

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

::selection {
  background: var(--selection);
  color: var(--fg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.875rem;
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0.5rem); }

/* controls that only work with JavaScript stay out of the way without it */
html:not(.js) .lang,
html:not(.js) .theme-toggle,
html:not(.js) .menu-button,
html:not(.js) .sort,
html:not(.js) .copy-button { display: none; }

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

/* Small uppercase label used across the page */
.label,
.masthead,
.facts dt,
.entry-date,
.subhead,
.sort-label,
.links-label {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* Header --------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.site-header.is-scrolled,
.site-header.nav-open {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom-color: var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  max-width: var(--maxw);
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-nav { margin-right: auto; }

.site-nav ul {
  display: flex;
  gap: clamp(1.25rem, 2.4vw, 2.25rem);
}

.site-nav a {
  position: relative;
  display: inline-block;
  padding-block: 0.5rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.25rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease);
}

.site-nav a:hover,
.site-nav a.is-active { color: var(--fg); }

.site-nav a:hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}


.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--fg-muted);
  transition: color 0.2s ease;
}
.icon-button:hover { color: var(--fg); }

@media (min-width: 45em) {
  .theme-toggle { margin-right: -0.5rem; }
}

.theme-toggle svg {
  grid-area: 1 / 1;
  transition: opacity 0.3s ease, transform 0.5s var(--ease);
}
:root:not([data-theme="light"]) .icon-moon,
:root[data-theme="light"] .icon-sun {
  opacity: 0;
  transform: rotate(-40deg) scale(0.7);
}

/* Language menu */

.lang { position: relative; }

.lang-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding-inline: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  transition: color 0.2s ease;
}
.lang-button:hover,
.lang-button[aria-expanded="true"] { color: var(--fg); }

.lang-button .chevron { transition: transform 0.35s var(--ease); }
.lang-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.flag {
  display: inline-block;
  flex: none;
  width: 1.125rem;
  height: 0.8rem;
  line-height: 0;
}
.flag svg {
  width: 100%;
  height: 100%;
  border-radius: 1.5px;
  box-shadow: 0 0 0 1px var(--flag-ring);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  min-width: 12rem;
  padding: 0.375rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow);
  animation: menu-in 0.2s var(--ease);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.625rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-align: left;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.lang-option:hover,
.lang-option:focus-visible {
  color: var(--fg);
  background: var(--accent-soft);
  outline: none;
}
.lang-option[aria-checked="true"] { color: var(--fg); }
.lang-option .check {
  margin-left: auto;
  color: var(--accent);
  opacity: 0;
}
.lang-option[aria-checked="true"] .check { opacity: 1; }

.menu-button {
  display: none;
  margin-right: auto;
  padding-block: 0.5rem;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  color: var(--fg);
}

/* Opening -------------------------------------------------------------------- */

.hero {
  padding-block: clamp(1.25rem, 3vw, 2.5rem) clamp(5rem, 11vw, 9rem);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--rule);
}

.masthead-place {
  display: flex;
  gap: 0.9rem;
}

.clock {
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.hero-grid {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: start;
}

.portrait { grid-column: 1 / span 3; }

.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--rule);
  filter: var(--photo-filter);
}

.hero-text { grid-column: 5 / span 7; }

.portrait-caption {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}

.portrait-name {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 430;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.portrait-degree {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--fg-faint);
  text-wrap: pretty;
}

.bio {
  max-width: 60ch;
  color: var(--fg-muted);
  text-wrap: pretty;
}
.bio p + p { margin-top: 1.1em; }

.bio p:first-child {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--fg);
}

.facts {
  max-width: 60ch;
  margin-top: 2.75rem;
  border-top: 1px solid var(--rule);
}

.facts > div {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  gap: var(--label-gap);
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--rule);
}

.facts dt { padding-top: 0.22rem; }
.facts dd { font-size: 0.9375rem; }

/* Sections ------------------------------------------------------------------- */

.section {
  padding-bottom: clamp(5rem, 11vw, 9rem);
}

.section-inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

/* hairline that opens each section, aligned to the text column */
.section-inner::before {
  content: "";
  grid-column: 1 / -1;
  padding-top: clamp(2.25rem, 5vw, 3.75rem);
  border-top: 1px solid var(--rule-strong);
}

.section-head {
  grid-column: 1 / span 4;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 2.25rem);
  padding-right: 1.5rem;
}

.section-body {
  grid-column: 5 / -1;
  min-width: 0;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 4.6vw, 3.75rem);
  font-weight: 330;
  line-height: 0.98;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

.count {
  position: relative;
  top: 0.4em;
  margin-left: 0.45em;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  vertical-align: top;
  color: var(--accent);
}

.section-dek {
  max-width: 28ch;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.section-note {
  max-width: 36ch;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--fg-faint);
  text-wrap: pretty;
}
.section-note:empty { display: none; }

.subhead {
  margin: clamp(3rem, 6vw, 4.5rem) 0 1rem;
}

/* Sort control */

.sort {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-top: 2.25rem;
  font-size: 0.875rem;
}

.sort-label {
  width: 100%;
  margin-bottom: 0.15rem;
}

.sort-option {
  position: relative;
  padding-block: 0.2rem;
  color: var(--fg-faint);
  transition: color 0.2s ease;
}
.sort-option:hover,
.sort-option[aria-pressed="true"] { color: var(--fg); }

.sort-option::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease);
}
.sort-option[aria-pressed="true"]::after { transform: scaleX(1); }

/* Index: the typographic list used for projects, publications and writing */

.index { border-top: 1px solid var(--rule); }

.entry {
  position: relative;
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr) auto;
  column-gap: var(--label-gap);
  padding-block: 1.375rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.entry-date {
  padding-top: 0.5rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.entry-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1.9vw, 1.5rem);
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
  text-wrap: balance;
  transition: color 0.25s ease;
}

.entry-link {
  color: inherit;
  text-decoration: none;
}

/* the whole row is clickable; secondary links sit above this layer */
.entry-link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.entry-link:focus-visible { outline: none; }
.entry-link:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.entry-arrow {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.35em;
  vertical-align: 0.14em;
  color: var(--accent);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.25s ease, transform 0.4s var(--ease);
}
.entry-arrow svg { width: 100%; height: 100%; }

.entry.has-link:hover .entry-title { color: var(--accent); }
.entry.has-link:hover .entry-arrow,
.entry.has-link:focus-within .entry-arrow {
  opacity: 1;
  transform: none;
}
.entry.has-link:hover .entry-date { color: var(--fg-muted); }

.entry-desc {
  max-width: 62ch;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-muted);
  text-wrap: pretty;
}
.entry-desc.is-empty {
  color: var(--fg-faint);
  font-style: italic;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.1rem;
  margin-top: 0.8rem;
  font-size: 0.8125rem;
  color: var(--fg-faint);
}

.entry-sublink {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
  color: var(--fg-muted);
  text-underline-offset: 0.25em;
}
.entry-sublink:hover { color: var(--accent); }
.entry-sublink svg {
  width: 0.62em;
  height: 0.62em;
  align-self: center;
}

.entry-aside {
  display: flex;
  gap: 1rem;
  padding-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--fg-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.stat svg {
  width: 0.8rem;
  height: 0.8rem;
}

.entry--empty,
.entry--soon { grid-template-columns: minmax(0, 1fr); }

.entry--soon { padding-block: 1.75rem 2rem; }

.entry-soon {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-style: italic;
  color: var(--fg-muted);
}

.entry-soon::before {
  content: "";
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-0.25em);
}

/* Publications */

.pub-authors {
  margin-top: 0.55rem;
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

.author-me {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.26em;
}

.pub-venue {
  margin-top: 0.2rem;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--fg-muted);
}

.pub-status {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--fg-muted);
}

/* Loading, error and stale states */

.status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.8125rem;
  color: var(--fg-faint);
}

.status-line.is-loading::before {
  content: "";
  align-self: center;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--accent);
  animation: breathe 1.4s ease-in-out infinite;
}

.entry--skeleton { animation: breathe 1.8s ease-in-out infinite; }
.entry--skeleton:nth-child(2) { animation-delay: 0.15s; }
.entry--skeleton:nth-child(3) { animation-delay: 0.3s; }
.entry--skeleton:nth-child(4) { animation-delay: 0.45s; }

.bar {
  display: block;
  height: 0.625rem;
  background: var(--rule);
}
.bar--date { width: 4rem; margin-top: 0.55rem; }
.bar--title { width: 42%; height: 1.1rem; margin-top: 0.35rem; }
.bar--text { width: 78%; margin-top: 0.9rem; }
.bar--meta { width: 28%; margin-top: 0.75rem; }

.notice {
  padding-block: 1.75rem 2rem;
  border-block: 1px solid var(--rule);
}

.notice-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.25;
}

.notice-body {
  max-width: 56ch;
  margin-top: 0.6rem;
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

.notice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.75rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

.text-button,
.text-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.25em;
  transition: color 0.2s ease;
}
.text-button:hover,
.text-link:hover { color: var(--accent); }
.text-link svg { width: 0.62em; height: 0.62em; align-self: center; }

.more-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  margin-left: calc(var(--label-col) + var(--label-gap));
  padding-block: 0.35rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  transition: color 0.2s ease;
}
.more-button:hover { color: var(--fg); }
.more-button svg { transition: transform 0.4s var(--ease); }
.more-button[aria-expanded="true"] svg { transform: rotate(180deg); }

.noscript {
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

/* Research */

.standfirst {
  max-width: 44ch;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1.95vw, 1.5rem);
  font-weight: 350;
  line-height: 1.42;
  letter-spacing: -0.008em;
  text-wrap: pretty;
}

.lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
  border-top: 1px solid var(--rule);
}

.lines li {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.lines-mark {
  flex: none;
  width: 0.9rem;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-style: italic;
  color: var(--accent);
}

/* Contact */

.contact-lead {
  max-width: 26ch;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 350;
  line-height: 1.22;
  letter-spacing: -0.018em;
  text-wrap: pretty;
}

.contact-body {
  max-width: 54ch;
  margin-top: 1.5rem;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.email {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.75rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.email-link {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 4.4vw, 3.25rem);
  font-weight: 330;
  line-height: 1.1;
  letter-spacing: -0.028em;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}
.email-link:hover { color: var(--accent); }

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-block: 0.35rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  transition: color 0.2s ease;
}
.copy-button:hover { color: var(--fg); }
.copy-button.is-done { color: var(--accent); }

.links { border-top: 1px solid var(--rule); }

.links a {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: var(--label-gap);
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.links-handle {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  transition: color 0.25s ease;
}

.links-arrow {
  width: 0.7rem;
  height: 0.7rem;
  align-self: center;
  color: var(--fg-faint);
  transition: transform 0.4s var(--ease), color 0.2s ease;
}
.links-arrow svg { width: 100%; height: 100%; }

.links a:hover .links-handle { color: var(--accent); }
.links a:hover .links-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* Footer --------------------------------------------------------------------- */

.site-footer { padding-bottom: 2.5rem; }

.footer-inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 0.75rem;
  align-items: baseline;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--fg-faint);
}

.footer-inner > p:first-child { grid-column: 1 / span 4; }

.colophon {
  grid-column: 5 / span 5;
  max-width: 52ch;
  text-wrap: pretty;
}

.to-top {
  grid-column: 10 / -1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg-muted);
  text-decoration: none;
}
.to-top:hover { color: var(--fg); }
.to-top svg { transition: transform 0.4s var(--ease); }
.to-top:hover svg { transform: translateY(-2px); }

/* Motion --------------------------------------------------------------------- */

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
}
@keyframes fade {
  from { opacity: 0; }
}
@keyframes breathe {
  50% { opacity: 0.4; }
}

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .js .masthead { animation: fade 0.9s ease both; }
  .js .hero-grid .portrait { animation: fade-up 1s var(--ease) 0.1s both; }
  .js .bio { animation: fade-up 1s var(--ease) 0.2s both; }
  .js .facts { animation: fade-up 1s var(--ease) 0.32s both; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .entry--skeleton,
  .status-line.is-loading::before { animation: none; }
}

/* Responsive ----------------------------------------------------------------- */

@media (max-width: 63.99em) {
  .section-head {
    grid-column: 1 / -1;
    position: static;
    padding-right: 0;
    margin-bottom: 2.75rem;
  }
  .section-body { grid-column: 1 / -1; }
  .section-dek,
  .section-note { max-width: 52ch; }

  .portrait { grid-column: 1 / span 4; }
  .hero-text { grid-column: 5 / -1; }

  .footer-inner > p:first-child { grid-column: 1 / span 6; }
  .colophon { grid-column: 1 / -1; grid-row: 2; }
  .to-top { grid-column: 7 / -1; }
}

@media (max-width: 44.99em) {
  :root { --header-h: 3.5rem; }

  body { font-size: 1rem; }

  .header-inner { gap: 1rem; }

  .menu-button { display: inline-flex; }
  .header-tools { margin-left: auto; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.25rem var(--gutter) 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: opacity 0.25s ease, transform 0.4s var(--ease), visibility 0s linear 0.4s;
  }
  .site-header.nav-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }
  .site-nav a {
    display: block;
    padding-block: 0.85rem;
    font-family: var(--font-serif);
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    color: var(--fg);
    border-bottom: 1px solid var(--rule);
  }
  .site-nav a::after { display: none; }
  .site-nav a.is-active { color: var(--accent); }

  :root { --label-col: 6.5rem; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .portrait {
    grid-column: 1;
    width: 11rem;
    margin-bottom: 2.25rem;
  }

  .bio p:first-child { font-size: 1.125rem; }
  .hero-text { grid-column: 1; }


  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry-date {
    padding-top: 0;
    margin-bottom: 0.4rem;
  }
  .entry-aside { padding-top: 0.65rem; }
  .bar--date { margin-top: 0; margin-bottom: 0.6rem; }
  .more-button { margin-left: 0; }

  .lines { grid-template-columns: minmax(0, 1fr); }

  .links a { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.15rem; }
  .footer-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .footer-inner > p:first-child,
  .to-top { grid-column: auto; }
  .links-label { grid-column: 1 / -1; }

  .bio,
  .entry-desc,
  .standfirst,
  .contact-body {
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}

@media (max-width: 24em) {
  .lang-code { display: none; }
}

/* Print ---------------------------------------------------------------------- */

@media print {
  :root,
  :root[data-theme="light"] {
    --bg: #fff;
    --fg: #000;
    --fg-muted: #333;
    --fg-faint: #555;
    --rule: #ccc;
    --rule-strong: #999;
    --accent: #000;
    --photo-filter: none;
  }
  .site-header,
  .skip-link,
  .sort,
  .more-button,
  .copy-button,
  .to-top,
  .entry-arrow { display: none !important; }
  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .section-head { position: static; }
  .section { break-inside: avoid-page; }
}
