/* Amie V3: home sections (hero, book + doorways, belief, topics, about, next book, quote) and shared bits. */

/* ===== Hero: the doorway picture on the left, the words in the night sky on the right ===== */
.amie-hero {
  min-height: 100svh;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  padding: clamp(6rem, 14vh, 9rem) clamp(1.25rem, 6vw, 7rem) clamp(4rem, 9vh, 6rem);
}

.amie-hero__zoom {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  will-change: transform;
}

.amie-hero .wp-block-cover__image-background { will-change: transform; }
.amie-hero .wp-block-cover__background { z-index: 1; }

/* darker where the words sit (right) and at the very bottom, so the doorway stays bright */
.amie-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 28%, color-mix(in srgb, var(--wp--preset--color--midnight) 72%, transparent) 76%),
    linear-gradient(0deg, color-mix(in srgb, var(--wp--preset--color--midnight) 85%, transparent), transparent 32%);
}

.amie-dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.amie-hero .wp-block-cover__inner-container { position: relative; z-index: 3; }

.amie-hero__light {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at var(--amie-door-x, 30%) var(--amie-door-y, 53%),
    var(--wp--preset--color--paper) calc(var(--amie-light-size, 0%) - 35%),
    color-mix(in srgb, var(--wp--preset--color--paper) 0%, transparent) var(--amie-light-size, 0%));
}

.amie-hero .amie-hero__panel {
  max-width: 44rem;
  margin-inline: auto 0 !important;
}

.amie-hero__panel > * { margin-block: 0; }

.amie-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
}

.amie-hero__eyebrow::before {
  content: "";
  width: 3rem;
  height: 1px;
  background: currentColor;
}

.amie-hero .amie-hero__title.has-display-font-size {
  font-size: clamp(3rem, 6.6vw, 6.5rem) !important;
  line-height: 0.98;
  margin: 1.5rem 0 1.75rem;
  text-shadow: 0 0.5rem 3rem color-mix(in srgb, var(--wp--preset--color--midnight) 70%, transparent);
}

.amie-hero__sub {
  max-width: 34rem;
  font-family: var(--wp--preset--font-family--serif);
  font-size: var(--wp--preset--font-size--medium);
  line-height: 1.5;
}

.amie-hero__actions { margin-top: 2.25rem !important; }

.amie-hero .amie-hero__cue {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3.5rem 0 0 auto !important;
  max-width: 44rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  transition: opacity 0.4s ease;
}

.amie-hero__cue::after {
  content: "";
  width: 4.5rem;
  height: 1px;
  background: var(--wp--preset--color--brass);
  transform-origin: left;
  animation: amie-cue 2.4s infinite ease-in-out;
}

.amie-hero.is-diving .amie-hero__cue { opacity: 0 !important; }

@keyframes amie-cue {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  50.1% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* split title */
.amie-line { display: block; overflow: hidden; padding: 0 0.08em 0.14em; margin: 0 -0.08em -0.14em; }
.amie-line__inner { display: block; }
.amie-wordwrap { display: inline-block; white-space: nowrap; }
.amie-char { display: inline-block; will-change: transform; }

@media (max-width: 781px) {
  .amie-hero { align-items: flex-end; padding-bottom: 2.5rem; }
  .amie-hero::before {
    background: linear-gradient(0deg, var(--wp--preset--color--midnight) 8%, color-mix(in srgb, var(--wp--preset--color--midnight) 70%, transparent) 42%, transparent 70%);
  }
  .amie-hero .amie-hero__title.has-display-font-size { font-size: clamp(2.6rem, 12vw, 3.6rem) !important; margin: 1rem 0 1.25rem; }
  .amie-hero__sub { font-size: var(--wp--preset--font-size--base); }
  .amie-hero .amie-hero__cue { margin-top: 2rem !important; }
}

/* ===== Book ===== */
.amie-book__cols { gap: clamp(2rem, 6vw, 6rem) !important; }

.amie-book__cover { position: relative; margin: 0; isolation: isolate; }

.amie-book__cover::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--wp--preset--color--brass-2) 55%, transparent), transparent);
  filter: blur(28px);
  animation: amie-breathe 6s ease-in-out infinite;
}

@keyframes amie-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.04); }
}

.amie-book__title { margin: 1rem 0 1.5rem !important; line-height: 1; }

.amie-lead { line-height: 1.3; font-weight: 500; }

