/**
 * @file assets/css/style.css
 * @description Main stylesheet for Davide Lombardi Portfolio.
 * Defines variables, resets, typography, responsive layouts, and animations
 * for a premium and editorial aesthetic.
 */

/* ==========================================================================
   Fonts (self-hosted, latin + latin-ext subsets — no requests to Google)
   ========================================================================== */
/* Inter normal — latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter normal — latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Playfair Display italic — latin-ext */
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/playfair-display-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Playfair Display italic — latin */
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/playfair-display-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Playfair Display normal — latin-ext */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/playfair-display-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Playfair Display normal — latin */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/playfair-display-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
  --ink: #0A1422;          /* Deep navy */
  --surface: #111F32;      /* Lighter navy */
  --paper: #F1EEE7;        /* Warm ivory */
  --muted: #A3AAB2;        /* Gray for secondary text */
  --brass: #B99A53;        /* Warm metallic gold */
  --rule: rgba(241, 238, 231, 0.1); 
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 64px;
  --max-w: 1200px;
  --brass-soft: rgba(185, 154, 83, 0.4);

  --nav-bg: rgba(10, 20, 34, 0.85);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin: 0;
  color: var(--paper);
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 5%;
}

.section-padding {
  padding: 120px 0;
  position: relative;
}

.bg-surface {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}
.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }

/* Buttons & Links */
.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-radius: 2px;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.cta-primary:hover {
  background: var(--brass);
  color: var(--ink);
  transform: translateY(-2px);
}

.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 32px;
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-radius: 2px;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.cta-secondary:hover {
  border-color: var(--brass);
  color: var(--brass);
}

.text-link {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--brass);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
  padding-bottom: 2px;
}
.text-link:hover {
  border-color: var(--brass);
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  padding: 24px 0;
  transition: background-color 0.3s ease, padding 0.3s ease, backdrop-filter 0.3s ease;
  background-color: transparent;
}
nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(10, 20, 34, 0.8) 0%, rgba(10, 20, 34, 0) 100%);
  z-index: -1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
nav.scrolled::before {
  opacity: 0;
}
nav.scrolled {
  background-color: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.nav-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--paper);
  z-index: 60;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--paper);
  text-transform: uppercase;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.nav-links a:hover {
  color: var(--brass);
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.nav-links a.btn-outline {
  border: 1px solid var(--rule);
  padding: 8px 16px;
  border-radius: 2px;
}
.nav-links a.btn-outline:hover {
  border-color: var(--brass);
  color: var(--brass);
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.desktop-only { display: flex; }
.mobile-only { display: none; }

/* Mobile Menu Button */
.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  z-index: 60;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}
.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--paper);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.mobile-menu-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.open span:nth-child(2) {
  transform: translateY(-0px) rotate(-45deg);
}

/* Mobile Menu Fullscreen */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
.mobile-link {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--paper);
  transform: translateY(20px);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.mobile-menu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}
.mobile-socials {
  margin-top: auto;
  display: flex;
  gap: 32px;
  justify-content: center;
  padding-bottom: 24px;
  opacity: 0;
  transition: opacity 0.4s ease 0.2s;
}
.mobile-menu.open .mobile-socials {
  opacity: 1;
}
.mobile-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.3s ease, transform 0.3s ease;
}
.mobile-socials a:hover {
  color: var(--paper);
  transform: translateY(-2px);
}


/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: flex-end;
}
/* Video Background */
.hero-video-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 20, 34, 0.2) 0%, rgba(10, 20, 34, 0.6) 60%, var(--ink) 100%);
}
.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 5% 10vh 5%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 40px;
}
.hero-label {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--brass);
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.95;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: var(--muted);
  font-style: italic;
  max-width: 24ch;
  margin: 0;
}
.hero-bottom-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
/* Signature logo, tinted with the brass palette through a mask */
.hero-signature {
  height: clamp(180px, 20vw, 280px);
  aspect-ratio: 700 / 940;
  -webkit-mask: url('../images/signature.webp') center / contain no-repeat;
  mask: url('../images/signature.webp') center / contain no-repeat;
}
.hero-signature svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* Handwriting effect: the pen strokes are drawn one after another on load */
.sig-stroke {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: sig-write var(--dur) cubic-bezier(0.45, 0, 0.55, 1) var(--delay) forwards;
}
.sig-stroke:nth-child(1) { --delay: 0.6s;  --dur: 0.9s; }
.sig-stroke:nth-child(2) { --delay: 1.5s;  --dur: 0.35s; }
.sig-stroke:nth-child(3) { --delay: 1.85s; --dur: 0.5s; }
.sig-stroke:nth-child(4) { --delay: 2.35s; --dur: 0.6s; }
.sig-stroke:nth-child(5) { --delay: 2.95s; --dur: 1.1s; }
.sig-stroke:nth-child(6) { --delay: 4.05s; --dur: 0.12s; }
@keyframes sig-write {
  to { stroke-dashoffset: 0; }
}
.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.scroll-indicator {
  position: absolute;
  bottom: 4vh;
  left: 5%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}
