/* ==========================================================================
   たまさんぽ！学生リールコンテスト in 八王子
   Design tokens
   - Primary: #1A6BB5 (浅川の水面を思わせる青)
   - Accent : #F5A623 (夕暮れの陽だまりオレンジ／CTA専用)
   - Coral  : #E8735A (ロゴの朱色。差し色・タグ)
   - Teal   : #14847A (ロゴの緑青。差し色・タグ)
   - Head   : Zen Maru Gothic／Body: Noto Serif JP
   ========================================================================== */

:root {
  --color-primary: #1a6bb5;
  --color-primary-dark: #124d85;
  --color-primary-soft: #e8f4fd;
  --color-accent: #f5a623;
  --color-accent-dark: #d8890a;
  --color-coral: #e8735a;
  --color-teal: #14847a;
  --color-bg: #ffffff;
  --color-bg-warm: #fbf8f2;
  --color-text: #333333;
  --color-text-light: #656565;
  --color-line: #e2ddd0;

  --font-head: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  --font-body: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --max-width: 1100px;
  --radius-sm: 6px;
  --radius-md: 14px;
  --header-h: 72px;

  --shadow-soft: 0 10px 30px rgba(26, 70, 110, 0.1);
  --shadow-card: 0 6px 20px rgba(51, 40, 20, 0.1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* clip (not hidden) — hidden/auto pair overflow-y to "auto" per spec,
     which turns <html> into a scroll container and breaks position:sticky
     for descendants (e.g. .top-col-left). clip avoids that side effect. */
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  margin: 0;
  line-height: 1.5;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: var(--font-body);
  font-size: 16px;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 40px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.2s ease;
}

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

/* ---------- Eyebrow / Section heading ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 10px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--color-accent);
  display: inline-block;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  margin-bottom: 14px;
}

.section-lead {
  color: var(--color-text-light);
  max-width: 640px;
  margin-bottom: 34px;
}

.section {
  padding-block: 64px;
}

.section--warm {
  background: var(--color-bg-warm);
}

.section--soft {
  background: var(--color-primary-soft);
}

.section-head {
  text-align: center;
  margin-inline: auto;
}

.section-head .section-lead {
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 14px 28px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    color 0.18s ease;
  white-space: nowrap;
}

/* CTA = pill shape, reserved for entry actions only (README 11-5) */
.btn-cta {
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #fff;
  box-shadow: 0 10px 22px rgba(245, 166, 35, 0.4);
  padding: 16px 36px;
}

.btn-cta:hover,
.btn-cta:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(245, 166, 35, 0.48);
}

