/*
 * Base: fonts, reset, typography, focus, accessibility utilities, motion.
 * Colours only via tokens.css.
 */

/* Variable fonts (OFL), self-hosted because of CSP font-src 'self'. */
@font-face {
  font-family: 'Raleway';
  src: url('../assets/fonts/raleway-var-latin.woff2') format('woff2'),
       url('../assets/fonts/Raleway-var.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Libre Baskerville';
  src: url('../assets/fonts/libre-baskerville-var-latin.woff2') format('woff2'),
       url('../assets/fonts/LibreBaskerville-var.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  font-variant-numeric: lining-nums;
  font-feature-settings: 'lnum' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-align: inherit;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

table {
  border-collapse: collapse;
}

dialog {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--pine-soft);
  color: var(--basalt);
}

/* Typography -------------------------------------------------------------- */
.display,
.t-display {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -.005em;
}

.t-44 { font-size: var(--fs-44); }
.t-32 { font-size: var(--fs-32); }
.t-24 { font-size: var(--fs-24); }
.t-20 { font-size: var(--fs-20); }
.t-16 { font-size: var(--fs-16); }
.t-14 { font-size: var(--fs-14); }
.t-13 { font-size: var(--fs-13); }
.t-12 { font-size: var(--fs-12); }

.t-light {
  font-weight: var(--fw-light);
}

.eyebrow {
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink-muted);
}

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

/* Every number shown as data: lining + tabular. */
.num,
data,
time,
td,
.price,
.area {
  font-variant-numeric: var(--numeric);
  font-feature-settings: 'lnum' 1, 'tnum' 1;
}

.price {
  color: var(--price-ink);
  font-weight: var(--fw-semibold);
}

/* Icons (SVG sprite) ------------------------------------------------------ */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  pointer-events: none;
}

.icon--16 { width: 16px; height: 16px; }
.icon--24 { width: 24px; height: 24px; }
.icon--28 { width: 28px; height: 28px; }

/* Focus ------------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.btn:focus-visible,
.pill:focus-visible,
.chip:focus-visible,
.icon-btn:focus-visible,
.segmented__btn:focus-visible,
.tab:focus-visible {
  border-radius: inherit;
}

/* Accessibility utilities ------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: calc(var(--safe-top) + var(--sp-2));
  left: calc(var(--safe-left) + var(--sp-2));
  z-index: calc(var(--z-splash) + 1);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--pine);
  color: var(--pine-ink);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: none;
  outline-color: var(--timber);
}

/* Scrollbars: quiet and thin ---------------------------------------------- */
.scroll {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--basalt-a20) var(--basalt-a0);
  -webkit-overflow-scrolling: touch;
}

.scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scroll::-webkit-scrollbar-thumb {
  border-radius: var(--r-pill);
  background: var(--basalt-a20);
  border: 2px solid var(--basalt-a0);
  background-clip: padding-box;
}

/* Glass utility ------------------------------------------------------------ */
.glass {
  /* Every glass panel carries text: 0.92 mist keeps muted text ≥ 4.5:1 over dusk/dark 3D. */
  background: var(--surface-glass-text);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid var(--border);
  box-shadow: var(--elev-1);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--surface-glass-strong);
  }
}

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

/* The app sets data-motion="reduced" as well, so JS-driven effects agree. */
[data-motion="reduced"] *,
[data-motion="reduced"] *::before,
[data-motion="reduced"] *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
}

noscript .noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--sp-6);
  background: var(--surface);
  text-align: center;
}
