/* ==========================================================================
   AMH PUBLISHERS — PROJECT TOKENS, HERO SYSTEM & SHARED UTILITIES
   Loaded after ./base.css (the extracted design system).

   Step 03 note: every token below is measured from the live references.
   Site 2 (global): accents #e63946 / #f77f00 / #fcbf49, Cinzel + Plus Jakarta
   Sans, light #f8fafc / dark #070a13. Site 1 (hero only): cream #fff8ef,
   navy #0c2340, orange #ff8518, red #e43019, dot grid #ffd8b9, Outfit.
   Hero tokens are scoped to .amh-hero so they never leak into other sections.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. FONT WIRING (next/font injects these variables)
   -------------------------------------------------------------------------- */
:root {
  --font-serif: var(--font-cinzel), 'Cinzel', 'Playfair Display', Georgia, serif;
  --font-sans: var(--font-jakarta), 'Plus Jakarta Sans', -apple-system,
    BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: var(--font-mono-jb), 'JetBrains Mono', monospace;

  /* sticky chrome heights (top bar + glass navbar) */
  --nav-height: 92px;
  --topbar-height: 40px;
}

@media (max-width: 1024px) {
  :root {
    --nav-height: 76px;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-height: 68px;
    --topbar-height: 0px;
  }
}

/* --------------------------------------------------------------------------
   1. HERO TOKENS (site 1 palette, scoped)
   -------------------------------------------------------------------------- */
.amh-hero {
  --hero-bg: #fff8ef;
  --hero-bg-deep: #ffeedd;
  --hero-text: #0c2340;
  --hero-text-soft: #334155;
  --hero-accent: #ff8518;
  --hero-accent-alt: #e43019;
  --hero-accent-warm: #ffcf00;
  --hero-dot: #ffd8b9;
  --hero-glow: rgba(255, 133, 24, 0.18);
  --hero-border: rgba(255, 133, 24, 0.35);
  --hero-gradient: linear-gradient(
    100deg,
    #e43019 0%,
    #ff8518 45%,
    #ffcf00 100%
  );
  --hero-font-display: var(--font-outfit), 'Outfit', var(--font-sans);

  background:
    radial-gradient(circle at 82% 18%, rgba(255, 133, 24, 0.12), transparent 46%),
    radial-gradient(circle at 8% 78%, rgba(228, 48, 25, 0.07), transparent 48%),
    var(--hero-bg);
  color: var(--hero-text);
  isolation: isolate;
}

[data-theme='dark'] .amh-hero {
  --hero-bg: #0a0f1c;
  --hero-bg-deep: #070a13;
  --hero-text: #f8fafc;
  --hero-text-soft: #cbd5e1;
  --hero-dot: rgba(255, 133, 24, 0.22);
  --hero-glow: rgba(255, 133, 24, 0.22);
  --hero-border: rgba(255, 133, 24, 0.4);

  background:
    radial-gradient(circle at 82% 18%, rgba(255, 133, 24, 0.16), transparent 48%),
    radial-gradient(circle at 8% 78%, rgba(228, 48, 25, 0.12), transparent 50%),
    var(--hero-bg);
}

/* dot grid + glow, mirrors site 1 */
.amh-hero__decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.amh-hero__dots {
  position: absolute;
  inset: 0;
  opacity: 0.7;
  background-image: radial-gradient(var(--hero-dot) 1.8px, transparent 1.8px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
}

.amh-hero__glow {
  position: absolute;
  top: 26%;
  left: 26%;
  width: 720px;
  height: 520px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    var(--hero-glow) 0%,
    transparent 70%
  );
  filter: blur(100px);
}

/* bottom blend into the marquee band */
.amh-hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(
    180deg,
    rgba(255, 238, 221, 0) 0%,
    var(--bg-primary) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   2. HERO LAYOUT
   -------------------------------------------------------------------------- */
.amh-hero {
  min-height: 100svh;
  padding-top: calc(var(--nav-height, 92px) + var(--topbar-height, 40px) + 56px);
  padding-bottom: 96px;
  align-items: center;
}

.amh-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.amh-hero__content {
  max-width: 660px;
}

.amh-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin-bottom: 26px;
  border-radius: var(--radius-full);
  border: 1px solid var(--hero-border);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hero-accent-alt);
}

[data-theme='dark'] .amh-hero__eyebrow {
  background: rgba(255, 255, 255, 0.05);
  color: #fbbf24;
}

.amh-hero__eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient-brand);
  box-shadow: 0 0 0 4px rgba(255, 133, 24, 0.16);
}

