/* =========================================================
   EPISTEMELODY — SHARED FOUNDATION
   Palette tokens + the header / nav / footer / button shell
   used by every page. Page-specific styles live alongside in
   circular.css, roster.css, service-detail.css, contact.css
   and housecall-helpdesk.css.
   ========================================================= */

:root {
  --ep-paper: #fff9ea;
  --ep-ink: #27374a;
  --ep-rose: #f49aaa;
  --ep-peach: #e89a86; /* warmer, dustier period pink — see home-circular.css */
  --ep-red: #bd3e50;
  --ep-red-dark: #a5333f;
  --ep-blue: #69bdd1;
  --ep-yellow: #f5ce58;
  --ep-gold: #e8b44a; /* harvest gold — the era's signature warm */
  --ep-cream: #ffeab0;
  --ep-line: #27374a;
}

.ep-page {
  margin: 0;
  background: var(--ep-paper);
  color: var(--ep-ink);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

.ep-page * { box-sizing: border-box; }

/* The HouseCall CTA breaks out of the shell with `calc(50% - 50vw)`, and
   50vw counts the scrollbar in most desktop browsers — so the band can sit
   a few pixels wider than the document and cause a sideways scroll. `clip`
   trims the overhang without creating a scroll container the way `hidden`
   would. Nothing on the site is meant to scroll horizontally. */
.ep-page { overflow-x: clip; }
.ep-page a { color: inherit; }

.ep-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.ep-shell-wide { width: min(1160px, calc(100% - 32px)); }

/* ---------- Header ---------- */

.ep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  border-bottom: 2px solid var(--ep-line);
}

.ep-brand {
  border: 0;
  color: var(--ep-red);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(21px, 2.7vw, 31px);
  font-weight: 700;
  /* Blunt strokes, like every other piece of display type on the site.
     Left on auto this was the thinnest, highest-contrast serif on the
     page. Positive tracking because wordmarks are set open, not tight —
     capitals need air, and spaced caps read institutional where packed
     caps read contemporary. The headlines stay tight on purpose. */
  font-optical-sizing: none;
  font-variation-settings: "opsz" 20, "wght" 700;
  letter-spacing: .04em;
  text-decoration: none;
}

.ep-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.ep-nav a {
  border: 0;
  color: var(--ep-ink);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-decoration: none;
}

.ep-nav a:hover,
.ep-nav a[aria-current="page"] {
  color: var(--ep-red);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Shared type + controls ---------- */

.ep-kicker {
  margin: 0 0 12px;
  color: var(--ep-red);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ep-button {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 25px;
  padding: 13px 17px;
  border: 2px solid var(--ep-line);
  background: var(--ep-yellow);
  box-shadow: 4px 4px 0 var(--ep-line);
  color: var(--ep-ink);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .07em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.ep-button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ep-line);
}

/* `.ep-page a {color: inherit}` above is (0,1,1) and outranks `.ep-button`
   at (0,1,0), so an anchor button inside a section that sets its own text
   colour — the red HouseCall CTA — would inherit that colour and turn
   invisible on its own pale fill. Anchors need the higher-specificity
   rule; the plain class still covers <button> in the contact form. */
.ep-page a.ep-button { color: var(--ep-ink); }

.ep-button-blue { background: var(--ep-blue); }

/* Two buttons side by side — the services half and the creative half.
   The wrapper carries the top margin so the pair stays aligned. */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 25px;
}

.hero-actions .ep-button { margin-top: 0; }

/* ---------- Footer ---------- */

.ep-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 0;
  color: var(--ep-ink);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- Period display type ---------- */
/* Fraunces carries an optical-size axis (9-144). Left on auto, a 100px+
   headline pulls the 144 master: fine hairlines, high stroke contrast,
   essentially a Didone — the wrong century. Pinning opsz low gives the
   blunt, low-contrast letterforms of Cooper Black and ITC Souvenir, which
   is what the era's display type actually looked like. Set here once so
   every page matches; font-variation-settings overrides font-weight, so
   the groups are split by the weight they already use. */

.circular-hero h1, .roster-hero h1, .detail-hero h1,
.contact-hero h1, .helpdesk-hero h1,
.section-title h2, .artist-heading h2, .detail-request h2,
.contact-intro h2, .section-heading h2,
.helpdesk-note h2, .helpdesk-cta h2 {
  font-optical-sizing: none;
  font-variation-settings: "opsz" 36, "wght" 700;
}

.service-entry h3, .offering h3, .steps h3,
.roster-list a, .call-card-title {
  font-optical-sizing: none;
  font-variation-settings: "opsz" 20, "wght" 700;
}

.home-note, .hero-line, .mission-lines p,
.artist-link a, .contact-details a {
  font-optical-sizing: none;
  font-variation-settings: "opsz" 20, "wght" 600;
}

/* ---------- Cross-page navigation ---------- */
/* Opts every page into cross-document view transitions, so moving
   between pages cross-fades instead of flashing white. Browsers
   without support just navigate normally. Paired with the
   speculation-rules block in each page's <head>, which prerenders
   linked pages on hover so the click lands instantly. */

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
  animation-timing-function: ease;
}

/* The wordmark is in the same place on every page, so let it morph
   across the navigation rather than fade out and back in. */
.ep-brand { view-transition-name: ep-brand; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .ep-shell,
  .ep-shell-wide { width: min(100% - 24px, 560px); }

  .ep-header {
    min-height: 0;
    padding: 20px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .ep-nav {
    justify-content: flex-start;
    gap: 14px;
  }

  .ep-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