.btn-cta--lg {
  font-size: 1.1rem;
  padding: 18px 46px;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.btn-outline {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #fff;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--color-primary-soft);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  margin-top: 12px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 500;
  display: flex;
  align-items: center;
  /* No backdrop-filter: filter/backdrop-filter on this element would make
     it a new containing block for its position:fixed descendant
     (.main-nav), collapsing that drawer to the header's own 72px box
     instead of the viewport. */
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 16px rgba(20, 40, 60, 0.08);
  border-bottom: 1px solid var(--color-line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--color-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.brand-title small {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--color-primary);
}

.main-nav {
  display: flex;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: block;
  font-family: var(--font-head);
  font-weight: 500;
  /* Sized down (was 0.86-0.92rem) so the brand title never has to
     ellipsis-truncate to make room for all 7 links + the CTA button in
     the 1100px+ inline nav — see also .brand-title and .site-header
     .nav-cta .btn, shrunk for the same reason. */
  font-size: clamp(0.72rem, 0.44rem + 0.4vw, 0.8rem);
  white-space: nowrap;
  color: var(--color-text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

/* Current-page marker, shared across every nav/menu on the site so it's
   always clear which page you're on. Orange reads fine against every
   background these appear on (transparent/solid header, dark left
   sidebar panel, dark footer); pointer-events:none disables the
   (redundant) link to the page you're already on. */
.nav-link[aria-current="page"],
.top-col-left-nav a[aria-current="page"],
.footer-links a[aria-current="page"],
.sitemap-grid a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  pointer-events: none;
  cursor: default;
}

.nav-cta {
  margin-left: 6px;
}

.hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 1200px is the single nav breakpoint site-wide: below it every page uses
   the hamburger drawer, above it sub-pages show the inline nav and the TOP
   page hands over to its left sidebar. Keeping one number means no width
   where TOP and the sub-pages disagree about which nav is showing. */
@media (min-width: 1200px) {
  .hamburger {
    display: none;
  }

  /* Shrunk so the inline 7-link nav + CTA never force the brand title
     to ellipsis-truncate at this breakpoint (mobile drawer keeps the
     regular .btn-cta size, where there's no width pressure). */
  .site-header .nav-cta .btn {
    padding: 9px 18px;
    font-size: 0.82rem;
  }
}

@media (max-width: 1199.98px) {
  .brand-title {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: 46vw;
  }

  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 20px 0 40px;
  }

  .main-nav.is-open {
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 0 20px;
  }

  .nav-link {
    padding: 16px 10px;
    border-bottom: 1px solid var(--color-line);
    font-size: 1.02rem;
  }

  .nav-cta {
    margin: 16px 10px 0;
  }

  .nav-cta .btn {
    width: 100%;
  }
}

/* ---------- TOP page: hamburger-only header ----------
   No inline menu bar at any width. The hamburger button is shown at every
   width below 1200px (README's SP + BP1タブレット tiers) — i.e. any time
   the left sidebar (.top-col-left-nav) isn't up yet. From 1200px the
   sidebar is the visible menu instead. The drawer always opens as a
   half-width panel from the right, at any scroll position — it's
   position:fixed, so scroll position never affects it. Selectors here
   are unscoped by width (higher specificity than the width-scoped rules
   above) so they apply at every breakpoint once .nav-hamburger-only is
   present. */
.site-header.nav-hamburger-only .main-nav {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  left: auto;
  width: 50%;
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 20px 0 40px;
  box-shadow: -8px 0 24px rgba(20, 40, 60, 0.15);
}

.site-header.nav-hamburger-only .main-nav.is-open {
  transform: translateX(0);
}

.site-header.nav-hamburger-only .nav-list {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 0 20px;
}

.site-header.nav-hamburger-only .nav-link {
  padding: 16px 10px;
  border-bottom: 1px solid var(--color-line);
  font-size: 1.02rem;
  color: var(--color-text);
  text-shadow: none;
}

.site-header.nav-hamburger-only .nav-cta {
  margin: 16px 10px 0;
}

.site-header.nav-hamburger-only .nav-cta .btn {
  width: 100%;
}

.site-header.nav-hamburger-only .hamburger {
  display: none;
}

@media (max-width: 1199.98px) {
  .site-header.nav-hamburger-only .hamburger {
    display: inline-flex;
  }
}

/* ---------- Hero (TOP) ----------
   Lives inline as the first block of .top-col-main (not a full-viewport
   section above it), so the left/center/right columns are all visible
   the moment the page loads. */
.hero {
  position: relative;
  min-height: 56vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--color-primary-dark);
  border-radius: var(--radius-md);
  margin: 24px 16px 0;
}

@media (min-width: 768px) {
  .hero {
    margin-inline: 40px;
  }
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease;
}

.hero-slide.is-active {
  opacity: 1;
}

/* G: gradient "breathing" glow — a soft living-light layer, kept separate
   from the scrim below so text contrast is never compromised */
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    var(--breathe-angle, 135deg),
    rgba(26, 107, 181, 0.16),
    rgba(20, 132, 122, 0.1)
  );
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(6, 24, 38, 0.86) 0%,
    rgba(6, 24, 38, 0.45) 42%,
    rgba(6, 24, 38, 0.15) 68%,
    rgba(6, 24, 38, 0.35) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  color: #fff;
  padding-block: 44px 40px;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-head);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: #ffd48a;
  margin-bottom: 14px;
}

