/* ============================================================
   Aparto — base.css
   Reset, layout primitives, the reveal system and focus states.
   Assumes design-system.css has already loaded; consumes its
   tokens exclusively and declares no colours of its own.
   ============================================================ */

/* ---------------- Reset ---------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--space-4));
}

/* Set by the lightbox and the mobile drawer while they are open. */
html.no-scroll {
  overflow: hidden;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

p {
  margin: 0;
}

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

address {
  font-style: normal;
}

::selection {
  background: var(--white);
  color: var(--bg);
}

/* ---------------- Layout primitives ---------------- */

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-5);
}
@media (min-width: 720px) {
  .wrap {
    padding-inline: var(--space-7);
  }
}

.section {
  padding-block: clamp(3.5rem, 2.8rem + 3.5vw, 6.25rem);
}

.section-head {
  max-width: 660px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
  text-align: center;
}
.section-head h2 {
  font-size: var(--step-4);
}
.section-sub {
  margin-top: var(--space-4);
  color: var(--muted);
  line-height: var(--leading-loose);
}

.overline {
  margin-bottom: var(--space-3);
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-overline);
  color: var(--ink);
}

/* ---------------- Reveal on scroll ----------------

   Deliberately inverted. `.reveal` is VISIBLE by default, and only
   becomes hidden once JavaScript has proved it is running by putting
   `js-enabled` on <html>. Written the other way round — hidden by
   default, revealed by script — a single JS error blanks every
   paragraph, property description and address on the page for both
   readers and crawlers. Never restore an `opacity: 0` default here. */

.reveal {
  opacity: 1;
  transform: none;
}

.js-enabled .reveal {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js-enabled .reveal:not(.in) {
  opacity: 0;
  transform: translateY(18px);
}

/* ---------------- Focus & skip link ---------------- */

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--bg);
  font-size: var(--step--1);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: translateY(0);
}

/* Read by screen readers, search engines and AI; not drawn on screen. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

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

  /* Content stays put and stays visible, whatever the script does. */
  .js-enabled .reveal,
  .js-enabled .reveal:not(.in) {
    opacity: 1;
    transform: none;
    transition: none;
  }

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

  .skip-link {
    transition: none;
  }
}
