/* Reset, typography and the layout primitives every page shares. */

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--fx-bg);
}

body {
  font-family: var(--fx-text);
  color: var(--fx-ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

::selection { background: rgba(8, 181, 209, .24); }

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

/* The UA's `[hidden]` rule loses to any class that sets `display`, and most of ours do. */
[hidden] { display: none !important; }

input,
button,
select,
textarea { font-family: inherit; }

button {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

a {
  color: var(--fx-cyanink);
  text-decoration: none;
  transition: color var(--fx-fast) ease;
}

/* Buttons own their colour in every state. Without the `:not(.btn)`, `a:hover` (0,1,1)
   outranks `.btn-primary` (0,1,0) and paints the label the same cyan as its own fill. */
a:not(.btn):hover { color: var(--fx-cyan); }

/* The controls draw their own focus state (border turns cyan); the UA ring would sit on top of it
   in whatever colour the OS accent happens to be. Keyboard users still get `.focus-ring`. */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--fx-cyan);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--fx-display);
  font-weight: 600;
  letter-spacing: -.025em;
  margin: 0;
  color: var(--fx-ink);
}

p { margin: 0; }

/* `ol` as well as `ul`: the UA gives an ordered list a 40px `padding-inline-start` and a 1em
   block margin, which put the numbered install steps well to the right of the heading above
   them on every surface. The only ordered lists here are `.steps`, whose `li` is a flex row
   with its own badge, so neither the indent nor the marker was ever wanted. */
ol,
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- layout ---------- */

/* The prototype puts the 1220px cap and the 20px gutter on the same element. */
.page {
  max-width: var(--fx-page);
  margin: 0 auto;
  padding-left: var(--fx-gutter);
  padding-right: var(--fx-gutter);
  width: 100%;
}

/* The footer is the one place the gutter sits outside the cap. */
.page-in-gutter {
  max-width: var(--fx-page);
  margin: 0 auto;
  width: 100%;
}

.section { padding-top: clamp(56px, 6vw, 88px); }
.section-tight { padding-top: clamp(28px, 4vw, 56px); }
.section-end { padding-bottom: clamp(56px, 6vw, 80px); }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.col { display: grid; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* `repeat(auto-fit, …)` collapses the tracks nothing lands in, so a two-panel section never
   splits into three columns however wide the viewport gets. */
.grid { display: grid; gap: var(--fx-gap); }
.grid-340 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-300 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-280 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-260 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-200 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-170 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-160 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
/* `auto-fill` keeps the empty tracks — used where the prototype wants a fixed rhythm. */
.grid-fill-340 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

/* ---------- type helpers ---------- */

.display { font-family: var(--fx-display); font-weight: 600; letter-spacing: -.025em; }
.mono { font-family: var(--fx-mono); }
.h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.07; letter-spacing: -.03em; }
.h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.1; }
.h3 { font-size: clamp(26px, 2.8vw, 34px); line-height: 1.1; }
.h4 { font-size: 20px; letter-spacing: -.02em; }
.lead { font-size: 17px; line-height: 1.55; color: var(--fx-ink2); }
.muted { color: var(--fx-ink2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.medium { font-weight: 500; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fx-ink2);
}

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

@keyframes fxUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fxIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fxDrawer { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fxPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes fxRise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fxFade { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fxSpin { to { transform: rotate(360deg); } }
@keyframes fxMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.fx-up { animation: fxUp var(--fx-slow) var(--fx-ease-out) both; }
.fx-in { animation: fxIn var(--fx-base) ease both; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
