/* ============================================================
   DANIELE PESCATORE – PORTFOLIO
   Main stylesheet
   ============================================================ */

/* === RESET & VARIABLES === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --dark:   transparent;
  --dark2:  rgba(22, 30, 48, .5);
  --dark3:  rgba(28, 38, 60, .76);
  --accent: #88adff;
  --accent2:#c19cff;
  --text:   #f6f8ff;
  --muted:  #bcc6dc;
  --border: #364263;
  --card:   #1c2539;
  --radius: 14px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #121a2b;
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* === NAVIGATION === */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 20, 34, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  transition: box-shadow .3s;
}

.nav-inner {
  max-width: 1100px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.nav-logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.3px;
  color: var(--text);
}

.nav-logo span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color .2s;
  letter-spacing: .01em;
}

.nav-links a:hover {
  color: var(--text);
}

.btn-nav {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  letter-spacing: .01em;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-right: 10px;
}

.lang-sep {
  color: var(--border);
  font-size: 11px;
  user-select: none;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 3px 5px;
  border-radius: 4px;
  transition: color .2s;
  line-height: 1;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--accent);
}

/* === LAYOUT === */
section {
  padding: 6rem 2rem;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1100px;
  margin: auto;
}

.section-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-tag::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -.03em;
}

/* === REVEAL ANIMATION === */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* === HERO === */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(136, 173, 255, .12);
  border: 1px solid rgba(136, 173, 255, .24);
  color: #cddcff;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-badge svg {
  width: 13px;
  height: 13px;
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.7rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 1.2rem;
  letter-spacing: -.04em;
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-role {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 500px;
  line-height: 1.8;
  font-weight: 400;
}

.btn-group {
  display: flex;
  gap: .85rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn {
  padding: 11px 24px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .22s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(136, 173, 255, .18);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(136, 173, 255, .22);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: #dbe6ff;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  letter-spacing: -.03em;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
  letter-spacing: .02em;
}

.hero-avatar {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--dark3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 2px 18px rgba(255, 255, 255, .05), inset 0 -18px 28px rgba(5, 10, 20, .2);
}

.avatar-ring-outer {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed rgba(136, 173, 255, .24);
  animation: spin 22s linear infinite;
}

.avatar-ring-inner {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(193, 156, 255, .15);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.avatar-photo {
  width: calc(100% - 18px);
  height: calc(100% - 18px);
  object-fit: cover;
  object-position: center 24%;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  display: block;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
  transform: scale(1.035);
  filter: saturate(.96) contrast(1.04);
  transition: transform .45s ease, filter .45s ease;
}

.hero-avatar::after {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, transparent 48%, rgba(10, 14, 24, .18) 74%, rgba(7, 10, 18, .34) 100%);
  pointer-events: none;
  z-index: 2;
}

.hero-avatar:hover .avatar-photo {
  transform: scale(1.06);
  filter: saturate(1) contrast(1.06);
}

/* === ABOUT === */
#about {
  background: var(--dark2);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  margin-bottom: .9rem;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.8;
}

.about-text a,
.tl-desc a,
.project-body p a,
.project-flag a {
  color: #b8c7ea;
  text-decoration: underline;
  text-decoration-color: rgba(184, 199, 234, .45);
  text-underline-offset: 2px;
  transition: color .2s, text-decoration-color .2s;
}

.about-text a:hover,
.tl-desc a:hover,
.project-body p a:hover,
.project-flag a:hover {
  color: #eef3ff;
  text-decoration-color: rgba(238, 243, 255, .7);
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 1.5rem;
}

.chip {
  background: rgba(136, 173, 255, .1);
  border: 1px solid rgba(136, 173, 255, .2);
  color: #d3e0ff;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  transition: all .2s;
  cursor: default;
}

.chip:hover {
  background: rgba(136, 173, 255, .18);
  border-color: rgba(136, 173, 255, .32);
}

.chip-hot {
  background: rgba(193, 156, 255, .1);
  border-color: rgba(193, 156, 255, .24);
  color: #e0cfff;
}

.chip-hot:hover {
  background: rgba(193, 156, 255, .18);
}

.timeline {
  display: flex;
  flex-direction: column;
}

.tl-item {
  display: flex;
  gap: 1rem;
}

.tl-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16px;
  flex-shrink: 0;
}

.tl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 7px;
  box-shadow: 0 0 0 3px rgba(136, 173, 255, .18);
}

.tl-line {
  width: 1px;
  flex: 1;
  background: var(--border);
  margin: 4px 0;
}

.tl-content {
  padding-bottom: 1.6rem;
}

.tl-year {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .06em;
  margin-bottom: 3px;
}

.tl-title {
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 3px;
  color: var(--text);
}

.tl-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
}

