/**
 * hero.css — the landing page hero ("the window").
 * ---------------------------------------------------------------------------
 * Plain CSS on purpose: it doesn't depend on the Tailwind build, so the hero
 * can't come out half-styled because someone forgot `npm run build`.
 *
 * The hero is always dark, in light and dark theme alike. Photography reads
 * best against near-black, and it gives the page one confident moment before
 * the lighter sections below.
 */

.hx {
  /* Light — warm cream stage. */
  --hx-bg: #fbf7f2;
  --hx-ink: #1a1411;
  --hx-muted: #6f635a;
  --hx-faint: rgba(26, 20, 17, .12);
  --hx-surface: rgba(255, 255, 255, .6);
  --hx-surface-hover: #ffffff;
  --hx-stroke: rgba(26, 20, 17, .12);
  --hx-accent: #ff6b00;
  --hx-accent-2: #ff9a44;
  --hx-gold: #a8782a;
  --hx-glow-1: rgba(255, 107, 0, .20);
  --hx-glow-2: rgba(233, 184, 114, .22);
  --hx-glow-3: rgba(255, 90, 120, .10);
  --hx-window-bg: #efe4d8;
  --hx-window-shadow: 0 0 0 1px rgba(26, 20, 17, .06), 0 40px 90px -36px rgba(255, 107, 0, .45), 0 30px 60px -30px rgba(26, 20, 17, .35);
  --hx-grain: .05;
  --hx-seal-ink: #1a1411;
  --hx-ease: cubic-bezier(.2, .8, .2, 1);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin-top: -72px;              /* sit under the transparent header */
  padding-top: 72px;
  background: var(--hx-bg);
  color: var(--hx-ink);
}

/* Dark — the near-black editorial stage. */
html.dark .hx {
  --hx-bg: #0d0a08;
  --hx-ink: #f7efe8;
  --hx-muted: rgba(247, 239, 232, .64);
  --hx-faint: rgba(247, 239, 232, .14);
  --hx-surface: rgba(255, 255, 255, .04);
  --hx-surface-hover: rgba(255, 255, 255, .09);
  --hx-stroke: rgba(247, 239, 232, .16);
  --hx-gold: #e9b872;
  --hx-glow-1: rgba(255, 107, 0, .30);
  --hx-glow-2: rgba(233, 184, 114, .14);
  --hx-glow-3: rgba(255, 60, 90, .10);
  --hx-window-bg: #1a1411;
  --hx-window-shadow: 0 0 0 1px rgba(247, 239, 232, .08), 0 40px 120px -30px rgba(255, 107, 0, .45), 0 30px 60px -20px rgba(0, 0, 0, .8);
  --hx-grain: .08;
  --hx-seal-ink: #f7efe8;
}

/* Warm light, slowly drifting, plus film grain. */
.hx__glow {
  position: absolute;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(40% 45% at 72% 38%, var(--hx-glow-1), transparent 70%),
    radial-gradient(35% 40% at 18% 80%, var(--hx-glow-2), transparent 70%),
    radial-gradient(30% 30% at 90% 90%, var(--hx-glow-3), transparent 70%);
  animation: hx-drift 18s ease-in-out infinite alternate;
}

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

@keyframes hx-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-4%, 3%, 0) scale(1.08); }
}

.hx__inner {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

/* ── Copy ───────────────────────────────────────────────────────────────── */

.hx__meta {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .9rem .45rem .7rem;
  border: 1px solid var(--hx-faint);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--hx-muted);
  background: var(--hx-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hx__pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hx-accent);
}

.hx__pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--hx-accent);
  animation: hx-pulse 2s var(--hx-ease) infinite;
}

@keyframes hx-pulse {
  from { transform: scale(1); opacity: .7; }
  to   { transform: scale(3.2); opacity: 0; }
}

/* Every slide's copy occupies the same grid cell, so the column is exactly as
   tall as its longest slide and nothing below it jumps when slides change. */
.hx__texts {
  display: grid;
  margin-top: 1.6rem;
}

.hx__text {
  grid-area: 1 / 1;
  pointer-events: none;
}

.hx__text.is-active {
  pointer-events: auto;
}

.hx__eyebrow {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--hx-gold);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s var(--hx-ease), transform .6s var(--hx-ease);
}

.hx__eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
}

.hx__title {
  margin: 1rem 0 0;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.7rem, 6.2vw, 6rem);
  line-height: .96;
  letter-spacing: -.035em;
  font-variation-settings: 'opsz' 144;
}

