/* ==========================================================================
   Morningstar Corporation
   Tema: dark, cerimoniale, typography-driven. Estetica divina/celestiale.
   ========================================================================== */

:root {
  /* Palette OKLCH (vedi DESIGN.md per il rationale) */
  --bg-deep:   oklch(0.14 0.02 270);
  --bg-soft:   oklch(0.18 0.02 270);
  --ink:       oklch(0.94 0.01 80);
  --ink-mute:  oklch(0.78 0.02 80);
  --ink-faint: oklch(0.62 0.02 80);
  --gold:      oklch(0.82 0.13 80);
  --gold-deep: oklch(0.66 0.12 75);
  --silver:    oklch(0.85 0.01 240);
  --border:    oklch(0.30 0.02 270);

  /* Fallback hex per browser senza supporto OKLCH (Safari < 15.4 ecc.) */
  --bg-deep-fb:   #16162b;
  --bg-soft-fb:   #1d1d33;
  --ink-fb:       #ece8df;
  --ink-mute-fb:  #b9b1a0;
  --ink-faint-fb: #8e8676;
  --gold-fb:      #e0c074;
  --gold-deep-fb: #b8964e;

  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --maxw: 1180px;
  --pad:  clamp(20px, 5vw, 56px);
  --rhythm-lg: clamp(96px, 14vw, 144px);
  --rhythm-md: clamp(64px, 9vw, 96px);
  --rhythm-sm: clamp(40px, 6vw, 56px);

  --easing: cubic-bezier(0.22, 1, 0.36, 1);
}

@supports not (color: oklch(0 0 0)) {
  :root {
    --bg-deep:   var(--bg-deep-fb);
    --bg-soft:   var(--bg-soft-fb);
    --ink:       var(--ink-fb);
    --ink-mute:  var(--ink-mute-fb);
    --ink-faint: var(--ink-faint-fb);
    --gold:      var(--gold-fb);
    --gold-deep: var(--gold-deep-fb);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

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

::selection {
  background: var(--gold);
  color: var(--bg-deep);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--bg-deep);
  padding: 12px 18px;
  font-weight: 600;
  z-index: 1000;
}
.skip-link:focus { left: 12px; top: 12px; }

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background-color 0.4s var(--easing), backdrop-filter 0.4s var(--easing), border-color 0.4s var(--easing);
  border-bottom: 1px solid transparent;
}

.site-nav.is-scrolled {
  background: color-mix(in oklab, var(--bg-deep) 92%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--pad);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: 0.04em;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}

.wordmark-text { display: inline-block; }
.wordmark::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--gold-deep);
  transition: right 0.4s var(--easing);
}
.wordmark:hover::after,
.wordmark:focus-visible::after { right: 0; }

.nav-links {
  display: flex;
  gap: 36px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  position: relative;
  padding: 8px 0;
  transition: color 0.3s var(--easing);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s var(--easing);
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a:focus-visible::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: border-color 0.3s var(--easing);
}
.nav-toggle:hover { border-color: var(--gold-deep); }

.nav-toggle-bar {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.4s var(--easing), opacity 0.3s var(--easing), top 0.4s var(--easing);
}
.nav-toggle-bar:nth-child(1) { top: 16px; }
.nav-toggle-bar:nth-child(2) { top: 26px; }

.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
  top: 21px;
  transform: rotate(-45deg);
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--easing);
}

.mobile-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: center;
}

.drawer-nav a {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 7vw, 36px);
  color: var(--ink);
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s var(--easing), transform 0.45s var(--easing), color 0.3s var(--easing);
  padding: 8px 16px;
}

.mobile-drawer.is-open .drawer-nav a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-drawer.is-open .drawer-nav a:nth-child(1) { transition-delay: 0.05s; }
.mobile-drawer.is-open .drawer-nav a:nth-child(2) { transition-delay: 0.1s; }
.mobile-drawer.is-open .drawer-nav a:nth-child(3) { transition-delay: 0.15s; }
.mobile-drawer.is-open .drawer-nav a:nth-child(4) { transition-delay: 0.2s; }

.drawer-nav a:hover { color: var(--gold); }

