/* ============================================================
   Lorenzo Fiaschi — site styles
   Design tokens live in :root (light) and html[data-theme="dark"].
   Change the accent in ONE place and the whole site follows.
   ============================================================ */

:root {
  --bg:#f5f7f5; --surface:#ffffff; --ink:#152420; --muted:#5a6661; --line:#e2e8e4;
  --accent:#0f5c52; --accent-2:#0a3f38; --accent-soft:#e7f0ed;
  --side-grad: linear-gradient(165deg,#0e3a37,#0b2b29);
  --side-ink:#e6f1ec; --side-muted:#93b9b1; --side-line:rgba(255,255,255,.13);
  --shadow:0 1px 2px rgba(0,0,0,.04), 0 8px 30px rgba(15,92,82,.06);
  --serif:"Cambria", Georgia, "Times New Roman", serif;
  --sans:"Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono:"Cascadia Code", Consolas, ui-monospace, Menlo, monospace;
}
html[data-theme="dark"] {
  --bg:#0d1311; --surface:#141c19; --ink:#e7ede9; --muted:#94a39c; --line:#243029;
  --accent:#49b39d; --accent-2:#62c7b1; --accent-soft:#15302b;
  --side-grad: linear-gradient(165deg,#0c2b29,#081d1c);
  --shadow:0 1px 2px rgba(0,0,0,.3), 0 10px 34px rgba(0,0,0,.35);
}

* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  margin:0; background:var(--bg); color:var(--ink); font-family:var(--sans);
  line-height:1.6; -webkit-font-smoothing:antialiased;
  transition:background .3s, color .3s;
}
a { color:var(--accent); text-decoration:none; }
a:hover { color:var(--accent-2); text-decoration:underline; }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:3px; }
@media (prefers-reduced-motion: reduce) { *, html { transition:none !important; scroll-behavior:auto !important; } }

.skip-link {
  position:absolute; left:-9999px; top:0; background:var(--accent); color:#fff;
  padding:10px 16px; border-radius:0 0 8px 0; z-index:50;
}
.skip-link:focus { left:0; }

.page { display:grid; grid-template-columns:320px 1fr; min-height:100vh; max-width:1320px; margin:0 auto; }

