/* Fabiano Taioli — CV */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5f6570;
  --line: #e4e2dc;
  --accent: #0b6e6e;
  --accent-soft: #e3f1f0;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --surface: #1a1d21;
    --text: #e8e6e1;
    --muted: #9aa0a8;
    --line: #2c3036;
    --accent: #5cc8c0;
    --accent-soft: #173533;
  }
}

/* Language switch: show only the spans matching <html lang>. */
html[lang="it"] body [lang="en"],
html[lang="en"] body [lang="it"] { display: none !important; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); font-weight: normal; }
.lambda { color: var(--accent); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 1rem; height: 3.5rem; }
.brand { font-weight: 700; color: var(--text); letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.menu { display: flex; gap: 1.1rem; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: .92rem; }
.menu a { color: var(--muted); }
.menu a:hover { color: var(--text); text-decoration: none; }
.lang-toggle {
  font: 600 .8rem var(--font); letter-spacing: .05em;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .3rem .7rem; cursor: pointer;
}
.lang-toggle:hover { border-color: var(--accent); }

/* Hero */
.hero { display: grid; grid-template-columns: 160px 1fr; gap: 2rem; align-items: start; padding-top: 3.5rem; padding-bottom: 2rem; }
.avatar { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.hero h1 { font-size: 2.4rem; letter-spacing: -.02em; }
.role { color: var(--accent); font-weight: 600; margin: .35rem 0 1rem; }
.lead { font-size: 1.08rem; margin: 0 0 1rem; }
.facts { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; list-style: none; padding: 0; margin: 0 0 1.25rem; color: var(--muted); font-size: .95rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn {
  display: inline-block; padding: .55rem 1rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .92rem;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Highlights */
.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1rem; }
.hl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; font-size: .88rem; color: var(--muted); }
.hl strong { display: block; color: var(--text); font-size: 1.25rem; margin-bottom: .15rem; }

/* Sections */
.section { padding-top: 2.75rem; padding-bottom: .5rem; }
.section > h2 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .75rem;
}
.section > h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
h3.sub { font-size: 1rem; margin: 1.75rem 0 .4rem; }

/* Jobs & projects */
.job { margin-bottom: 1.75rem; }
.job-head, .project-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.job h3 { font-size: 1.25rem; }
.job-role { margin: .15rem 0 .6rem; font-weight: 600; }
.when { margin: 0; color: var(--muted); font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.job.compact p { margin-top: 0; }

.project {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1rem 0;
}
.project.compact { border-left-color: var(--line); }
.project h4 { font-size: 1.08rem; }
.client { margin: .3rem 0 0; font-size: .88rem; color: var(--muted); }
.project-role { margin: .2rem 0 .5rem; font-size: .9rem; font-weight: 600; color: var(--accent); }
.project p { margin-bottom: .5rem; }
.bullets { margin: .25rem 0 .6rem; padding-left: 1.15rem; }
.bullets li { margin: .3rem 0; }
.tags { font: .8rem/1.5 var(--mono); color: var(--muted); margin: .6rem 0 0 !important; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; }
.skill h3 { font-size: .95rem; margin-bottom: .3rem; }
.skill p { margin: 0; font-size: .92rem; color: var(--muted); }
.skill.wide { grid-column: 1 / -1; border-left: 3px solid var(--accent); }

/* Open source */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; color: var(--text); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card h3 { font-size: 1rem; font-family: var(--mono); display: flex; justify-content: space-between; align-items: center; }
.card p { margin: .35rem 0 0; font-size: .88rem; color: var(--muted); }
.lang-tag { font: 600 .7rem var(--font); background: var(--accent-soft); color: var(--accent); padding: .1rem .45rem; border-radius: 999px; }

/* Education */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { padding-top: .15rem; }
.timeline h3 { font-size: 1rem; }
.timeline p { margin: .15rem 0 0; font-size: .92rem; }

/* Footer */
.footer { padding-top: 2.5rem; padding-bottom: 2.5rem; color: var(--muted); font-size: .85rem; text-align: center; }

/* Responsive */
@media screen and (max-width: 760px) {
  .menu { display: none; }
  .lang-toggle { margin-left: auto; }
  .hero { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 2rem; }
  .avatar { width: 112px; height: 112px; }
  .hero h1 { font-size: 2rem; }
  .highlights { grid-template-columns: repeat(2, 1fr); }
  .skills, .cards { grid-template-columns: 1fr; }
  .job-head, .project-head { flex-direction: column; gap: .1rem; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
}

/* Print / PDF */
@media print {
  @page { size: A4; margin: 12mm; }
  :root {
    --bg: #fff; --surface: #fff; --text: #111; --muted: #555; --line: #ddd;
    --accent: #0b6e6e; --accent-soft: #e3f1f0;
  }
  body { font-size: 9.5pt; line-height: 1.4; }
  h2, h3, h4 { break-after: avoid; }
  .section > h2 + * { break-before: avoid; }
  .topbar, .no-print, .footer { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .hero { padding-top: 0; padding-bottom: .75rem; grid-template-columns: 90px 1fr; gap: 1.25rem; }
  .avatar { width: 90px; height: 90px; box-shadow: none; }
  .hero h1 { font-size: 20pt; }
  .lead { font-size: 10pt; }
  .highlights { display: none; }
  .section { padding-top: .6rem; }
  .job { margin-bottom: .8rem; }
  .job-role { margin-bottom: .3rem; }
  .section > p.muted { display: none; }
  h3.sub { margin-top: 1rem; }
  .section > h2 { margin-bottom: .6rem; }
  .project { padding: .6rem .8rem; margin: .5rem 0; }
  .project-head, .client, .project-role, .bullets li { break-inside: avoid; break-after: auto; }
  .project h4 { break-after: avoid; }
  .skills { grid-template-columns: repeat(2, 1fr); gap: .4rem; }
  .skill, .card { padding: .45rem .7rem; break-inside: avoid; }
  .cards { grid-template-columns: repeat(6, 1fr); gap: .4rem; }
  .card p { display: none; }
  .card h3 { font-size: 8.5pt; }
  .timeline li { break-inside: avoid; padding: .35rem 0; }
  .skill p, .timeline p { font-size: 8.8pt; }
  a { color: inherit; }
  #contact { display: none; }
}

/* Articles */
.articles { list-style: none; padding: 0; margin: 0 0 1rem; }
.articles li { display: grid; grid-template-columns: 3.5rem 1fr; gap: .75rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.articles li:last-child { border-bottom: 0; }
.articles .when { padding-top: .1rem; }
.articles .muted { font-size: .88rem; }
@media print {
  .articles li { padding: .15rem 0; font-size: 8.8pt; break-inside: avoid; }
  .articles .muted { font-size: inherit; }
}

/* Languages + interests side by side */
.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
@media screen and (max-width: 760px) { .extras { grid-template-columns: 1fr; } }
@media print { .extras p { font-size: 8.8pt; margin: .2rem 0 0; } .extras h3.sub { margin-top: .8rem; } }
