/* ============================================================
   Antonio Russo — Portfolio
   Design ispirato a "elegant resume": carta bianca, accento blu,
   tipografia grottesca, regole sottili, etichette maiuscole.
   ============================================================ */

:root {
  --ink: #171a2b;
  --ink-soft: #4a4f63;
  --paper: #ffffff;
  --bg: #edebe5;
  --bg-alt: #e4e1d8;
  --accent: #2743c7;
  --accent-deep: #16246e;
  --line: #d5d2c8;
  --radius: 14px;
  --shadow: 0 18px 50px -18px rgba(23, 26, 43, .25);
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; }

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

/* ---------- chip / etichetta blu (come nel mockup) ---------- */
.chip {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: 6px 18px;
  margin-bottom: 18px;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(237, 235, 229, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .03em;
}

.nav { display: flex; gap: 26px; }
.nav a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav a:hover, .nav a.active { color: var(--accent); text-decoration: none; }

/* ---------- bottoni ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 12px 26px;
  border: 2px solid var(--accent);
  transition: all .2s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn-ghost { color: var(--accent); background: transparent; }
.btn-ghost:hover { background: var(--accent); color: #fff; }

.topbar .btn { padding: 9px 20px; font-size: 13px; }

/* ---------- hero ---------- */
.hero { padding: 90px 0 70px; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 60px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(52px, 8vw, 88px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.hero h1 em { font-style: normal; color: var(--accent); }

.hero-sub {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 14px 0 26px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

.hero-bio { max-width: 560px; color: var(--ink-soft); font-size: 17px; }

.hero-actions { display: flex; gap: 14px; margin: 30px 0; flex-wrap: wrap; }

.hero-contacts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-size: 14px;
  color: var(--ink-soft);
}
.hero-contacts a { color: var(--ink-soft); }
.hero-contacts a:hover { color: var(--accent); }

.hero-photo { position: relative; justify-self: end; }

.photo-frame {
  width: min(320px, 70vw);
  aspect-ratio: 4 / 5;
  background: var(--paper);
  padding: 14px 14px 0;
  box-shadow: var(--shadow);
  position: relative;
}
.photo-frame::before {
  content: "";
  position: absolute;
  inset: -16px 16px auto -16px;
  height: 100%;
  border: 2px solid var(--accent);
  z-index: -1;
}
.photo-frame img {
  width: 100%;
  height: calc(100% - 14px);
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}

.photo-caption {
  position: absolute;
  bottom: -26px;
  left: -30px;
  background: var(--accent);
  color: #fff;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.photo-caption .num { font-family: var(--font-display); font-size: 34px; font-weight: 800; }
.photo-caption .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; line-height: 1.35; }

/* ---------- sezioni ---------- */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }

.section-head { margin-bottom: 48px; }
.section-head h2 {
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 800;
  text-transform: uppercase;
}
.section-sub { color: var(--ink-soft); margin-top: 12px; max-width: 640px; }

/* ---------- CV "paper" ---------- */
.paper {
  background: var(--paper);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  border-top: 6px solid var(--accent);
}

.paper-col { padding: 48px 44px; }
.paper-side { border-left: 1px solid var(--line); background: #fbfaf7; }

.paper-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding-bottom: 12px;
  margin-bottom: 26px;
  border-bottom: 2px solid var(--ink);
}
.paper-col > .paper-title:not(:first-child) { margin-top: 44px; }

.job { margin-bottom: 34px; }
.job:last-child { margin-bottom: 0; }
.job h4 { font-size: 17px; font-weight: 700; }
.job h4 span { color: var(--accent); font-weight: 600; }
.job-date {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 4px 0 12px;
}
.job ul { list-style: none; }
.job li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.job li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  background: var(--accent);
}

.edu { margin-bottom: 10px; }
.edu h4 { font-size: 16px; }
.edu p { font-size: 14px; color: var(--ink-soft); }

/* barre competenze (come nel mockup) */
.skills { list-style: none; }
.skills li { margin-bottom: 16px; }
.skills span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.skills i {
  display: block;
  height: 5px;
  background: var(--line);
  position: relative;
}
.skills i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--v, 50%);
  background: var(--accent);
}
.skills i::after {
  content: "";
  position: absolute;
  left: var(--v, 50%);
  top: 50%;
  width: 11px;
  height: 11px;
  background: var(--accent-deep);
  transform: translate(-50%, -50%) rotate(45deg);
}

