/* ==========================================================================
   Paolo Brunasti — personal site
   Minimal & clean, light/dark via prefers-color-scheme
   ========================================================================== */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #62625d;
  --faint: #8c8c86;
  --line: #e6e3dc;
  --accent: #1f6f66;
  --accent-soft: #e4f0ee;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --max: 46rem;
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151614;
    --surface: #1c1d1b;
    --text: #ecebe6;
    --muted: #a8a7a0;
    --faint: #7d7c76;
    --line: #2d2e2b;
    --accent: #6cc2b6;
    --accent-soft: #1f2f2c;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .95rem;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: .25rem 0;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.nav .lang a {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  padding: .1rem .45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.nav .lang a:hover { border-color: var(--accent); }

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

main { padding: 3rem 0 4rem; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: 0 0 .5rem; }
h2 {
  font-size: 1.45rem;
  margin: 3.5rem 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
h3 { font-size: 1.15rem; margin: 0; }

p { margin: 0 0 1rem; }

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 2rem;
}
.eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .5rem;
}
.muted { color: var(--muted); }

/* ---------- Home hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}
.hero img {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.hero .headline {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 .25rem;
}
.hero .location { font-size: .95rem; color: var(--faint); margin: 0; }

@media (min-width: 40rem) {
  .hero { grid-template-columns: auto 1fr; }
  .hero img { width: 11rem; height: 11rem; }
}

.bio p:first-child { font-size: 1.15rem; }

/* ---------- Tags ---------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  font-size: .85rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
}
.tags.small li {
  font-size: .78rem;
  padding: .1rem .55rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.more { margin: 1rem 0 0; font-size: .95rem; }

/* ---------- Skill groups ---------- */

.skill-groups {
  display: grid;
  gap: 2.25rem;
}
.skill-group h3 { margin-bottom: .35rem; }
.skill-group p {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: .8rem;
}

/* ---------- Simple definition rows (languages, education) ---------- */

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rows li {
  display: grid;
  grid-template-columns: 1fr;
  gap: .1rem 1.5rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
.rows li:last-child { border-bottom: 0; }
.rows .when {
  color: var(--faint);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 36rem) {
  .rows li { grid-template-columns: 8.5rem 1fr; }
}

/* ---------- Timeline (experience) ---------- */

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}
.timeline > li {
  position: relative;
  padding: 0 0 2.25rem 1.5rem;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: .5rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline > li.current::before { background: var(--accent); }
.timeline .when {
  display: block;
  font-size: .85rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  margin-bottom: .15rem;
}
.timeline .org {
  color: var(--muted);
  font-size: .95rem;
  margin: .1rem 0 .6rem;
}
.timeline p { margin-bottom: .6rem; }
.timeline ul.points {
  margin: 0 0 .75rem;
  padding-left: 1.1rem;
}
.timeline ul.points li { margin-bottom: .2rem; }

details {
  margin: .25rem 0 .75rem;
}
summary {
  cursor: pointer;
  color: var(--accent);
  font-size: .9rem;
  width: fit-content;
}
details[open] summary { margin-bottom: .5rem; }

/* ---------- Cards (projects, talks) ---------- */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 40rem) {
  .cards.two { grid-template-columns: 1fr 1fr; }
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
}
.card .client {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .3rem;
}
.card h3 { margin-bottom: .5rem; }
.card p { font-size: .95rem; color: var(--muted); margin: 0; }
.card .meta {
  font-size: .9rem;
  color: var(--faint);
  margin: 0 0 .6rem;
}
.card .link { margin-top: .9rem; font-size: .95rem; }

/* ---------- Contact ---------- */

.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: .1rem 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.contact-list li:last-child { border-bottom: 0; }
.contact-list .label {
  font-size: .85rem;
  color: var(--faint);
}
.contact-list a { word-break: break-word; }
@media (min-width: 36rem) {
  .contact-list li { grid-template-columns: 8.5rem 1fr; }
}

.button {
  display: inline-block;
  padding: .6rem 1.1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
}
.button:hover { opacity: .9; }
.button.ghost {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

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

.site-footer {
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--faint);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}
.site-footer a { color: var(--muted); }

@media print {
  .site-header .nav, .site-footer, .actions { display: none; }
  details > *:not(summary) { display: block; }
  body { background: #fff; color: #000; }
}
