/*
  Rafael Vrecar — CV website
  No external fonts, scripts, trackers, or third-party resources.

  Design tokens are kept at the top to make future changes easy.
*/
:root {
  --blue: #0e5484;
  --blue-dark: #0a4168;
  --ink: #30343a;
  --muted: #686f77;
  --line: #d9dde1;
  --surface: #f4f6f8;
  --white: #fff;
  --content-width: 1180px;
  --sidebar-width: 250px;
  --radius: 0.4rem;
  --shadow: 0 14px 40px rgb(29 45 58 / 8%);
  --font-sans: "Trebuchet MS", "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--blue-dark); }
a:focus-visible { outline: 3px solid rgb(14 84 132 / 35%); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: .75rem;
  left: .75rem;
  transform: translateY(-160%);
  padding: .65rem .85rem;
  color: var(--white);
  background: var(--ink);
}
.skip-link:focus { transform: none; }

.site-header {
  color: var(--white);
  background: var(--blue);
  border-bottom: .35rem solid var(--blue-dark);
}
.header-inner {
  width: min(var(--content-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.35rem 0 2rem;
}
.header-inner h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.45rem);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -.035em;
}
.header-inner h1 strong { font-weight: 700; }

.content-shell {
  width: min(860px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}
.content-shell .cv-section p { margin: 0 0 .8rem; }
.content-shell .cv-section p:last-child { margin-bottom: 0; }

.page-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  width: min(var(--content-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.25rem 0 4rem;
}

.sidebar { min-width: 0; }
.sidebar-sticky { position: sticky; top: 1.25rem; }
.portrait { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-lines { margin: 1.1rem 0 0; font-size: .86rem; line-height: 1.75; color: var(--muted); }
.link-list { display: flex; flex-direction: column; margin-top: 1.5rem; border-top: 1px solid var(--line); }
.link-list a { padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .86rem; text-decoration: none; }
.link-list a:last-child { border-bottom: none; }
.link-list a:hover { color: var(--blue-dark); text-decoration: underline; }
.main-content { min-width: 0; }
.cv-section { scroll-margin-top: 1rem; margin-bottom: 3.2rem; }
.cv-section > h2, .split-section h2 {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  line-height: 1.2;
  font-weight: 400;
}
.cv-section > h2::after, .split-section h2::after { content: ""; flex: 1; border-top: 1px solid var(--ink); }
.intro-section p { font-size: 1.04rem; }

.timeline { display: grid; gap: 1.15rem; }
.timeline-item {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 1.1rem;
  position: relative;
}
.timeline-item::before { content: ""; position: absolute; top: 0; bottom: -1.15rem; left: 7.72rem; width: 1px; background: var(--line); }
.timeline-item:last-child::before { bottom: 0; }
.timeline-date { margin: .1rem 0 0; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; text-align: right; }
.timeline-item > div { padding-left: .8rem; }
.timeline-item > div::before { content: ""; position: absolute; left: 7.49rem; top: .43rem; width: .48rem; height: .48rem; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--white); }
.timeline h3 { margin: 0; font-size: 1.02rem; line-height: 1.4; }
.timeline p { margin: .24rem 0 0; }
.meta { color: var(--muted); font-size: .82rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }

.split-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 3.8rem); }
.compact-list { margin: 0; padding-left: 1.15rem; }
.compact-list li { margin: .28rem 0; }
.subheading { margin: 2rem 0 .8rem; color: var(--blue); font-size: 1.05rem; }
.section-note { margin: -.6rem 0 1.25rem; color: var(--muted); font-size: .88rem; }

.detail-list { margin: .55rem 0 0; padding-left: 1.1rem; }
.detail-list li { margin: .28rem 0; }

.publications { margin: 0; padding-left: 1.4rem; }
.publications li { margin: 0 0 1rem; padding-left: .35rem; }
.publications li::marker { color: var(--blue); font-weight: 700; }

.site-footer { padding: 1.2rem 1rem; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); text-align: center; font-size: .78rem; }
.site-footer p { margin: 0; }

@media (max-width: 850px) {
  .page-shell { grid-template-columns: 1fr; gap: 2.2rem; }
  .sidebar-sticky { position: static; }
  .sidebar-top { display: flex; align-items: center; gap: 1.25rem; }
  .portrait { flex: 0 0 108px; width: 108px; }
  .contact-lines { margin: 0; }
  .link-list { flex-direction: row; flex-wrap: wrap; column-gap: 1.5rem; border-top: none; margin-top: 1.1rem; }
  .link-list a { border-bottom: none; padding: .2rem 0; }
}

@media (max-width: 620px) {
  .header-inner { padding: 1.8rem 0 1.55rem; }
  .page-shell { width: min(100% - 1.25rem, var(--content-width)); padding-top: 1.2rem; }
  .portrait { flex-basis: 84px; width: 84px; }
  .contact-lines { font-size: .82rem; }
  .split-section { grid-template-columns: 1fr; gap: 2.5rem; }
  .timeline-item { grid-template-columns: 1fr; gap: .15rem; }
  .timeline-date { text-align: left; color: var(--blue); font-weight: 700; }
  .timeline-item::before, .timeline-item > div::before { display: none; }
  .timeline-item > div { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  :root { --content-width: none; }
  body { font-size: 9.5pt; }
  .site-header { color: var(--ink); background: transparent; border-bottom: 2px solid var(--blue); }
  .header-inner { width: 100%; padding: 0 0 1rem; }
  .page-shell { width: 100%; grid-template-columns: 165px minmax(0, 1fr); gap: 1.8rem; padding: 1rem 0; }
  .sidebar-sticky { position: static; }
  .site-footer, .skip-link { display: none; }
  .portrait { box-shadow: none; }
  .cv-section { margin-bottom: 1.5rem; break-inside: auto; }
  .timeline-item, .publications li { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