.amh-hero__title {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(2.35rem, 4.4vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.028em;
  color: var(--hero-text);
  margin: 0 0 26px;
  text-wrap: balance;
}

.amh-hero__line {
  display: block;
}

.amh-hero__type-line {
  display: block;
  min-height: 1.22em;
  line-height: 1.1;
}

.amh-hero__type-inner {
  display: inline-flex;
  align-items: center;
  min-height: 1.22em;
  white-space: nowrap;
}

.amh-hero__type-text {
  font-family: var(--font-serif);
  font-weight: 800;
  font-style: italic;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  padding-right: 2px;
}

.amh-hero__cursor {
  display: inline-block;
  width: 4px;
  height: 0.82em;
  margin-left: 6px;
  border-radius: 2px;
  background: var(--hero-accent);
  box-shadow: 0 0 12px rgba(255, 133, 24, 0.75);
  animation: amhBlink 1s steps(1) infinite;
}

@keyframes amhBlink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.amh-hero__desc {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.25vw, 1.16rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--hero-text-soft);
  max-width: 590px;
  margin: 0 0 34px;
}

.amh-hero__desc strong {
  font-weight: 700;
  color: var(--hero-accent-alt);
}

[data-theme='dark'] .amh-hero__desc strong {
  color: #fbbf24;
}

.amh-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 38px;
}

/* site 1 button treatment, scoped to the hero */
.amh-hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform var(--transition-fast), box-shadow var(--transition-normal),
    background-color var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
  will-change: transform;
}

.amh-hero__btn--primary {
  background: linear-gradient(100deg, #e43019 0%, #ff8518 62%, #ff9d42 100%);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(228, 48, 25, 0.28);
}

.amh-hero__btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(228, 48, 25, 0.36);
}

.amh-hero__btn--ghost {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(12, 35, 64, 0.16);
  color: var(--hero-text);
  backdrop-filter: blur(8px);
}

.amh-hero__btn--ghost:hover {
  transform: translateY(-3px);
  border-color: var(--hero-accent);
  color: var(--hero-accent-alt);
  box-shadow: 0 12px 28px rgba(255, 133, 24, 0.18);
}

[data-theme='dark'] .amh-hero__btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

.amh-hero__btn svg {
  width: 18px;
  height: 18px;
}

.amh-hero__trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding-top: 24px;
  border-top: 1px solid rgba(12, 35, 64, 0.09);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hero-text-soft);
}

[data-theme='dark'] .amh-hero__trust {
  border-top-color: rgba(255, 255, 255, 0.09);
}

.amh-hero__trust-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.amh-hero__trust-item svg {
  width: 15px;
  height: 15px;
  color: var(--hero-accent);
}

/* --------------------------------------------------------------------------
   3. HERO VISUAL — scrolling cover wall + featured 3D card
   -------------------------------------------------------------------------- */
.amh-hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 560px;
  perspective: 1200px;
}

.amh-hero__wall {
  position: absolute;
  inset: -34px -30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  overflow: hidden;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(
    ellipse at 50% 50%,
    #000 30%,
    rgba(0, 0, 0, 0.45) 62%,
    transparent 88%
  );
  mask-image: radial-gradient(
    ellipse at 50% 50%,
    #000 30%,
    rgba(0, 0, 0, 0.45) 62%,
    transparent 88%
  );
  z-index: 1;
  pointer-events: none;
}

.amh-hero__wall-col {
  position: relative;
  overflow: hidden;
  height: 100%;
}

.amh-hero__wall-track {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: amhWallUp 34s linear infinite;
}

.amh-hero__wall-col--down .amh-hero__wall-track {
  animation-name: amhWallDown;
  animation-duration: 40s;
}

.amh-hero__wall-col--fast .amh-hero__wall-track {
  animation-duration: 26s;
}

.amh-hero__wall:hover .amh-hero__wall-track {
  animation-play-state: paused;
}

@keyframes amhWallUp {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

@keyframes amhWallDown {
  0% {
    transform: translateY(-50%);
  }
  100% {
    transform: translateY(0);
  }
}

.amh-hero__wall-card {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 4px 12px 12px 4px;
  overflow: hidden;
  background: #0c1220;
  box-shadow: 8px 10px 26px rgba(12, 35, 64, 0.28);
  border-right: 2px solid rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.amh-hero__wall-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.amh-hero__wall-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(
    90deg,
    rgba(2, 6, 23, 0.85) 0%,
    rgba(2, 6, 23, 0.35) 55%,
    transparent 100%
  );
  z-index: 2;
}

.amh-hero__wall-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.14) 0%,
    transparent 42%,
    rgba(0, 0, 0, 0.22) 100%
  );
  z-index: 2;
}

.amh-hero__featured {
  position: relative;
  z-index: 3;
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
  will-change: transform;
}

/* reuse the reference 3D book card, scaled up for the hero */
.amh-hero__featured .book-card-3d {
  width: clamp(230px, 24vw, 310px);
  transform: rotateY(-14deg) rotateX(6deg);
  box-shadow: 26px 34px 60px rgba(12, 35, 64, 0.34);
}

.amh-hero__featured .book-stage-glow {
  width: 420px;
  height: 420px;
  opacity: 0.85;
}

.amh-hero__badge {
  position: absolute;
  top: 8px;
  left: -18px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--hero-border);
  box-shadow: 0 16px 34px rgba(12, 35, 64, 0.16);
  backdrop-filter: blur(12px);
  animation: amhFloat 6s ease-in-out infinite;
}

