:root {
  --ink: #f4efe6;
  --ink-soft: rgba(244, 239, 230, 0.74);
  --amber: #e8b86d;
  --bg: #0c0a08;
  --shadow: rgba(8, 6, 4, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.stage {
  position: relative;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: grid;
  place-items: end start;
  isolation: isolate;
  overflow: hidden;
}

.hero {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--bg);
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0;
  transform: scale(1.06);
  transition:
    opacity 0.9s var(--ease),
    transform 10s var(--ease);
  will-change: opacity, transform;
}

.hero.is-ready .hero__img {
  opacity: 1;
  transform: scale(1);
  animation: breathe 18s var(--ease) infinite alternate;
}

.veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(12, 10, 8, 0.12) 0%,
      rgba(12, 10, 8, 0.28) 42%,
      rgba(12, 10, 8, 0.78) 78%,
      rgba(12, 10, 8, 0.92) 100%
    ),
    linear-gradient(
      90deg,
      rgba(12, 10, 8, 0.42) 0%,
      transparent 48%
    );
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.06;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.copy {
  position: relative;
  z-index: 2;
  width: min(100%, 28rem);
  padding:
    clamp(1.5rem, 4vw, 3rem)
    clamp(1.25rem, 5vw, 5rem)
    calc(clamp(1.75rem, 5vw, 4.5rem) + var(--safe-bottom))
    calc(clamp(1.25rem, 5vw, 5rem) + var(--safe-left));
  animation: rise 1.1s var(--ease) both;
}

.brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: clamp(3.25rem, 14vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-shadow: 0 12px 40px var(--shadow);
}

.brand__dot {
  color: var(--amber);
  display: inline-block;
  animation: blink 3.6s ease-in-out infinite;
}

.line {
  margin-top: 1rem;
  font-weight: 300;
  font-size: clamp(0.98rem, 2.8vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 18rem;
  animation: rise 1.1s var(--ease) 0.16s both;
}

.dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(232, 184, 109, 0.55);
  animation: pulse 2.4s ease-out infinite;
  vertical-align: 0.15em;
}

@keyframes breathe {
  from {
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.05) translate3d(-1%, -0.5%, 0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%,
  92%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
  95% {
    opacity: 0.35;
    transform: scaleY(0.15);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(232, 184, 109, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(232, 184, 109, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(232, 184, 109, 0);
  }
}

/* Phones — portrait: text sits cleanly over lower third */
@media (max-width: 720px) and (orientation: portrait) {
  .stage {
    place-items: end stretch;
  }

  .hero__img {
    object-position: center 28%;
  }

  .veil {
    background:
      linear-gradient(
        180deg,
        rgba(12, 10, 8, 0.08) 0%,
        rgba(12, 10, 8, 0.18) 38%,
        rgba(12, 10, 8, 0.72) 68%,
        rgba(12, 10, 8, 0.94) 100%
      );
  }

  .copy {
    width: 100%;
    padding:
      1.5rem
      calc(1.25rem + var(--safe-right))
      calc(2.25rem + var(--safe-bottom))
      calc(1.25rem + var(--safe-left));
  }

  .line {
    max-width: none;
  }
}

/* Tablets */
@media (min-width: 721px) and (max-width: 1100px) {
  .copy {
    width: min(100%, 26rem);
    padding:
      2.25rem
      calc(2.5rem + var(--safe-right))
      calc(2.75rem + var(--safe-bottom))
      calc(2.5rem + var(--safe-left));
  }

  .brand {
    font-size: clamp(4rem, 9vw, 5.5rem);
  }
}

/* Landscape phones / short viewports */
@media (max-height: 480px) and (orientation: landscape) {
  .stage {
    place-items: center start;
  }

  .veil {
    background:
      linear-gradient(
        90deg,
        rgba(12, 10, 8, 0.78) 0%,
        rgba(12, 10, 8, 0.35) 42%,
        transparent 70%
      ),
      linear-gradient(
        180deg,
        transparent 50%,
        rgba(12, 10, 8, 0.45) 100%
      );
  }

  .copy {
    padding:
      calc(1rem + var(--safe-top))
      1.5rem
      calc(1rem + var(--safe-bottom))
      calc(1.5rem + var(--safe-left));
  }

  .brand {
    font-size: clamp(2.4rem, 10vh, 3.6rem);
  }

  .line {
    margin-top: 0.65rem;
    font-size: 0.95rem;
  }

  .hero.is-ready .hero__img {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__img,
  .brand__dot,
  .dot,
  .copy,
  .line {
    animation: none !important;
    transition: opacity 0.3s ease !important;
  }

  .hero.is-ready .hero__img {
    transform: none;
  }
}
