@font-face {
  font-family: "Instrument Serif";
  src: url("./fonts/instrument-serif-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("./fonts/instrument-serif-italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f4e9;
  --ink: #27271f;
  --muted: #6d6b60;
  --accent: #85352c;
  --rule: #c9c6b8;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

* { box-sizing: border-box; }
body { margin: 0; }
::selection { background: #dcd5be; color: var(--ink); }
a { color: inherit; }

.page {
  width: min(100% - 7rem, 65rem);
  margin-inline: auto;
}

.title-page { text-align: center; padding-top: 2rem; }
h1 { font-weight: 400; font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h1 span { display: inline; }
h1 .surname { font-style: italic; }
.subtitle { font-size: 1.125rem; color: var(--muted); margin: 0.5rem 0 0; }
.about-control { display: flex; justify-content: center; margin: 1.6rem 0 2.2rem; }
.about-toggle {
  --profile-width: min(24rem, calc(100vw - 2.5rem));
  position: relative;
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.about-symbol { display: grid; place-items: center; width: 100%; height: 100%; font-size: 2.6rem; font-style: italic; line-height: 1; }
.about-profile {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 0.45rem;
  width: var(--profile-width);
  padding: 1.1rem 1.5rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  text-align: center;
  visibility: hidden;
}
.profile-position { font-size: 1.4rem; line-height: 1.15; overflow-wrap: anywhere; }
.profile-workplace { font: 0.875rem/1.5 var(--sans); color: var(--muted); overflow-wrap: anywhere; }
.about-toggle[data-expanded="true"] .about-symbol { visibility: hidden; }
.about-toggle[data-expanded="true"] .about-profile { visibility: visible; }
.about-toggle[data-animating="true"] .about-symbol,
.about-toggle[data-animating="true"] .about-profile { visibility: hidden; }
.about-pixels { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; pointer-events: none; }
.about-toggle[data-animating="true"] .about-pixels { visibility: visible; }
.about-toggle:hover .about-symbol { color: var(--accent); }
.about-toggle:hover .about-profile { border-color: var(--muted); }
.about-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

.project-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.08em 0.2em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(1.75rem, 4.1vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.013em;
  text-align: left;
}

.project-index li { display: inline-flex; align-items: baseline; gap: 0.2em; white-space: nowrap; }
.project-separator { align-self: center; font-family: var(--serif); font-size: 0.42em; line-height: 1; color: var(--ink); user-select: none; }
.project-reference {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.105em;
  white-space: nowrap;
  transition: color 160ms ease;
}

.project-reference:hover { color: var(--ink); }
.project-reference[aria-disabled="true"] { cursor: default; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 1px; }
.colophon { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.3rem 1.5rem; margin-top: 2rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.75rem; color: var(--muted); }
.skip-link { position: fixed; top: 0.6rem; left: 0.6rem; z-index: 1; padding: 0.8rem 1rem; background: var(--ink); color: var(--paper); font: 1rem var(--sans); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }

@media (min-width: 1600px) {
  .page { width: min(100% - 8rem, 72rem); }
}

@media (max-width: 600px) {
  .page { width: calc(100% - 2.5rem); }
  .title-page { padding-top: 1.75rem; }
  h1 { font-size: 1.75rem; }
  .about-control { margin: 1.4rem 0 1.8rem; }
  .about-symbol { font-size: 2.4rem; }
  .colophon { flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; line-height: 1.5; }
  .colophon span:last-child { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  * { transition: none !important; }
}
