/**
 * hero.css — the homepage Hero, built to match the reference screenshot
 * (docs/16-final-implementation-report.md "Theme pivot"). Owns:
 * .home-hero and everything under it, plus .scroll-cue.
 *
 * Still honors the original responsive contract from the plugin-era Hero
 * (100dvh shell, capped media size, height-aware safety rule) — only the
 * markup source changed from "existing Elementor Hero" to "authored here".
 */

.home-hero {
  --hero-bg: #eef1f4;
  --hero-marquee-color: rgba(19, 21, 26, .05);
  --hero-marquee-stroke: rgba(19, 21, 26, .16);

  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: clip;
  background: var(--hero-bg);
  color: var(--color-text);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home-hero {
    --hero-bg: #101218;
    --hero-marquee-color: rgba(255, 255, 255, .04);
    --hero-marquee-stroke: rgba(255, 255, 255, .14);
  }
}

:root[data-theme="dark"] .home-hero {
  --hero-bg: #101218;
  --hero-marquee-color: rgba(255, 255, 255, .04);
  --hero-marquee-stroke: rgba(255, 255, 255, .14);
}

/* ---------- Background marquee ---------- */

.home-hero__marquee {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 2vw, 24px);
  overflow: hidden;
  direction: ltr; /* decorative Latin text; physical motion, not logical */
}

.home-hero__marquee-row {
  display: flex;
  width: max-content;
  white-space: nowrap;
  font-size: clamp(4rem, 13vw, 10.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--hero-marquee-color);
}

.home-hero__marquee-row--a {
  animation: sayid-marquee-rtl 90s linear infinite;
}

.home-hero__marquee-row--b {
  animation: sayid-marquee-ltr 110s linear infinite;
}

/* One of the two lines is hollow/outline text — characters have a stroke,
   no fill — rather than both being identical solid fills. */
.home-hero__marquee-row--outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--hero-marquee-stroke);
  text-stroke: 1.5px var(--hero-marquee-stroke);
}

@keyframes sayid-marquee-rtl {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes sayid-marquee-ltr {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero__marquee-row--a,
  .home-hero__marquee-row--b {
    animation: none;
    transform: translateX(-25%);
  }
}

/* ---------- Nav ---------- */

.home-hero__nav {
  position: relative;
  z-index: 2;
  padding-block: clamp(16px, 3vh, 28px);
}

/* ---------- Main content grid ----------
   grid-template-areas is written "content media social" — in the
   inherited RTL context the first named column sits on the physical
   right, so this reads as content(right) / media(middle) / social(left)
   without needing any direction overrides. */

.home-hero__inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) 56px;
  grid-template-areas: "content media social";
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding-block: clamp(24px, 4vh, 48px);
}

.home-hero__social {
  grid-area: social;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  height: 100%;
  justify-content: center;
}

.home-hero__social-line {
  width: 1px;
  height: 64px;
  background: var(--color-border-strong);
  transform-origin: bottom; /* grows upward, away from the link list below it */
  transition: transform var(--motion-normal) var(--ease-out), background-color var(--motion-normal) var(--ease-out);
}

/* Hovering any link in the list (not the line itself) doubles the line and
   turns it yellow — transform (not height) so the links never shift. */
.home-hero__social:has(a:hover) .home-hero__social-line,
.home-hero__social:has(a:focus-visible) .home-hero__social-line {
  transform: scaleY(2);
  background: var(--color-yellow);
}

.home-hero__social ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.home-hero__social a {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: var(--text-small);
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: .02em;
  transition: color var(--motion-fast) var(--ease-out);
}

.home-hero__social a:hover,
.home-hero__social a:focus-visible {
  color: var(--color-yellow);
}

.home-hero__media {
  grid-area: media;
  display: flex;
  justify-content: center;
}

.home-hero__photo {
  max-height: min(78dvh, 900px);
  max-width: 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: grayscale(1);
  -webkit-mask-image: linear-gradient(to bottom, black 62%, transparent 96%);
  mask-image: linear-gradient(to bottom, black 62%, transparent 96%);
}