.amie-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-block: 2rem !important;
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  padding-top: 1.5rem;
}

.amie-stat > * { margin: 0; }

.amie-count {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--xx-large);
  line-height: 1;
  color: var(--wp--preset--color--brass);
}

.amie-stat__label {
  font-size: var(--wp--preset--font-size--small);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 0.5rem !important;
}

/* phones: columns as wide as their longest word, so "paperback" never breaks in the middle */
@media (max-width: 600px) {
  .amie-stats { grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 1.25rem; }
  .amie-stat__label { letter-spacing: 0.1em; }
}
@media (max-width: 359px) {
  .amie-stats { gap: 0.75rem; }
  .amie-stat__label { font-size: 0.75rem; letter-spacing: 0.06em; }
}

/* eighteen doorways, one per story (the row is made by doors.js) */
.amie-doors {
  margin-top: clamp(3.5rem, 8vw, 6.5rem) !important;
  padding-top: 2.5rem;
  border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 14%, transparent);
  display: grid;
  gap: 1.75rem;
}

.amie-doors > * { margin: 0 !important; }

.amie-doors__row { display: flex; align-items: flex-end; gap: clamp(0.35rem, 1vw, 0.9rem); }

.amie-door {
  flex: 1 1 0;
  max-width: 3.4rem;
  aspect-ratio: 5 / 8;
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--brass) 50%, transparent);
  border-radius: 999px 999px 3px 3px;
  transition: border-color 0.5s, box-shadow 0.6s, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.amie-door::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(180deg, var(--wp--preset--color--brass-2), color-mix(in srgb, var(--wp--preset--color--brass) 25%, transparent));
  transition: opacity 0.5s;
}

.amie-door.is-lit {
  border-color: var(--wp--preset--color--brass);
  box-shadow: 0 0 1.4rem color-mix(in srgb, var(--wp--preset--color--brass-2) 55%, transparent);
  transform: translateY(-5px);
}

.amie-door.is-lit::after { opacity: 1; }

.amie-doors__count {
  margin-left: auto;
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--xx-large);
  line-height: 0.8;
  color: var(--wp--preset--color--brass);
  min-width: 2.2ch;
  text-align: right;
}

.amie-doors__caption { max-width: 34ch; line-height: 1.25; }

@media (max-width: 781px) {
  .amie-doors__row { flex-wrap: wrap; }
  .amie-door { flex: 0 0 calc((100% - 8 * 0.45rem) / 9); }
  .amie-doors__row { gap: 0.6rem 0.45rem; }
  .amie-doors__count { order: -1; flex-basis: 100%; text-align: left; margin: 0 0 0.75rem; }
}

/* ===== Belief: held on screen while its words light up ===== */
.amie-belief {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.amie-belief::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, color-mix(in srgb, var(--wp--preset--color--brass) 16%, transparent), transparent 70%),
    repeating-linear-gradient(60deg, color-mix(in srgb, var(--wp--preset--color--brass) 7%, transparent) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(-60deg, color-mix(in srgb, var(--wp--preset--color--brass) 7%, transparent) 0 1px, transparent 1px 46px);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent 75%);
}

.amie-belief__statement {
  line-height: 1.22;
  font-weight: 400;
  margin-block: 2.25rem !important;
}

.amie-words .amie-word { display: inline-block; will-change: opacity, filter; }

@media (max-width: 781px) {
  .amie-belief .amie-belief__statement.has-xx-large-font-size { font-size: 2.1rem !important; }
}

