/* Living Word TX
   Colours are taken from the hero photograph (see the notes file for how). */

:root {
  --lw-night:   #1a1209;  /* deepest shadow in the room */
  --lw-umber:   #30251c;  /* the work shirt */
  --lw-leather: #79523b;  /* warm clay: skin and leather in the light */
  --lw-plaster: #7c5f43;  /* the wall */
  --lw-light:   #dcb48b;  /* the window light on the wall */
  --lw-page:    #f8edd8;  /* the lit paper */

  --lw-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --lw-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background: var(--lw-night);
  color: var(--lw-page);
  font-family: var(--lw-sans);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--lw-night);
}

.hero-media,
.hero-slide {
  position: absolute;
  inset: 0;
}
.hero-media { z-index: -2; }

.hero-slide {
  opacity: 0;
  transition: opacity 1.8s ease-in-out;
}
.hero-slide.is-active { opacity: 1; }

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 40%;
  transform-origin: 62% 42%;
  animation: lw-drift 20s ease-in-out infinite alternate;
  will-change: transform;
}

/* Slow push-in toward the reader, then back out. "alternate" means no jump at the loop point. */
@keyframes lw-drift {
  from { transform: scale(1); }
  to   { transform: scale(1.09) translate3d(-1.5%, -1%, 0); }
}

.hero.is-paused .hero-slide img { animation-play-state: paused; }

/* Shade behind the words. Phone: from the top, where the wall is empty. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom,
      rgba(26, 18, 9, .88) 0%,
      rgba(26, 18, 9, .70) 20%,
      rgba(26, 18, 9, .28) 36%,
      rgba(26, 18, 9, 0) 50%),
    linear-gradient(to top, rgba(26, 18, 9, .55) 0%, rgba(26, 18, 9, 0) 22%);
}

.hero-body {
  padding-top: clamp(1.75rem, 6vh, 4rem);
  padding-bottom: 5rem;
}

.hero-title {
  font-family: var(--lw-serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 11.5vw, 6.5rem);
  line-height: .98;
  letter-spacing: -.015em;
  color: var(--lw-page);
  text-shadow: 0 1px 24px rgba(26, 18, 9, .55);
  margin: 0 0 .35em;
  text-wrap: balance;
}

.hero-lead {
  font-family: var(--lw-serif);
  font-style: italic;
  font-size: clamp(1.15rem, 4.2vw, 1.75rem);
  line-height: 1.3;
  color: var(--lw-light);
  text-shadow: 0 1px 14px rgba(26, 18, 9, .7);
  max-width: 22ch;
  margin: 0 0 1.5rem;
}

/* Social placeholders (not links yet; see the note in index.html) */
.social-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1.5px solid var(--lw-light);
  color: var(--lw-light);
  background: rgba(26, 18, 9, .45);
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
/* Hover: only on devices that really hover, so it never "sticks" on phones. */
@media (hover: hover) {
  .social-link:hover {
    background: var(--lw-light);
    color: var(--lw-night);
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(26, 18, 9, .55);
  }
}
/* Click or tap: the button presses in... */
.social-link:active {
  background: var(--lw-page);
  color: var(--lw-night);
  transform: scale(.9);
  box-shadow: none;
  transition-duration: .05s;
}
/* ...and a ring of light spreads out from it. */
.social-link::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  border: 2px solid var(--lw-light);
  opacity: 0;
  pointer-events: none;
}
.social-link.is-tapped::after { animation: lw-ring .5s ease-out; }
@keyframes lw-ring {
  from { opacity: .9; transform: scale(1); }
  to   { opacity: 0;  transform: scale(1.7); }
}
.social-link:focus-visible,
.hero-toggle:focus-visible {
  outline: 3px solid var(--lw-page);
  outline-offset: 3px;
}

/* Pause / play */
.hero-toggle {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(248, 237, 216, .55);
  background: rgba(26, 18, 9, .6);
  color: var(--lw-page);
}
.hero-toggle:hover { background: rgba(26, 18, 9, .85); }
.hero-toggle .icon-play { display: none; }
.hero.is-paused .hero-toggle .icon-pause { display: none; }
.hero.is-paused .hero-toggle .icon-play { display: block; }

/* Wide and short screens (laptops, desktops, phones on their side). */
@media (min-aspect-ratio: 1/1) {
  .hero { align-items: center; }
  .hero-body { padding-top: 3rem; padding-bottom: 3rem; }
  .hero-title { font-size: clamp(2.8rem, 6.4vw, 6.5rem); }
  .hero-lead  { font-size: clamp(1.15rem, 2vw, 1.75rem); }

  .hero::before {
    background: linear-gradient(to right,
      rgba(26, 18, 9, .86) 0%,
      rgba(26, 18, 9, .62) 34%,
      rgba(26, 18, 9, 0) 62%);
  }

  /* Until the wide pictures exist: stand the upright picture at the right
     and let its left edge melt into a wall-coloured background. */
  .hero--portrait-only {
    background: linear-gradient(to right, var(--lw-night) 0%, #2a1d10 45%, #4a3620 100%);
  }
  .hero--portrait-only::before { display: none; }
  .hero--portrait-only .hero-slide {
    display: flex;
    justify-content: flex-end;
    padding-right: clamp(0px, 6vw, 9rem);
  }
  .hero--portrait-only .hero-slide img {
    width: auto;
    max-width: 60%;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 38%, #000 86%, transparent 100%);
            mask-image: linear-gradient(to right, transparent 0%, #000 38%, #000 86%, transparent 100%);
  }
}

/* Visitors who ask their device for less motion get a still picture. */
@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
  .hero-slide img { animation: none; }
  .hero-toggle { display: none; }
  .social-link { transition: background-color .2s ease, color .2s ease; }
  .social-link:hover, .social-link:active { transform: none; }
  .social-link.is-tapped::after { animation: none; }
}

/* ---------- Below the hero ---------- */

.band {
  position: relative;
  overflow: hidden;
  background: var(--lw-light);
  color: var(--lw-night);
  padding: clamp(3rem, 8vw, 6rem) 0;
}
/* The window light from the photograph, carried onto the page. */
.band::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -5%;
  width: 60%;
  height: 120%;
  background: linear-gradient(105deg, rgba(248, 237, 216, 0) 18%, rgba(248, 237, 216, .7) 19%, rgba(248, 237, 216, .7) 62%, rgba(248, 237, 216, 0) 63%);
  pointer-events: none;
}
.band > .container { position: relative; }

.band-title {
  font-family: var(--lw-serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -.01em;
  margin-bottom: .5em;
}
.band-text {
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 58ch;
  color: var(--lw-umber);
}

.tile {
  height: 100%;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--lw-umber);
  color: var(--lw-page);
  border-top: 4px solid var(--lw-leather);
}
.tile h3 {
  font-family: var(--lw-serif);
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--lw-light);
  margin-bottom: .35em;
}
.tile p { margin: 0; line-height: 1.55; }

.foot {
  background: var(--lw-night);
  color: var(--lw-light);
  padding: 1.75rem 0;
  font-size: .95rem;
}