[data-theme='dark'] .amh-hero__badge {
  background: rgba(12, 18, 32, 0.9);
  border-color: rgba(255, 133, 24, 0.35);
}

.amh-hero__badge-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e43019, #ff8518);
  color: #ffffff;
  flex-shrink: 0;
}

.amh-hero__badge-icon svg {
  width: 17px;
  height: 17px;
}

.amh-hero__badge-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--hero-text);
  line-height: 1.25;
}

.amh-hero__badge-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

@keyframes amhFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* --------------------------------------------------------------------------
   4. SHARED UTILITIES
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 400;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 16px;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 3px;
  border-radius: 4px;
}

/* keep anchored sections clear of the sticky header */
section[id] {
  scroll-margin-top: calc(var(--nav-height, 92px) + 12px);
}

/* --------------------------------------------------------------------------
   4b. TOP BAR (utility strip above the glass navbar)
   -------------------------------------------------------------------------- */
.amh-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height, 40px);
  z-index: 1006;
  display: flex;
  align-items: center;
  background: #0c2340;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

[data-theme='dark'] .amh-topbar {
  background: #070a13;
}

.amh-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.amh-topbar__group {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.amh-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.amh-topbar__link:hover {
  color: #ffcf00;
}

.amh-topbar__link svg {
  width: 13px;
  height: 13px;
  color: #ff8518;
  flex-shrink: 0;
}

.amh-topbar__sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.18);
}

.amh-topbar__hours {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.amh-topbar__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 15px;
  border-radius: var(--radius-full);
  background: linear-gradient(100deg, #e43019, #ff8518);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: filter var(--transition-fast), transform var(--transition-fast);
}

.amh-topbar__cta:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

body.is-scrolled .amh-topbar {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.site-header {
  top: var(--topbar-height, 40px);
  transition: top 0.35s ease, padding var(--transition-normal),
    background var(--transition-normal), box-shadow var(--transition-normal);
}

body.is-scrolled .site-header {
  top: 0;
}

@media (max-width: 640px) {
  .amh-topbar {
    display: none;
  }

  .site-header {
    top: 0;
  }
}

html {
  scroll-behavior: smooth;
}

body.is-locked,
body.no-scroll {
  overflow: hidden;
}

/* header state once scrolled (theme-safe) */
.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

[data-theme='dark'] .site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* reveal system: base.css ships .reveal-on-scroll / .is-revealed */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-on-scroll,
  .reveal-on-scroll.is-revealed {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .amh-hero__wall-track,
  .amh-hero__badge,
  .amh-hero__cursor {
    animation: none !important;
  }

  .marquee-track,
  .brands-track {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   5. HERO RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .amh-hero__grid {
    grid-template-columns: 1fr;
    gap: 44px;
    text-align: center;
  }

  .amh-hero__content {
    max-width: 100%;
    margin-inline: auto;
  }

  .amh-hero__desc {
    margin-inline: auto;
  }

  .amh-hero__actions {
    justify-content: center;
  }

  .amh-hero__trust {
    justify-content: center;
  }

  .amh-hero__visual {
    order: 2;
    min-height: 460px;
    max-width: 560px;
    margin-inline: auto;
    width: 100%;
  }

  .amh-hero__badge {
    left: 0;
  }
}

@media (max-width: 640px) {
  .amh-hero {
    padding-top: calc(var(--nav-height, 76px) + 34px);
    padding-bottom: 64px;
  }

  .amh-hero__title {
    font-size: clamp(2rem, 8.4vw, 2.6rem);
  }

  .amh-hero__visual {
    min-height: 380px;
  }

  .amh-hero__wall {
    inset: -18px -12px;
    gap: 10px;
    opacity: 0.4;
  }

  .amh-hero__featured .book-card-3d {
    width: 200px;
  }

  .amh-hero__badge {
    top: -6px;
    left: -4px;
    padding: 9px 12px;
  }

  .amh-hero__btn {
    width: 100%;
  }

  .amh-hero__actions {
    gap: 12px;
  }
}

/* --------------------------------------------------------------------------
   6. SEAMLESS MARQUEE HALVES
   -------------------------------------------------------------------------- */
.amh-marquee__track {
  display: flex;
  gap: 0;
}

.amh-marquee__group {
  display: flex;
  align-items: center;
  gap: 56px;
  padding-right: 56px;
  flex-shrink: 0;
}

.form-feedback-notice--error {
  background: rgba(230, 57, 70, 0.12);
  border-color: rgba(230, 57, 70, 0.35);
  color: var(--accent-red);
}

.footer-advisory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-advisory-list strong {
  color: var(--text-primary);
  font-weight: 600;
}

.footer-advisory-list a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-advisory-list a:hover {
  color: var(--accent-orange);
}

.footer-advisory-divider {
  margin-top: 2px;
  border-top: 1px solid var(--border-color);
}

.footer-advisory-label {
  margin: 2px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.footer-logo-img {
  align-self: flex-start;
  max-width: none;
}

.brand-logo-img {
  max-width: none;
}
