/* =============================================================
   MAIN.CSS — CSS custom properties, reset, base typography
   ============================================================= */

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

:root {
  /* --- Color system (warm parchment palette) --- */
  --c-bg:          #FDFAF4;
  --c-bg-warm:     #F5EDD8;
  --c-bg-deep:     #EDE0C4;
  --c-text:        #1C1410;   /* deep espresso — never pure black */
  --c-text-mid:    #6B5E4E;   /* warm brown-gray */
  --c-text-light:  #A89885;   /* muted tan */
  --c-accent:      #7A5C2E;   /* warm tobacco */
  --c-accent-lt:   #C4A35A;   /* muted gold */
  --c-border:      rgba(122, 92, 46, 0.10);
  --c-border-warm: rgba(196, 163, 90, 0.22);

  /* --- Typography --- */
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'Jost', system-ui, sans-serif;

  /* --- Layout --- */
  --max-width: 1360px;
  --nav-height: 5rem;

  /* --- Motion (custom easings — no linear/ease-in-out) --- */
  --ease-expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
}

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

html {
  overflow-x: hidden;   /* iOS Safari: body alone isn't enough */
}

body {
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

/* --- Grain overlay (fixed + pointer-events-none = GPU-safe) --- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  background-repeat: repeat;
}

/* =============================================================
   REVEAL ANIMATIONS
   Only transform + opacity — never width/height/top/left
   ============================================================= */
.reveal-up {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity   0.8s var(--ease-expo) var(--delay, 0ms),
    transform 0.8s var(--ease-expo) var(--delay, 0ms);
}

.reveal-right {
  opacity: 0;
  transform: translateX(28px);
  transition:
    opacity   0.9s var(--ease-expo) 180ms,
    transform 0.9s var(--ease-expo) 180ms;
}

.is-revealed {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}