/* === SERVICES === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 1.15rem;
  margin-top: 2.5rem;
}

.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: all .28s;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(136, 173, 255, .05), rgba(193, 156, 255, .05));
  opacity: 0;
  transition: opacity .3s;
}

.service-card:hover {
  border-color: rgba(136, 173, 255, .28);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

.service-card:hover::after {
  opacity: 1;
}

.s-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.s-icon svg {
  width: 20px;
  height: 20px;
}

.si-blue   { background: rgba(136, 173, 255, .12); color: #cfe0ff; }
.si-purple { background: rgba(193, 156, 255, .12); color: #e4d1ff; }
.si-teal   { background: rgba(94, 211, 194, .12); color: #8ce6d7; }
.si-amber  { background: rgba(255, 194, 107, .12); color: #ffd79b; }
.si-green  { background: rgba(110, 223, 145, .12); color: #aef0bf; }
.si-pink   { background: rgba(245, 135, 188, .12); color: #ffc0de; }

.service-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: .45rem;
  letter-spacing: -.01em;
}

.service-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

/* === PORTFOLIO === */
#portfolio {
  background: var(--dark2);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.55rem;
  margin-top: 2.5rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.project-card:hover {
  border-color: rgba(136, 173, 255, .28);
  transform: translateY(-5px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .34);
}

.project-thumb {
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.pt-blue  { background: linear-gradient(135deg, rgba(136, 173, 255, .16), rgba(193, 156, 255, .12)); }
.pt-teal  { background: linear-gradient(135deg, rgba(94, 211, 194, .15), rgba(136, 173, 255, .11)); }
.pt-amber { background: linear-gradient(135deg, rgba(255, 194, 107, .16), rgba(245, 135, 188, .08)); }
.pt-green { background: linear-gradient(135deg, rgba(110, 223, 145, .15), rgba(94, 211, 194, .08)); }

.project-thumb svg {
  width: 44px;
  height: 44px;
}

.project-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(.95) contrast(1.03);
  transform: scale(1.025);
  transition: transform .5s ease, filter .5s ease;
}

.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 11, 18, .04) 0%, rgba(8, 11, 18, .1) 48%, rgba(8, 11, 18, .5) 100%);
  pointer-events: none;
}

.project-card:hover .project-thumb-image {
  transform: scale(1.065);
  filter: saturate(.99) contrast(1.05);
}

.project-tags {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  z-index: 1;
  max-width: calc(100% - 24px);
}

.ptag {
  background: rgba(8, 11, 18, .54);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #eef3ff;
  padding: 4px 9px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  backdrop-filter: blur(10px);
}

.project-body {
  padding: 1.2rem 1.2rem 1.25rem;
}

.project-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: .45rem;
  letter-spacing: -.01em;
  line-height: 1.35;
}

.project-body p {
  font-size: 13.2px;
  color: var(--muted);
  line-height: 1.68;
}

.project-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cadbff;
  margin-top: .7rem;
  font-weight: 500;
}

.project-flag a {
  color: inherit;
}

.project-flag svg {
  width: 12px;
  height: 12px;
}

/* === CERTIFICATIONS === */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.cert-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .25s;
}

.cert-card:hover {
  border-color: rgba(136, 173, 255, .28);
  transform: translateY(-3px);
}

.cert-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-icon svg {
  width: 17px;
  height: 17px;
}

.cert-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.cert-org {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* === CONTACT === */
#contact {
  background: var(--dark2);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info p {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.clink {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  transition: color .2s;
}

.clink:hover {
  color: #e6eeff;
}

.clink-icon {
  width: 36px;
  height: 36px;
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #cadbff;
}

.clink-icon svg {
  width: 15px;
  height: 15px;
}

.form-group {
  margin-bottom: 1.05rem;
}

.form-group label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: .4rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border .2s;
  font-family: 'Inter', system-ui, sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(136, 173, 255, .12);
}

.form-group textarea {
  height: 105px;
  resize: vertical;
}

.btn-send {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 9px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: .01em;
}

.btn-send:hover {
  opacity: .86;
  transform: translateY(-1px);
}

.btn-send svg {
  width: 15px;
  height: 15px;
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  position: relative;
  z-index: 1;
}

/* === TYPING CURSOR === */
.cursor {
  display: inline-block;
  width: 2px;
  height: .9em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink .75s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* === FORM FEEDBACK === */
.form-feedback-success,
.form-feedback-error {
  margin-top: 1rem;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 500;
}

.form-feedback-success {
  background: rgba(74, 222, 128, .12);
  border: 1px solid rgba(74, 222, 128, .35);
  color: #4ade80;
}

.form-feedback-error {
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .35);
  color: #f87171;
}

.btn-send:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none !important;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-avatar {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .projects-grid {
    gap: 1.15rem;
  }

  .project-thumb {
    height: 148px;
  }

  .project-body {
    padding: 1.05rem;
  }
}