.hero-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.hero-copy {
  margin-top: 18px;
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-align: center;
  display: block;
  width: 100%;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* ---------- Sub-page header band ---------- */
.page-band {
  padding-top: calc(var(--header-h) + 46px);
  padding-bottom: 46px;
  background: linear-gradient(160deg, var(--color-primary-soft), #fdf3e9 130%);
  border-bottom: 1px solid var(--color-line);
}

.page-band-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

/* Page icon, sat on a white disc. object-fit:contain (not cover) and no
   rotation: these are flat square icons, not photos — cover would crop
   their built-in padding and a tilt would read as a misaligned image. */
.page-band img.page-band-photo {
  width: 104px;
  height: 104px;
  padding: 22px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  flex-shrink: 0;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--color-primary);
}

.page-title {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
}

.page-lead {
  color: var(--color-text-light);
  margin-top: 8px;
  max-width: 620px;
}

/* Numbered step marker (schedule / contest flow). */

.trail-marker {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--color-primary);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Varela Round", var(--font-head);
  font-weight: 700;
  margin-inline: auto;
  box-shadow: 0 4px 12px rgba(26, 107, 181, 0.25);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 26px;
  border: 1px solid var(--color-line);
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 10px;
  color: var(--color-primary-dark);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

/* ---------- Reel photo cards (signature) ----------
   Vertical 9:16 frames echoing the Instagram Reel format the
   contest actually produces; slight scrapbook tilt + tape. */
.reel-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 14px 4px 26px;
  scroll-snap-type: x proximity;
}

.reel-card {
  position: relative;
  flex: 0 0 auto;
  width: 168px;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  scroll-snap-align: start;
  background: #111;
}

.reel-card:nth-child(odd) {
  transform: rotate(-2.5deg);
}

.reel-card:nth-child(even) {
  transform: rotate(2deg);
}

.reel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: 46px;
  height: 18px;
  background: rgba(245, 230, 200, 0.75);
  border: 1px solid rgba(200, 180, 140, 0.5);
}

.reel-card figcaption,
.reel-card .reel-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 10px 8px;
  font-family: var(--font-head);
  font-size: 0.72rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
}

@media (min-width: 768px) {
  .reel-row {
    overflow: visible;
    flex-wrap: wrap;
    justify-content: center;
  }
  .reel-card {
    width: 190px;
  }
}

/* ---------- Timeline / schedule ---------- */
.timeline {
  display: grid;
  gap: 22px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px;
}

.timeline-item .trail-marker {
  margin-inline: 0;
  width: 46px;
  height: 46px;
  font-size: 0.95rem;
}

.timeline-item .timeline-body {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}

/* Cards that open the detail modal (about page's "コンテストの流れ") —
   resets the <button>'s native chrome so it still reads as the plain
   card above, just clickable. */
.timeline-item .timeline-trigger {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.timeline-item .timeline-trigger:hover,
.timeline-item .timeline-trigger:focus-visible {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: 0 12px 26px rgba(26, 107, 181, 0.16);
}

.timeline-item .timeline-date {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.timeline-item .timeline-step-title {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--color-text);
  font-size: 1rem;
}

.timeline-cue {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-primary);
}

.timeline-connector {
  position: relative;
}

.timeline-connector::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 46px;
  bottom: -22px;
  border-left: 3px dotted var(--color-primary);
  opacity: 0.4;
}

.timeline-item:last-child .timeline-connector::before {
  display: none;
}

.timeline--no-connector .timeline-connector::before {
  display: none;
}

/* ---------- Modal (schedule detail — about page's "コンテストの流れ") ----------
   Same show/hide idiom as .share-rail.is-visible / .to-top.is-visible:
   opacity + visibility + pointer-events, toggled via .is-open (js/main.js). */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 30, 45, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-soft);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-overlay.is-open .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--color-primary);
  color: #fff;
}

.modal-title {
  margin: 0 0 12px;
  font-family: var(--font-head);
  font-size: 1.15rem;
}

.modal-panel .btn {
  margin-top: 16px;
}