.drawer-foot {
  position: absolute;
  bottom: clamp(40px, 6vw, 64px);
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-faint);
  margin: 0;
  opacity: 0;
  transition: opacity 0.6s var(--easing) 0.3s;
}
.mobile-drawer.is-open .drawer-foot { opacity: 1; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px var(--pad) var(--rhythm-md);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, color-mix(in oklab, var(--gold) 10%, transparent), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 100%, color-mix(in oklab, var(--bg-soft) 70%, transparent), transparent 70%);
  z-index: -1;
}

.hero-stars {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: starTwinkle 6s var(--easing) infinite;
}

.hero-stars span:nth-child(1)  { top: 12%; left: 8%;  animation-delay: 0s;   width: 1px; height: 1px; }
.hero-stars span:nth-child(2)  { top: 22%; left: 84%; animation-delay: 0.7s; }
.hero-stars span:nth-child(3)  { top: 34%; left: 14%; animation-delay: 1.4s; width: 1px; height: 1px; }
.hero-stars span:nth-child(4)  { top: 8%;  left: 62%; animation-delay: 2.1s; width: 3px; height: 3px; }
.hero-stars span:nth-child(5)  { top: 48%; left: 92%; animation-delay: 2.8s; }
.hero-stars span:nth-child(6)  { top: 64%; left: 6%;  animation-delay: 3.5s; }
.hero-stars span:nth-child(7)  { top: 72%; left: 78%; animation-delay: 0.3s; width: 1px; height: 1px; }
.hero-stars span:nth-child(8)  { top: 18%; left: 48%; animation-delay: 1.1s; }
.hero-stars span:nth-child(9)  { top: 56%; left: 32%; animation-delay: 1.9s; width: 1px; height: 1px; }
.hero-stars span:nth-child(10) { top: 82%; left: 88%; animation-delay: 2.6s; }
.hero-stars span:nth-child(11) { top: 28%; left: 28%; animation-delay: 3.3s; width: 1px; height: 1px; }
.hero-stars span:nth-child(12) { top: 44%; left: 70%; animation-delay: 4.0s; }
.hero-stars span:nth-child(13) { top: 88%; left: 22%; animation-delay: 0.5s; }
.hero-stars span:nth-child(14) { top: 38%; left: 56%; animation-delay: 1.7s; width: 1px; height: 1px; }
.hero-stars span:nth-child(15) { top: 76%; left: 50%; animation-delay: 2.4s; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  40%, 60% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-stars span { animation: none; opacity: 0.7; }
}

.hero-inner {
  position: relative;
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 clamp(24px, 4vw, 36px);
  opacity: 0.92;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(56px, 13vw, 168px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

.hero-title-line {
  display: block;
}

.hero-title-line--em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
  margin-top: -0.05em;
  text-shadow: 0 0 60px color-mix(in oklab, var(--gold) 25%, transparent);
}

.hero-lede {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(19px, 2.4vw, 26px);
  line-height: 1.5;
  color: var(--ink-mute);
  max-width: 32ch;
  margin: clamp(28px, 4vw, 44px) auto 0;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(40px, 6vw, 72px);
  padding: 14px 4px 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  min-height: 44px;
  min-width: 140px;
  justify-content: center;
}

.hero-cta::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold-deep);
  transform-origin: center;
  transition: transform 0.5s var(--easing), background 0.3s var(--easing);
}

.hero-cta:hover::after,
.hero-cta:focus-visible::after {
  background: var(--gold);
  transform: scaleY(2);
}

.hero-cta-arrow {
  font-size: 18px;
  color: var(--gold);
  transition: transform 0.5s var(--easing);
}

.hero-cta:hover .hero-cta-arrow {
  transform: translateY(4px);
}

/* ==========================================================================
   Section eyebrow (kicker)
   ========================================================================== */

.section-eyebrow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: clamp(40px, 6vw, 64px);
  position: relative;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.05em;
  position: relative;
  padding-bottom: 14px;
}

.section-num::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 1px;
  background: var(--gold-deep);
}

.section-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5.5vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 22ch;
  margin: 0 0 clamp(40px, 6vw, 64px);
}

.section-title em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

/* ==========================================================================
   Section: Manifesto
   ========================================================================== */

.manifesto {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--rhythm-lg) var(--pad);
}

.manifesto-body {
  max-width: 62ch;
  margin-left: clamp(0px, 8vw, 120px);
}

.manifesto-lede {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 clamp(32px, 5vw, 48px);
  letter-spacing: -0.005em;
}

.manifesto-text {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.7;
  color: var(--ink-mute);
  margin: 0 0 24px;
}

