/* =====================================================================
   Matteo Menardi Ménego — Official Website
   Shared design system (based on live v1.1.2 refinements)
   Ladin palette, glassmorphism, wallpaper robustness, theme toggle
   ===================================================================== */

:root {
  --ladin-blue:  #87CEEB;
  --ladin-white: #FFFFFF;
  --ladin-green: #006A4E;
  --platinum:    #E5E4E2;
}

/* Typography */
.font-sentient, body {
  font-family: 'Sentient', ui-serif, Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

/* Wallpaper layer - robust with real <img> */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #c9d6e2;
}
html.dark .site-bg { background: #0a1622; }
.site-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.05) 35%, rgba(255,255,255,0.11) 100%);
  transition: background .35s ease;
}
html.dark .site-bg::after {
  background: linear-gradient(180deg, rgba(4,7,11,.40) 0%, rgba(4,7,11,.32) 55%, rgba(4,7,11,.46) 100%);
}

/* Content above wallpaper */
body > header, body > main, body > footer { position: relative; z-index: 1; }

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.40);
  -webkit-backdrop-filter: saturate(185%) blur(28px);
  backdrop-filter: saturate(185%) blur(28px);
  border: 1px solid rgba(0, 106, 78, 0.07);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.12), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
html.dark .glass {
  background: rgba(10, 14, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45), 0 4px 6px -4px rgba(0, 0, 0, 0.25);
}

/* Cards */
.apple-rounded { border-radius: 1.75rem; }
.section-card { transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s cubic-bezier(.4,0,.2,1); }
.section-card:hover { transform: translateY(-2px); }

/* Platinum ring */
.platinum-ring {
  box-shadow: 0 0 0 4px #E5E4E2, 0 0 0 8px rgba(229, 228, 226, 0.25);
  transition: box-shadow .3s cubic-bezier(.4,0,.2,1);
}
.platinum-ring:hover {
  box-shadow: 0 0 0 6px #E5E4E2, 0 0 0 12px rgba(229, 228, 226, 0.2);
}

/* Theme toggle pill */
.theme-pill { appearance: none; background: transparent; border: 0; padding: 0; margin: 0; cursor: pointer; display: inline-flex; align-items: center; }
.pill-track {
  position: relative; display: inline-block; width: 64px; height: 32px; border-radius: 9999px;
  background: #dfe3e1; border: 1px solid rgba(0,106,78,.18);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.18); transition: background .3s ease, border-color .3s ease;
}
html.dark .pill-track { background: #2e3a44; border-color: rgba(255,255,255,.12); }
.pill-knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 9999px;
  background: #ffffff; z-index: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.32), 0 1px 2px rgba(0,0,0,.2);
  transition: transform .32s cubic-bezier(.4,0,.2,1), background .3s ease;
}
html.dark .pill-knob { transform: translateX(32px); background: #f6f7f9; }
.pill-ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; pointer-events: none; transition: opacity .25s ease; }
.pill-sun { opacity: 1; } .pill-moon { opacity: 0; }
html.dark .pill-sun { opacity: 0; } html.dark .pill-moon { opacity: 1; }