/* ---------- Tags / badges ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 9999px;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.tag--coral {
  background: #fbe6e0;
  color: #b6472f;
}

.tag--teal {
  background: #ddf1ee;
  color: var(--color-teal);
}

.tag--accent {
  background: #fdf0da;
  color: var(--color-accent-dark);
}

/* ---------- NEWS ticker ---------- */
.news-list {
  border-top: 1px solid var(--color-line);
}

.news-item {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-line);
  flex-wrap: wrap;
}

.news-item time {
  font-family: var(--font-head);
  font-size: 0.85rem;
  color: var(--color-text-light);
  flex-shrink: 0;
  width: 96px;
}

/* Headline, whether or not it links out — entries without a detail page
   yet are plain text, so this can't hang off the <a> alone. */
.news-item a,
.news-item > span:not(.tag) {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  transition: color 0.2s ease;
}

.news-item a:hover {
  color: var(--color-primary);
}

/* ---------- FAQ / Accordion ---------- */
.accordion-item {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 22px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
}

.accordion-trigger .q-mark {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.accordion-trigger .chevron {
  margin-left: auto;
  transition: transform 0.25s ease;
  color: var(--color-primary);
  flex-shrink: 0;
}

.accordion-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.accordion-panel > div {
  overflow: hidden;
}

.accordion-item.is-open .accordion-panel {
  grid-template-rows: 1fr;
}

.accordion-panel-inner {
  padding: 0 22px 20px 68px;
  color: var(--color-text-light);
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  gap: 20px;
}

.form-row label {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.required-badge {
  display: inline-block;
  font-size: 0.65rem;
  background: var(--color-coral);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 700;
  vertical-align: middle;
}

.optional-badge {
  display: inline-block;
  font-size: 0.65rem;
  background: #eee;
  color: #777;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 700;
  vertical-align: middle;
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid #cfcabd;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 181, 0.15);
  outline: none;
}

.form-row textarea {
  min-height: 160px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 6px;
}

.form-error {
  font-size: 0.8rem;
  color: #c23a3a;
  margin-top: 6px;
  display: none;
}

.form-row.has-error input,
.form-row.has-error select,
.form-row.has-error textarea {
  border-color: #c23a3a;
}

.form-row.has-error .form-error {
  display: block;
}

.form-status {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  display: none;
  font-family: var(--font-head);
  font-weight: 500;
}

.form-status.is-success {
  display: block;
  background: #e4f6ea;
  color: #256a3f;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0f2f47;
  color: #d6e6f2;
  padding-block: 56px 30px;
}

.footer-grid {
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.footer-brand img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}

.footer-brand-title {
  font-family: var(--font-head);
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 6px;
}

.footer-organizer {
  font-size: 0.82rem;
  color: #a9c2d6;
  margin-top: 14px;
  line-height: 1.9;
}

.footer-heading {
  font-family: var(--font-head);
  color: #fff;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 0.88rem;
  color: #cfe2ef;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 44px;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: #8fa9bd;
}

/* CC BY 4.0 attribution for Hachioji City open-data photos */
.footer-credits {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 40px;
  padding-top: 20px;
  font-size: 0.76rem;
  color: #8fa9bd;
  line-height: 1.8;
}

.footer-credits-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  color: #cfe2ef;
  margin-bottom: 8px;
}

.footer-credits-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 4px 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .footer-credits-list {
    grid-template-columns: 1fr 1fr;
  }
}

.footer-credits-list li {
  margin: 0;
}

.footer-credits-license {
  margin-top: 10px;
}

.footer-credits a {
  color: #a9c2d6;
  text-decoration: underline;
}

.footer-credits a:hover {
  color: var(--color-accent);
}

