/* Squiggleworks marketing site. Palette, fonts and radii are lifted straight
   from the app (src/lib/theme.ts) so the site and the app read as one thing.
   Fonts are self hosted rather than pulled from Google, so visiting this page
   makes no third party requests at all. */

@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/Fredoka_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/Nunito_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/Nunito_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #FDF8EF;
  --card: #FFFFFF;
  --ink: #33344E;
  --ink-soft: #8B877C;
  --line: #F0E6D6;
  --coral: #FF6B57;
  --coral-dark: #E8503C;
  --coral-soft: #FFE3DE;
  --sunshine-soft: #FFF2D4;
  --sky-soft: #DFF0FC;
  --lavender-soft: #ECE5FB;
  --mint-soft: #DDF5EC;
  --radius-card: 24px;
  --shadow: 0 4px 12px rgba(92, 74, 46, 0.08);
  --heading: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--heading);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

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

a { color: var(--coral-dark); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  padding: 12px 18px;
  border-radius: 0 0 14px 0;
  z-index: 10;
}
.skip:focus { left: 0; }

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

/* --- nav ---------------------------------------------------------------- */

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--heading);
  font-size: 21px;
  color: var(--ink);
  text-decoration: none;
}

.brand img.brand-spin {
  transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.brand:hover img.brand-spin {
  transform: rotate(-12deg) scale(1.08);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-family: var(--body);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  color: var(--ink);
  padding: 10px 14px;
  white-space: nowrap;
  border-radius: 999px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-link:hover {
  color: var(--coral-dark);
  background: var(--coral-soft);
}

.nav-cta {
  font-family: var(--body);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.nav-cta:hover {
  background: var(--coral-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(92, 74, 46, 0.12);
}

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

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  letter-spacing: -0.01em;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 18px 0 28px;
  max-width: 34em;
}

.hero-art {
  display: flex;
  justify-content: center;
  position: relative;
}

.mascot {
  width: min(300px, 74vw);
  filter: drop-shadow(0 12px 22px rgba(92, 74, 46, 0.14));
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transform: perspective(700px) rotateY(var(--tilt-x)) rotateX(var(--tilt-y));
  transform-origin: 50% 70%;
  transition: transform 0.18s ease-out;
}

.mascot.is-live {
  cursor: pointer;
  animation: mascot-bob 3.2s ease-in-out infinite;
}

.mascot.is-live:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 8px;
  border-radius: 50%;
}

.mascot.is-pop {
  animation: mascot-pop 0.42s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes mascot-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@keyframes mascot-pop {
  0% { scale: 1; rotate: 0deg; }
  40% { scale: 1.12; rotate: -4deg; }
  70% { scale: 0.96; rotate: 3deg; }
  100% { scale: 1; rotate: 0deg; }
}

/* --- CTAs / store badges ------------------------------------------------ */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: #fff;
  background: var(--coral);
  padding: 14px 26px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.cta-primary:hover {
  background: var(--coral-dark);
  transform: translateY(-2px);
}

.badges { display: flex; flex-wrap: wrap; gap: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 12px 22px 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.badge:hover { transform: translateY(-2px); }
.badge svg { width: 26px; height: 26px; fill: currentColor; flex: none; }

.badge-copy { display: flex; flex-direction: column; line-height: 1.15; }
.badge-copy small { font-size: 0.68rem; opacity: 0.8; }
.badge-copy strong { font-size: 1.05rem; font-weight: 700; }

/* No listing yet: still readable, clearly not a link. */
.badge.is-soon {
  background: var(--card);
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  cursor: default;
  box-shadow: none;
}
.badge.is-soon:hover { transform: none; }

.badge-note {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 16px 0 0;
  font-weight: 700;
}

/* --- samples ------------------------------------------------------------ */

section > h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  text-align: center;
}

.section-lede {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 10px 0 0;
}

.samples {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 24px 64px;
}

.sample-grid {
  list-style: none;
  padding: 0;
  margin: 36px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.sample-grid li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}

.sample-frame {
  position: relative;
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  transform: perspective(800px) rotateX(var(--rx)) rotateY(var(--ry))
    translateY(calc(var(--lift) * -1));
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
  border-radius: 18px;
  box-shadow: var(--shadow);
  will-change: transform;
}

.sample-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  mix-blend-mode: multiply;
}

.sample-grid li:nth-child(1) .sample-frame::after {
  background: linear-gradient(160deg, #FFC94B66, #4FA8E866 55%, transparent 72%);
}
.sample-grid li:nth-child(2) .sample-frame::after {
  background: linear-gradient(160deg, #9B7FE866, #F27BB466 55%, transparent 72%);
}
.sample-grid li:nth-child(3) .sample-frame::after {
  background: linear-gradient(160deg, #3FBF9566, #FFC94B66 55%, transparent 72%);
}
.sample-grid li:nth-child(4) .sample-frame::after {
  background: linear-gradient(160deg, #FF6B5766, #4FA8E866 55%, transparent 72%);
}

.sample-grid li:hover .sample-frame {
  box-shadow: 0 16px 28px rgba(92, 74, 46, 0.16);
}
.sample-grid li:hover .sample-frame::after { opacity: 1; }

.sample-grid img {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  width: 100%;
  display: block;
}

.sample-grid span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.sample-grid li:hover span {
  color: var(--coral-dark);
  transform: translateY(-2px);
}

/* --- features ----------------------------------------------------------- */

.features {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 24px 56px;
}

.feature-grid {
  list-style: none;
  padding: 0;
  margin: 36px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.feature-grid li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-grid li:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 26px rgba(92, 74, 46, 0.12);
}

.feature-grid li:nth-child(1) { background: linear-gradient(var(--coral-soft), var(--card) 62%); }
.feature-grid li:nth-child(2) { background: linear-gradient(var(--lavender-soft), var(--card) 62%); }
.feature-grid li:nth-child(3) { background: linear-gradient(var(--sunshine-soft), var(--card) 62%); }

.feature-grid img {
  width: 84px;
  transform-origin: 50% 80%;
}

.feature-grid img.is-wiggle {
  animation: mascot-wiggle 0.55s ease;
}

@keyframes mascot-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  55% { transform: rotate(7deg); }
  75% { transform: rotate(-4deg); }
}

.feature-grid h3 { font-size: 1.3rem; margin: 8px 0 10px; }

.feature-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* --- parents ------------------------------------------------------------ */

.parents {
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 24px 72px;
}

.parent-list {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  gap: 12px;
}

.parent-list li {
  background: var(--sky-soft);
  border-radius: 18px;
  padding: 16px 20px;
  color: var(--ink);
  font-size: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.parent-list li:nth-child(even) { background: var(--mint-soft); }
.parent-list li:hover {
  transform: translateX(6px);
  box-shadow: 0 6px 16px rgba(92, 74, 46, 0.08);
}

/* --- long form documents (privacy policy) -------------------------------- */

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 24px 72px;
}

.doc h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.6rem);
}

.doc-date {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 10px 0 32px;
}

/* Parents skim. The summary carries the whole policy in five lines. */
.doc-summary {
  background: var(--sky-soft);
  border-radius: var(--radius-card);
  padding: 24px 26px;
  margin-bottom: 40px;
}

.doc-summary h2 {
  text-align: left;
  font-size: 1.25rem;
  margin: 0 0 12px;
}

.doc-summary ul { margin: 0; padding-left: 22px; }
.doc-summary li { margin-bottom: 8px; }
.doc-summary li:last-child { margin-bottom: 0; }

.doc h2 {
  text-align: left;
  font-size: 1.35rem;
  margin: 36px 0 12px;
}

.doc p { margin: 0 0 14px; }

.doc ul { padding-left: 22px; margin: 0 0 14px; }
.doc li { margin-bottom: 7px; }

.doc strong { font-weight: 700; }

/* --- meet the team ------------------------------------------------------ */

.team {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px 72px;
}

.team-intro {
  text-align: center;
  margin-bottom: 40px;
}

.team-intro h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.team-intro .lede {
  margin-inline: auto;
  margin-bottom: 0;
}

.team-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.person {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px 26px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.person-connor {
  background: linear-gradient(var(--coral-soft), var(--card) 55%);
}

.person-alex {
  background: linear-gradient(var(--sky-soft), var(--card) 55%);
}

.person-photo {
  width: min(180px, 52vw);
  aspect-ratio: 1;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 36px;
  display: block;
  margin: 0 auto 18px;
  box-shadow: var(--shadow);
}

.person h2 {
  font-size: 1.7rem;
  margin: 0 0 6px;
}

.person-role {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.95rem;
}

.person-bio {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.ownership {
  margin-top: 56px;
  text-align: center;
}

.ownership-bar {
  display: flex;
  width: 100%;
  max-width: 640px;
  margin: 28px auto 18px;
  height: 56px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--card);
}

.ownership-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: 0;
  min-width: 0;
  transition: flex-grow 0.45s cubic-bezier(0.2, 1.1, 0.4, 1);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
}

/* data-share instead of inline styles — Cloudflare CSP blocks style="". */
.ownership-fill[data-share="5"] { flex-grow: 5; }
.ownership-fill[data-share="10"] { flex-grow: 10; }
.ownership-fill[data-share="15"] { flex-grow: 15; }
.ownership-fill[data-share="20"] { flex-grow: 20; }
.ownership-fill[data-share="25"] { flex-grow: 25; }
.ownership-fill[data-share="30"] { flex-grow: 30; }
.ownership-fill[data-share="35"] { flex-grow: 35; }
.ownership-fill[data-share="40"] { flex-grow: 40; }
.ownership-fill[data-share="45"] { flex-grow: 45; }
.ownership-fill[data-share="50"] { flex-grow: 50; }
.ownership-fill[data-share="55"] { flex-grow: 55; }
.ownership-fill[data-share="60"] { flex-grow: 60; }
.ownership-fill[data-share="65"] { flex-grow: 65; }
.ownership-fill[data-share="70"] { flex-grow: 70; }
.ownership-fill[data-share="75"] { flex-grow: 75; }
.ownership-fill[data-share="80"] { flex-grow: 80; }
.ownership-fill[data-share="85"] { flex-grow: 85; }
.ownership-fill[data-share="90"] { flex-grow: 90; }
.ownership-fill[data-share="95"] { flex-grow: 95; }
.ownership-fill[data-share="100"] { flex-grow: 100; }

.ownership-fill span {
  padding: 0 12px;
  transition: opacity 0.2s ease;
}

.ownership-fill.is-tight span {
  font-size: 0.8rem;
  padding: 0 6px;
}

.ownership-fill.is-gone span {
  opacity: 0;
}

.ownership-connor {
  background: var(--coral);
  color: #fff;
}

.ownership-connor.is-bump {
  animation: ownership-bump 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes ownership-bump {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.12); }
  100% { filter: brightness(1); }
}

.ownership-alex {
  background: var(--sky-soft);
  color: var(--ink);
}

.ownership-live {
  margin: 0 0 22px;
  font-weight: 700;
  color: var(--ink);
}

.ownership-btn {
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.ownership-btn:hover:not(:disabled) {
  background: var(--coral-dark);
  transform: translateY(-2px);
}

.ownership-btn:disabled {
  background: var(--ink-soft);
  cursor: default;
}

.ownership-note {
  margin: 14px auto 0;
  max-width: 36em;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.92rem;
}

@media (max-width: 700px) {
  .team-grid { grid-template-columns: 1fr; }
  .ownership-bar { height: 52px; }
  .ownership-fill { font-size: 0.82rem; }
}

/* --- footer ------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 40px 24px 56px;
  text-align: center;
}

.foot-name {
  font-family: var(--heading);
  font-size: 1.15rem;
  margin: 10px 0 6px;
}

.foot-small {
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin: 4px 0;
}

/* --- responsive --------------------------------------------------------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-bottom: 48px;
    gap: 28px;
  }
  .hero-art { grid-row: 1; }
  .lede { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .badges { justify-content: center; }
  .sample-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  body { font-size: 16px; }
  .badge { width: 100%; }
  .nav-cta { display: none; }
  .nav-link { padding: 8px 10px; font-size: 14px; }
}

/* --- scroll reveal + confetti ------------------------------------------- */

.will-reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 0.55s ease var(--reveal-delay, 0ms),
    transform 0.55s cubic-bezier(0.2, 1.1, 0.4, 1) var(--reveal-delay, 0ms);
}

.will-reveal.is-in {
  opacity: 1;
  transform: none;
}

.confetti {
  position: fixed;
  z-index: 40;
  width: var(--size, 8px);
  height: var(--size, 8px);
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-fly 0.85s cubic-bezier(0.15, 0.7, 0.3, 1) var(--delay, 0ms) forwards;
}

.confetti.is-round { border-radius: 999px; }

@keyframes confetti-fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--spin)) scale(0.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .will-reveal {
    opacity: 1;
    transform: none;
  }
  .mascot,
  .sample-frame {
    transform: none !important;
  }
}