.quote {
  margin-top: 40px;
  padding: 22px 24px;
  background: #eef1fb;
  color: var(--ink-soft);
  font-size: 14.5px;
  font-style: italic;
  position: relative;
}
.quote::before {
  content: "\201C";
  font-family: Georgia, serif;
  font-size: 54px;
  color: var(--accent);
  position: absolute;
  top: -8px;
  left: 10px;
  line-height: 1;
}

.cv-download { text-align: center; margin-top: 44px; }

/* ---------- griglie ---------- */
.grid { display: grid; gap: 26px; }
.grid-portfolio { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-software { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* card portfolio */
.card {
  background: var(--paper);
  box-shadow: 0 10px 32px -14px rgba(23, 26, 43, .18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }

.card-cover {
  height: 150px;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--cover, linear-gradient(135deg, #2743c7, #16246e));
}
.card-cover img { width: 64px; height: 64px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.card-cover .cover-type {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 4px 10px;
  backdrop-filter: blur(4px);
}

.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { font-size: 19px; font-weight: 700; }
.card-body p { font-size: 14px; color: var(--ink-soft); flex: 1; }

.stack { display: flex; flex-wrap: wrap; gap: 6px; }
.stack span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-deep);
  background: #e9edfa;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* card software */
.repo {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.repo:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.repo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.repo-head h3 { font-size: 17px; font-weight: 700; }
.repo-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.repo-lang::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lang-color, #888);
}
.repo p { font-size: 13.5px; color: var(--ink-soft); flex: 1; }
.repo-link { font-size: 13px; font-weight: 600; }

/* ---------- footer ---------- */
.footer { background: var(--accent-deep); color: #fff; padding: 70px 0 0; }

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  padding-bottom: 50px;
}
.footer h2 { font-size: clamp(30px, 4vw, 44px); text-transform: uppercase; font-weight: 800; }
.footer p { color: #b8c1e8; margin-top: 8px; }

.footer-links { list-style: none; display: grid; gap: 10px; }
.footer-links a {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,.25);
  padding-bottom: 2px;
}
.footer-links a:hover { text-decoration: none; border-color: #fff; }

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  padding-bottom: 22px;
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: 13px;
  color: #93a0d6;
}

/* ---------- modal verifica download CV ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 26, 43, .55);
  backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }

.modal-card {
  position: relative;
  background: var(--paper);
  border-top: 6px solid var(--accent);
  box-shadow: var(--shadow);
  padding: 36px 40px;
  max-width: 420px;
  width: 100%;
}
.modal-card h3 {
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.modal-card > p { font-size: 14px; color: var(--ink-soft); margin-bottom: 20px; }

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: none;
  font-size: 26px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--ink); }

.captcha-q {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}
.captcha-q b { color: var(--accent); font-size: 20px; }

.captcha-row { display: flex; gap: 10px; }
.captcha-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 10px 14px;
  border: 2px solid var(--line);
  outline: none;
}
.captcha-row input:focus { border-color: var(--accent); }

.captcha-err { margin-top: 10px; font-size: 13px; color: #b91c1c; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 70px; }
  .hero-photo { justify-self: start; margin-left: 30px; }
  .paper { grid-template-columns: 1fr; }
  .paper-side { border-left: 0; border-top: 1px solid var(--line); }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav { display: none; }
  .hero { padding-top: 50px; }
  .paper-col { padding: 34px 26px; }
}