/* ---------- Floating UI ---------- */
.share-rail {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 400;
  display: none;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (min-width: 768px) {
  .share-rail {
    display: flex;
  }
}

/* Hidden while the hero is on screen (kept clear of the full-bleed
   hero image); revealed once scrolled past it — toggled by main.js. */
.share-rail.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.share-rail a,
.share-rail .share-copy {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.share-rail a:hover,
.share-rail .share-copy:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
}

.share-copy {
  border: none;
  cursor: pointer;
}

.share-copy-icon--check {
  display: none;
}

.share-copy.is-copied {
  background: var(--color-primary);
  color: #fff;
}

.share-copy.is-copied .share-copy-icon--link {
  display: none;
}

.share-copy.is-copied .share-copy-icon--check {
  display: block;
}

.to-top {
  position: fixed;
  right: 18px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(18, 55, 90, 0.35);
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--color-primary-dark);
}

/* ---------- Misc content ---------- */
.prose h2 {
  font-size: 1.3rem;
  color: var(--color-primary-dark);
  margin-top: 2.2em;
  margin-bottom: 0.7em;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--color-primary-soft);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.08rem;
  color: var(--color-primary-dark);
  margin-top: 1.6em;
  margin-bottom: 0.5em;
}

.prose ul {
  list-style: none;
  margin: 0 0 1.2em;
  padding: 0;
}

.prose ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 0.5em;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.85em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
}

.prose ol {
  padding-left: 1.4em;
  margin-bottom: 1.2em;
}

.prose ol li {
  margin-bottom: 0.5em;
}

.prose strong {
  color: var(--color-primary-dark);
}

.link-emphasis {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-emphasis:hover {
  color: var(--color-primary-dark);
}

/* ---------- Post grid (NEWS-style repeatable posts, e.g. Teams) ----------
   One .post-card per entry; add more freely, the grid just wraps. Built
   for a WordPress post-loop: .post-thumb -> post thumbnail (video/image),
   .post-title/.post-excerpt -> post title/excerpt, whole card links to
   the single-post permalink. .post-thumb--placeholder is the "not a real
   photo yet" state for seed content. */
.post-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(26, 107, 181, 0.16);
}

.post-card-link {
  display: block;
  color: inherit;
}

.post-thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  display: flex;
}

.post-thumb--placeholder {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-bg-warm);
  border-bottom: 2px dashed var(--color-line);
  color: var(--color-text-light);
}

.post-thumb-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.post-body {
  padding: 20px 22px 24px;
}

.post-date {
  display: block;
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--color-primary);
  font-weight: 700;
}

.post-title {
  margin: 6px 0 0;
  font-size: 1.05rem;
}

.post-excerpt {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--color-text-light);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5em;
}

table.plain {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

table.plain th,
table.plain td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-line);
}

table.plain th {
  font-family: var(--font-head);
  color: var(--color-primary-dark);
  background: var(--color-primary-soft);
  white-space: nowrap;
}

.callout {
  background: #fdf3e4;
  border: 1px solid #f1dcb0;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 1.6em;
}

.callout-title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--color-accent-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-embed {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-line);
}

.map-embed iframe {
  width: 100%;
  height: 340px;
  border: 0;
  display: block;
}

.two-col {
  display: grid;
  gap: 36px;
  align-items: start;
}

@media (min-width: 860px) {
  .two-col {
    grid-template-columns: 1.1fr 0.9fr;
  }
  .two-col.is-reversed {
    grid-template-columns: 0.9fr 1.1fr;
  }
  .two-col.is-reversed > :first-child {
    order: 2;
  }
}

/* まちるセクション：テキスト＋Instagram（2カラム）→ YouTube全幅（README 8-P01） */
.machiru-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: stretch;
}

@media (min-width: 767px) {
  .machiru-inner {
    flex-direction: row;
    align-items: center;
  }
  .machiru-text,
  .machiru-instagram {
    flex: 1;
  }
}

.machiru-instagram {
  display: flex;
  justify-content: center;
}

/* A white raised panel rather than a tinted one, so the same band reads
   correctly on every section background it appears over (white, warm
   beige and pale blue all occur) instead of clashing with one of them. */
.cta-band {
  background: #fff;
  border: 1px solid var(--color-line);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-md);
  padding: 40px 32px;
  text-align: center;
}

