/* ==========================================================================
   FWO — Global
   Layer 3 of 6: shared helpers, reveal start-states and reusable components.
   ========================================================================== */

body.is-locked { overflow: hidden; }

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

/* Sections land below the fixed nav when reached through an anchor link */
section[id] { scroll-margin-top: calc(var(--nav-h) - 1px); }

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

.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 300;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Layout helpers ---------- */

.container {
  width: min(100% - (var(--gutter) * 2), var(--max));
  margin-inline: auto;
}

.section { position: relative; padding-block: var(--section-y); }
.section--light { background: var(--paper); color: var(--ink); }
.section--dark { background: var(--ink); color: var(--white); }

/* ---------- Reveal start-states (animated by js/lib/reveal.js) ----------
   Elements start hidden only when JS is running. If motion is unavailable
   (reduced motion, Anime.js missing, scripts blocked) the .no-motion class
   is added to <html> and everything shows immediately. */

.js [data-reveal],
.js [data-reveal-group] > *,
.js [data-hero] { opacity: 0; }

.no-motion [data-reveal],
.no-motion [data-reveal-group] > *,
.no-motion [data-hero] { opacity: 1 !important; transform: none !important; }

/* ---------- Section header ---------- */

.section-head { margin-bottom: clamp(2.5rem, 6vw, 5rem); max-width: 60rem; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.section--light .kicker { color: var(--accent-deep); }
.kicker::before {
  content: "";
  width: 2.5rem; height: 2px;
  background: currentColor;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}
/* Outlined word inside a heading — the "funky" accent */
.display em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}
.section--light .display em { -webkit-text-stroke-color: var(--ink); }

.subhead {
  margin-bottom: 1.75rem;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.lede {
  margin-top: 1.5rem;
  max-width: 38rem;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--muted-on-dark);
}
.section--light .lede { color: var(--muted-on-light); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.4rem;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  will-change: transform;
}
.btn svg { width: 1.1em; height: 1.1em; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn--primary { background: var(--accent); color: var(--ink); }
.btn--primary:hover { background: var(--white); }

.btn--ghost { border-color: var(--line-on-dark-strong); color: var(--white); }
.btn--ghost:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.section--light .btn--ghost { border-color: var(--ink); color: var(--ink); }
.section--light .btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }

.btn--dark { background: var(--ink); color: var(--white); }
.btn--dark:hover { background: var(--accent-deep); }

.btn--small { min-height: 2.75rem; padding: 0.55rem 1.3rem; }

/* ---------- Icon button (carousel arrows, lightbox controls, socials) ---------- */

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.25rem; height: 3.25rem;
  border: 2px solid var(--line-on-dark);
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.icon-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }

.section--light .icon-btn { border-color: var(--ink); }
.section--light .icon-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
  transform: translateY(-4px) rotate(-6deg);
}

/* ---------- Card ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 24rem;
  padding: 2rem 1.75rem;
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.45s var(--ease), border-color 0.45s var(--ease), background-color 0.45s var(--ease);
  will-change: transform;
}
.card::before { /* gold bar that wipes in on hover */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.card:hover,
.card:focus-within {
  border-color: var(--accent-line);
  background: var(--ink-2-hover);
  box-shadow: var(--shadow-card-hover);
}
.card:hover::before,
.card:focus-within::before { transform: scaleX(1); }

.card__num {
  position: absolute;
  top: 1.5rem; right: 1.75rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--muted-on-dark);
}
.card__icon { width: 3.5rem; height: 3.5rem; color: var(--accent); margin-bottom: auto; }
.card__title {
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}
.card__text { margin-top: 0.9rem; color: var(--muted-on-dark); font-size: 0.98rem; }
.card__link {
  margin-top: 1.5rem;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.card__link::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.card__link span { display: inline-block; transition: transform 0.3s var(--ease); }
.card:hover .card__link span { transform: translateX(6px); }

@media (max-width: 1100px) { .card { min-height: 20rem; } }
@media (max-width: 560px) { .card { min-height: 0; } .card__icon { margin-bottom: 0; } }

/* ---------- Timeline ---------- */

.timeline { border-left: 2px solid var(--ink); }
.timeline__item { position: relative; padding: 0 0 2.25rem 2rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -0.5rem; top: 0.3rem;
  width: 0.85rem; height: 0.85rem;
  background: var(--accent);
  border: 2px solid var(--ink);
  transform: rotate(45deg);
}
.timeline__year {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.timeline__title { margin: 0.25rem 0 0.3rem; font-size: var(--step-1); font-weight: 700; line-height: 1.2; }
.timeline__item p { color: var(--muted-on-light); }

/* ---------- Placeholder tag (shown on items flagged placeholder in content.js) ---------- */

.tag-placeholder {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.15rem 0.55rem;
  border: 1px dashed currentColor;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
  vertical-align: middle;
}