.scroll-line {
  width: 40px;
  height: 1px;
  background: var(--muted);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--paper);
  transform: translateX(-100%);
  animation: scrollAnim 2s infinite cubic-bezier(0.65, 0, 0.35, 1);
}
@keyframes scrollAnim {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Common Section Styles */
.section-header {
  margin-bottom: 64px;
}
.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 24px;
}
.section-line {
  width: 60px;
  height: 1px;
  background: var(--brass);
}



/* Music Section */
.music-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
}
.music-player {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.5);
}
.music-tag {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: 16px;
}
.music-title {
  font-size: 2rem;
  margin-bottom: 24px;
}
.music-desc {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 40ch;
}

/* Profile Section */
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}
.profile-quote h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  line-height: 1.3;
  color: var(--paper);
  font-style: italic;
}
.profile-text p {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 24px;
  max-width: 48ch;
}

/* Experiences Section */
.experiences-list {
  display: flex;
  flex-direction: column;
  gap: 120px;
}
.experience-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.experience-row.reverse {
  direction: rtl;
}
.experience-row.reverse > * {
  direction: ltr;
}
.experience-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.4);
  filter: grayscale(20%) contrast(1.1);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.6s ease;
}
.experience-image:hover img {
  transform: scale(1.02);
  filter: grayscale(0%) contrast(1.1);
}
.experience-content {
  max-width: 440px;
}
.exp-meta {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: 16px;
}
.exp-title {
  font-size: 2.2rem;
  margin-bottom: 24px;
}
.exp-desc {
  font-size: 1.05rem;
  color: var(--muted);
}

/* Gallery Section */
.gallery-section {
  padding: 60px 5%;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 280px;
  gap: 16px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  filter: grayscale(30%) contrast(1.1);
  transition: filter 0.4s ease, transform 0.4s ease;
}
.gallery-img:hover {
  filter: grayscale(0%);
  transform: scale(1.02);
}
.g-tall { grid-row: span 2; }
.g-wide { grid-column: span 2; }

/* Formation Timeline */
.timeline {
  display: flex;
  flex-direction: column;
}
.timeline-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-top: 1px solid var(--brass-soft);
}
.timeline-item:last-child {
  border-bottom: 1px solid var(--brass-soft);
}
.timeline-meta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--brass);
  padding-top: 6px;
}
.timeline-title {
  font-size: 1.6rem;
  margin-bottom: 12px;
}
.timeline-where {
  font-size: 1.1rem;
  color: var(--paper);
  margin-bottom: 8px;
}
.timeline-desc {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Research / Deep Dive */
.research-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  padding: 64px 0;
  border-top: 1px solid var(--brass);
  border-bottom: 1px solid var(--brass);
}
.research-title h2 {
  font-size: 2rem;
  line-height: 1.2;
}
.research-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.research-item {
  border: 1px solid var(--brass-soft);
  padding: 32px;
  border-radius: 24px;
  background: rgba(17, 31, 50, 0.7);
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.4);
}
.research-item h3 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 16px;
}
.research-item p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Skills Typography */
.skills-typography {
  display: flex;
  flex-direction: column;
  gap: 48px;
  text-align: center;
}
.skill-head {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: 24px;
}
.skill-list {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--paper);
  line-height: 1.5;
}

/* About Section */
.about-layout {
  display: grid;
  grid-template-columns: 4fr 5fr;
  gap: 80px;
  align-items: center;
}
.about-image img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 24px;
  transition: transform 0.4s ease;
}
.about-image img:hover {
  transform: scale(1.02);
}
.about-text h2 {
  font-size: 3rem;
  margin-bottom: 32px;
}
.about-text p {
  font-size: 1.15rem;
  color: var(--muted);
}

/* Social Banner */


.social-label {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--brass);
}
.social-links {
  display: flex;
  gap: 40px;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}
.social-links a:hover {
  color: var(--paper);
  transform: translateY(-2px);
}



/* Contact Section */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}
.contact-text h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 24px;
}
.contact-text p {
  font-size: 1.2rem;
  color: var(--muted);
}
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.c-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.c-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--paper);
}
.contact-actions {
  margin-top: 16px;
  display: flex;
  gap: 16px;
}

