/* ==========================================================================
   Spaghetto — Teaser Page
   Tokens sourced from stitch/desktop/DESIGN.md + stitch/mobile/DESIGN.md
   ========================================================================== */

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

:root {
  /* Typography */
  --font-display: "Bodoni Moda", Didot, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --fs-display: clamp(2.5rem, 2.16rem + 3.43vw, 5.25rem);
  --lh-display: 1.1;
  --fs-eyebrow: 14px;
  --fs-body: 18px;
  --lh-body: 30px;
  --fs-label: 12px;

  /* Color — Italian Editorial Hospitality palette */
  --color-bg: #0c0906;
  --color-primary: #ffffff;
  --color-on-primary: #121414;
  --color-ink-soft: #c4c7c8;
  --color-border: #ffffff;

  /* Spacing */
  --space-margin-mobile: 20px;
  --space-margin-desktop: 64px;
  --space-gutter: 24px;
  --content-max-desktop: 600px;
  --content-max-mobile: 24rem;

  /* Motion */
  --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);

  /* Viewport height with fallback */
  --vh-fallback: 100vh;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--color-bg);
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

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

.hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: var(--vh-fallback);
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  background-color: var(--color-bg);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  /* Mobile source is a tall portrait crop; "contain" guarantees both hands and
     forearms are always in frame instead of cover cropping them off the sides. */
  object-fit: contain;
  object-position: center bottom;
}

html.has-motion:not(.is-ready) .hero-bg-img {
  transform: scale(1.018);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 32%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.1) 55%, rgba(0, 0, 0, 0) 72%);
}

.hero-frame {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: var(--vh-fallback);
  min-height: 100svh;
  min-height: 100dvh;
  padding: var(--space-margin-mobile);
  padding-bottom: max(var(--space-margin-mobile), env(safe-area-inset-bottom));
  padding-top: max(var(--space-margin-mobile), env(safe-area-inset-top));
}

.hero-header {
  display: flex;
  justify-content: flex-start;
}

.logo {
  width: auto;
  height: 32px;
}

.hero-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  max-width: var(--content-max-mobile);
  gap: 24px;
  padding-bottom: 8vh;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

.headline .line {
  display: block;
  overflow: hidden;
}

.headline .line > span {
  display: block;
}

.body-copy {
  margin: 0;
  max-width: 32rem;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  color: var(--color-ink-soft);
}

.cta-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 0;
  transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease, transform 240ms ease;
}

.btn:hover {
  transform: translateX(2px);
}

.btn:active {
  transform: scale(0.99);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--color-primary);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.hero-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  opacity: 0.55;
}

.entity-statement {
  margin: 0;
  max-width: 34ch;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-ink-soft);
  opacity: 0.7;
}

.local-business {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 2px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--color-ink-soft);
  opacity: 0.7;
}

.local-business strong {
  flex-basis: 100%;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.9;
}

.local-business a {
  display: inline-block;
  padding: 2px 0;
  text-decoration: none;
  color: var(--color-ink-soft);
}

.local-business a:hover,
.local-business a:focus-visible {
  color: var(--color-primary);
}

/* ==========================================================================
   Desktop / wide layout
   ========================================================================== */

@media (min-width: 768px) {
  .hero-frame {
    padding: var(--space-margin-desktop);
  }

  .logo {
    height: 40px;
  }

  .hero-main {
    justify-content: center;
    max-width: var(--content-max-desktop);
    padding-bottom: 0;
  }

  .cta-row {
    flex-direction: row;
    align-items: center;
    width: auto;
  }

  .btn {
    padding: 16px 32px;
    white-space: nowrap;
    width: auto;
  }

  .hero-bg-img {
    object-fit: cover;
    object-position: center 35%;
  }
}

/* ==========================================================================
   Focus states
   ========================================================================== */

a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

/* ==========================================================================
   Entrance choreography (progressive enhancement — see script.js)

   html.has-motion   — JS confirmed: safe to hold elements in their hidden
                        pre-animation state (prevents a flash of fully
                        visible content, without ever hiding <body>).
   html.is-ready      — DOM parsed: safe to actually start the keyframes.

   Each element carries its own --delay (and optionally --dur, --ty) as an
   inline custom property, so the whole sequence reads as one timeline
   rather than a pile of numbered classes.
   ========================================================================== */

.reveal,
.reveal-line {
  opacity: 1;
  transform: none;
}

html.has-motion .reveal {
  opacity: 0;
  transform: translateY(var(--ty, 8px));
}

html.has-motion .reveal-line {
  opacity: 0;
  transform: translateY(var(--ty, 20px));
}

html.has-motion.is-ready .hero-bg-img {
  transform: scale(1.018);
  animation: bg-settle 1300ms var(--ease-premium) forwards;
}

html.has-motion.is-ready .reveal {
  animation: fade-up var(--dur, 480ms) var(--ease-premium) var(--delay, 0ms) forwards;
}

html.has-motion.is-ready .reveal-line {
  animation: fade-up var(--dur, 650ms) var(--ease-premium) var(--delay, 0ms) forwards;
}

html.has-motion.is-ready:not(.motion-done) .reveal,
html.has-motion.is-ready:not(.motion-done) .reveal-line,
html.has-motion.is-ready:not(.motion-done) .hero-bg-img {
  will-change: opacity, transform;
}

@keyframes bg-settle {
  to { transform: scale(1); }
}

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 767px) {
  .reveal-line {
    --ty: 14px;
  }

  .hero-main {
    gap: 16px;
    padding-bottom: 1vh;
  }

  .hero-footer {
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.has-motion .hero-bg-img,
  html.has-motion .reveal,
  html.has-motion .reveal-line {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    will-change: auto !important;
  }
}
