/* =========================================================
   GLOBAL RESET & BASE STYLES
   ========================================================= */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--on-surface);
  background-color: var(--surface);
  overflow-x: hidden;
}

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

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: var(--font-family);
  border: none;
  background: none;
}

/* ── Layout Container ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-8);
}

/* ── Section Base ── */
section {
  position: relative;
}

/* ── Utility: Screen reader only ── */
.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;
}

/* ── Scroll reveal base ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

/* ── Section Label ── */
.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-label);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: var(--space-4);
}

/* ── Section Heading ── */
.section-heading {
  font-size: var(--text-5xl);
  font-weight: var(--font-headline);
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-tight);
  color: var(--on-surface);
  margin-bottom: var(--space-6);
}

/* ── Section Subtext ── */
.section-subtext {
  font-size: var(--text-lg);
  color: var(--on-surface-variant);
  line-height: var(--leading-body);
  max-width: 56ch;
}

/* ── Divider Rule (tonal, no hard lines) ── */
.tonal-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(79, 70, 50, 0.2) 20%,
    rgba(79, 70, 50, 0.2) 80%,
    transparent
  );
  border: none;
}

/* ── Focus ring for accessibility ── */
:focus-visible {
  outline: 2px solid var(--primary-container);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.5rem 1rem;
  z-index: 9999;
  transition: top 0.2s ease;
  border-radius: 0 0 var(--radius) var(--radius);
}

.skip-link:focus {
  top: 0;
}


/* ── Layering Utilities ── */
.layer-content {
  position: relative;
  z-index: 1;
}