.hx__title em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(100deg, var(--hx-accent) 0%, var(--hx-accent-2) 45%, var(--hx-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: .06em;            /* italic overhang gets clipped otherwise */
}

/* Lines rise out of a mask, one after the other. */
.hx__line {
  display: block;
  overflow: hidden;
  padding-bottom: .08em;
}

.hx__line > span {
  display: block;
  opacity: 0;
  transform: translateY(108%);
  transition: transform .95s var(--hx-ease), opacity .5s ease;
}

.hx__lead {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.65;
  color: var(--hx-muted);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--hx-ease), transform .7s var(--hx-ease);
}

.hx__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2.2rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--hx-ease), transform .7s var(--hx-ease);
}

.hx__text.is-active .hx__eyebrow,
.hx__text.is-active .hx__lead,
.hx__text.is-active .hx__cta { opacity: 1; transform: none; }
.hx__text.is-active .hx__line > span { transform: none; opacity: 1; }

.hx__text.is-active .hx__eyebrow { transition-delay: .15s; }
.hx__text.is-active .hx__line:nth-child(1) > span { transition-delay: .22s; }
.hx__text.is-active .hx__line:nth-child(2) > span { transition-delay: .32s; }
.hx__text.is-active .hx__line:nth-child(3) > span { transition-delay: .42s; }
.hx__text.is-active .hx__lead { transition-delay: .5s; }
.hx__text.is-active .hx__cta { transition-delay: .6s; }

/* Leaving: fade quickly so the two slides never read on top of each other. */
.hx__text:not(.is-active) .hx__eyebrow,
.hx__text:not(.is-active) .hx__lead,
.hx__text:not(.is-active) .hx__cta { transition-duration: .3s; transform: translateY(-10px); }
.hx__text:not(.is-active) .hx__line > span { transition-duration: .45s, .3s; transform: translateY(-108%); opacity: 0; }

.hx__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 52px;
  padding: 0 1.6rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .3s var(--hx-ease), background .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.hx__btn svg {
  width: 18px;
  height: 18px;
  transition: transform .35s var(--hx-ease);
}

.hx__btn:hover svg { transform: translateX(4px); }
.hx__btn:active { transform: scale(.97); }

.hx__btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--hx-accent), #ff8424);
  box-shadow: 0 10px 30px -8px rgba(255, 107, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.hx__btn--primary:hover {
  box-shadow: 0 16px 40px -8px rgba(255, 107, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.hx__btn--ghost {
  color: var(--hx-ink);
  border: 1px solid var(--hx-faint);
  background: var(--hx-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hx__btn--ghost:hover {
  border-color: var(--hx-ink);
  background: var(--hx-surface-hover);
}

.hx__btn:focus-visible,
.hx__window:focus-visible,
.hx__dot:focus-visible,
.hx__arrow:focus-visible {
  outline: 2px solid var(--hx-accent);
  outline-offset: 4px;
}

.hx__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.25rem;
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--hx-faint);
}

.hx__stat-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
}

.hx__stat-label {
  margin-top: .4rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--hx-muted);
}

/* ── The window ─────────────────────────────────────────────────────────── */

.hx__stage {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: min(500px, calc((100svh - 300px) * .8));
}

/* Giant outlined slide number behind the window. */
.hx__index {
  position: absolute;
  top: -.35em;
  left: -.55em;
  z-index: -1;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(7rem, 15vw, 13rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.05em;
  color: transparent;
  -webkit-text-stroke: 1px var(--hx-stroke);
  pointer-events: none;
  user-select: none;
}

.hx__window {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 999px 999px 32px 32px;       /* an arched window */
  background: var(--hx-window-bg);
  box-shadow: var(--hx-window-shadow);
  transform: translateZ(0);                   /* Safari: clip the canvas to the radius */
  cursor: pointer;
}

.hx__canvas,
.hx__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hx__canvas {
  display: block;
  opacity: 0;
  transition: opacity .6s ease;
}

.hx--gl.hx--ready .hx__canvas { opacity: 1; }

.hx__img {
  object-fit: cover;
  object-position: 50% 30%;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.1s ease, transform 6s ease;
}

/* Fallback (no WebGL / reduced motion) and the moment before GL is ready. */
.hx--static .hx__img.is-active,
.hx--gl:not(.hx--ready) .hx__img.is-active {
  opacity: 1;
  transform: scale(1);
}

.hx--gl.hx--ready .hx__img { visibility: hidden; }

/* Inner edge light and a soft bottom shade so the caption reads. */
.hx__window::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  background: linear-gradient(to top, rgba(13, 10, 8, .55) 0%, transparent 32%);
}

.hx__view {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .65rem .65rem 1.1rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  background: rgba(13, 10, 8, .45);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background .3s ease;
}

.hx__view-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hx-accent);
  transition: transform .4s var(--hx-ease);
}

