:root {
  color-scheme: light only;
  --cream: #f7f1e8;
  --ivory: #fffdf8;
  --ink: #172033;
  --muted: #59616e;
  --muted-deep: #444d5d;
  --violet: #5b21b6;
  --violet-deep: #48168f;
  --orange: #e8520a;
  --orange-deep: #c74308;
  --focus: #b83b00;

  --atmo-warmth: 0.08;
  --atmo-violet: 0.02;
  --atmo-depth: 0.06;
  --atmo-horizon: 0.03;
  --atmo-flow: 0.05;
  --atmo-clarity: 0.24;
  --atmo-luminance: 1;
  --content-y: 120;
  --content-opacity: 0;
  --pointer-x: 0;
  --pointer-y: 0;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

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

html {
  min-width: 320px;
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--cream);
  -webkit-text-size-adjust: 100%;
}

html.intro-active { overflow: hidden; }

body {
  min-width: 320px;
  width: 100%; height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
a { color: inherit; }
button { border: 0; background: none; cursor: pointer; }
img, svg { display: block; }

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

/* ═══════════════════════════════════════════
   SKIP LINK
   ═══════════════════════════════════════════ */

.skip-link {
  position: fixed; z-index: 200;
  top: 0.75rem; left: 0.75rem;
  padding: 0.7rem 1rem; border-radius: 0.5rem;
  background: var(--ink); color: #fff;
  font-size: 0.78rem; font-weight: 700;
  text-decoration: none;
  transform: translateY(calc(-100% - 1rem));
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--focus); outline-offset: 2px; }

/* ═══════════════════════════════════════════
   INTRO LAYER (Skip button container)
   ═══════════════════════════════════════════ */

.intro-layer {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: max(2rem, env(safe-area-inset-bottom)) max(2rem, env(safe-area-inset-right));
  pointer-events: none; opacity: 0;
  transition: opacity 400ms ease;
}
.intro-active .intro-layer { opacity: 1; visibility: visible; }
.intro-complete .intro-layer { opacity: 0; visibility: hidden; pointer-events: none; }

.intro-skip {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.1rem; border-radius: 2rem;
  background: rgba(23,32,51,0.05); backdrop-filter: blur(6px);
  color: var(--muted-deep);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  transition: background 200ms, color 200ms;
}
.intro-active .intro-skip { pointer-events: auto; }
.intro-skip:hover { background: rgba(23,32,51,0.09); color: var(--ink); }
.intro-skip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ═══════════════════════════════════════════
   THE SINGLE FRAME
   ═══════════════════════════════════════════ */

.experience-shell {
  position: relative;
  width: 100%; min-height: 100vh; min-height: 100svh;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  background: var(--cream);
}

/* ═══════════════════════════════════════════
   CINEMA WORLD — Procedural atmospheric field
   ═══════════════════════════════════════════ */

.cinema-world {
  position: absolute; inset: -32px; z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 105% at 31% 28%, rgba(255,253,248,0.98) 0%, rgba(247,241,232,0.72) 55%, transparent 78%),
    radial-gradient(ellipse 115% 72% at 52% 112%, rgba(226,126,67,0.25) 0%, rgba(232,157,103,0.1) 46%, transparent 76%),
    radial-gradient(ellipse 58% 92% at 94% 32%, rgba(111,78,151,0.14) 0%, transparent 72%),
    linear-gradient(180deg, #fbf7ef 0%, #f7f0e6 64%, #edc8ad 100%);
}

.atmosphere-canvas {
  position: absolute; inset: 0;
  display: block;
  width: 100%; height: 100%;
  pointer-events: none;
}

