/* Reset, document defaults, shared primitives. */

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

* { margin: 0; }

/* Reserve the scrollbar gutter permanently: scroll locks (intro veil, mobile
   menu) would otherwise widen the viewport and shift centred content sideways. */
html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

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

picture { display: contents; }

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

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

a {
  color: inherit;
  text-decoration: none;
}

address { font-style: normal; }

ul[class],
ol[class] {
  list-style: none;
  padding-left: 0;
}

p,
h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* --- Motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

/* --- Document ------------------------------------------------------------- */

body {
  min-height: 100svh;
  background-color: var(--ace-ink);
  color: var(--ace-porcelain);
  font-family: var(--ace-font-body);
  font-size: var(--ace-fs-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background-color: var(--ace-gold);
  color: var(--ace-ink);
}

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

[id] { scroll-margin-top: calc(var(--ace-header-h) + var(--ace-sp-5)); }

.ace-section[id] {
  scroll-margin-top: calc(var(--ace-header-h) + var(--ace-sp-5) - var(--ace-section-pad));
}

@media (max-width: 640px) {
  html { scroll-padding-bottom: 6rem; }
}

/* --- Typography ----------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--ace-font-display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.008em;
  text-wrap: balance;
}

h1 { font-size: var(--ace-fs-hero); }
h2 { font-size: var(--ace-fs-h2); }

h3,
h4 {
  font-size: var(--ace-fs-h3);
  line-height: 1.25;
  letter-spacing: 0;
}

p { text-wrap: pretty; }

em { font-weight: 400; }

strong { font-weight: 500; }

blockquote { quotes: none; }

small { font-size: var(--ace-fs-sm); }

/* --- Primitives ----------------------------------------------------------- */

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

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

.ace-overline {
  display: block;
  font-family: var(--ace-font-body);
  font-size: var(--ace-fs-overline);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: var(--ace-track-label);
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--ace-gold);
}

/* --- Brand lockup --------------------------------------------------------- */

.ace-lockup {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.ace-lockup__mark {
  width: auto;
  height: clamp(1.9rem, 1.7rem + .8vw, 2.3rem);
}

.ace-lockup__name {
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ace-porcelain);
}

/* --- Buttons -------------------------------------------------------------- */

.ace-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  padding: 1.02rem 1.85rem;
  border: 1px solid transparent;
  border-radius: var(--ace-r-pill);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--ace-track-ui);
  /* letter-spacing trails the last glyph, so centred tracked caps sit half a
     step left. Indenting by one step re-centres the ink. */
  text-indent: var(--ace-track-ui);
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  transition:
    background-color var(--ace-dur) var(--ace-ease-soft),
    border-color var(--ace-dur) var(--ace-ease-soft),
    color var(--ace-dur) var(--ace-ease-soft),
    box-shadow var(--ace-dur) var(--ace-ease-soft),
    transform var(--ace-dur-fast) var(--ace-ease-soft);
}

.ace-btn:active { transform: translateY(1px); }

.ace-btn--gold {
  background-color: var(--ace-gold);
  color: var(--ace-ink);
}

.ace-btn--gold:hover {
  background-color: var(--ace-gold-bright);
  box-shadow: 0 14px 40px -18px rgba(198, 161, 91, .55);
}

.ace-btn--ghost {
  border-color: var(--ace-line-strong);
  color: var(--ace-porcelain);
}

.ace-btn--ghost:hover {
  border-color: var(--ace-gold);
  color: var(--ace-gold-bright);
}

.ace-btn--sm {
  padding: .7rem 1.2rem;
  font-size: .75rem;
}

.ace-btn--mail {
  letter-spacing: .01em;
  text-indent: 0;
  text-transform: none;
}

.ace-btn--back::before {
  content: "";
  flex: none;
  width: .45em;
  height: .45em;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  rotate: 45deg;
}

/* --- Utilities ------------------------------------------------------------ */

.ace-skip {
  position: fixed;
  top: var(--ace-sp-4);
  left: var(--ace-sp-4);
  z-index: var(--ace-z-skip);
  padding: .75rem 1.25rem;
  border-radius: var(--ace-r-pill);
  background-color: var(--ace-gold);
  color: var(--ace-ink);
  font-size: var(--ace-fs-sm);
  font-weight: 500;
  transform: translateY(-250%);
  transition: transform var(--ace-dur) var(--ace-ease);
}

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