/* =========================================================
   Fabio Valentino — personal showcase
   Vanilla CSS, no dependencies
   ========================================================= */

:root {
  --bg: #070b18;
  --bg-soft: #0c1226;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e8ecf7;
  --muted: #9aa6c0;
  --accent: #5eead4;
  --accent-2: #818cf8;
  --accent-3: #f0abfc;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -30px rgba(2, 6, 23, 0.9);
  --maxw: 1120px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(15.5px, 0.35vw + 14.6px, 17px);
  line-height: 1.65;
  letter-spacing: 0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  padding: 12px 18px;
  background: var(--accent);
  color: #04121a;
  font-weight: 700;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- background ---------- */

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(129, 140, 248, 0.18), transparent 60%),
    radial-gradient(800px 500px at 88% 8%, rgba(94, 234, 212, 0.13), transparent 62%),
    linear-gradient(180deg, #070b18 0%, #080c1b 45%, #060a15 100%);
}

.glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.glow-a {
  top: -14vw;
  left: -12vw;
  background: radial-gradient(circle at 30% 30%, #6366f1, transparent 65%);
}
.glow-b {
  top: 22vw;
  right: -18vw;
  background: radial-gradient(circle at 60% 40%, #2dd4bf, transparent 62%);
  opacity: 0.24;
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 24, 0.55);
  border-bottom: 1px solid transparent;
  transition: background 240ms ease, border-color 240ms ease;
}
.site-header.scrolled {
  background: rgba(7, 11, 24, 0.86);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.22), rgba(129, 140, 248, 0.3));
  border: 1px solid rgba(94, 234, 212, 0.35);
  color: #c7fff5;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.brand-text { font-size: 15px; }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav a {
  position: relative;
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}
.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
  background: var(--surface);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: var(--text);
  border-radius: 2px;
  transition: transform 220ms ease, opacity 160ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- hero ---------- */

.hero {
  padding: clamp(56px, 11vw, 128px) 0 clamp(36px, 6vw, 72px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 26px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(12, 18, 38, 0.6);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.15);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.14); }
  50% { box-shadow: 0 0 0 7px rgba(94, 234, 212, 0.05); }
}

.hero h1 {
  margin: 0;
  font-size: clamp(44px, 9vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 780;
}
.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.role {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: clamp(14px, 1.7vw, 17px);
  color: var(--accent);
  letter-spacing: 0.02em;
}
.role::before { content: "> "; opacity: 0.55; }

.lede {
  max-width: 60ch;
  margin: 22px 0 0;
  color: #b6c0d8;
  font-size: clamp(16px, 1.6vw, 18.5px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 220ms ease, background 180ms ease, border-color 180ms ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(120deg, #7af3dd, #8b93ff);
  color: #06121a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 22px -14px rgba(45, 212, 191, 0.45); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(148, 163, 184, 0.45); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: clamp(42px, 6vw, 64px) 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}
.stat {
  padding: 20px 22px;
  background: rgba(9, 14, 30, 0.86);
}
.stat dt {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #7c89a8;
}
.stat dd {
  margin: 6px 0 0;
  font-size: clamp(15px, 1.7vw, 18px);
  font-weight: 600;
}
.stat .num { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- sections ---------- */

.section {
  padding: clamp(58px, 9vw, 104px) 0;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.section-head { margin-bottom: clamp(28px, 4vw, 46px); }
.kicker {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}
.section h2 {
  margin: 0;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--shadow);
}

/* ---------- profile ---------- */

.profile-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(18px, 2.6vw, 28px);
  align-items: start;
}

.prose p { margin: 0 0 14px; color: #bcc6dc; }
.prose p:last-child { margin-bottom: 0; }

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.facts li {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(12, 18, 38, 0.55);
  transition: border-color 180ms ease, background 180ms ease;
}
.facts li:hover { border-color: var(--border-strong); background: rgba(18, 26, 50, 0.7); }
.fact-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #7c89a8;
  margin-bottom: 4px;
}
.fact-value { display: block; font-weight: 600; font-size: 15.5px; }
.inline-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(94, 234, 212, 0.35); }
.inline-link:hover { border-bottom-color: var(--accent); }
.fact-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- timeline ---------- */

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 26px;
  display: grid;
  gap: 18px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.55), rgba(129, 140, 248, 0.35) 45%, transparent 96%);
}
.timeline > li { position: relative; }
.tl-dot {
  position: absolute;
  left: -26px;
  top: 26px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid rgba(94, 234, 212, 0.75);
  box-shadow: 0 0 0 4px rgba(7, 11, 24, 1);
}