.prologue-stage {
  position: absolute; inset: 0; z-index: 8;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.prologue-phrase {
  position: absolute;
  left: 50%; top: 53%;
  width: min(90vw, 72rem);
  margin: 0;
  transform: translate(-50%, -50%);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(3.5rem, 6.2vw, 7.4rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-align: center;
  color: var(--ink);
  opacity: 0;
  filter: blur(14px);
  clip-path: inset(0 50% 0 50%);
  will-change: opacity, filter, clip-path, transform, letter-spacing;
}

.prologue-focal {
  color: var(--violet);
  font-size: clamp(5rem, 9.5vw, 11rem);
  font-style: italic;
  line-height: 0.86;
}

.prologue-four { font-size: clamp(3.8rem, 6.8vw, 8rem); }

/* ═══════════════════════════════════════════
   LANGUAGE CONTROL
   ═══════════════════════════════════════════ */

.lang-control {
  position: absolute;
  top: max(1.5rem, env(safe-area-inset-top));
  right: max(2rem, env(safe-area-inset-right));
  z-index: 110;
  display: flex; align-items: center;
  opacity: 1;
  transition: opacity 600ms ease;
}

.lang-btn {
  padding: 0.4rem 0.55rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--muted); transition: color 200ms;
}
.lang-btn.active { color: var(--ink); }
.lang-btn:hover { color: var(--ink); }
.lang-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 0.2rem; }

.lang-divider { width: 1px; height: 0.7rem; background: var(--muted); opacity: 0.3; }

/* ═══════════════════════════════════════════
   BRAND / LOGO
   ═══════════════════════════════════════════ */

.scene-brand {
  position: absolute;
  top: max(clamp(1.2rem, 3vh, 2.5rem), env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  z-index: 10;
  opacity: 0;
}

.scene-logo {
  width: clamp(2.2rem, 4vw, 3.4rem); height: auto;
  opacity: 0.9;
}

/* ═══════════════════════════════════════════
   MAIN CONTENT — CENTRED MONUMENTAL
   ═══════════════════════════════════════════ */

.cinematic-main {
  position: relative; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  width: 100%; max-width: 52rem;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  padding-bottom: 3vh;
  transform: translateY(calc(var(--content-y) * 1px));
  opacity: var(--content-opacity);
  will-change: transform, opacity;
}
.cinematic-main:focus { outline: none; }


.scene-copy {
  display: flex; flex-direction: column; align-items: center;
  width: 100%;
}

/* ═══════════════════════════════════════════
   EYEBROW
   ═══════════════════════════════════════════ */

.eyebrow {
  margin: 0 0 clamp(0.8rem, 2vh, 1.8rem);
  font-size: clamp(0.6rem, 0.68vw, 0.76rem);
  font-weight: 700; letter-spacing: 0.2em;
  color: var(--muted); text-transform: uppercase;
  opacity: 0;
}

/* ═══════════════════════════════════════════
   HEADLINE
   ═══════════════════════════════════════════ */

h1 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 5.8vw, 5rem);
  line-height: 1.14;
  letter-spacing: -0.018em;
  color: var(--ink);
}

html[lang="it"] .cinematic-main { max-width: 60rem; }
html[lang="it"] h1 { font-size: clamp(2.15rem, 5.2vw, 4.75rem); }

.headline-line { display: block; }
.headline-inner { display: inline-block; opacity: 0; }

.headline-focal {
  color: var(--violet);
  font-style: italic;
}

/* ═══════════════════════════════════════════
   SUPPORTING COPY
   ═══════════════════════════════════════════ */

.supporting-copy {
  margin: clamp(1rem, 2.5vh, 2rem) 0 0;
  max-width: 33rem;
  font-size: clamp(0.86rem, 1.05vw, 1.02rem);
  line-height: 1.68; color: var(--muted-deep);
  opacity: 0;
}

.chapter-statement {
  margin: clamp(0.5rem, 1.2vh, 1rem) 0 0;
  font-size: clamp(0.82rem, 0.92vw, 0.94rem);
  font-style: italic; color: var(--muted);
  opacity: 0;
}

/* ═══════════════════════════════════════════
   CTA
   ═══════════════════════════════════════════ */

.contact-actions {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.6rem; margin-top: clamp(1.2rem, 3vh, 2.2rem);
  opacity: 0;
}

.contact-button {
  display: inline-flex; align-items: center; gap: 0.65rem;
  padding: 0.8rem 1.7rem;
  border: 1.5px solid var(--ink); border-radius: 3rem;
  color: var(--ink); font-size: 0.86rem; font-weight: 600;
  text-decoration: none;
  transition: border-color 250ms, color 250ms, transform 120ms;
}
.contact-button:hover { border-color: var(--orange); color: var(--orange-deep); }
.contact-button:hover .contact-arrow { transform: translateX(3px); }
.contact-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.contact-button:active { transform: scale(0.97); }

.contact-arrow { display: flex; transition: transform 250ms; }
.contact-arrow svg { width: 1.05rem; height: 1.05rem; }