.hx__view-icon svg { width: 16px; height: 16px; }
.hx__window:hover .hx__view { background: rgba(13, 10, 8, .6); }
.hx__window:hover .hx__view-icon { transform: rotate(-45deg); }

/* Rotating seal overlapping the window's edge. */
.hx__seal {
  position: absolute;
  left: -46px;
  top: 30%;
  z-index: 3;
  width: 112px;
  height: 112px;
  pointer-events: none;
}

/* A backing disc, so the ring text stays legible over a busy photo. */
.hx__seal::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--hx-bg);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .35);
}

.hx__seal svg {
  position: relative;
  width: 100%;
  height: 100%;
  color: var(--hx-seal-ink);
  animation: hx-spin 22s linear infinite;
}

.hx__seal-core {
  position: absolute;
  inset: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hx-accent);
  box-shadow: 0 8px 24px -6px rgba(255, 107, 0, .7);
}

.hx__seal-core svg {
  width: 20px;
  height: 20px;
  animation: none;
  color: #fff;
}

@keyframes hx-spin { to { transform: rotate(360deg); } }

/* ── Slide navigation ───────────────────────────────────────────────────── */

.hx__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hx__counter {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hx__counter span:last-child { color: var(--hx-muted); }

.hx__dots {
  display: flex;
  flex: 1;
  gap: .4rem;
}

.hx__dot {
  position: relative;
  flex: 1;
  height: 28px;                 /* tall hit area, thin visible bar */
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hx__dot::before,
.hx__dot::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
}

.hx__dot::before { background: var(--hx-faint); }

.hx__dot::after {
  background: var(--hx-accent);
  transform: scaleX(0);
  transform-origin: left;
}

.hx__dot.is-active::after { animation: hx-fill 6.5s linear forwards; }
.hx--paused .hx__dot.is-active::after,
.hx--static .hx__dot.is-active::after { animation-play-state: paused; }
.hx--static .hx__dot.is-active::after { animation: none; transform: scaleX(1); }

@keyframes hx-fill { to { transform: scaleX(1); } }

.hx__arrows {
  display: flex;
  gap: .5rem;
}

.hx__arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--hx-faint);
  background: var(--hx-surface);
  color: var(--hx-ink);
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .25s var(--hx-ease);
}

.hx__arrow:hover {
  border-color: var(--hx-accent);
  background: rgba(255, 107, 0, .12);
}

.hx__arrow:active { transform: scale(.92); }
.hx__arrow svg { width: 18px; height: 18px; }

/* ── Marquee ───────────────────────────────────────────────────────────── */

.hx__marquee {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--hx-faint);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.hx__marquee-track {
  display: flex;
  width: max-content;
  animation: hx-marquee 38s linear infinite;
}

.hx__marquee-item {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.15rem 1rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 500;
  font-style: italic;
  white-space: nowrap;
  color: var(--hx-muted);
}

.hx__marquee-item::after {
  content: '✦';
  font-style: normal;
  font-size: .8em;
  color: var(--hx-accent);
}

@keyframes hx-marquee { to { transform: translateX(-50%); } }

/* ── Small screens: the photo leads, the copy follows ──────────────────── */

@media (max-width: 959px) {
  .hx { min-height: 0; }

  .hx__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
    padding: 1.25rem 1.25rem 2.5rem;
  }

  .hx__stage {
    order: -1;
    justify-self: stretch;
    max-width: none;
  }

  .hx__window {
    aspect-ratio: auto;
    height: min(56svh, 125vw);
    border-radius: 999px 999px 28px 28px;
  }

  .hx__index { display: none; }

  .hx__seal {
    left: auto;
    right: -14px;
    bottom: auto;
    top: 22%;
    width: 92px;
    height: 92px;
  }

  .hx__seal-core { inset: 28px; }

  .hx__texts { margin-top: 1.25rem; }
  .hx__stats { gap: 1.6rem; margin-top: 2.25rem; }
  .hx__stat-value { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .hx__btn { flex: 1 1 auto; justify-content: center; padding: 0 1.2rem; }
  .hx__arrows { display: none; }
  .hx__seal { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hx__glow,
  .hx__pulse::after,
  .hx__seal svg,
  .hx__marquee-track { animation: none !important; }

  .hx__line > span,
  .hx__eyebrow,
  .hx__lead,
  .hx__cta,
  .hx__img { transition: none !important; }
}
