/* ==========================================================================
   APPLE SERVICES / APPS DESIGN SYSTEM - Alessandro Canali 2026
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Syne:wght@600;700;800&display=swap');

:root {
  /* Colors - Apple Editorial Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-card: rgba(255, 255, 255, 0.85);

  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --border-light: rgba(0, 0, 0, 0.08);

  --accent-blue: #0066cc;
  --accent-blue-hover: #0077ed;

  /* Soft Pastel Backdrops per Section (Apple Style) */
  --pastel-cream-bg: linear-gradient(135deg, #faf8f5 0%, #f2eae1 100%);
  --pastel-cream-border: rgba(217, 191, 163, 0.45);
  --pastel-cream-text: #8c7355;

  /* Custom Skills Pastels derived from #FAA009, #CC3300, #4C894B */
  --skills-orange-bg: #ffe8cc;
  /* Rich solid pastel orange */
  --skills-orange-border: rgba(250, 160, 9, 0.35);
  --skills-orange-text: #b27200;

  --skills-red-bg: #ffd6cc;
  /* Rich solid pastel red/rust */
  --skills-red-border: rgba(204, 51, 0, 0.35);
  --skills-red-text: #cc3300;

  --skills-green-bg: #dceddc;
  /* Rich solid pastel green */
  --skills-green-border: rgba(76, 137, 75, 0.35);
  --skills-green-text: #3c6e3b;

  --skills-cyan-bg: #e0f7ff;
  /* Rich solid pastel cyan */
  --skills-cyan-border: rgba(0, 153, 204, 0.35);
  --skills-cyan-text: #0099CC;

  --pastel-green-bg: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  --pastel-green-border: rgba(167, 243, 208, 0.3);
  --pastel-green-text: #059669;

  --pastel-yellow-bg: linear-gradient(135deg, #fefce8 0%, #fef08a 100%);
  --pastel-yellow-border: rgba(253, 224, 71, 0.3);
  --pastel-yellow-text: #ca8a04;

  --pastel-rose-bg: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  --pastel-rose-border: rgba(254, 205, 211, 0.3);
  --pastel-rose-text: #e11d48;

  --pastel-blue-bg: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  --pastel-blue-border: rgba(186, 230, 253, 0.3);
  --pastel-blue-text: #0284c7;

  /* Sizing tokens */
  --rounded-card: 24px;
  --rounded-icon: 20px;
  --rounded-btn: 30px;

  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-accent: 'Syne', sans-serif;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  font-size: 16px;
  background-color: var(--bg-primary);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #d1d1d6;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a6;
}

/* Grid layout containers */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padding {
  padding: 60px 0;
}

/* Apple-style Section Header */
.section-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 3.5rem;
  color: var(--text-primary);
}

.section-title span.accent {
  display: block;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* Bento card standard */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--rounded-card);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
  transition: var(--transition-smooth);
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 76px;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 40px;
  width: auto;
  transition: var(--transition-smooth);
  filter: contrast(1.1);
}



.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2.2rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

.nav-socials {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: 1.5rem;
}

.social-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

.social-icon img {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: var(--transition-smooth);
}

.social-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--text-primary);
  transform: translateY(-2px);
}

.social-icon:hover img {
  opacity: 1;
}

/* Mobile Toggle */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.menu-btn span {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition-smooth);
}

/* ==========================================================================
   HERO SECTION (CHI SONO)
   ========================================================================== */

#home {
  position: relative;
  min-height: auto;
  display: flex;
  align-items: center;
  padding-top: 110px;
  padding-bottom: 50px;
  background-color: var(--bg-primary);
}

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

.hero-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

/* Pastel dynamic gradient circle behind picture */
.hero-backdrop {
  display: none;
}

.hero-avatar {
  position: relative;
  width: 380px;
  height: 380px;
  z-index: 2;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.hero-avatar img,
.hero-avatar video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}



.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.hero-subtitle {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--pastel-cream-text);
  background: var(--pastel-cream-bg);
  padding: 4px 12px;
  border-radius: 20px;
  align-self: flex-start;
  border: 1px solid var(--pastel-cream-border);
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  white-space: nowrap;
}

.hero-tagline {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
}

.hero-desc {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.6;
}

.hero-cta-wrapper {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.8rem;
}

