:root {
  --color-bg: #f3efe8;
  --color-hero-surface: #fffcf6;
  --color-border-subtle: rgba(26, 22, 16, 0.08);
  --color-text: #1e1b17;
  --color-muted: rgba(30, 27, 23, 0.68);
  --color-accent: #9d6f2f;
  --color-accent-hover: #7a5825;
  --color-accent-soft: rgba(157, 111, 47, 0.12);
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --shadow-soft: 0 18px 48px rgba(30, 27, 23, 0.08),
    0 2px 8px rgba(30, 27, 23, 0.04);
  --radius-lg: clamp(14px, 2.2vw, 24px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-img-max-w: min(100%, 28rem);
  --hero-img-max-h: min(68dvh, 32rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--color-text);
  background: radial-gradient(
      ellipse 120% 85% at 50% -15%,
      var(--color-accent-soft),
      transparent 55%
    ),
    var(--color-bg);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.page {
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(0.75rem, 3vw, 2rem);
}

.hero {
  width: 100%;
  max-width: min(72rem, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.hero__visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3.5vw, 2rem);
  background: linear-gradient(
    165deg,
    var(--color-hero-surface) 0%,
    #fff8ea 42%,
    #faf4ea 100%
  );
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-soft);
}

.hero__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    70% 60% at 50% 0%,
    rgba(255, 255, 255, 0.55),
    transparent 65%
  );
}

.hero__image {
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  max-width: var(--hero-img-max-w);
  max-height: var(--hero-img-max-h);
  object-fit: contain;
  object-position: center;
  display: block;
}

.hero__content {
  padding: clamp(0.75rem, 2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

.hero__brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.85rem, 8vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--color-accent);
}

.hero__title {
  position: relative;
  display: inline-block;
  align-self: flex-start;
  margin: 0;
  margin-top: 0.2em;
  padding-bottom: 0.35em;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(0.9375rem, 2.15vw, 1.375rem);
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text);
  transform-origin: 50% 100%;
  animation: hero-soon-in 0.85s var(--ease-out) 0.15s both,
    hero-soon-flash 2.85s cubic-bezier(0.45, 0, 0.55, 1) 1.05s infinite;
}

.hero__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-accent) 12%,
    var(--color-accent) 88%,
    transparent 100%
  );
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  animation: hero-soon-line 0.95s var(--ease-out) 0.45s forwards,
    hero-soon-line-flash 2.85s cubic-bezier(0.45, 0, 0.55, 1) 1.05s infinite;
}

@keyframes hero-soon-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
    letter-spacing: 0.22em;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0.14em;
  }
}

@keyframes hero-soon-flash {
  0%,
  9% {
    opacity: 1;
  }
  12.5%,
  14.5% {
    opacity: 0.05;
  }
  18%,
  36% {
    opacity: 1;
  }
  40%,
  42% {
    opacity: 0.05;
  }
  46%,
  100% {
    opacity: 1;
  }
}

@keyframes hero-soon-line {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes hero-soon-line-flash {
  0%,
  9% {
    opacity: 1;
  }
  12.5%,
  14.5% {
    opacity: 0.12;
  }
  18%,
  36% {
    opacity: 1;
  }
  40%,
  42% {
    opacity: 0.12;
  }
  46%,
  100% {
    opacity: 1;
  }
}

.hero__lede {
  margin: 0;
  font-size: clamp(0.9375rem, 1.75vw, 1.125rem);
  color: var(--color-muted);
  max-width: 36ch;
}

.hero__footnote {
  margin: 0.5rem 0 0;
  font-size: clamp(0.875rem, 1.5vw, 0.9375rem);
}

.link {
  color: var(--color-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.22s var(--ease-out), text-underline-offset 0.22s var(--ease-out);
}

.link:hover {
  color: var(--color-accent-hover);
  text-underline-offset: 6px;
}

.link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Large image: give a bit more room on wide screens */
@media (min-width: 1100px) {
  :root {
    --hero-img-max-w: min(100%, 32rem);
    --hero-img-max-h: min(72dvh, 36rem);
  }
}

/* Mid: keep two columns until ~720px for balance */
@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    gap: clamp(1rem, 4.5vw, 1.75rem);
    align-content: center;
  }

  .hero__visual {
    order: -1;
    padding: clamp(0.875rem, 4vw, 1.5rem);
  }

  :root {
    --hero-img-max-w: min(100%, 22rem);
    --hero-img-max-h: min(52dvh, 24rem);
  }

  .hero__content {
    text-align: center;
    align-items: center;
  }

  .hero__title {
    align-self: center;
  }

  .hero__lede {
    max-width: 40ch;
  }
}

/* Short viewports: avoid image eating the whole fold */
@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --hero-img-max-h: min(42dvh, 14rem);
  }

  .page {
    align-items: flex-start;
    padding-block: 0.5rem;
  }

  .hero {
    gap: 0.75rem;
  }
}

/* Ultra-narrow */
@media (max-width: 380px) {
  :root {
    --hero-img-max-w: 100%;
    --hero-img-max-h: min(48dvh, 20rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .link {
    transition: none;
  }

  .hero__title {
    animation: none;
  }

  .hero__title::after {
    animation: none;
    transform: scaleX(1);
    opacity: 1;
  }
}
