/* ===========================================================================
   CV — Gabriele Romanato
   Direzione: il CV di uno sviluppatore letto come un file sorgente ben
   formattato. Corpo umanista (Inter), display grottesco (Space Grotesk),
   e un filo di monospazio (JetBrains Mono) per le "meta" — etichette, date,
   eyebrow in stile commento di codice. La firma è la timeline-changelog.
   =========================================================================== */

:root {
  --bg:        #ffffff;
  --tint:      #f4f6fa;
  --ink:       #12151c;
  --muted:     #5a6472;
  --hair:      #e2e6ec;
  --accent:    #3b49df;
  --accent-sf: #eaecfb;

  --serif: "Space Grotesk", system-ui, sans-serif;
  --sans:  "Inter", system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 46rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--tint);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* --- shell --------------------------------------------------------------- */

.cv {
  max-width: var(--maxw);
  margin: 3.5rem auto;
  background: var(--bg);
  padding: 3.25rem 3rem 3.5rem;
  border: 1px solid var(--hair);
  border-radius: 4px;
}

/* --- header -------------------------------------------------------------- */

.head { margin-bottom: 2.5rem; }

.name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.85rem);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
}

.role {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin: 0.55rem 0 0;
  text-transform: lowercase;
}

.contacts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  padding: 0;
  margin: 1.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.contacts a { color: var(--muted); }
.contacts a:hover { color: var(--accent); }

/* --- section scaffolding ------------------------------------------------- */

.block { margin-top: 2.4rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--hair);
}

.summary { margin: 0; color: #2a2f38; }

/* --- timeline / changelog (la firma) ------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; }

.entry {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.25rem;
  padding: 0 0 1.6rem;
  position: relative;
}
.entry:not(:last-child) { border-left: 0; }

.when {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 0.2rem;
  white-space: nowrap;
}

.what { position: relative; padding-left: 1.15rem; }
/* riga verticale + tacca accent = look changelog */
.what::before {
  content: "";
  position: absolute;
  left: 0; top: 0.45rem;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.entry:not(:last-child) .what::after {
  content: "";
  position: absolute;
  left: 3px; top: 1rem; bottom: -1.6rem;
  width: 1px;
  background: var(--hair);
}

.what h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.what .org { color: var(--muted); font-weight: 500; }

.desc { margin: 0.35rem 0 0; color: #333a44; font-size: 0.94rem; }

.bullets { margin: 0.6rem 0 0; padding-left: 1.05rem; }
.bullets li { margin: 0.2rem 0; font-size: 0.92rem; color: #333a44; }

/* --- skills -------------------------------------------------------------- */

.skills { margin: 0; display: grid; gap: 0.7rem; }
.skill { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.25rem; align-items: baseline; }
.skill dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 0.1rem;
}
.skill dd { margin: 0; font-size: 0.94rem; }

/* --- projects ------------------------------------------------------------ */

.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.15rem; }
.projects h3 { font-family: var(--serif); font-weight: 600; font-size: 1rem; margin: 0; }
.projects .desc { font-size: 0.92rem; }
.projects .tags {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

/* --- education / languages ---------------------------------------------- */

.edu, .langs { list-style: none; margin: 0; padding: 0; }
.edu li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.25rem; padding: 0.25rem 0; }
.edu .when { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.edu .what { padding-left: 0; font-size: 0.94rem; }
.edu .what::before, .edu .what::after { display: none; }

.langs { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.langs li span { color: var(--muted); font-size: 0.86rem; }

/* --- download button ----------------------------------------------------- */

.dl {
  position: fixed;
  top: 1.25rem; right: 1.25rem;
  z-index: 10;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #fff;
  background: var(--accent);
  padding: 0.5rem 0.85rem;
  border-radius: 4px;
}
.dl:hover { text-decoration: none; opacity: 0.92; }

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 34rem) {
  .cv { margin: 0; border: 0; border-radius: 0; padding: 2rem 1.35rem 2.5rem; }
  .entry, .skill, .edu li { grid-template-columns: 1fr; gap: 0.35rem; }
  .what { padding-left: 1.15rem; }
  .when { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- stampa / PDF (A4) --------------------------------------------------- */

@page { size: A4; margin: 14mm; }

@media print {
  body { background: #fff; }
  .dl { display: none !important; }
  .cv { margin: 0; max-width: none; border: 0; border-radius: 0; padding: 0; }
  a { color: var(--ink); }
  .role, .eyebrow { color: var(--accent); }
  .block { break-inside: avoid; }
  .entry { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* classe .print (server-side, per il render headless) = identica a @media print
   applicata anche a schermo, così il renderer non dipende dall'emulazione media */
body.print { background: #fff; }
body.print .dl { display: none !important; }
body.print .cv { margin: 0; max-width: none; border: 0; border-radius: 0; padding: 0; }
