/* ==========================================================================
   TIME Orthopedics — Base
   Reset, document defaults, typography, landmarks, focus.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
  scrollbar-gutter: stable;
}

body {
  background: var(--white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img { height: auto; }

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

p, li { text-wrap: pretty; }

/* --------------------------------------------------------------------------
   Display type
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  text-wrap: balance;
  color: var(--text);
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }
h4 { font-size: var(--step-1); letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.28em; }
a:hover { text-decoration-color: var(--indigo); }

/* --------------------------------------------------------------------------
   Focus — indigo on light grounds, lime on the indigo masthead and footer.
   -------------------------------------------------------------------------- */

:focus { outline: none; }

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.nav :focus-visible,
.footer :focus-visible,
.on-indigo :focus-visible { outline-color: var(--lime); }

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-skip);
  padding: var(--sp-3) var(--sp-5);
  background: var(--indigo);
  color: var(--white);
  font-weight: 600;
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible { transform: translateY(0); }

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

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

.shell--narrow { max-width: 860px; }

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--white  { background: var(--white); }
.section--paper  { background: var(--paper); }
.section--paper2 { background: var(--paper-2); }

.section--tight-top    { padding-top: 0; }
.section--tight-bottom { padding-bottom: var(--sp-6); }

/* Small uppercase label that opens most sections */
.eyebrow {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--sp-5);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: var(--measure);
}

.prose { max-width: var(--measure); color: var(--text-muted); }
.prose > * + * { margin-top: var(--sp-4); }
.prose strong { color: var(--text); font-weight: 600; }

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

/* --------------------------------------------------------------------------
   Scroll reveal
   The base class is added by JS so that with JavaScript disabled every
   section is simply visible.
   -------------------------------------------------------------------------- */

.js-reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
}

.js-reveal.is-visible { opacity: 1; transform: none; }

.js-reveal[data-stagger] > * {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js-reveal[data-stagger].is-visible > * { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@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;
  }

  .js-reveal,
  .js-reveal[data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