/* ===== What she writes about: a page of the book beside the three themes (no mouse effects) ===== */
.amie-themes { gap: clamp(2.5rem, 6vw, 6rem) !important; }
.amie-bookpage { margin: 0 auto !important; max-width: 31rem; }
.amie-bookpage img {
  display: block;
  width: 100%;
  height: auto;
  /* the photo is cut off at the facing page and below the shadow: fade those two edges into the paper */
  -webkit-mask-image: linear-gradient(to right, #000 80%, transparent 99%), linear-gradient(to bottom, #000 82%, transparent 99%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, #000 80%, transparent 99%), linear-gradient(to bottom, #000 82%, transparent 99%);
  mask-composite: intersect;
}

.amie-themes__words > .amie-eyebrow { margin-top: 0 !important; }
.amie-themes__title { margin: 1rem 0 clamp(2rem, 4vw, 3rem) !important; line-height: 1.04 !important; }

.amie-themes__list { border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 16%, transparent); }
.amie-theme {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 0.4rem;
  padding: clamp(1.25rem, 2.4vw, 1.75rem) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 16%, transparent);
}
.amie-theme > * { margin: 0 !important; }
/* capital numerals in the serif, centred on the first line of the title */
.amie-theme__num {
  grid-row: 1 / span 2;
  font-family: var(--wp--preset--font-family--serif);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  line-height: calc(clamp(1.5rem, 2.4vw, 2.1rem) * 1.15);
  color: var(--wp--preset--color--brass);
}
.amie-theme__title {
  font-family: var(--wp--preset--font-family--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.15;
  color: var(--wp--preset--color--ink);
}
.amie-theme__text { grid-column: 2; max-width: 34rem; color: var(--wp--preset--color--slate); }

@media (max-width: 781px) {
  .amie-bookpage { max-width: 22rem; }
}

/* ===== About ===== */
.amie-about__lead { line-height: 1.2; font-weight: 500; margin-bottom: 1.75rem !important; }

/* ===== The next book: letters fall into place over faint exam-paper lines ===== */
.amie-next { position: relative; overflow: hidden; isolation: isolate; }

.amie-next::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--wp--preset--color--mist) 10%, transparent) 0 1px, transparent 1px 2.4rem);
  -webkit-mask-image: linear-gradient(180deg, transparent, black 25%, black 75%, transparent);
  mask-image: linear-gradient(180deg, transparent, black 25%, black 75%, transparent);
}

.amie-next::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: max(1rem, calc((100% - 1200px) / 2 - 2.5rem));
  width: 1px;
  z-index: -1;
  background: color-mix(in srgb, var(--wp--preset--color--brass) 35%, transparent);
}

.amie-gravity { line-height: 0.95; margin-block: 1.25rem clamp(2rem, 5vw, 3.5rem) !important; }
.amie-gravity .amie-char { display: inline-block; }

.amie-next__cols { gap: clamp(2rem, 6vw, 5rem) !important; }

.amie-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--brass-2) 50%, transparent);
  border-radius: 999px;
  font-size: 0.75rem !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.amie-badge::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--wp--preset--color--brass-2);
  animation: amie-pulse 2s infinite;
}

@keyframes amie-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--wp--preset--color--brass-2) 70%, transparent); }
  80%, 100% { box-shadow: 0 0 0 0.6rem color-mix(in srgb, var(--wp--preset--color--brass-2) 0%, transparent); }
}

.amie-next__vow { line-height: 1.25; margin-top: 1.75rem !important; }

/* ===== Quote ===== */
.wp-block-quote { border: 0; padding: 0; }

.amie-quote.has-x-large-font-size {
  font-size: clamp(1.75rem, 3.6vw, 3rem) !important;
  line-height: 1.28;
}

.amie-quote::before {
  content: "\201C";
  display: block;
  text-align: center;
  font-family: var(--wp--preset--font-family--display);
  font-size: clamp(5rem, 9vw, 7.5rem);
  line-height: 1; height: 0.5em;
  color: var(--wp--preset--color--brass);
  margin-bottom: 0.5rem;
}

.amie-quote cite {
  display: block;
  margin-top: 2.25rem;
  font-family: var(--wp--preset--font-family--sans);
  font-size: var(--wp--preset--font-size--small);
  font-style: normal;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--wp--preset--color--bronze);
}

.amie-rise .amie-word { display: inline-block; }

/* ===== Parallax / tilt / clip helpers ===== */
.amie-clip { overflow: hidden; }
.amie-tilt { perspective: 900px; }
.amie-tilt img {
  will-change: transform;
  filter: drop-shadow(0 2rem 2.5rem color-mix(in srgb, var(--wp--preset--color--ink) 35%, transparent));
}

@media (prefers-reduced-motion: reduce) {
  .amie-hero__cue::after,
  .amie-book__cover::before,
  .amie-badge::before { animation: none; }
}

/* ===== Phone touches ===== */
@media (max-width: 781px) {
  .amie-hero__eyebrow { letter-spacing: 0.2em; font-size: 0.7rem !important; }
  .amie-hero__eyebrow::before { width: 1.5rem; }
  .amie-eyebrow.has-text-align-center::before { display: none; }
  .amie-next::after { display: none; }
}
