/* Inter, ospitata qui (variabile, pesi 100-900): nessuna richiesta a Google Fonts. Licenza: assets/fonts/OFL-Inter.txt */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("assets/fonts/inter-latin.woff2") format("woff2"); }

/* Matteo Lubinu: minimal, black and white (same system as Ryuubi Studio) */

:root {
  --bg: #ffffff;
  --surface: #f7f7f6;
  --surface-2: #efefed;
  --text: #111111;
  --muted: #55595f;        /* 7:1 on white */
  --muted-2: #6b7078;      /* 4.9:1 on white, for meta text */
  --line: rgba(17, 17, 17, .10);
  --line-strong: rgba(17, 17, 17, .32);
  --btn: #111111;
  --btn-text: #ffffff;
  --focus: #111111;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
  --wide: 760px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e;
    --surface: #161616;
    --surface-2: #202020;
    --text: #f2f2f0;
    --muted: #b4b7bc;
    --muted-2: #8e939b;
    --line: rgba(255, 255, 255, .11);
    --line-strong: rgba(255, 255, 255, .34);
    --btn: #f2f2f0;
    --btn-text: #0e0e0e;
    --focus: #f2f2f0;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }

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

.skip { position: absolute; left: 16px; top: -48px; background: var(--btn); color: var(--btn-text); padding: 10px 16px; border-radius: 8px; z-index: 10; text-decoration: none; font-size: .9rem; }
.skip:focus { top: 16px; }

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

.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 24px; }
.wordmark { font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; font-size: .95rem; color: var(--muted); padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; font-size: .95rem; font-weight: 500; text-decoration: none; border: 1px solid var(--line-strong); color: var(--text); transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }
.btn-primary:hover { background: var(--btn); opacity: .85; }

/* ---------- Hero ---------- */

.hero, .page-hero { border-top: 0; }
.hero { padding: 72px 0 80px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); margin-bottom: 28px; }
.hero h1 { font-size: clamp(2.1rem, 6.2vw, 3.4rem); line-height: 1.08; letter-spacing: -.035em; max-width: 18ch; }
.hero h1 span { color: var(--muted-2); }
.lede { color: var(--muted); font-size: 1.15rem; line-height: 1.55; max-width: 52ch; margin: 24px 0 0; }

/* ---------- Sections ---------- */

section { padding: 56px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { font-size: 1.5rem; }
.section-head a { font-size: .92rem; color: var(--muted); display: inline-block; padding: 8px 0; }
.kicker { font-size: .78rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 14px; }

/* ---------- Work ---------- */

.work-list { display: grid; gap: 16px; }

.project { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 20px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, transform .15s; }
.project:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.project:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }

.project-icon { width: 64px; height: 64px; border-radius: 15px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.project-tags { font-size: .82rem; color: var(--muted-2); margin: 0 0 6px; }
.project h3 { font-size: 1.3rem; }
.project-link { text-decoration: none; }
.project-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.project p.desc { margin: 8px 0 0; color: var(--muted); font-size: 1rem; }
.project-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; font-size: .92rem; font-weight: 500; }
.project-actions a { display: inline-block; padding: 8px 0; text-decoration-color: var(--line-strong); }
.project-actions a:hover { text-decoration-color: currentColor; }
.project-actions .soon { font-weight: 400; color: var(--muted-2); }

/* ---------- Professional work ---------- */

.pro { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.pro p { color: var(--muted); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chips li { font-size: .88rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.pro h3 { font-size: 1.15rem; margin-bottom: 10px; }

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

.contact { text-align: left; }
.contact h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -.03em; max-width: 16ch; }
.contact p { color: var(--muted); max-width: 46ch; margin-top: 14px; }

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

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: .88rem; color: var(--muted-2); }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { display: inline-block; padding: 10px 0; text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* ---------- About ---------- */

.page-hero { padding: 40px 0 56px; }
.page-hero .intro { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }
.page-hero .avatar { margin: 0; width: 96px; height: 96px; }
.page-hero h1 { font-size: clamp(2rem, 5.5vw, 3rem); letter-spacing: -.035em; }
.page-hero .role { color: var(--muted-2); margin: 6px 0 0; font-size: 1rem; }

.prose { max-width: 62ch; }
.prose p { color: var(--muted); }
.prose p:first-child { color: var(--text); font-size: 1.2rem; line-height: 1.5; }
.prose strong { color: var(--text); font-weight: 500; }

.xp-list { list-style: none; margin: 0; padding: 0; }
.xp-company { display: grid; grid-template-columns: 200px 1fr; gap: 8px 40px; padding: 32px 0; border-top: 1px solid var(--line); }
.xp-company:first-child { border-top: 0; padding-top: 0; }
.xp-side h3 { font-size: 1.1rem; }
.xp-total { color: var(--muted-2); font-size: .88rem; margin: 4px 0 0; }
.xp-role { padding: 0 0 20px; }
.xp-role:last-child { padding-bottom: 0; }
.xp-role h4 { font-size: 1.05rem; }
.xp-meta { color: var(--muted-2); font-size: .88rem; margin: 2px 0 10px; }
.xp-role ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: .96rem; }
.xp-role li { margin-bottom: 6px; padding-left: 2px; }
.xp-role li::marker { color: var(--muted-2); }

.outside { color: var(--muted); max-width: 52ch; margin: 0; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .wordmark { white-space: nowrap; font-size: 1rem; }
  .nav a { padding: 8px 10px; }
  .hero { padding: 48px 0 56px; }
  section { padding: 44px 0; }
  .project { grid-template-columns: 52px 1fr; gap: 16px; padding: 20px; }
  .project-icon { width: 52px; height: 52px; border-radius: 12px; }
  .pro { grid-template-columns: 1fr; gap: 28px; }
  .xp-company { grid-template-columns: 1fr; gap: 4px; }
  .xp-side { margin-bottom: 14px; }
  .page-hero .intro { flex-direction: column; align-items: flex-start; gap: 16px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
