/* ============================================================
   Amber Blake — Conscious Connections
   Shared base: palette tokens, typography, veil treatments.
   Palette (confirmed): Fog · Sea Glass · Sepia Ink · First Light · Veil
   ============================================================ */

:root {
  --fog: #f2efe9;
  --fog-deep: #e9e5dd;
  --sea-glass: #e3e8e2;
  --veil: #cfc9c0;
  --sepia: #32261a;
  --sepia-soft: #6b5a47;
  --sepia-faint: #9c8d7c;
  --first-light: #d8a292;
  --first-light-soft: #ecd6cb;

  --font-display: "Italiana", serif;
  --font-body: "EB Garamond", serif;
  --font-caption: "Hanken Grotesk", sans-serif;

  --ease-drift: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

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

body {
  background: var(--fog);
  color: var(--sepia);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--first-light-soft); color: var(--sepia); }

/* ---------- Atmosphere layers ---------- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 62% 58%, rgba(232, 196, 180, 0.28) 0%, rgba(232, 196, 180, 0) 55%),
    linear-gradient(to bottom, #eef0ee 0%, var(--fog) 45%, #e7e9e4 100%);
}

.atmosphere::before {
  /* static fog plate — always present as the ground truth / WebGL poster */
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/fog-hero.jpg") center / cover no-repeat;
  opacity: 0.85;
}

.atmosphere canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 2.4s ease;
}

.atmosphere.is-live canvas { opacity: 1; }

/* film grain, very faint */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  animation: grain 9s steps(10) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 3%); }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

/* ---------- Typography primitives ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: 0.01em;
}

.poem {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  color: var(--sepia-soft);
}

.caption {
  font-family: var(--font-caption);
  font-weight: 400;
  font-size: 0.6875rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sepia-faint);
}

.caption .num { color: var(--first-light); }

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

p a, .invite a {
  border-bottom: 1px solid var(--first-light);
  transition: color 0.5s ease, border-color 0.5s ease;
}

p a:hover, .invite a:hover { color: var(--first-light); }

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--first-light);
  outline-offset: 6px;
  border-radius: 1px;
}

/* ---------- The veil: unify her photography into the fog world ---------- */

.veiled {
  position: relative;
  overflow: hidden;
}

.veiled img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.5) contrast(0.94) brightness(1.05) sepia(0.14);
}

.veiled::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(242, 239, 233, 0.55) 0%, rgba(242, 239, 233, 0) 38%, rgba(242, 239, 233, 0) 62%, rgba(242, 239, 233, 0.6) 100%),
    radial-gradient(110% 110% at 50% 50%, rgba(242, 239, 233, 0) 55%, rgba(242, 239, 233, 0.55) 100%);
  mix-blend-mode: lighten;
}

.veiled.soft-mask {
  -webkit-mask-image: radial-gradient(115% 115% at 50% 48%, #000 55%, transparent 98%);
          mask-image: radial-gradient(115% 115% at 50% 48%, #000 55%, transparent 98%);
}

/* ---------- Emergence (GSAP targets; visible without JS) ---------- */

[data-emerge], [data-emerge-group] > * {
  will-change: opacity, transform, filter;
}

.no-js [data-emerge], .no-js [data-emerge-group] > * {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* ---------- Shared structure ---------- */

.mark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  color: var(--sepia);
  white-space: nowrap;
}

.mark .dash { color: var(--first-light); margin: 0 0.1em; }

main { position: relative; z-index: 1; }

.fold {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer.colophon {
  padding: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 6vw, 6rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}

footer.colophon .caption { letter-spacing: 0.26em; }

/* ---------- Skip link ---------- */

.skip {
  position: fixed;
  top: -4rem;
  left: 1.5rem;
  z-index: 100;
  background: var(--sepia);
  color: var(--fog);
  font-family: var(--font-caption);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.8em 1.4em;
  transition: top 0.3s ease;
}

.skip:focus { top: 1.25rem; }