/* Styled Capsule buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2.2rem;
  border-radius: var(--rounded-btn);
  font-size: 1rem;
  font-weight: 600;
  background: var(--text-primary);
  color: var(--bg-primary);
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
  transform: translateY(-2px);
  opacity: 0.9;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2.2rem;
  border-radius: var(--rounded-btn);
  font-size: 1rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: #e8e8ed;
  border-color: rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   PORTFOLIO SECTION
   ========================================================================== */

#portfolio {
  background-color: var(--bg-secondary);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 2.2rem;
}

.portfolio-card {
  overflow: hidden;
  border-radius: var(--rounded-card);
  border: none;
  background: var(--bg-primary);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
}

.portfolio-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.portfolio-thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: transparent;
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.02);
  /* Extremely subtle dimming for contrast */
  transition: var(--transition-smooth);
  z-index: 3;
}

.play-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.play-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--text-primary);
  margin-left: 2px;
}



.portfolio-card:hover .portfolio-overlay {
  background: rgba(255, 255, 255, 0.1);
}

.portfolio-card:hover .play-btn {
  transform: scale(1.12);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  border-color: #ffffff;
}

.portfolio-info {
  padding: 1.5rem;
}

.portfolio-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.portfolio-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.portfolio-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 6px;
}

/* ==========================================================================
   SKILLS SECTION (BENTO GRID STYLE)
   ========================================================================== */

.skills-wrapper {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 5rem;
  align-items: center;
}

.skills-intro {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.skills-desc {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.skills-illustration {
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--rounded-card);
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-light);
}

.skills-illustration img {
  max-height: 240px;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.06));
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.8rem;
}

/* Bento Box with solid pastel background */
.skills-card {
  padding: 2rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--rounded-card);
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.skills-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.skills-card:nth-child(1) {
  background: var(--skills-orange-bg);
}

.skills-card:nth-child(2) {
  background: var(--skills-red-bg);
}

.skills-card:nth-child(3) {
  background: var(--skills-green-bg);
}

.skills-card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 1.2rem;
}

.skills-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.skills-card:nth-child(1) .skills-icon-wrapper {
  color: var(--skills-orange-text);
}

.skills-card:nth-child(2) .skills-icon-wrapper {
  color: var(--skills-red-text);
}

.skills-card:nth-child(3) .skills-icon-wrapper {
  color: var(--skills-green-text);
}

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

.skills-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skills-badge {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 6px 14px;
  border-radius: 8px;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.skills-badge:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   GEAR SECTION (iOS HOVER-ACTIVE APP ICONS STYLE)
   ========================================================================== */

#gear {
  background-color: var(--bg-secondary);
}

.gear-tabs-container {
  display: flex;
  flex-direction: column;
  /*gap: 3.5rem;*/
}

.gear-tabs-header {
  display: flex;
  justify-content: center;
  background: rgba(0, 0, 0, 0.03);
  padding: 6px;
  border-radius: 40px;
  align-self: center;
  border: 1px solid var(--border-light);
}

.gear-tabs-container .gear-tabs-header {
  gap: 3.5rem;
  margin-bottom: 60px;
}

.tab-btn {
  padding: 0.6rem 2rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-primary);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.04);
}

.gear-tab-content {
  display: none;
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gear-tab-content.active {
  display: block;
}

.gear-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2.5rem 2rem;
  justify-items: center;
}

/* Bento top intro gear card */
.gear-intro-block {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 3rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--rounded-card);
  margin-bottom: 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
}

.gear-intro-img {
  width: 440px;
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.gear-intro-text h3 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.gear-intro-text p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* iOS Icon Card style */
.gear-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.8rem;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 130px;
}

/* Physical App Icon borders, shadows and rounded corners */
.gear-logo-container {
  width: 82px;
  height: 82px;
  border-radius: 20px;
  /* Golden ratio iOS rounding */
  background: var(--bg-primary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

/* Inner stroke overlay to look like real App icon */
.gear-logo-container::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1) inset;
  pointer-events: none;
}

.gear-logo-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: contrast(1.02);
  transition: var(--transition-smooth);
}

.gear-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.gear-item-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

/* Micro-interaction on hover: lifts like iOS / Apple TV icon press */
.gear-item:hover .gear-logo-container {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.gear-item:hover .gear-logo-container img {
  transform: scale(1.02);
}

/* Brand specific pastels and accents for each category */
#gear-hardware .gear-item:hover .gear-logo-container {
  background: var(--skills-orange-bg);
  border-color: var(--skills-orange-border);
}

