/* Motion shares the town's unhurried rhythm. Layout and text remain readable
   without JavaScript, on touch devices, and with reduced motion enabled. */
:root{--motion-ease:cubic-bezier(.22,1,.36,1);--motion-sweep:cubic-bezier(.65,0,.25,1)}
.home-page .home-button,.inner-page .home-button{
  position:relative;isolation:isolate;overflow:hidden;
  background:var(--green);color:#fff;border-color:var(--green);
  transition:color .45s var(--motion-sweep),box-shadow .45s var(--motion-ease);
}
.home-page .home-button::before,.inner-page .home-button::before{
  content:"";position:absolute;inset:0;z-index:-1;background:var(--paper);
  transform:scaleX(0);transform-origin:left center;transition:transform .45s var(--motion-sweep);
}
.home-page .home-button.outline,.inner-page .home-button.outline{background:var(--paper);color:var(--green);border-color:#72a092}
.home-page .home-button.outline::before,.inner-page .home-button.outline::before{background:var(--green)}
.home-page .home-button:focus-visible,.inner-page .home-button:focus-visible{color:var(--green);transform:none}
.home-page .home-button.outline:focus-visible,.inner-page .home-button.outline:focus-visible{color:#fff}
.home-button:focus-visible::before{transform:scaleX(1)}
.home-page .home-button:disabled,.inner-page .home-button:disabled{cursor:not-allowed;transform:none}
.home-button:disabled::before{display:none}

/* A line sweeps underneath secondary actions; no moving text or layout shifts. */
:is(.nav>a:not(.home-button),.film-link,.lesson-open,.article-more,.inner-text-link,.home-footer nav>a,.home-footer nav>button){
  background-image:linear-gradient(currentColor,currentColor);background-repeat:no-repeat;
  background-position:left bottom;background-size:0 1px;
  transition:background-size .4s var(--motion-sweep),color .3s;
  text-decoration:none;border-bottom-color:transparent;
}
:is(.nav>a:not(.home-button),.film-link,.lesson-open,.article-more,.inner-text-link,.home-footer nav>a,.home-footer nav>button):focus-visible{background-size:100% 1px;text-decoration:none}
.nav>a[aria-current=page]:not(.home-button){background-size:100% 1px}
:is(.journal-filters button,.result-filter button,.textbook-tabs button,.dash-nav button){transition:background-color .3s,color .3s,border-color .3s}

/* The supplied film is the main visual in the hero. */
.home-page .hero-layout{display:grid;grid-template-columns:minmax(300px,.82fr) minmax(0,1.85fr);grid-template-areas:"copy film" "actions film";grid-template-rows:auto auto;column-gap:44px;row-gap:24px;padding-top:48px;padding-bottom:56px;min-height:620px}
.home-page .hero-copy{grid-area:copy;width:auto;min-width:0;align-self:end}
.home-page .hero-copy h1{font-size:clamp(2.125rem,3.25vw,3.25rem)}
.home-page .hero-actions{grid-area:actions;align-self:start;margin-top:0;gap:12px}
.home-page .hero-actions .home-button{font-size:.8125rem;padding:12px 18px;gap:12px}
.home-page .hero-town.hero-film{grid-area:film;position:relative;top:auto;right:auto;bottom:auto;left:auto;width:100%;margin:0;align-self:center;overflow:hidden;border:1px solid #ffffffd9;border-radius:24px;background:#fffdf5;box-shadow:0 28px 72px -28px #345f4955}
.hero-film-screen{position:relative;aspect-ratio:16/9;overflow:hidden;background:#e5f1ea}
.home-page .hero-film-screen .hero-film-poster{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:none}
.hero-film-screen video{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .6s var(--motion-ease)}
.hero-film.has-frame video{opacity:1}
.home-page .hero-town .hero-film-caption{position:static;display:flex;justify-content:space-between;align-items:center;gap:16px;width:auto;height:auto;padding:18px 24px;border-radius:0;background:#fffdf5;text-align:left;transform:none;font-size:.9375rem;line-height:1.7;font-weight:700}
.hero-film-caption small{display:block;font-size:.625rem;letter-spacing:.15em;font-weight:600;color:#557c70;margin-bottom:3px}
.hero-film-controls{display:flex;align-items:center;gap:16px;flex-shrink:0}
.hero-film-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;flex-shrink:0;border:1px solid #adc6b8;border-radius:999px;background:transparent;padding:8px 14px;font-size:.8125rem;font-weight:600;transition:background .3s}
.hero-film-toggle[hidden]{display:none}
.hero-film-icon{font-size:1rem;width:16px;text-align:center}
.hero-film-toggle:focus-visible{background:#e1ede2}
.home-page .hero-film-controls .film-link{margin:0;padding:8px 0;min-height:44px;display:inline-flex;align-items:center;gap:8px;font-size:.8125rem;white-space:nowrap}
.home-page .hero-film-status{font-size:.8125rem;margin:0;padding:0 24px 16px;line-height:1.7}

@media(hover:hover) and (pointer:fine){
  .home-page .home-button:not(:disabled):hover,.inner-page .home-button:not(:disabled):hover{color:var(--green);background:var(--green);transform:none;box-shadow:0 5px 16px -8px #164b454d}
  .home-page .home-button.outline:hover,.inner-page .home-button.outline:hover{color:#fff;background:var(--paper)}
  .home-button:not(:disabled):hover::before{transform:scaleX(1)}
  :is(.nav>a:not(.home-button),.film-link,.lesson-open,.article-more,.inner-text-link,.home-footer nav>a,.home-footer nav>button):hover{background-size:100% 1px;text-decoration:none}
  .hero-film-toggle:hover{background:#e1ede2}
  .article-picture,.journal-image-link{transition:filter .5s var(--motion-ease),translate .5s var(--motion-ease)}
  .article-picture:hover,.journal-image-link:hover{translate:0 -4px;filter:drop-shadow(0 8px 12px #26584912)}
}
@media(max-width:1000px){
 .home-page .hero-layout{grid-template-columns:1fr;grid-template-areas:"copy" "film" "actions";grid-template-rows:auto;gap:24px;padding-top:32px;padding-bottom:40px;min-height:0}
 .home-page .hero-copy{align-self:auto;display:grid;grid-template-columns:1fr 1fr;gap:0 32px;align-items:center}
 .home-page .hero-copy h1{grid-row:1/3;font-size:clamp(2rem,4.5vw,3rem)}
 .home-page .hero-tagline{margin-top:0}
 .home-page .hero-description{margin-top:8px}
 .home-page .hero-actions{justify-content:center}
 .home-page .hero-town.hero-film{opacity:1}
}
@media(max-width:640px){
 .home-page .hero-layout{display:grid;gap:22px;padding-top:26px;padding-bottom:32px}
 .home-page .hero-copy{display:block}
 .home-page .hero-copy h1{font-size:clamp(2rem,8.3vw,2.75rem);line-height:1.22}
 .home-page .hero-tagline{margin-top:14px;font-size:1rem}
 .home-page .hero-description{margin-top:10px;font-size:.875rem;line-height:1.9}
 .home-page .hero-town.hero-film{border-radius:18px;align-self:stretch;max-width:none}
 .home-page .hero-town .hero-film-caption{padding:14px 16px;gap:12px;font-size:.8125rem;flex-wrap:wrap}
 .hero-film-caption small{font-size:.5625rem;letter-spacing:.08em}
 .hero-film-controls{gap:14px;flex-wrap:wrap}
 .hero-film-toggle{font-size:.75rem;padding:8px 10px;gap:5px}
 .home-page .hero-film-controls .film-link{font-size:.75rem}
 .home-page .hero-film-status{padding:0 16px 14px}
 .home-page .hero-actions{justify-content:flex-start}
 .home-page .hero-actions .home-button{font-size:.8125rem;padding:12px 16px}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation:none!important;transition:none!important}
  .article-picture:hover,.journal-image-link:hover{translate:none}
}
