/* ============================
   CSS VARIABLES & RESET
   ============================ */
:root {
  --bg: #0a0d14;
  --bg-2: #0f1320;
  --bg-3: #141928;
  --surface: #141928;
  --surface-2: #1b2236;
  --border: rgba(255,255,255,0.07);
  --text: #e4eaf8;
  --text-muted: #7888aa;
  --accent: #4f7ef8;
  --accent-2: #93b4ff;
  --accent-glow: rgba(79,126,248,0.22);
  --green: #22d3a0;
  --excel-color: #1d6f42;
  --outlook-color: #0078d4;
  --powerapps-color: #742774;
  --automate-color: #0066ff;
  --sharepoint-color: #038387;
  --rpa-color: #c83a27;
  --radius: 16px;
  --radius-sm: 8px;
  --nav-h: 68px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light {
  --bg: #f4f6fc;
  --bg-2: #ffffff;
  --bg-3: #eaeefc;
  --surface: #ffffff;
  --surface-2: #eaeefc;
  --border: rgba(0,0,0,0.08);
  --text: #0d1426;
  --text-muted: #5566aa;
  --accent: #3b66e8;
  --accent-2: #5580f0;
  --accent-glow: rgba(59,102,232,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ============================
   TYPOGRAPHY
   ============================ */
h1, h2, h3 { line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.8rem, 7.5vw, 5.5rem); }
h2 { font-size: clamp(1.9rem, 5vw, 2.9rem); }
h3 { font-size: 1.2rem; font-weight: 700; }

.accent { color: var(--accent); }

/* ============================
   LAYOUT
   ============================ */
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 6rem 0; }
.section-header { margin-bottom: 3.5rem; }

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-sub {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 640px;
  line-height: 1.75;
}

/* ============================
   NAVBAR
   ============================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
  background: var(--bg-2);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--nav-h);
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  flex-shrink: 0;
  margin-right: auto;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
  border-radius: 6px;
  transition: opacity var(--transition);
}

.logo:hover .logo-img { opacity: 0.85; }

.nav-links { display: flex; gap: 1.75rem; }

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--transition);
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

#theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

#theme-toggle:hover { color: var(--text); background: var(--surface); }

body.dark .icon-sun  { display: inline; }
body.dark .icon-moon { display: none; }
body.light .icon-sun  { display: none; }
body.light .icon-moon { display: inline; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 0.5rem 1.5rem 1rem;
}

.mobile-menu a {
  padding: 0.75rem 0;
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--text); }
.mobile-menu.open { display: flex; }

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  border: none;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover { box-shadow: 0 8px 30px var(--accent-glow); }

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

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

/* ============================
   HERO
   ============================ */
#hero {
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79,126,248,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(34,211,160,0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Hero wrapper — photos are absolute, content floats on top */
.hero-layout {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Photos: absolutely behind the content */
.hero-person {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 46%;
  z-index: 0;
  overflow: hidden;
}

.hero-person--left  { left: 0; }
.hero-person--right { right: 0; }

.hero-person img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  /* Desaturate + dim for elegance, content stays readable */
  filter: grayscale(30%) brightness(0.7) saturate(0.75);
  transition: filter 0.6s ease;
}

/* Gradient veil: strong inner-edge fade toward bg + soft bottom fade */
.hero-person__fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-person--left .hero-person__fade {
  background:
    linear-gradient(to right,  transparent 15%, var(--bg) 72%),
    linear-gradient(to bottom, transparent 55%, var(--bg) 100%);
}

.hero-person--right .hero-person__fade {
  background:
    linear-gradient(to left,   transparent 15%, var(--bg) 72%),
    linear-gradient(to bottom, transparent 55%, var(--bg) 100%);
}

/* Subtle name label — sits in the outer corner of each photo */
.hero-person__name {
  position: absolute;
  bottom: 2.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  z-index: 2;
  writing-mode: vertical-rl;
}

.hero-person--left  .hero-person__name { left: 1.4rem; transform: rotate(180deg); }
.hero-person--right .hero-person__name { right: 1.4rem; }

/* Center content — full readable width, floats above photos */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  width: 100%;
  padding: calc(var(--nav-h) + 1rem) 2rem 4rem;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
  opacity: 0.85;
}

.hero-name {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 50%, var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.4rem;
}

.hero-sub {
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto 2rem;
  line-height: 1.75;
}

.hero-sub em { color: var(--accent-2); font-style: normal; font-weight: 600; }

.hero-cta {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
}

.badge:hover { color: var(--accent); border-color: var(--accent); }

/* ============================
   COMPETENZE
   ============================ */
#competenze { background: var(--bg-2); }

/* Gruppo skill (label sopra la griglia) */
.skill-group { margin-bottom: 3.5rem; }
.skill-group:last-child { margin-bottom: 0; }

.skill-group-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.skill-group-icon {
  width: 28px; height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.skill-group-icon svg { width: 100%; height: 100%; }

/* Griglia card skill */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.skills-grid--four {
  grid-template-columns: repeat(4, 1fr);
}

/* Card singola */
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

/* Card Excel — cliccabile con call to action evidente */
.skill-card--link {
  border-color: rgba(79,126,248,0.3);
  background: linear-gradient(135deg, var(--surface) 60%, rgba(79,126,248,0.05));
  cursor: pointer;
  position: relative;
}

.skill-card--link:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 48px var(--accent-glow);
}

/* Card accent (RPA) */
.skill-card--accent {
  border-color: rgba(200,58,39,0.25);
  background: linear-gradient(135deg, var(--surface) 60%, rgba(200,58,39,0.04));
}

.skill-card--accent:hover { border-color: var(--rpa-color); }

.skill-card-inner {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

/* Icona colorata per skill */
.skill-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.skill-icon svg { width: 24px; height: 24px; }

.skill-icon.excel     { background: rgba(29,111,66,0.2);   color: #2dbe70; }
.skill-icon.outlook   { background: rgba(0,120,212,0.2);   color: #4db8ff; }
.skill-icon.powerapps { background: rgba(116,39,116,0.2);  color: #c77bc7; }
.skill-icon.automate  { background: rgba(0,102,255,0.2);   color: #6699ff; }
.skill-icon.sharepoint{ background: rgba(3,131,135,0.2);   color: #22d3d8; }
.skill-icon.rpa       { background: rgba(200,58,39,0.2);   color: #ff7060; }

.skill-info h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }

.skill-vba {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

.skill-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* Badge CTA sulla card Excel */
.skill-cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  width: fit-content;
  transition: background var(--transition), transform var(--transition);
}

.skill-card--link:hover .skill-cta-badge {
  background: var(--accent-2);
  transform: translateX(3px);
}

/* ============================
   SERVIZI (Chi Siamo / Cosa Facciamo)
   ============================ */
#servizi { background: var(--bg); }

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

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.8;
}

.about-text strong { color: var(--text); }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color var(--transition), transform var(--transition);
}

.stat-card:hover { border-color: var(--accent); transform: translateY(-4px); }

.stat-number {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}

/* ============================
   CASO STUDIO
   ============================ */
#progetto { background: var(--bg-2); }

.case-study-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.case-study-card:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.case-study-visual {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-right: 1px solid var(--border);
  background: linear-gradient(135deg, #0d1220, #111a2e);
}

body.light .case-study-visual { background: linear-gradient(135deg, #e8eaf6, #c5cae9); }

.mockup-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 0.25rem; }

.mockup-bar span { width: 10px; height: 10px; border-radius: 50%; }
.mockup-bar span:nth-child(1) { background: #ff5f57; }
.mockup-bar span:nth-child(2) { background: #febc2e; }
.mockup-bar span:nth-child(3) { background: #28c840; }

.mockup-body { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }

.mockup-row { height: 12px; border-radius: 4px; background: rgba(255,255,255,0.1); width: 100%; }
.mockup-row.wide  { height: 20px; width: 80%; }
.mockup-row.short { width: 55%; }
.mockup-cols { display: flex; gap: 0.5rem; flex: 1; min-height: 70px; }
.mockup-col  { flex: 1; border-radius: 8px; background: rgba(255,255,255,0.07); }
.mockup-col.narrow { flex: 0 0 30%; background: rgba(79,126,248,0.2); }

.case-tags-visual {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.case-tags-visual span {
  background: rgba(79,126,248,0.18);
  color: var(--accent-2);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.case-study-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
}

.case-badge {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(79,126,248,0.25);
  border-radius: 999px;
  padding: 0.2rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  width: fit-content;
}

.case-study-info h3 { font-size: 1.4rem; }

.case-study-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.project-highlights {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.project-highlights li {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-left: 1.1rem;
  position: relative;
}

.project-highlights li::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.case-stack { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.tag {
  background: var(--accent-glow);
  color: var(--accent-2);
  border: 1px solid rgba(79,126,248,0.22);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ============================
   TEAM
   ============================ */
#team { background: var(--bg); }

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.team-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

/* Avatar con iniziali — finché non ci sono foto reali */
.team-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 32px var(--accent-glow);
  flex-shrink: 0;
  border: 3px solid var(--accent);
}

.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.team-info { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; width: 100%; }

.team-info h3 { font-size: 1.35rem; }

.team-role {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.team-bio {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.75;
  max-width: 400px;
}

.team-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.team-skills span {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
}

.team-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  padding: 0.45rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}

.team-linkedin:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================
   CONTATTI
   ============================ */
#contatti { background: var(--bg-2); text-align: center; }

.contact-email {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
  transition: opacity var(--transition);
}

.contact-email:hover { opacity: 0.7; }

.contact-sub {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.contact-cards {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.75rem;
  min-width: 220px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.contact-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

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

.contact-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.contact-card-value {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

/* ============================
   CONTACT FORM
   ============================ */
.contact-form {
  max-width: 640px;
  margin: 0 auto 4rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.contact-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-field {
  position: relative;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.4rem 1rem 0.6rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.form-field label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: top var(--transition), font-size var(--transition), color var(--transition);
  background: transparent;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-field input:focus + label,
.form-field input:not(:placeholder-shown) + label,
.form-field textarea:focus + label,
.form-field textarea:not(:placeholder-shown) + label {
  top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
}

.form-field .req { color: var(--accent); }

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #ef4f6b;
  box-shadow: 0 0 0 3px rgba(239, 79, 107, 0.18);
}

.contact-form__submit {
  align-self: center;
  margin-top: 0.5rem;
  min-width: 180px;
  justify-content: center;
}

.contact-form__submit[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.contact-form__hint {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.contact-form__hint a {
  color: #25D366;
  font-weight: 600;
  border-bottom: 1.5px solid transparent;
  transition: border-color var(--transition);
}

.contact-form__hint a:hover { border-bottom-color: #25D366; }

.contact-form__status {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  min-height: 1.4rem;
  margin: 0;
  color: var(--text-muted);
}

.contact-form__status.is-success { color: var(--green); }
.contact-form__status.is-error   { color: #ef4f6b; }

/* ============================
   WHATSAPP FAB
   ============================ */
.whatsapp-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35), 0 4px 12px rgba(0,0,0,0.15);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  animation: wa-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

.whatsapp-fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  opacity: 0.6;
  z-index: -1;
  animation: wa-pulse 2.5s ease-out infinite;
}

.whatsapp-fab:hover {
  transform: translateY(-3px) scale(1.05);
  background: #1ebe5b;
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.45), 0 6px 16px rgba(0,0,0,0.2);
}

.whatsapp-fab:active { transform: translateY(-1px) scale(1.02); }

.whatsapp-fab__icon {
  width: 32px;
  height: 32px;
  display: block;
}

.whatsapp-fab__tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #0d1426;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.whatsapp-fab__tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #0d1426;
}

.whatsapp-fab:hover .whatsapp-fab__tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@keyframes wa-pulse {
  0%   { transform: scale(1);    opacity: 0.6; }
  70%  { transform: scale(1.6);  opacity: 0;   }
  100% { transform: scale(1.6);  opacity: 0;   }
}

@keyframes wa-pop-in {
  from { transform: scale(0) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0);      opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-fab,
  .whatsapp-fab::before { animation: none; }
}

/* Hide tooltip on touch devices (no hover) */
@media (hover: none) {
  .whatsapp-fab__tooltip { display: none; }
}

/* ============================
   FOOTER
   ============================ */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer .container { display: flex; flex-direction: column; gap: 0.25rem; }
footer strong { color: var(--text); }
.footer-copy { font-size: 0.8rem; opacity: 0.6; }

/* ============================
   SCROLL REVEAL
   ============================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1000px) {
  .skills-grid--four { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .team-grid  { grid-template-columns: 1fr; }

  /* Narrow photos on tablet */
  .hero-person { width: 32%; }

  .hero-content { padding: calc(var(--nav-h) + 1rem) 1.5rem 4rem; }

  .case-study-card {
    grid-template-columns: 1fr;
  }

  .case-study-visual {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 160px;
  }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* Mobile hero: photos row on top, content below */
  .hero-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    min-height: unset;
    align-items: start;
  }

  .hero-person--left {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    width: 100%;
    height: min(62vw, 280px);
  }

  .hero-person--right {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    width: 100%;
    height: min(62vw, 280px);
  }

  .hero-person--left .hero-person__fade {
    background:
      linear-gradient(to bottom, transparent 40%, var(--bg) 100%),
      linear-gradient(to right, var(--bg) 0%, transparent 20%);
  }

  .hero-person--right .hero-person__fade {
    background:
      linear-gradient(to bottom, transparent 40%, var(--bg) 100%),
      linear-gradient(to left, var(--bg) 0%, transparent 20%);
  }

  .hero-person__name {
    writing-mode: horizontal-tb;
    bottom: 0.6rem;
    left: 0; right: 0;
    text-align: center;
    font-size: 0.6rem;
  }

  .hero-person--left  .hero-person__name { transform: none; }
  .hero-person--right .hero-person__name { transform: none; }

  .hero-content {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 1.25rem 1.25rem 4rem;
  }

  #hero { text-align: left; }
  .hero-cta, .hero-badges { justify-content: flex-start; }
  .hero-sub { margin: 0 0 1.4rem; }

  .skills-grid,
  .skills-grid--four { grid-template-columns: 1fr; }

  .about-stats { grid-template-columns: 1fr 1fr; }

  section { padding: 4rem 0; }

  .contact-cards { flex-direction: column; align-items: center; }
  .contact-card  { width: 100%; max-width: 360px; }

  .contact-form { margin-bottom: 3rem; }
  .contact-form__submit { width: 100%; }

  .whatsapp-fab {
    width: 54px;
    height: 54px;
    right: 1rem;
    bottom: 1rem;
  }
  .whatsapp-fab__icon { width: 28px; height: 28px; }
}