/* Footer logos */
.footer-logo { height: 52px; width: auto; border-radius: 11px; background: #ffffff; box-shadow: 0 2px 8px rgba(0,0,0,.26); border: 1px solid rgba(0,0,0,.10); transition: transform .25s ease, box-shadow .25s ease; }
html.dark .footer-logo { background: #000000; border-color: rgba(255,255,255,.16); }
a:hover > .footer-logo { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.32); }

/* Readability on wallpaper */
.readable-on-wp { text-shadow: 0 1px 3px rgba(255,255,255,.85), 0 2px 8px rgba(255,255,255,.6), 0 4px 18px rgba(255,255,255,.35); }
html.dark .readable-on-wp { text-shadow: 0 1px 2px rgba(0,0,0,.75), 0 3px 12px rgba(0,0,0,.65), 0 6px 24px rgba(0,0,0,.45); }

/* Table for milestones */
.milestone-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.milestone-table th, .milestone-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid rgba(148, 163, 184, 0.2); }
.dark .milestone-table th, .dark .milestone-table td { border-bottom-color: rgba(148, 163, 184, 0.15); }
.milestone-table th { font-family: 'Sentient-Medium', sans-serif; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: #006A4E; }
.dark .milestone-table th { color: #87CEEB; }
.milestone-table tr:last-child td { border-bottom: none; }
.milestone-table tr:hover td { background: rgba(0, 106, 78, 0.04); }
.dark .milestone-table tr:hover td { background: rgba(135, 206, 235, 0.06); }

/* Responsive image grids */
.image-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .image-grid-2 { grid-template-columns: repeat(2, 1fr); } }

/* Active nav */
.nav-link.active { color: #006A4E; font-weight: 500; }
.dark .nav-link.active { color: #87CEEB; }

/* Print */
@media print {
  .site-bg, nav, footer, .theme-pill { display: none !important; }
  body { background: white !important; color: black !important; }
  .glass { background: white !important; border: 1px solid #ddd !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

/* =====================================================================
   Additional polish for v2.0 multi-page site (Maximum Rigor)
   ===================================================================== */

/* Ménego italic accent in dark mode */
.monego-italic {
  font-style: italic;
  transition: color .2s ease;
}
html.dark .monego-italic {
  color: #87CEEB;
}

/* Justified long text */
.content-justified {
  text-align: justify;
  text-justify: inter-word;
}

/* Platinum quote styling */
.platinum-quote {
  font-style: italic;
  color: #E5E4E2;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
html.dark .platinum-quote {
  color: #E5E4E2;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* Hero profile image */
.hero-profile {
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.4);
  transition: transform .4s cubic-bezier(.4,0,.2,1), box-shadow .4s ease;
}
.hero-profile:hover {
  transform: scale(1.015);
}

/* Footer social/partner links */
.footer-link {
  transition: color .2s ease, transform .2s ease;
  display: inline-flex;
  align-items: center;
}
.footer-link:hover {
  transform: translateY(-1px);
  color: #006A4E;
}
html.dark .footer-link:hover {
  color: #87CEEB;
}

/* Ladin flag CSS recreation - 3:2 proportion, horizontal tricolor */
.ladin-flag {
  width: 48px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.2);
  border: 1px solid rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.ladin-flag > div {
  flex: 1;
  transition: filter .2s ease;
}
.ladin-flag:hover > div {
  filter: brightness(1.08);
}

/* Mobile menu two-row polish */
#mobile-nav a {
  transition: background-color .15s ease, color .15s ease;
}
#mobile-nav a:hover {
  background-color: rgba(255,255,255,.5);
}
html.dark #mobile-nav a:hover {
  background-color: rgba(255,255,255,.08);
}

/* Social cards on My Socials page */
.social-card {
  transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s ease, border-color .2s ease;
}
.social-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}
html.dark .social-card:hover {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.2);
}

/* Story image galleries - no crop, original res friendly */
.story-image {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  transition: transform .3s ease, box-shadow .3s ease;
}
.story-image:hover {
  transform: scale(1.01);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.15);
}
.image-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .image-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .image-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* CV style lists */
.cv-list li {
  margin-bottom: 0.65rem;
  padding-left: 0.25rem;
}
.cv-list li:last-child {
  margin-bottom: 0;
}

/* Lookup button platinum emphasis */
.lookup-btn {
  border-color: #E5E4E2;
  box-shadow: 0 0 0 1px #E5E4E2, 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.lookup-btn:hover {
  border-color: #87CEEB;
  box-shadow: 0 0 0 3px rgba(229,228,226,.4);
}

/* General button and link polish */
a.nav-link, .nav-link {
  position: relative;
}
a.nav-link:after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #006A4E, #87CEEB);
  transition: width .25s ease;
}
html.dark a.nav-link:after {
  background: linear-gradient(to right, #87CEEB, #006A4E);
}
a.nav-link:hover:after, .nav-link.active:after {
  width: 100%;
}

/* Accessibility focus */
button:focus-visible, a:focus-visible {
  outline: 2px solid #87CEEB;
  outline-offset: 3px;
  border-radius: 0.5rem;
}