/* Footer */
.site-footer {
  padding: 40px 0;
  background: var(--ink);
  border-top: 1px solid var(--rule);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.footer-signature {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
.footer-copy {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  justify-self: end;
}
.footer-signature a {
  font-weight: 700;
  color: var(--brass);
  text-decoration: none;
  transition: opacity 0.3s ease;
}
.footer-signature a:hover {
  opacity: 0.8;
}

/* Hidden Notes */
.hidden-note {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--brass-soft);
  opacity: 0.7;
  z-index: 5;
  background: transparent;
  border: none;
  padding: 0;
  outline: none;
  appearance: none;
  transform: rotate(var(--r, 0deg));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, color 0.3s ease;
}
.hidden-note svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hidden-note:hover, .hidden-note.playing {
  opacity: 1;
  color: var(--brass);
  transform: rotate(var(--r, 0deg)) scale(1.15);
}

/* Now Playing Bar */
#nowPlayingBar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 150%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 12px 12px;
  border-radius: 8px;
  background: rgba(17, 31, 50, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 90vw;
}
#nowPlayingBar.show {
  transform: translate(-50%, 0);
}
#nowPlayingBar .np-label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
  border-left: 1px solid var(--brass);
  padding-left: 16px;
}
.np-video-wrapper {
  width: 120px;
  height: 68px;
  border-radius: 2px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
#hiddenAudioFrame {
  width: 200px;
  height: 200px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
}
#nowPlayingBar .np-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  padding: 0;
}
#nowPlayingBar .np-close:hover {
  color: var(--paper);
}
#nowPlayingBar .np-open {
  font-size: 0.75rem;
  color: var(--brass);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-left: 1px solid var(--brass);
  padding-left: 16px;
}

/* Responsive */
@media (max-width: 992px) {
  .music-layout, .profile-layout, .experience-row, .about-layout, .contact-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .experience-row.reverse {
    direction: ltr;
  }
  .research-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 24px;
  }
  .hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-bottom-right {
    margin-top: -20px;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  /* Phone hero: signature centered above the "ROMA / PIANISTA" label.
     display: contents lifts the signature and the buttons into the
     hero column so the signature can be ordered first. */
  .hero-bottom-right { display: contents; }
  .hero-signature {
    order: -1;
    align-self: center;
    height: 120px;
  }
  .hero-actions { margin-top: -20px; }

  .section-padding { padding: 80px 0; }
  .desktop-only { display: none; }
  .mobile-only { display: flex; }
  
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 32px 0;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 200px;
  }
  .g-tall { grid-row: span 1; }
  
  
  
  .contact-actions {
    flex-direction: column;
  }
  .contact-actions a {
    width: 100%;
  }

  .footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .research-content {
    grid-template-columns: 1fr;
  }
}

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

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 4px;
}

/* CSP Utility Classes replacing inline styles */
.note-1 { top: 5%; right: 10%; --r: -15deg; }
.note-2 { top: 15%; left: 5%; --r: 25deg; }
.note-3 { bottom: 10%; right: 8%; --r: -10deg; }
.note-4 { top: 50%; left: 10%; --r: 12deg; }
.contact-socials-wrapper { margin-top: 48px; }
.contact-social-label { margin-bottom: 16px; }

/* Editorial Gallery Override */
.editorial-gallery {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
}
.editorial-gallery .g-full {
  grid-column: 1 / -1;
  aspect-ratio: 21/9;
}
.editorial-gallery img {
  aspect-ratio: 4/3;
}
@media (max-width: 768px) {
  .editorial-gallery .g-full { aspect-ratio: 16/9; }
}


.section-padding-sm {
  padding: 80px 0;
  position: relative;
}
@media (max-width: 768px) {
  .section-padding-sm { padding: 60px 0; }
}


.contact-actions-spaced { margin-top: 24px; }

/* YouTube Facade */
#yt-facade-container {
  position: relative;
  width: 100%;
  height: 100%;
}
#yt-facade {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  position: relative;
  cursor: pointer;
}
.yt-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s;
}
#yt-facade:hover .yt-poster {
  filter: brightness(0.8);
}
.yt-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background-color: rgba(33, 33, 33, 0.8);
  border-radius: 12px;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: background-color 0.3s;
}
.yt-play-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-30%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 20px;
  border-color: transparent transparent transparent #fff;
}
#yt-facade:hover .yt-play-btn {
  background-color: #ff0000;
}




/* ==========================================================================
   Secondary pages (privacy, 404)
   ========================================================================== */
.simple-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.simple-header {
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.simple-main {
  flex: 1;
  padding: 80px 0 100px;
}
.simple-main h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-bottom: 20px;
}
.simple-lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0 0 40px;
}
.simple-footer {
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}
.simple-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.error-page {
  display: flex;
  align-items: center;
}
.error-code {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 18vw, 9rem);
  line-height: 1;
  color: var(--brass);
  margin: 0 0 16px;
}
.legal .container {
  max-width: 820px;
}
.legal h2 {
  font-size: 1.35rem;
  margin: 44px 0 12px;
  color: var(--brass);
}
.legal p {
  color: var(--muted);
  margin: 0 0 16px;
}
.legal a {
  color: var(--paper);
  border-bottom: 1px solid var(--brass-soft);
}
.legal a:hover {
  border-color: var(--brass);
}
.legal code {
  font-size: 0.9em;
  color: var(--paper);
}
.legal-updated {
  margin-top: 56px;
  font-size: 0.85rem;
}
.footer-copy a {
  border-bottom: 1px solid var(--brass-soft);
  transition: border-color 0.3s ease;
}
.footer-copy a:hover {
  border-color: var(--brass);
}
