/* ==========================================================================
   J2 FINE FURNITURE — base
   Reset, typography, page rhythm and the shared utility layer.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

svg {
  fill: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary);
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--color-text);
  text-wrap: balance;
}

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

p {
  margin: 0 0 18px;
  max-width: var(--measure);
}

p:last-child {
  margin-bottom: 0;
}

strong,
b {
  font-weight: 600;
}

hr {
  height: 1px;
  background: var(--color-border);
  border: 0;
}

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

::selection {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

/* --------------------------------------------------------------- rhythm */

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

.j2-container--narrow {
  max-width: var(--container-narrow);
}

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

.j2-section--tight {
  padding-block: var(--section-y-tight);
}

/* Warm sand band that alternates with white sections. */
.j2-section--alt,
.j2-section--sand {
  background: var(--color-surface-alt);
}

.j2-section--surface {
  background: var(--color-surface);
}

.j2-section--ink {
  background: var(--color-primary-dark);
  color: var(--color-text-inverse);
}

.j2-section--ink h2,
.j2-section--ink h3,
.j2-section--ink h4 {
  color: var(--color-text-inverse);
}

.j2-section--ink p {
  color: rgba(247, 244, 239, 0.82);
}

/* --------------------------------------------------------- section heads */

.j2-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: clamp(28px, 3.4vw, 48px);
}

.j2-section-head__text {
  max-width: 640px;
}

.j2-section-head__text h2 {
  margin-bottom: 12px;
}

.j2-section-head--centred {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.j2-section-head--centred .j2-section-head__text {
  text-align: center;
}

/* ------------------------------------------------------------ typography */

.j2-display {
  font-size: var(--text-h1);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.j2-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: var(--text-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-secondary-dark);
}

.j2-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.j2-eyebrow--plain::before {
  display: none;
}

.j2-lead {
  font-size: clamp(1.0625rem, 1vw + 0.2rem, 1.1875rem);
  line-height: 1.55;
  color: var(--color-text-muted);
}

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

.j2-faint {
  color: var(--color-text-faint);
}

.j2-small {
  font-size: var(--text-sm);
}

.j2-xs {
  font-size: var(--text-xs);
}

.j2-centre {
  text-align: center;
}

.j2-measure {
  max-width: var(--measure);
}

/* ------------------------------------------------------------------ grids */

.j2-grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 28px);
}

.j2-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.j2-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.j2-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.j2-stack > * + * {
  margin-top: 16px;
}

.j2-stack-lg > * + * {
  margin-top: 28px;
}

/* -------------------------------------------------------------- utilities */

.j2-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.j2-hide {
  display: none !important;
}

.j2-mt-0 {
  margin-top: 0;
}

.j2-mt-2 {
  margin-top: 16px;
}

.j2-mt-3 {
  margin-top: clamp(20px, 3vw, 32px);
}

.j2-mt-4 {
  margin-top: clamp(30px, 4vw, 52px);
}

.j2-mb-0 {
  margin-bottom: 0;
}

.j2-mb-2 {
  margin-bottom: 16px;
}

.j2-mb-3 {
  margin-bottom: clamp(20px, 3vw, 32px);
}

.j2-mb-4 {
  margin-bottom: clamp(30px, 4vw, 52px);
}

.j2-divider {
  height: 1px;
  background: var(--color-border);
  border: 0;
  margin-block: clamp(28px, 4vw, 48px);
}

/* Subtle entrance animation, disabled when motion is not wanted. */
.j2-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.j2-reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

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