.cta-band h2 {
  color: var(--color-text);
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  margin-bottom: 12px;
}

.cta-band p {
  color: var(--color-text-light);
  margin-bottom: 22px;
}

.sitemap-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .sitemap-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.sitemap-grid a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 0.86rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sitemap-grid a:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.avatar-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.placeholder-card {
  border: 2px dashed var(--color-line);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  color: var(--color-text-light);
  background: var(--color-bg-warm);
}

.placeholder-card .eyebrow {
  justify-content: center;
}

/* ==========================================================================
   TOP page 4-area layout (README Section 8)
   top-columns: left(sticky,1200px+) / main(768px cap, hero is its first
   block) / right(spacer,768px+). padding-top clears the fixed header,
   same role .page-band's padding-top plays on every sub-page.
   ========================================================================== */
/* CSS Grid (not flex) so the fixed-width center column and the
   fill-the-rest side columns don't fight over flex-basis distribution. */
.top-columns {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  width: 100%;
  padding-top: var(--header-h);
}

@media (min-width: 768px) {
  .top-columns {
    grid-template-columns: 1fr 84px;
  }
}

@media (min-width: 1200px) {
  .top-columns {
    grid-template-columns: 1fr minmax(0, 768px) 84px;
    padding-top: 0;
  }
}

.top-col-left {
  display: none;
  position: relative;
  overflow: hidden;
  background: var(--color-primary-dark);
}

@media (min-width: 1200px) {
  .top-col-left {
    display: block;
    position: sticky;
    top: 0;
    height: 100vh;
  }
}

/* PC (1200px+) only: the TOP page header is redundant once the left
   sidebar nav (.top-col-left-nav) takes over as the visible menu, so
   it's hidden here — .nav-hamburger-only is unique to the TOP page's
   header, so this doesn't affect the sub-page headers. */
@media (min-width: 1200px) {
  .site-header.nav-hamburger-only {
    display: none;
  }
}

.top-col-left-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease;
}

.top-col-left-slide.is-active {
  opacity: 1;
}

.top-col-left::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(190deg, rgba(6, 24, 38, 0.5), rgba(6, 24, 38, 0.82));
}

.top-col-left-content {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* flex-start + the auto margins on .top-col-left-nav/-cta below: the
     intro card stays pinned to the top, and the nav+CTA pair centres
     itself in whatever space is left under it. */
  justify-content: flex-start;
  text-align: center;
  color: #fff;
}

/* Sits at the top-left of the sidebar. In normal flow (not absolute):
   the nav below claims the leftover space via auto margins, so the two
   can never overlap the way a fixed offset would on a short viewport.
   Hidden while the hero (center column) is on screen — card background
   and text slide in together from the left once toggleLeftIntro()
   (js/main.js) marks the hero as scrolled past, mirroring the
   .share-rail is-visible toggle's hero-bottom check. */
.top-col-left-intro {
  align-self: flex-start;
  max-width: 100%;
  text-align: left;
  background: #fff;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateX(-56px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.top-col-left-content.is-visible .top-col-left-intro {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .top-col-left-intro {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

.top-col-left-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--color-text);
}

.top-col-left-copy {
  margin-top: 14px;
  margin-bottom: 0;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-block;
  padding-bottom: 6px;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-accent);
}

.top-col-left-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  margin-top: auto;
  width: 100%;
  max-width: 260px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md);
  padding: 10px;
}

.top-col-left-nav a {
  font-family: var(--font-head);
  font-size: 0.86rem;
  color: #fff;
  text-align: center;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.top-col-left-nav a:hover {
  background: rgba(255, 255, 255, 0.22);
}

.top-col-left-cta {
  margin-top: 14px;
  margin-bottom: auto;
  width: 100%;
  max-width: 260px;
}

.top-col-main {
  width: 100%;
  min-width: 0;
}

.top-col-main > .container {
  max-width: 768px;
}

.top-col-right {
  display: none;
  width: 84px; /* share-button width (42px) x2, per README 11-6 */
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .top-col-right {
    display: block;
  }
}

/* ==========================================================================
   Stat counters (Section 22-C: count-up)
   ========================================================================== */
.stat-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
  margin-block: 28px;
}