#gear-hardware .gear-item:hover .gear-item-title {
  color: var(--skills-orange-text);
}

#gear-video-sw .gear-item:hover .gear-logo-container {
  background: var(--skills-red-bg);
  border-color: var(--skills-red-border);
}

#gear-video-sw .gear-item:hover .gear-item-title {
  color: var(--skills-red-text);
}

#gear-audio-sw .gear-item:hover .gear-logo-container {
  background: var(--skills-green-bg);
  border-color: var(--skills-green-border);
}

#gear-audio-sw .gear-item:hover .gear-item-title {
  color: var(--skills-green-text);
}

#gear-streaming-sw .gear-item:hover .gear-logo-container {
  background: var(--skills-cyan-bg);
  border-color: var(--skills-cyan-border);
}

#gear-streaming-sw .gear-item:hover .gear-item-title {
  color: var(--skills-cyan-text);
}

/* ==========================================================================
   RESUME SECTION (Spacious band editorial timeline)
   ========================================================================== */

/* ==========================================================================
   RESUME SECTION (Discursive Editorial Style)
   ========================================================================== */

.resume-discursive-container {
  max-width: 1040px;
  margin: 0 auto;
}

.resume-text-wrapper {
  background: var(--bg-primary);
  border-radius: var(--rounded-card);
  padding: 3.5rem 4rem;
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.resume-paragraph {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: justify;
}

.resume-paragraph.lead-text {
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 2rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

.resume-paragraph strong {
  color: var(--text-primary);
  font-weight: 700;
}

.resume-paragraph em {
  font-style: normal;
  color: var(--text-primary);
  font-weight: 600;
}

.resume-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border-light);
  text-underline-offset: 4px;
  transition: var(--transition-smooth);
}

.resume-link:hover {
  color: var(--accent-blue);
  text-decoration-color: var(--accent-blue);
}

@media (max-width: 768px) {
  .resume-text-wrapper {
    padding: 2.5rem 2rem;
    gap: 1.5rem;
  }

  .resume-paragraph {
    font-size: 0.95rem;
    text-align: left;
  }

  .resume-paragraph.lead-text {
    font-size: 1.15rem;
    padding-bottom: 1.5rem;
  }
}

/* ==========================================================================
   FOOTER & CONTACT SECTION
   ========================================================================== */

footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 100px 0 50px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 5rem;
  align-items: stretch;
  margin-bottom: 5rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  justify-content: center;
}

.contact-title {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.contact-title span {
  display: block;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  margin-top: 8px;
}

.contact-desc {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.contact-buttons {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

/* Capsule buttons matching iOS style */
.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.9rem 2.5rem;
  border-radius: var(--rounded-btn);
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--text-primary);
  color: var(--bg-primary);
  transition: var(--transition-smooth);
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-contact:hover {
  transform: translateY(-2px);
  opacity: 0.9;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.btn-contact svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn-contact.linkedin {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-contact.linkedin:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.2);
}

.contact-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5rem;
  border-radius: var(--rounded-card);
  border: none;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
}

.contact-illustration-img {
  max-height: 250px;
  width: auto;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.06));
  transition: var(--transition-smooth);
}


.footer-bottom {
  text-align: center;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-light);
}

.copyright {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.copyright span.accent-name {
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   CUSTOM LIGHTBOX VIDEO PLAYER OVERLAY
   ========================================================================== */

.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 17, 0.93);
  /* Dark overlay is best for focus on video contrast */
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content-wrapper {
  position: relative;
  width: 90%;
  max-width: 1020px;
  aspect-ratio: 16/9;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85);
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: #000;
}

.lightbox-modal.active .lightbox-content-wrapper {
  transform: scale(1);
}

/* White glassmorphic close btn */
.lightbox-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 10010;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
  border-color: #ffffff;
}

.lightbox-close-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.lightbox-video-container {
  width: 100%;
  height: 100%;
}

.lightbox-video-container video,
.lightbox-video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
}

