/* mirceapetrache.cl — shared stylesheet. No external fonts or services. */

:root {
  --paper: #f6f7f9;
  --surface: #ffffff;
  --ink: #1a1f2b;
  --muted: #5b6372;
  --rule: #d9dde4;
  --accent: #2f5d8a;
  --lattice: #9fb2c9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161d;
    --surface: #171c25;
    --ink: #e6e9ee;
    --muted: #9aa3b2;
    --rule: #2a3140;
    --accent: #8db4dd;
    --lattice: #3c4b61;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

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

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

/* ---------- Header with lattice motif ---------- */

.masthead {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.masthead-inner {
  position: relative;
  max-width: 68rem;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 2.25rem;
}
.lattice {
  position: absolute;
  right: -2rem; top: 50%;
  width: min(34rem, 70%);
  transform: translateY(-50%);
  fill: var(--lattice);
  pointer-events: none;
}
.masthead .name {
  position: relative;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.masthead .name a { color: var(--ink); text-decoration: none; }
.masthead .affil {
  position: relative;
  margin: 0.5rem 0 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 32rem;
}

/* ---------- Layout ---------- */

.layout {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 3rem;
}

nav.site { font-family: var(--sans); font-size: 0.9rem; }
nav.site .nav-inner { position: sticky; top: 1.5rem; }
nav.site ul { list-style: none; margin: 0; padding: 0; }
nav.site details { margin-top: 1rem; }
nav.site summary { padding-left: 0.75rem; font-size: 0.8rem; color: var(--muted); cursor: pointer; margin-bottom: 0.25rem; list-style: none; }
nav.site summary::-webkit-details-marker { display: none; }
nav.site summary::after { content: " +"; }
nav.site details[open] summary::after { content: " \2212"; }
nav.site li { margin: 0; }
nav.site a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.75rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  text-decoration: none;
  line-height: 1.35;
}
nav.site a:hover { color: var(--ink); border-left-color: var(--muted); }
nav.site a[aria-current="page"] { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }

main { max-width: 44rem; min-width: 0; }

/* ---------- Typography ---------- */

h1 { font-size: 1.9rem; font-weight: 400; line-height: 1.2; margin: 0 0 1.25rem; }
h2 {
  font-size: 1.35rem; font-weight: 400; line-height: 1.3;
  margin: 2.5rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
h3 { font-size: 1.1rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
p { margin: 0 0 1rem; }
h1 + h2 { border-top: 0; padding-top: 0; margin-top: 1.5rem; }
ul, ol { padding-left: 1.4rem; margin: 0 0 1rem; }
li { margin-bottom: 0.45rem; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.lede { font-size: 1.15rem; }
strike, s { color: var(--muted); }

/* Paper lists keep the author's own codes (A11, D3, ...) in a gutter */
ol.papers { list-style: none; padding: 0; }
ol.papers li { display: grid; grid-template-columns: 2.8rem minmax(0, 1fr); gap: 0.5rem; margin-bottom: 0.9rem; }
ol.papers .code { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); padding-top: 0.15rem; font-variant-numeric: tabular-nums; }
.title { font-style: italic; }
.venue { color: var(--muted); }

dl.cv { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.4rem 1rem; margin: 0 0 1rem; }
dl.cv dt { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); padding-top: 0.15rem; }
dl.cv dd { margin: 0; }

.files { list-style: none; padding: 0; }
.files li::before { content: "PDF"; font-family: var(--sans); font-size: 0.7rem; color: var(--muted); border: 1px solid var(--rule); padding: 0 0.3rem; margin-right: 0.5rem; border-radius: 2px; vertical-align: 1px; }

.figure { margin: 1.5rem 0; }

.table-wrap { overflow-x: auto; }

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

footer.contact {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
}
footer.contact .inner { max-width: 68rem; margin: 0 auto; padding: 1.75rem 1.5rem 2.25rem; }
footer.contact p { margin: 0 0 0.3rem; }
footer.contact strong { color: var(--ink); font-weight: 600; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 1.25rem; }
  nav.site .nav-inner { position: static; }
  nav.site ul { display: flex; flex-wrap: wrap; gap: 0.35rem; }
  nav.site details { margin-top: 0.6rem; }
  nav.site summary { padding: 0.3rem 0; font-size: 0.85rem; }
  nav.site a { border-left: 0; border: 1px solid var(--rule); border-radius: 3px; padding: 0.3rem 0.6rem; background: var(--surface); }
  nav.site a[aria-current="page"] { border-color: var(--accent); }
  .lattice { opacity: 0.55; width: 90%; right: -30%; }
  dl.cv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.cv dd { margin-bottom: 0.75rem; }
}

@media print {
  nav.site, .lattice { display: none; }
  .layout { display: block; }
}