/* ==========================================================================
   Section: Cosa
   ========================================================================== */

.cosa {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--rhythm-lg) var(--pad);
  border-top: 1px solid var(--border);
}

.cosa-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: clamp(40px, 5vw, 56px);
}

.cosa-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: baseline;
  padding-bottom: clamp(36px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
}

.cosa-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cosa-num {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 28px);
  color: var(--gold);
  letter-spacing: 0.02em;
}

.cosa-h {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 0 0 12px;
  color: var(--ink);
}

.cosa-p {
  grid-column: 2;
  grid-row: 2;
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.7;
  color: var(--ink-mute);
  margin: 0;
  max-width: 56ch;
}

/* ==========================================================================
   Section: Pantheon
   ========================================================================== */

.pantheon {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--rhythm-lg) var(--pad);
  border-top: 1px solid var(--border);
}

.pantheon-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}

.pantheon-item {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 3fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: baseline;
  padding: clamp(24px, 3vw, 36px) 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.pantheon-item:last-child {
  border-bottom: none;
}

.pantheon-item--lead {
  padding-top: 0;
}

.pantheon-item--lead .pantheon-name {
  font-size: clamp(40px, 6vw, 76px);
}

.pantheon-role {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.pantheon-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  transition: color 0.4s var(--easing);
}

.pantheon-item:hover .pantheon-name {
  color: var(--gold);
}

.pantheon-alias {
  grid-column: 2;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-faint);
  margin: 8px 0 0;
  letter-spacing: 0.01em;
}

.pantheon-alias span {
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 12px;
  padding-left: 6px;
}

/* ==========================================================================
   Section: Valori
   ========================================================================== */

.valori {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--rhythm-lg) var(--pad);
  border-top: 1px solid var(--border);
}

.valori-stack {
  display: grid;
  gap: clamp(48px, 7vw, 88px);
}

.valore {
  max-width: 56ch;
  position: relative;
}

.valore:nth-child(2) { margin-left: clamp(0px, 12vw, 160px); }
.valore:nth-child(3) { margin-left: clamp(0px, 22vw, 280px); }

.valore-tag {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--gold);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

.valore-h {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--ink);
  letter-spacing: -0.008em;
}

.valore-p {
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.7;
  color: var(--ink-mute);
  margin: 0;
}

/* ==========================================================================
   Closing pull-quote
   ========================================================================== */

.closing {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--rhythm-lg) var(--pad);
  text-align: center;
  border-top: 1px solid var(--border);
}

.closing-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4.5vw, 48px);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 24px;
  letter-spacing: -0.008em;
}

.closing-text em {
  font-style: italic;
  color: var(--gold);
  display: block;
  margin-top: 8px;
}

.closing-source {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-soft);
  padding: clamp(64px, 8vw, 96px) 0 clamp(40px, 5vw, 56px);
  margin-top: clamp(80px, 10vw, 120px);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  gap: clamp(32px, 5vw, 56px);
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

.footer-brand { }

.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0.04em;
  color: var(--ink);
  margin: 0 0 8px;
}

.footer-claim {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-mute);
  margin: 0;
  max-width: 38ch;
}

.footer-meta {
  text-align: left;
}

@media (min-width: 768px) {
  .footer-meta { text-align: right; }
}

.footer-copy {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.footer-credit {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0;
  letter-spacing: 0.02em;
}

.footer-credit a {
  color: var(--gold);
  position: relative;
  padding-bottom: 1px;
}

.footer-credit a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold-deep);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--easing);
}

.footer-credit a:hover::after,
.footer-credit a:focus-visible::after {
  transform: scaleX(1);
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--easing), transform 0.8s var(--easing);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
  body { font-size: 16px; }

  .nav-links { display: none; }
  .nav-toggle { display: block; }

  .hero { min-height: 88vh; min-height: 88svh; }

  .manifesto-body { margin-left: 0; }

  .cosa-item {
    grid-template-columns: 60px 1fr;
    gap: 12px;
  }

  .pantheon-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 28px 0;
  }
  .pantheon-item--lead { padding-top: 0; }
  .pantheon-alias { grid-column: 1; margin-top: 4px; }

  .valore:nth-child(2) { margin-left: 0; }
  .valore:nth-child(3) { margin-left: 0; }
}

/* Very small phones */
@media (max-width: 360px) {
  :root { --pad: 16px; }
  .hero-title { font-size: 48px; }
}