.cta-detail {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  opacity: 0;
}

.email-link {
  font-size: 0.72rem; color: var(--muted);
  text-decoration: none; transition: color 200ms;
  opacity: 0.7;
}
.email-link:hover { color: var(--orange); opacity: 1; }
.email-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 0.2rem; }

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

.scene-footer {
  position: absolute; bottom: clamp(0.8rem, 2vh, 1.8rem);
  left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(0.8rem, 2.5vw, 2.2rem);
  padding: 0 1.5rem;
  font-size: 0.7rem; color: var(--muted);
  opacity: 0;
}
.scene-footer address { font-style: normal; }
.scene-footer p { margin: 0; }

.status-indicator { display: flex; align-items: center; gap: 0.45rem; }
.status-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--orange);
  animation: breathe 5.5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ═══════════════════════════════════════════
   REPLAY BUTTON
   ═══════════════════════════════════════════ */

.replay-btn {
  position: absolute; bottom: clamp(0.8rem, 2vh, 1.8rem);
  left: 2rem; z-index: 50;
  padding: 0.4rem 0.8rem; border-radius: 1rem;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); background: rgba(23,32,51,0.04);
  transition: color 200ms, background 200ms;
}
.replay-btn:hover { color: var(--ink); background: rgba(23,32,51,0.07); }
.replay-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.replay-btn[hidden] { display: none; }

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE
   ═══════════════════════════════════════════ */

@media (max-width: 600px) {
  .experience-shell { justify-content: flex-start; }

  .cinema-world {
    background:
      radial-gradient(ellipse 118% 95% at 26% 30%, rgba(255,253,248,0.99) 0%, rgba(247,241,232,0.72) 58%, transparent 82%),
      radial-gradient(ellipse 145% 66% at 48% 112%, rgba(223,118,59,0.28) 0%, rgba(232,157,103,0.09) 52%, transparent 78%),
      radial-gradient(ellipse 76% 94% at 111% 22%, rgba(105,73,147,0.15) 0%, transparent 74%),
      linear-gradient(180deg, #fbf7ef 0%, #f7f0e6 67%, #eac5ac 100%);
  }

  .scene-brand { top: max(0.85rem, env(safe-area-inset-top)); }
  .scene-logo { width: 2rem; }
  .lang-control {
    top: max(0.72rem, env(safe-area-inset-top));
    right: max(0.72rem, env(safe-area-inset-right));
  }
  .lang-btn { min-width: 2rem; min-height: 2rem; padding: 0.35rem; }

  .cinematic-main {
    position: absolute;
    top: clamp(8rem, 24dvh, 12.8rem);
    width: 100%; max-width: 28rem;
    padding: 0 1.15rem;
    padding-bottom: 0;
  }
  h1 {
    font-size: clamp(1.95rem, 9vw, 2.6rem);
    line-height: 1.04;
    letter-spacing: -0.022em;
  }
  html[lang="it"] .cinematic-main { max-width: 28rem; }
  html[lang="it"] h1 {
    font-size: clamp(1.78rem, 8.2vw, 2.35rem);
    line-height: 1.05;
    letter-spacing: -0.026em;
  }

  .eyebrow { margin-bottom: 0.7rem; font-size: 0.55rem; letter-spacing: 0.18em; }
  .supporting-copy { max-width: 23rem; margin-top: 0.9rem; font-size: 0.76rem; line-height: 1.52; }
  .chapter-statement { margin-top: 0.45rem; font-size: 0.72rem; }
  .contact-actions { margin-top: 1rem; gap: 0.28rem; }
  .contact-button { min-height: 2.75rem; padding: 0.62rem 1.35rem; font-size: 0.8rem; }
  .cta-detail { margin-top: 0.3rem; font-size: 0.67rem; }
  .email-link { padding: 0.15rem; font-size: 0.64rem; }

  .scene-footer {
    bottom: max(2.55rem, calc(env(safe-area-inset-bottom) + 2rem));
    flex-direction: column;
    gap: 0.12rem;
    padding: 0 0.75rem;
    font-size: 0.57rem;
    line-height: 1.35;
  }
  .status-indicator { gap: 0.35rem; }
  .status-dot { width: 4px; height: 4px; }

  .intro-skip { font-size: 0.7rem; padding: 0.55rem 0.9rem; }
  .intro-layer { padding: 1rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)); }
  .replay-btn {
    left: max(0.75rem, env(safe-area-inset-left));
    bottom: max(0.55rem, env(safe-area-inset-bottom));
    font-size: 0.58rem;
  }

  .prologue-phrase {
    top: 53%;
    width: calc(100% - 2rem);
    font-size: clamp(2.2rem, 11.5vw, 3.35rem);
    line-height: 0.98;
  }
  html[lang="it"] .prologue-phrase { font-size: clamp(2rem, 10vw, 3rem); }
  .prologue-focal { font-size: clamp(3.7rem, 17vw, 5.6rem); }
  html[lang="it"] .prologue-focal { font-size: clamp(3.25rem, 14.5vw, 4.9rem); }
}

