/* ==========================================================================
   Endless Hybrids — Base  (v1.1.0)
   Reset + base element styles (reading semantic tokens) + motion primitives.
   Load AFTER tokens.css + themes.css, BEFORE components.css.
   Intentionally light: components do the heavy lifting; this just makes raw
   HTML look on-brand and provides the shared .eh-reveal scroll animation.
   v1.1.0: strong=heading/600, text-wrap balance/pretty, p max-width 70ch,
   :focus-visible red ring. (Components with their own strong/p rules override
   these — e.g. the navy Banner keeps its cream strong.)
   ========================================================================== */

/* ---- Reset (the convention already used across the site) ----------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ---- Document ----------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--eh-surface-page);
  color: var(--eh-body);
  font-family: var(--eh-font-sans);
  font-weight: var(--eh-weight-body);
  font-size: var(--eh-type-body);
  line-height: var(--eh-lh-body);
  letter-spacing: var(--eh-track-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- Headings: serif, heading color (components may override) ------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--eh-font-serif);
  font-weight: 400;
  color: var(--eh-heading);
  line-height: var(--eh-lh-snug);
  text-wrap: balance;
}
h1 { font-size: var(--eh-type-h1); line-height: var(--eh-lh-tight); }
h2 { font-size: var(--eh-type-h2); }
h3 { font-size: var(--eh-type-h3); font-weight: 500; }

/* ---- Text --------------------------------------------------------------- */
p { margin: 0 0 var(--eh-space-4); max-width: 70ch; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; color: var(--eh-heading); }
em, i { font-style: italic; }

small { font-size: var(--eh-type-body-sm); }

a {
  color: var(--eh-accent);
  text-decoration: none;
  transition: opacity var(--eh-dur-hover) var(--eh-ease);
}
a:hover { opacity: 0.72; }

::selection { background: var(--eh-red-wash); }

/* ---- Media & rules ------------------------------------------------------ */
img, picture, video, svg, canvas { max-width: 100%; display: block; }

hr {
  border: 0;
  border-top: var(--eh-border-hairline);
  margin: var(--eh-space-8) 0;
}

/* ---- Forms inherit type ------------------------------------------------- */
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--eh-focus-ring); border-radius: var(--eh-radius-sm); }

/* ==========================================================================
   Motion primitives
   ========================================================================== */

/* Scroll-reveal: add .eh-reveal to an element, then an IntersectionObserver
   adds .is-visible when it enters the viewport. (JS lives in the page; see the
   publication template.) Stagger with .eh-reveal--d1 / --d2. */
.eh-reveal {
  opacity: 0;
  transform: var(--eh-reveal-transform, translateY(20px));
  transition: opacity var(--eh-dur-reveal) var(--eh-ease-out),
              transform var(--eh-dur-reveal) var(--eh-ease-out);
}
.eh-reveal.is-visible { opacity: 1; transform: translateY(0); }
.eh-reveal--d1 { transition-delay: 0.1s; }
.eh-reveal--d2 { transition-delay: 0.2s; }

/* Optional one-shot page/element fade-in. */
.eh-fade-in { animation: eh-fadeIn var(--eh-dur-fade) var(--eh-ease-out) both; }

@keyframes eh-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes eh-thesisFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Subtle "breathing" shadow used by featured channel cards. */
@keyframes eh-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 58, 54, 0); }
  50%      { box-shadow: 0 4px 20px rgba(61, 58, 54, 0.12); }
}

/* Respect reduced-motion: kill reveal offset + decorative animation. */
@media (prefers-reduced-motion: reduce) {
  .eh-reveal { opacity: 1; transform: none; transition: none; }
  .eh-fade-in { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
