/* ==========================================================================
   Hangtime — reset, document base, typography primitives and shared controls.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The sticky header must not cover an anchored section. */
  scroll-padding-top: calc(var(--ht-header-h) + 16px);
}

body {
  margin: 0;
  background: var(--ht-wall);
  color: var(--ht-ink);
  font: 400 var(--ht-fs-body) / var(--ht-lh-body) var(--ht-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* The rail and the oversized wall type both overhang their containers. */
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

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

a {
  color: inherit;
}

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

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

:focus-visible {
  /* The legible form of the accent: a pale brand colour would leave the
     focus ring invisible against the wall. */
  outline: var(--ht-focus-width) solid var(--ht-accent-text, var(--ht-accent));
  outline-offset: var(--ht-focus-offset);
  border-radius: 2px;
}

::selection {
  color: var(--ht-on-accent, #fff);
  background: var(--ht-accent);
}

[hidden] {
  display: none !important;
}

/* Set by hangtime-theme.js when an image fails to load. Hidden rather than
   removed, so the space it was given keeps its background and the layout
   does not jump. */
img[data-ht-failed] {
  visibility: hidden;
}

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

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

.ht-sr-focusable:focus-visible {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: var(--ht-z-skip);
  width: auto;
  height: auto;
  padding: 12px 20px;
  clip: auto;
  clip-path: none;
  color: #fff;
  background: var(--ht-ink);
}

.ht-wrap {
  width: 100%;
  max-width: var(--ht-maxw);
  margin: 0 auto;
  padding: 0 var(--ht-gutter);
}

/* The monospace label voice: section eyebrows, prices, controls, metadata. */
.ht-mono {
  font-family: var(--ht-mono);
  font-size: var(--ht-fs-mono);
  font-weight: 500;
  letter-spacing: var(--ht-ls-mono);
  text-transform: uppercase;
}

.ht-muted {
  color: var(--ht-ink-2);
}

.ht-display {
  font-family: var(--ht-display);
  font-weight: var(--ht-display-weight, 800);
  line-height: var(--ht-lh-display);
  letter-spacing: var(--ht-ls-display);
  text-transform: uppercase;
}

.ht-section {
  padding: var(--ht-section-y) 0;
  border-top: var(--ht-border);
}

.ht-section-head {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--ht-head-gap);
}

.ht-section-head h1,
.ht-section-head h2 {
  font-family: var(--ht-display);
  font-size: var(--ht-fs-hero);
  font-weight: var(--ht-display-weight, 800);
  line-height: var(--ht-lh-display);
  letter-spacing: var(--ht-ls-display);
  text-transform: uppercase;
}

.ht-section-head > p {
  color: var(--ht-ink-2);
}

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

.ht-btn {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  height: var(--ht-control-h);
  padding: 0 26px;
  font-family: var(--ht-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.08em;
  /* Worked out from the accent's own brightness, so a near-fluorescent brand
     colour gets dark type on it rather than invisible white. */
  color: var(--ht-on-accent, #fff);
  text-transform: uppercase;
  text-decoration: none;
  background: var(--ht-accent);
  border: 0;
  transition: background var(--ht-dur-fast), transform var(--ht-dur-fast);
}

.ht-btn:hover {
  background: var(--ht-accent-2);
}

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

.ht-btn[disabled],
.ht-btn[aria-disabled='true'] {
  color: var(--ht-ink-2);
  background: var(--ht-panel);
  pointer-events: none;
}

.ht-btn--ghost {
  color: var(--ht-ink);
  background: none;
  border: 1px solid var(--ht-ink);
}

.ht-btn--ghost:hover {
  color: var(--ht-wall);
  background: var(--ht-ink);
}

.ht-btn--block {
  width: 100%;
}

.ht-btn--sm {
  height: var(--ht-control-h-sm);
  padding: 0 16px;
}

/* --- Fields --------------------------------------------------------------- */

.ht-field {
  height: var(--ht-control-h);
  min-width: 0;
  padding: 0 18px;
  color: inherit;
  background: transparent;
  border: 1px solid var(--ht-line);
  border-radius: 0;
}

.ht-field::placeholder {
  color: var(--ht-steel);
}

.ht-field:focus {
  border-color: var(--ht-accent);
  outline: none;
}

.ht-field[aria-invalid='true'] {
  border-color: var(--ht-warn);
}

/* --- Disclosure rows ------------------------------------------------------ */

.ht-details {
  border-top: var(--ht-border);
}

.ht-details details {
  border-bottom: var(--ht-border);
}

.ht-details summary {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-family: var(--ht-mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}

.ht-details summary::-webkit-details-marker {
  display: none;
}

.ht-details summary::after {
  content: '+';
  font-size: 15px;
  transition: transform var(--ht-dur) var(--ht-ease);
}

.ht-details details[open] > summary::after {
  transform: rotate(45deg);
}

.ht-details details > :not(summary) {
  max-width: 60ch;
  padding-bottom: 16px;
  font-size: 14px;
  color: var(--ht-ink-2);
}

/* --- Entrance motion ------------------------------------------------------ */
/* `.ht-reveal` only hides content once JavaScript has confirmed it can reveal
   it again, so content is never stranded invisible when scripting fails.

   The travel uses the independent `translate` property rather than
   `transform`, so revealing something never clobbers a transform it already
   needs — the oversized wall word is centred with one, and the grid cards
   rotate their art with another. */

html.ht-js .ht-reveal {
  opacity: 0;
  translate: 0 18px;
  transition:
    opacity var(--ht-dur-reveal) var(--ht-ease),
    translate var(--ht-dur-reveal) var(--ht-ease);
  transition-delay: var(--ht-d, 0s);
}

html.ht-js .ht-reveal.is-in {
  opacity: 1;
  translate: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  html.ht-js .ht-reveal {
    opacity: 1;
    translate: none;
  }
}
