/* ==========================================================================
   Base: reset, typography, layout primitives, utilities, motion
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

/* Pages with the sticky in-page nav need extra offset for #anchor jumps */
html:has(.service-nav) {
  scroll-padding-top: calc(var(--header-h) + 80px);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

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

img,
video {
  height: auto;
}

/* <picture> wrappers inside cropped media frames must fill their frame */
.card__media picture,
.material-card__media picture,
.featured__item picture,
.gallery__btn picture,
.hero__photo picture,
.hero__bg picture,
.cta-band__media picture,
.page-hero__media picture,
.video-facade picture,
.finish__swatch picture,
.material__media picture {
  width: 100%;
  height: 100%;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

/* ---- Typography ---------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); line-height: var(--leading-snug); }
h4 { font-size: var(--text-lg); line-height: var(--leading-snug); }

p {
  text-wrap: pretty;
}

em,
.u-italic {
  font-style: italic;
}

a {
  color: inherit;
  text-decoration-color: var(--color-brass);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) ease, text-decoration-color var(--dur-fast) ease;
}
@media (hover: hover) {
  a:hover {
    color: var(--color-brass-ink);
  }
}

strong {
  font-weight: 700;
}

::selection {
  background: var(--color-brass);
  color: var(--color-graphite);
}

/* ---- Focus --------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.section--dark :focus-visible,
.site-footer :focus-visible,
.hero :focus-visible,
.page-hero :focus-visible {
  outline-color: var(--color-brass-light);
}

/* ---- Skip link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: calc(var(--z-menu) + 10);
  padding: var(--space-3) var(--space-5);
  background: var(--color-graphite);
  color: var(--color-white);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--color-white);
}

/* ---- Layout primitives -------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

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

.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.section--alt {
  background: var(--color-ivory-deep);
}

.section--gradient {
  background: var(--gradient-ivory);
}

.section--dark {
  background: var(--color-graphite);
  color: var(--color-text-on-dark);
}
@media (hover: hover) {
  .section--dark a:hover {
    color: var(--color-brass-light);
  }
}

.section__header {
  display: grid;
  gap: var(--space-4);
  max-width: 46rem;
  margin-bottom: var(--space-8);
}

.section__header--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.section__header--split {
  max-width: none;
}

@media (min-width: 1024px) {
  .section__header--split {
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: var(--space-9);
  }
}

.section__lead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 40rem;
}

.section--dark .section__lead {
  color: var(--color-text-on-dark-muted);
}

.section__footer {
  margin-top: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.section__footer--center {
  justify-content: center;
}

/* ---- Eyebrow: small tracked label with brass rule ----------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-brass-ink);
}

.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
}

.section--dark .eyebrow,
.hero .eyebrow,
.page-hero .eyebrow {
  color: var(--color-brass);
}

.section__header--center .eyebrow::after {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
}

/* ---- Utilities ----------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.u-accent {
  color: var(--color-brass-ink);
  font-style: italic;
}

.section--dark .u-accent,
.hero .u-accent,
.page-hero .u-accent,
.cta-band .u-accent {
  color: var(--color-brass);
}

.u-muted {
  color: var(--color-text-muted);
}

.rule {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: 0;
}

/* Placeholder marker for client-replaceable content (visible only in markup / devtools) */
[data-placeholder] {
  position: relative;
}

/* ---- Scroll reveal ------------------------------------------------------- */
/* Elements only hide when JS has confirmed support (html.js) and motion is OK */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
