/*
 * The base layer: a small reset plus the element defaults every page and application gets for
 * free. Nothing here knows about a specific page. Import order is always tokens.css, then this,
 * then components.css.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Somebody who asked the operating system to stop animations meant it everywhere, including the
   smooth scroll above, which is the one people forget. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--ep-bg);
  color: var(--ep-ink);
  font-family: var(--ep-font-sans);
  font-size: var(--ep-text-body);
  line-height: var(--ep-leading-normal);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--ep-font-display);
  font-weight: var(--ep-weight-bold);
  line-height: var(--ep-leading-snug);
  letter-spacing: var(--ep-tracking-tight);
  text-wrap: balance;
}

p,
ul,
ol,
dl,
figure,
blockquote,
pre {
  margin: 0;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--ep-accent);
  text-underline-offset: 0.18em;
  transition: color var(--ep-duration-fast) var(--ep-ease);
}

/* :focus-visible so a mouse click on a button does not paint a ring but a keyboard tab always
   does. The ring is two-stage so it stays visible on any surface in the system. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--ep-focus-ring);
  border-radius: var(--ep-radius-xs);
}

hr {
  border: 0;
  border-top: 1px solid var(--ep-line);
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

code,
kbd,
samp,
pre {
  font-family: var(--ep-font-mono);
  font-size: 0.92em;
}

::selection {
  background: var(--ep-accent);
  color: var(--ep-on-accent);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--ep-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--ep-line-strong);
  border: 3px solid var(--ep-bg);
  border-radius: var(--ep-radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ep-ink-3);
}

/* ---- Type utilities --------------------------------------------------------------------- */

.ep-display {
  font-family: var(--ep-font-display);
  font-size: var(--ep-text-display);
  font-weight: var(--ep-weight-black);
  line-height: var(--ep-leading-tight);
  letter-spacing: var(--ep-tracking-display);
}

.ep-title {
  font-family: var(--ep-font-display);
  font-size: var(--ep-text-title);
  font-weight: var(--ep-weight-bold);
  line-height: var(--ep-leading-snug);
  letter-spacing: var(--ep-tracking-display);
}

.ep-heading {
  font-family: var(--ep-font-display);
  font-size: var(--ep-text-heading);
  font-weight: var(--ep-weight-bold);
}

/* The one place the accent and the cool counterweight meet. Used on the last clause of a
   headline, never on a whole one: a fully gradient headline is unreadable and looks cheap. */
.ep-gradient {
  background: linear-gradient(
    100deg,
    var(--ep-accent) 8%,
    light-dark(#e8863a, #ffd9a8) 50%,
    var(--ep-ice) 96%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The mono label. Section kickers, table headers, metric captions, stack names. */
.ep-mono {
  font-family: var(--ep-font-mono);
  font-size: var(--ep-text-label);
  font-weight: var(--ep-weight-medium);
  letter-spacing: var(--ep-tracking-label);
  text-transform: uppercase;
  color: var(--ep-ink-3);
  font-variant-numeric: tabular-nums;
}

.ep-mono--accent {
  color: var(--ep-accent);
}

.ep-lede {
  font-size: var(--ep-text-subheading);
  line-height: var(--ep-leading-relaxed);
  color: var(--ep-ink-2);
  max-width: var(--ep-measure-prose);
  text-wrap: pretty;
}

.ep-prose {
  max-width: var(--ep-measure-prose);
  line-height: var(--ep-leading-relaxed);
  color: var(--ep-ink-2);
  text-wrap: pretty;
}

.ep-prose > * + * {
  margin-top: var(--ep-space-sm);
}

.ep-prose strong {
  color: var(--ep-ink);
  font-weight: var(--ep-weight-semibold);
}

/* ---- Layout utilities -------------------------------------------------------------------- */

.ep-page {
  width: 100%;
  max-width: var(--ep-page-max);
  margin-inline: auto;
  padding-inline: var(--ep-page-gutter);
}

.ep-section {
  padding-block: var(--ep-space-section);
}

.ep-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ep-skip-link {
  position: absolute;
  top: var(--ep-space-2xs);
  left: var(--ep-space-2xs);
  z-index: 100;
  padding: var(--ep-space-2xs) var(--ep-space-sm);
  background: var(--ep-accent);
  color: var(--ep-on-accent);
  border-radius: var(--ep-radius-sm);
  font-size: var(--ep-text-small);
  font-weight: var(--ep-weight-semibold);
  text-decoration: none;
  transform: translateY(-250%);
  transition: transform var(--ep-duration) var(--ep-ease-out);
}

.ep-skip-link:focus {
  transform: translateY(0);
  color: var(--ep-on-accent);
}

/* ---- Scroll reveal ------------------------------------------------------------------------ */
/* Paired with a small IntersectionObserver. Kept in the system rather than the page because
   RequestDesk's marketing-facing screens use it too. */

.ep-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--ep-duration-slow) var(--ep-ease),
    transform var(--ep-duration-slow) var(--ep-ease-out);
}

.ep-reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .ep-reveal {
    opacity: 1;
    transform: none;
  }
}