.home-hero__photo--placeholder {
  background: linear-gradient(180deg, var(--color-border-strong) 0%, transparent 85%);
  border-radius: var(--radius-lg);
}

.home-hero__content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* inline-start = right, in this RTL context */
  text-align: start;
}

.home-hero__greeting {
  font-size: var(--text-large);
  color: var(--color-text-muted);
  /* margin-bottom: var(--space-2); */
}

.home-hero__name {
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0;
}

.home-hero__name-suffix {
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-inline-start: var(--space-2);
}

/* #magicalTag: the hidden click-8-times easter egg (assets/js/magic-name.js)
   isn't a real link, so this hover is its only visual hint — same yellow
   the site's actual links use. */
#magicalTag {
  transition: color var(--motion-fast) var(--ease-out);
}

#magicalTag:hover {
  color: var(--color-yellow);
}

.home-hero__role {
  color: transparent;
  -webkit-text-stroke: 1px var(--color-text-muted);
  /* margin-top: var(--space-3); */
  font-size: var(--text-h2);
  font-weight: 900;
}

.home-hero__role--outline {
  color: transparent;
  -webkit-text-stroke: 1px var(--color-text);
  text-stroke: 1px var(--color-text);
}

.home-hero__lede {
  margin-top: var(--space-4);
  max-width: 34ch;
  color: var(--color-text-muted);
  font-size: .875rem; /* 14px, was var(--text-large) (18px) */
}

.home-hero__actions {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

/* ---------- Rotating headline chip ----------
   Not a button — nothing to click. Styled like highlighted/selected text
   (a filled chip) because it visually *is* the "selected" phrase among a
   rotating set, per the confirmed design intent. */

.home-hero__rotator {
  overflow: hidden;
  max-height: 3.2em; /* pre-JS fallback; hero-rotator.js sets the exact px height */
  border-radius: 0;
  background: #1b1d29;
}

.home-hero__rotator-track {
  display: flex;
  flex-direction: column;
  transition: transform 480ms var(--ease-out);
}

.home-hero__rotator-track > li {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding: 0;
  color: #fff;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .home-hero__rotator-track {
    transition: none;
  }
}

.home-hero__ip {
  margin-top: var(--space-6);
  font-size: var(--text-small);
  color: var(--color-text-muted);
  direction: ltr;
  text-align: start;
}

/* ---------- Height-aware safety rule (brief §14), not a new breakpoint. ---------- */

@media (max-height: 760px) {
  .home-hero__photo {
    max-height: min(52dvh, 560px);
  }
  .home-hero__inner {
    padding-block: var(--space-6);
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  .home-hero__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "content";
    gap: var(--space-8);
  }
  .home-hero__social {
    display: none; /* the vertical rail doesn't survive a narrow viewport legibly */
  }
  .home-hero__photo {
    max-height: min(46dvh, 420px);
    aspect-ratio: 4 / 5;
  }
  .home-hero__marquee-row {
    font-size: clamp(2.75rem, 16vw, 4rem);
  }
}

/* ---------- Scroll cue ---------- */

.scroll-cue {
  position: absolute;
  inset-inline: 0;
  inset-block-end: clamp(20px, 4vh, 40px);
  z-index: 2;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.scroll-cue__btn {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  color: var(--color-text-muted);
  opacity: .85;
  transition: opacity var(--motion-normal) var(--ease-out), transform var(--motion-normal) var(--ease-out);
}

.scroll-cue__btn:hover,
.scroll-cue__btn:focus-visible {
  opacity: 1;
}

.scroll-cue__label {
  font-size: var(--text-small);
}

.scroll-cue__icon {
  display: block;
  animation: sayid-scroll-cue-bob var(--motion-ambient) ease-in-out infinite;
}

@keyframes sayid-scroll-cue-bob {
  0%, 100% { transform: translateY(0); opacity: .6; }
  50%      { transform: translateY(5px); opacity: 1; }
}

.scroll-cue.is-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-normal) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue__icon {
    animation: none;
  }
}