.job { padding: clamp(20px, 2.6vw, 26px); transition: border-color 200ms ease, transform 200ms ease; }
.job:hover { border-color: var(--border-strong); transform: translateX(3px); }

.job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 18px;
}
.job h3 { margin: 0; font-size: 18.5px; letter-spacing: -0.01em; }
.company { margin: 3px 0 0; color: var(--accent); font-size: 14.5px; font-weight: 550; }
.sep { opacity: 0.4; }
.period {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.bullets {
  margin: 14px 0 0;
  padding: 0 0 0 18px;
  color: #b3bdd4;
  font-size: 15px;
}
.bullets li { margin: 5px 0; }
.bullets li::marker { color: rgba(94, 234, 212, 0.7); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 4.5px 10px;
  font-family: var(--mono);
  font-size: 11.8px;
  letter-spacing: 0.01em;
  color: #a7f3e7;
  background: rgba(94, 234, 212, 0.07);
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 7px;
}

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

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 22px);
}
.skill h3,
.strengths h3,
.languages h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16.5px;
  letter-spacing: -0.005em;
}
.skill-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(129, 140, 248, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: #c7cbfd;
  font-family: var(--mono);
  font-size: 12px;
}
.skill .tags { margin-top: 14px; }

.strengths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 22px);
  margin-top: clamp(16px, 2.2vw, 22px);
}
.card.soft {
  background: rgba(12, 18, 38, 0.5);
  box-shadow: none;
}
.card.soft h3 { font-size: 15.5px; color: #dfe6f5; }
.card.soft p { margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }

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

.two-col {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(16px, 2.2vw, 24px);
  align-items: start;
}

.edu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.edu .card { padding: 18px 20px; }
.edu .period { display: inline-block; margin-bottom: 8px; }
.edu h3 { margin: 0; font-size: 16px; font-weight: 620; }
.muted { color: var(--muted); }
.edu .muted { margin: 4px 0 0; font-size: 13.5px; }

.languages { padding: clamp(20px, 2.6vw, 26px); }
.lang { margin-top: 20px; }
.lang-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 7px;
}
.level {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: var(--p);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.lang-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}
.lang-detail strong { color: var(--text); font-family: var(--mono); font-size: 12.5px; }

/* ---------- contact ---------- */

.section-contact { border-top: none; padding-bottom: clamp(64px, 9vw, 112px); }
.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 56px);
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  background:
    radial-gradient(700px 260px at 8% 0%, rgba(94, 234, 212, 0.14), transparent 65%),
    radial-gradient(600px 300px at 95% 110%, rgba(129, 140, 248, 0.18), transparent 68%),
    rgba(10, 15, 32, 0.9);
  box-shadow: var(--shadow);
}
.contact-card h2 { margin: 0 0 12px; }
.contact-lede { max-width: 52ch; margin: 0; color: #b6c0d8; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.contact-meta {
  margin: 26px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  padding: 26px 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  font-size: 13.5px;
}
.footer-inner p { margin: 0; }
.to-top {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.to-top:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }

/* ---------- reveal ---------- */

/* Only the JS-enhanced page starts hidden, so the site stays readable
   if scripts are unavailable. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms cubic-bezier(0.22, 1, 0.36, 1), transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}
.js .reveal.visible { opacity: 1; transform: none; }

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

@media (max-width: 900px) {
  .profile-grid,
  .two-col { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .strengths { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: calc(100% + 10px);
    right: clamp(20px, 4vw, 40px);
    left: clamp(20px, 4vw, 40px);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    background: rgba(10, 15, 32, 0.97);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    box-shadow: 0 30px 60px -30px #000;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 11px 14px; }
  .header-inner { position: relative; }

  .stats { grid-template-columns: 1fr; }
  .strengths { grid-template-columns: 1fr; }
  .timeline { padding-left: 20px; }
  .tl-dot { left: -20px; }
  .job:hover { transform: none; }
  .hero { padding-top: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- print ---------- */

@media print {
  .bg-glow, .site-header, .nav-toggle, .to-top, .hero-actions, .contact-actions { display: none !important; }
  body { background: #fff; color: #111; }
  .card, .contact-card, .stats { box-shadow: none; background: #fff; border-color: #ccc; }
  .grad { color: #111; -webkit-text-fill-color: #111; }
  .section { break-inside: avoid; }
}
