/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --cream: #fbf3e6;
  --paper: #fffdf8;
  --ink: #1b2340;
  --coral: #ff6b4a;
  --teal: #16a9bc;
  --sun: #ffc93f;
  --grape: #7a5cff;

  --display: "Fredoka", ui-sans-serif, system-ui, sans-serif;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter: clamp(1.25rem, 5vw, 3rem);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1; }
::selection { background: var(--coral); color: var(--paper); }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--cream);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.dot-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--ink) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  opacity: 0.06;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
/* Defensive: split-text elements must never get stuck invisible */
.reveal[data-split] { opacity: 1; transform: none; }

/* =============================================================
   4. Hero
   ============================================================= */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(.6rem, 2vw, 1.1rem);
  padding: clamp(2rem, 8vh, 4rem) var(--gutter);
  position: relative;
}

.hero-kicker {
  font-family: var(--sans);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: .5rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.hero-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.6rem, 18vw, 11rem);
  letter-spacing: -0.01em;
  line-height: 0.95;
}
.hero-title .char {
  display: inline-block;
  will-change: transform, opacity;
}
.hero-title .char:nth-child(6n+1) { color: var(--coral); }
.hero-title .char:nth-child(6n+2) { color: var(--teal); }
.hero-title .char:nth-child(6n+3) { color: var(--ink); }
.hero-title .char:nth-child(6n+4) { color: var(--grape); }
.hero-title .char:nth-child(6n+5) { color: var(--sun); }
.hero-title .char:nth-child(6n+6) { color: var(--coral); }

.hero-tagline {
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  font-weight: 500;
  max-width: 26ch;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}

.hero-scroll {
  margin-top: clamp(1.5rem, 5vh, 3rem);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}
.hero-scroll-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--coral);
  animation: scrollBounce 1.6s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* =============================================================
   5. Gallery
   ============================================================= */
.gallery {
  padding: clamp(2rem, 8vh, 5rem) var(--gutter) clamp(3rem, 10vh, 6rem);
}

.gallery-grid {
  max-width: 1080px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  justify-items: center;
}

.photo-card {
  --rotate: 0deg;
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transform: rotate(var(--rotate));
  transition: transform .5s var(--ease-bounce);
}
.photo-card:hover,
.photo-card:focus-within {
  transform: rotate(0deg) translateY(-6px) scale(1.03);
}

.photo-card-frame {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--paper);
  padding: .7rem .7rem 2.2rem;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
  transition: box-shadow .4s var(--ease-out);
}
.photo-card:hover .photo-card-frame,
.photo-card:focus-within .photo-card-frame {
  box-shadow: 12px 12px 0 var(--coral);
}
.photo-card-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.photo-card-caption {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  text-align: center;
}

/* =============================================================
   6. Footer
   ============================================================= */
.site-footer {
  text-align: center;
  padding: clamp(2.5rem, 8vh, 4rem) var(--gutter) clamp(2rem, 6vh, 3rem);
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.footer-domain {
  font-family: var(--display);
  font-weight: 600;
  color: var(--teal);
  border-bottom: 3px solid var(--sun);
}
.footer-copy {
  font-size: .8rem;
  color: color-mix(in srgb, var(--ink) 60%, transparent);
}

/* =============================================================
   7. Responsive
   ============================================================= */
@media (min-width: 720px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }
  .photo-card:nth-child(2) { margin-top: 3rem; }
  .photo-card:nth-child(4) { margin-top: -1.5rem; }
}

@media (min-width: 1280px) {
  .gallery-grid { max-width: 1200px; }
}

/* =============================================================
   8. Reduced motion — only the truly ambient/decorative loop
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