/* ==========================================================================
   ANIMATIONS & MOBILE BREAKPOINTS
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  html {
    font-size: 15px;
  }

  .section-title {
    font-size: 3rem;
  }

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

  .hero-image-wrapper {
    order: -1;
  }

  .hero-avatar {
    width: 320px;
    height: 320px;
  }

  .hero-content {
    align-items: center;
  }

  .hero-title {
    font-size: 3.5rem;
    white-space: normal;
  }

  .hero-tagline {
    font-size: 1.6rem;
    white-space: normal;
    margin-top: 2px;
  }

  .skills-wrapper {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .gear-intro-block {
    flex-direction: column;
    text-align: center;
    padding: 2rem;
  }

  .gear-intro-img {
    width: 100%;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem;
  }

  .timeline-left {
    text-align: left;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
    text-align: center;
  }

  .contact-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .menu-btn {
    display: flex;
    margin-left: auto;
    /* Aligns the hamburger menu to the far right on mobile */
  }

  .nav-menu {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    height: calc(100vh - 76px);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    flex-direction: column;
    padding: 3rem 0;
    gap: 2.2rem;
    transform: translateX(-100%);
    transition: var(--transition-smooth);
    z-index: 999;
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-socials {
    margin-left: 0;
    margin-top: 2rem;
  }

  /* Active mobile burger icon transforms */
  .menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-btn.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Safe typography scales on mobile to prevent clipping and overflow */
  .hero-title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .hero-tagline {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }

  .hero-avatar {
    width: min(290px, 75vw);
    height: min(290px, 75vw);
  }

  .section-title {
    font-size: clamp(1.8rem, 7vw, 2.4rem);
    margin-bottom: 2rem;
  }

  .section-title span.accent {
    font-size: clamp(1rem, 4.5vw, 1.2rem);
  }

  /* Mobile Horizontal Scrollable Tab Bar in GEAR & Spacing Fixes */
  .gear-tabs-container {
    gap: 1.8rem;
  }

  .gear-tabs-header {
    width: 100%;
    justify-content: center;
    /* Center the tabs by default on mobile landscape and tablet */
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    border-radius: 20px;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;

    /* Default initial fallback (fade right) */
    -webkit-mask-image: linear-gradient(to right, #000 82%, transparent 97%);
    mask-image: linear-gradient(to right, #000 82%, transparent 97%);
    transition: mask-image 0.25s ease, -webkit-mask-image 0.25s ease;
  }

  /* Class states controlled dynamically by scroll position in main.js */
  .gear-tabs-header.fade-right {
    -webkit-mask-image: linear-gradient(to right, #000 82%, transparent 97%);
    mask-image: linear-gradient(to right, #000 82%, transparent 97%);
  }

  .gear-tabs-header.fade-left {
    -webkit-mask-image: linear-gradient(to right, transparent 3%, #000 18%);
    mask-image: linear-gradient(to right, transparent 3%, #000 18%);
  }

  .gear-tabs-header.fade-both {
    -webkit-mask-image: linear-gradient(to right, transparent 3%, #000 18%, #000 82%, transparent 97%);
    mask-image: linear-gradient(to right, transparent 3%, #000 18%, #000 82%, transparent 97%);
  }

  .gear-tabs-header::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 0.6rem 1.4rem;
    flex-shrink: 0;
  }

  /* Specific override for narrow mobile screens in portrait mode where tabs will overflow */
  @media (max-width: 480px) {
    .gear-tabs-header {
      justify-content: flex-start !important;
    }
  }

  .gear-intro-block {
    margin-top: 1.5rem !important;
    margin-bottom: 2rem !important;
  }

  /* Force exactly 2 columns on mobile for an elegant grid and adjust sizes */
  .gear-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.8rem 1rem !important;
  }

  .gear-item {
    width: 100% !important;
    max-width: 140px !important;
  }

  .gear-logo-container {
    width: 72px !important;
    height: 72px !important;
    border-radius: 16px !important;
    padding: 10px !important;
  }

  /* Footer "Collaboriamo!" mobile adaptation and clipping preventions */
  .contact-title {
    font-size: clamp(2.2rem, 9vw, 2.8rem);
  }

  .contact-title span {
    font-size: clamp(1.1rem, 5vw, 1.3rem);
  }

  .contact-desc {
    font-size: 1.05rem;
    line-height: 1.5;
  }

  .contact-illustration {
    padding: 1.5rem;
    margin-top: 1rem;
  }

  .contact-illustration-img {
    max-height: 200px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }
}