@media (max-width: 380px) {
  .cinematic-main { padding-inline: 1rem; }
  h1 { font-size: clamp(1.82rem, 9vw, 2.1rem); }
  html[lang="it"] h1 { font-size: clamp(1.68rem, 8.1vw, 1.95rem); }
  .supporting-copy { font-size: 0.72rem; }
}

@media (max-height: 720px) and (max-width: 600px) {
  .supporting-copy { display: none; }
  .chapter-statement { display: none; }
  .contact-actions { margin-top: 1rem; }
}

@media (max-height: 600px) and (max-width: 600px) {
  .cinematic-main { top: clamp(7.4rem, 23dvh, 8.3rem); }
  .scene-footer { bottom: 2.35rem; }
}

@media (max-height: 780px) and (min-width: 601px) {
  h1 { font-size: clamp(2rem, 4.5vw, 3.8rem); }
  .supporting-copy { font-size: 0.82rem; margin-top: 0.7rem; }
  .chapter-statement { font-size: 0.78rem; }
  .contact-actions { margin-top: 1rem; }
  .scene-brand { top: 0.6rem; }
  .scene-logo { width: 1.6rem; }
  .eyebrow { margin-bottom: 0.5rem; }
}

@media (min-width: 2400px) {
  h1 { font-size: 5.8rem; }
  .scene-logo { width: 4.2rem; }
}

/* ═══════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scene-brand,
  .eyebrow,
  .headline-inner,
  .supporting-copy,
  .chapter-statement,
  .contact-actions,
  .cta-detail,
  .scene-footer,
  .lang-control {
    opacity: 1 !important;
  }

  .prologue-stage,
  .replay-btn { display: none !important; }

  :root {
    --atmo-warmth: 0.9;
    --atmo-violet: 0.8;
    --atmo-depth: 1;
    --atmo-horizon: 1;
    --atmo-flow: 0.92;
    --atmo-clarity: 1;
    --content-y: 0;
    --content-opacity: 1;
  }

  .status-dot { animation: none; opacity: 0.8; }
}

/* ═══════════════════════════════════════════
   NO-JS FALLBACK
   ═══════════════════════════════════════════ */

html:not(.js) .intro-layer { display: none; }
html:not(.js) .replay-btn { display: none; }
html:not(.js) .prologue-stage { display: none; }

html:not(.js) .scene-brand,
html:not(.js) .eyebrow,
html:not(.js) .headline-inner,
html:not(.js) .supporting-copy,
html:not(.js) .chapter-statement,
html:not(.js) .contact-actions,
html:not(.js) .cta-detail,
html:not(.js) .scene-footer,
html:not(.js) .lang-control {
  opacity: 1 !important;
}

html:not(.js) {
  --atmo-warmth: 0.9;
  --atmo-violet: 0.8;
  --atmo-depth: 1;
  --atmo-horizon: 1;
  --atmo-flow: 0.92;
  --atmo-clarity: 1;
  --content-y: 0;
  --content-opacity: 1;
}

/* ═══════════════════════════════════════════
   FORCED COLORS
   ═══════════════════════════════════════════ */

@media (forced-colors: active) {
  .cinema-world { display: none; }
  .contact-button { border: 2px solid ButtonText; }
  .status-dot { background: Highlight; }
}

/* ═══════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════ */

@media print {
  .cinema-world, .intro-layer, .lang-control, .replay-btn { display: none !important; }
  body { background: #fff; overflow: visible; height: auto; }
  .experience-shell { height: auto; }
}