/* ---------- Sidebar (pinned, non-scrolling, all info grouped) ---------- */
.side {
  background:var(--side-grad); color:var(--side-ink); padding:36px 28px;
  position:sticky; top:0; height:100vh; overflow:hidden; display:flex; flex-direction:column;
}
.s-name { font-family:var(--serif); font-size:1.55rem; text-align:center; margin:8px 0 0; line-height:1.15; }
.s-role { text-align:center; color:var(--side-muted); font-size:.9rem; margin:.4rem 0 0; }
.s-place { text-align:center; font-size:.84rem; margin:.4rem 0 0; line-height:1.45; }
.s-place a { color:#bfe0d8; }
.s-nav { margin:22px 0 6px; display:flex; flex-direction:column; gap:1px; }
.s-nav a { color:var(--side-ink); padding:7px 12px; border-radius:9px; font-size:.92rem; transition:background .15s, color .15s, box-shadow .15s; }
.s-nav a:hover { background:rgba(255,255,255,.08); text-decoration:none; }
.s-nav a.active { background:rgba(255,255,255,.11); color:#fff; box-shadow:inset 3px 0 0 #5fc9b6; }
.s-contact { margin-top:6px; border-top:1px solid var(--side-line); padding-top:12px; display:flex; flex-direction:column; gap:9px; font-size:.86rem; }
.s-contact a { color:var(--side-muted); display:flex; gap:9px; align-items:center; }
.s-contact a:hover { color:#fff; text-decoration:none; }
.s-contact .ic { width:18px; display:inline-flex; align-items:center; justify-content:center; opacity:.9; font-style:normal; }
.s-contact .ic-svg svg { display:block; }
.s-address { color:var(--side-muted); font-size:.8rem; line-height:1.5; margin:4px 0 0; }
.toggle {
  margin-top:8px; align-self:flex-start; background:transparent; color:var(--side-muted);
  border:1px solid var(--side-line); border-radius:999px; padding:6px 13px; font-size:.76rem;
  font-family:var(--mono); cursor:pointer; transition:color .2s, border-color .2s;
}
.toggle:hover { color:#fff; border-color:rgba(255,255,255,.4); }

/* ---------- Hero ---------- */
.hero { display:flex; gap:44px; align-items:flex-start; padding:56px 52px 40px; border-bottom:1px solid var(--line); }
.hero-text { flex:1 1 auto; min-width:0; }
.hero-photo { flex:0 0 auto; }
.hero-photo img { display:block; width:210px; height:250px; object-fit:cover; object-position:center top; border-radius:16px; box-shadow:var(--shadow); border:1px solid var(--line); }
.quote {
  margin:24px 0 0; padding:14px 0 14px 22px; border-left:3px solid var(--accent);
  font-family:var(--serif); font-style:italic; font-size:1.1rem; color:var(--muted); max-width:52ch;
}
.quote cite { display:block; font-style:normal; font-size:.82rem; font-family:var(--sans); margin-top:8px; color:var(--muted); letter-spacing:.02em; }
.hero-bio { font-size:1.12rem; line-height:1.7; color:var(--ink); margin:22px 0 0; max-width:60ch; }

/* ---------- Main column (single column) ---------- */
.main-col { padding:38px 52px 50px; }
.block { max-width:760px; margin-bottom:40px; scroll-margin-top:24px; }
.block:last-child { margin-bottom:0; }
h2 { font-family:var(--serif); font-size:1.35rem; margin:0 0 16px; padding-bottom:9px; border-bottom:2px solid var(--accent); display:inline-block; }
.subhead { font-family:var(--sans); font-size:.76rem; text-transform:uppercase; letter-spacing:.13em; color:var(--muted); margin:22px 0 6px; font-weight:700; }
.subhead:first-of-type { margin-top:6px; }
.lead { font-size:1.06rem; color:var(--ink); }
.entry { display:grid; grid-template-columns:1fr auto; gap:4px 18px; padding:12px 0; border-bottom:1px solid var(--line); }
.entry:last-child { border-bottom:none; }
.entry .h { font-weight:600; }
.entry .s { color:var(--muted); font-size:.92rem; }
.entry .y { color:var(--muted); font-size:.84rem; white-space:nowrap; font-family:var(--mono); font-variant-numeric:tabular-nums; }

/* News list */
.news-list .ni { display:grid; grid-template-columns:58px 1fr; gap:16px; padding:12px 0; border-bottom:1px solid var(--line); }
.news-list .ni:last-child { border-bottom:none; }
.ni .d { font-family:var(--mono); font-size:.78rem; color:var(--accent); letter-spacing:.04em; padding-top:2px; }
.ni .t { font-size:.96rem; line-height:1.5; }

/* CV section: heading + download button on one line */
.cv-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.cv-head h2 { margin:0; }
#cv { max-width:none; }                 /* CV section spans full width so the button reaches the page's right edge */
.cv-body { max-width:760px; }           /* keep experience & education at a readable width */
.btn-accent { display:inline-flex; align-items:center; background:var(--accent); color:#fff; padding:10px 16px; border-radius:9px; font-weight:600; font-size:.88rem; }
.btn-accent:hover { background:var(--accent-2); text-decoration:none; color:#fff; }

.site-footer { padding:22px 52px; border-top:1px solid var(--line); color:var(--muted); font-size:.8rem; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .page { grid-template-columns:1fr; }
  .side { position:static; height:auto; overflow:visible; }
  .s-nav { flex-direction:row; flex-wrap:wrap; justify-content:center; }
  .s-contact { flex-direction:row; flex-wrap:wrap; justify-content:center; align-items:center; }
  .s-address { width:100%; text-align:center; }
  .main-col { padding:32px 26px 50px; max-width:none; }
  .hero { flex-direction:column-reverse; align-items:flex-start; gap:24px; padding:40px 26px 30px; }
  .hero-photo img { width:150px; height:180px; }
  .site-footer { padding:22px 26px; }
}
