/* =============================================================
   base.css — Reset, Body, Typography, Global Elements
   gestaltme.com | v1.0 | 2026-03
   =============================================================
   DEPENDS ON: tokens.css (must load before this file)
   ============================================================= */

/* -----------------------------------------------------------
   MODERN RESET
----------------------------------------------------------- */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  line-height: var(--leading-relaxed);
  color: var(--c-brown);
  background-color: var(--c-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
  overflow: hidden;
}

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

img {
  height: auto;
}

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

p,
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

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

ul, ol {
  list-style: none;
}

/* -----------------------------------------------------------
   NOISE TEXTURE OVERLAY
   Adds organic depth to the flat cream background
----------------------------------------------------------- */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* -----------------------------------------------------------
   TYPOGRAPHY — HEADINGS
   Display font for all headings. Scale fluid via clamp().
----------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--c-charcoal);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
}

/* Italic accent inside headings (e.g. <em> in <h2>) */
h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--c-sage-dk);
}

/* Dark section headings override */
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--c-white);
}

.section--dark h1 em,
.section--dark h2 em,
.section--dark h3 em {
  color: var(--c-sage-lt);
}

/* -----------------------------------------------------------
   TYPOGRAPHY — BODY TEXT
----------------------------------------------------------- */

p {
  line-height: var(--leading-relaxed);
  color: var(--c-brown);
}

p + p {
  margin-top: var(--sp-4);
}

.section--dark p {
  color: var(--c-dark-text);
}

/* Lead paragraph — larger intro text */
.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--c-brown);
  max-width: 60ch;
}

/* Muted / caption text */
.text-muted {
  font-size: var(--text-sm);
  color: var(--c-muted);
}

/* Eyebrow label above sections */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--c-sage-dk);
  margin-bottom: var(--sp-4);
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--c-sage);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Eyebrow on dark background */
.section--dark .eyebrow {
  color: var(--c-sage-lt);
}

.section--dark .eyebrow::before {
  background: var(--c-sage-lt);
}

/* Eyebrow as pill (hero variant) */
.eyebrow--pill {
  background: var(--c-sage-lt);
  color: var(--c-sage-dk);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-pill);
}

/* Pill variant: hide the ::before dot — text already has separators */
.eyebrow--pill::before {
  display: none;
}

.section--dark .eyebrow--pill {
  background: rgba(122,158,142,.18);
  color: var(--c-sage-lt);
}

/* -----------------------------------------------------------
   LINKS
----------------------------------------------------------- */

a:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Underline link style */
.link-underline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-sage-dk);
  border-bottom: 1.5px solid var(--c-sage-lt);
  padding-bottom: 2px;
  transition: border-color var(--ease), color var(--ease);
}

.link-underline:hover {
  border-color: var(--c-sage);
  color: var(--c-charcoal);
}

/* -----------------------------------------------------------
   SELECTION
----------------------------------------------------------- */

::selection {
  background: var(--c-sage-lt);
  color: var(--c-charcoal);
}

/* -----------------------------------------------------------
   SCROLLBAR (webkit)
----------------------------------------------------------- */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--c-linen);
}

::-webkit-scrollbar-thumb {
  background: var(--c-sage-lt);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-sage);
}

/* -----------------------------------------------------------
   UTILITY CLASSES
----------------------------------------------------------- */

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

.hidden {
  display: none !important;
}
