/* ==========================================================================
   base.css — design tokens, reset, typography, layout helpers
   Change colors / fonts / radii here and the whole site follows.
   ========================================================================== */

:root {
  /* Palette (placeholder — swap for the brand colors) */
  --cream: #f6f2ea;       /* matches the warm beige of the logo */
  --cream-2: #ece6da;
  --paper: #fffefb;
  --ink: #1e1d1a;         /* the logo's near-black */
  --ink-soft: #6a655c;
  --line: rgba(30, 29, 26, 0.13);

  /* The site chrome is deliberately NEUTRAL (warm charcoal + sand) because the soaps come in
     every color. Each soap's own page (product.html) overrides these four tokens with that
     soap's color — see "product theme" in pages.css. */
  --accent: #2b2825;       /* buttons, footer, top banner */
  --accent-soft: #bdb2a0;  /* focus glow, progress bar */
  --emph: #7d6b57;         /* italic emphasis in headlines */
  --sand: #d9cdb9;         /* hover fills, highlights */
  --danger: #b4432f;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape + motion */
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 32px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --shadow-1: 0 1px 2px rgba(42, 40, 36, 0.06), 0 10px 28px -14px rgba(42, 40, 36, 0.2);
  --shadow-2: 0 2px 4px rgba(42, 40, 36, 0.06), 0 34px 60px -26px rgba(42, 40, 36, 0.32);

  /* Layout */
  --header-h: 76px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --max: 1240px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  animation: page-in 0.8s var(--ease) both;
}

/* soft paper grain over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* Browsers that support cross-page view transitions (Chrome/Edge) cross-fade between pages and
   glide a soap's photo from the shop into its own page. Others fall back to the simple fade above. */
@view-transition { navigation: auto; }
html.vt body { animation: none; }
.header { view-transition-name: site-header; }
::view-transition-group(root) { animation-duration: 0.45s; }
body.is-leaving { opacity: 0; transition: opacity 0.28s ease; }

main { flex: 1; }

[hidden] { display: none !important; }
/* wrappers filled in by layout.js — transparent to layout so the header can stick to the viewport */
#site-header, #site-footer { display: contents; }
[data-parallax] { transform: translate3d(0, var(--sy, 0px), 0); }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0; }
em { font-style: italic; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 350;
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144;
  text-wrap: balance;
}
h1 { font-size: clamp(2.8rem, 7vw, 6rem); }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.7rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; font-weight: 400; }

::selection { background: var(--sand); color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- layout helpers ---------- */
.container { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(4rem, 9vw, 8rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4.5rem); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.section__head p { max-width: 38ch; color: var(--ink-soft); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 28px; height: 1.5px; background: currentColor; }

.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;
}

.skip-link {
  position: fixed;
  left: 1rem; top: -4rem;
  z-index: 300;
  padding: 0.7rem 1.1rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  text-decoration: none;
  transition: top 0.3s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- scroll reveal (only hides content when JS is running) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease) var(--d, 0ms), transform 1s var(--ease) var(--d, 0ms);
}
.js [data-reveal="scale"] { transform: scale(0.94); }
.js [data-reveal="left"] { transform: translateX(-44px); }
.js [data-reveal="right"] { transform: translateX(44px); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* split-word headline reveal */
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.word > span {
  display: inline-block;
  transform: translateY(112%);
  transition: transform 1s var(--ease) calc(var(--i) * 70ms + 150ms);
}
.is-split-in .word > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .word > span { transform: none; }
}