.stat-item {
  text-align: center;
  padding: 18px 8px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
}

.stat-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  color: var(--color-primary-dark);
}

.stat-label {
  font-size: 0.76rem;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* ==========================================================================
   Section 22: Animation & motion primitives
   ========================================================================== */

/* I: scroll progress bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 1100;
  transition: width 0.1s linear;
}

/* Loading screen — shows on every visit while webfonts finish loading,
   then removes itself (js/loading.js). */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: #061626;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.loading-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  animation: loading-pulse 1.1s ease-in-out infinite;
}

.loading-dots {
  display: flex;
  gap: 8px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: loading-dot 1.1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loading-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.88);
    opacity: 0.7;
  }
}

@keyframes loading-dot {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-logo,
  .loading-dots span {
    animation: none;
  }
}

/* F: text "fill" reveal — the heading's colour sweeps in from the top.
   Painted with a two-stop gradient clipped to the glyphs and slid into
   place, rather than overlaying a duplicate copy of the text: a duplicate
   (content: attr(...)) gets announced a second time by some screen
   readers and can visually double up if the two layers land a sub-pixel
   apart. Only engages once JS confirms it's driving the reveal
   (html.js-anim) and the browser supports background-clip:text —
   otherwise the heading just renders normally. Colour defaults to the
   body text colour; override per element with --fill-text-color. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  html.js-anim [data-fill-text] {
    display: inline-block;
    background-image: linear-gradient(
      to bottom,
      var(--fill-text-color, var(--color-text)) 50%,
      rgba(51, 51, 51, 0.3) 50%
    );
    background-size: 100% 200%;
    background-position: 0 100%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: background-position 1s ease;
  }

  html.js-anim [data-fill-text].is-filled {
    background-position: 0 0;
  }
}

/* E / H: reveal-on-scroll targets.
   Hidden ONLY once JS confirms it's driving the reveal (.js-anim on <html>) —
   if a script fails to load, content stays visible by default (no FOUC risk). */
.text-rise,
.animate-item {
  opacity: 1;
  transform: none;
}

html.js-anim .text-rise,
html.js-anim .animate-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

html.js-anim .animate-item[data-from="left"] {
  transform: translateX(-48px);
}

html.js-anim .animate-item[data-from="right"] {
  transform: translateX(48px);
}

html.js-anim .text-rise.is-visible,
html.js-anim .animate-item.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

@media (prefers-reduced-motion: reduce) {
  html.js-anim .text-rise,
  html.js-anim .animate-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  /* Drop the gradient fill entirely and hand the heading back to its
     normal colour — no sweep, nothing left half-painted. */
  html.js-anim [data-fill-text] {
    background-image: none !important;
    color: inherit !important;
    transition: none !important;
  }
}

/* M: button fill-on-hover (applied to outline buttons — solid CTA/primary buttons
   already read as "filled" per README 11-5, so the sweep effect belongs on
   .btn-outline where a transparent-to-filled transition is meaningful) */
.btn-outline {
  position: relative;
  overflow: hidden;
  z-index: 0;
  transition: color 0.35s ease;
}

.btn-outline::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: -1;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  color: #fff;
  background: transparent;
}

.btn-outline:hover::before,
.btn-outline:focus-visible::before {
  transform: translateX(0);
}

/* N: card hover lift (reinforces existing shadow with a subtle rise) */
.card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(26, 107, 181, 0.18);
}

/* O: button ripple (JS-appended .ripple span) */
.btn {
  position: relative;
  overflow: hidden;
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  animation: btn-ripple-anim 0.6s ease-out forwards;
}

@keyframes btn-ripple-anim {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* P: global cursor/tap ripple */
.cursor-ripple {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0.7;
  pointer-events: none;
  z-index: 9999;
  animation: cursor-ripple-anim 0.35s ease-out forwards;
}

@keyframes cursor-ripple-anim {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}
