:root {
  --bg: #FAF6EB;
  --lavender: #AC9FD8;
  --acid: #E1FD3B;
  --ink: #1c1a16;
  --card: #fffdf7;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* film grain */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.statement {
  font-family: "Funnel Display", sans-serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  line-height: 1.6;
  transition: opacity 0.4s ease;
}

body.expanded .statement {
  opacity: 0;
  pointer-events: none;
}

/* clickable phrases */
.phrase {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  position: relative;
  padding: 0 0.1em;
  white-space: nowrap;
  background-image: linear-gradient(var(--acid), var(--acid));
  background-repeat: no-repeat;
  background-size: 100% 0.22em;
  background-position: 0 96%;
  transition: background-size 0.25s ease;
}

.phrase--lavender {
  background-image: linear-gradient(var(--lavender), var(--lavender));
}

.phrase:hover,
.phrase:focus-visible {
  background-size: 100% 88%;
  outline: none;
}

.phrase::after {
  content: "↗";
  font-size: 0.5em;
  vertical-align: super;
  margin-left: 0.15em;
  color: var(--lavender);
  display: inline-block;
  transition: transform 0.25s ease;
}

.phrase--lavender::after { color: var(--ink); }

.phrase:hover::after { transform: translate(0.15em, -0.15em); }

@keyframes underline-pulse {
  0%, 100% { background-size: 100% 0.22em; }
  50%      { background-size: 100% 0.45em; }
}

body:not(.expanded) .phrase { animation: underline-pulse 3.2s ease-in-out infinite; }
body:not(.expanded) .phrase--lavender { animation-delay: 0.8s; }
.phrase:hover { animation: none; }

/* placeholder reserving the spot where the fan sits */
.stack-space {
  width: min(560px, 90vw);
  height: clamp(240px, 36vh, 330px);
  margin-top: 0.75rem;
}

/* ---------- stage (the cards live here in both states) ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

body.expanded .stage {
  pointer-events: auto;
  cursor: grab;
}

body.expanded .stage.dragging { cursor: grabbing; }

.scroller {
  position: absolute;
  inset: 0;
}

.card {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  transition:
    transform 0.55s cubic-bezier(0.34, 1.3, 0.64, 1),
    width 0.55s cubic-bezier(0.34, 1.3, 0.64, 1),
    opacity 0.4s ease;
  will-change: transform, width;
}

.card.inactive {
  opacity: 0;
  pointer-events: none;
}

.polaroid {
  background: var(--card);
  padding: 10px 10px 40px;
  box-shadow: 0 10px 24px rgba(28, 26, 22, 0.18);
  border-radius: 2px;
}

.polaroid .media {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--lavender);
}

/* peek: hovering a phrase lifts its cards out of the deck */
body.peek-ai .card[data-group="ai"] .polaroid,
body.peek-products .card[data-group="products"] .polaroid {
  transform: translateY(-26px);
}

body.peek-ai .card[data-group="ai"],
body.peek-products .card[data-group="products"] {
  z-index: 20 !important;
}

.card .polaroid { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ---------- fixed deck UI: caption block + nav arrows ---------- */

.deck-ui[hidden] { display: none; }

.deck-ui {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}

.deck-caption {
  width: min(400px, 64vw);
  text-align: left;
  color: var(--ink);
  transition: opacity 0.18s ease;
}

.cap-title {
  font-family: "Funnel Display", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.cap-body {
  font-size: 0.9rem;
  line-height: 1.55;
}

.deck-caption em { color: var(--lavender); font-style: normal; font-weight: 600; }

.nav-btn {
  flex: 0 0 auto;
  appearance: none;
  border: none;
  background: none;
  color: var(--ink);
  font-family: "Funnel Display", sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.2em 0.35em;
  margin-top: -0.2em;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-btn:hover {
  color: var(--lavender);
  transform: scale(1.15);
}

/* ---------- return button (top-left of the image stack) ---------- */

.return-btn {
  position: fixed;
  z-index: 30;
  appearance: none;
  border: none;
  background: none;
  color: var(--ink);
  font-family: "Funnel Display", sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.2em 0.35em;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.return-btn:hover {
  color: var(--lavender);
  transform: rotate(90deg);
}
