/* Calistreak landing. Same identity as the app (src/theme): Young Serif titles,
   Nunito text, the Violeta palette (light and dark), large radii, 3D buttons.
   Fonts are self-hosted (npm run gen:landing): no requests to third parties. */

@font-face {
  font-family: 'Young Serif';
  src: url('fonts/young-serif-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('fonts/nunito-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('fonts/nunito-700.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('fonts/nunito-800.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #faf6f1;
  --surface: #fffefd;
  --ink: #251e15;
  --muted: #69625a;
  --line: #e5ded7;
  --primary: #6b40c9;
  --primary-edge: #4a1e97;
  --primary-soft: #ebe8ff;
  --primary-text: #6b40c9;
  --on-primary: #ffffff;
  --shadow: 0 6px 24px rgba(37, 30, 21, 0.08);
  --radius: 22px;
  --gutter: 16px;
  color-scheme: light;
}

/* Light is the default; dark only when chosen in the footer (theme.js). */
:root[data-theme='dark'] {
  --bg: #141319;
  --surface: #1f1e26;
  --ink: #f3ede8;
  --muted: #b3ada5;
  --line: #35343d;
  --primary: #a890fe;
  --primary-edge: #7862bf;
  --primary-soft: #2f2849;
  --primary-text: #bcadff;
  --on-primary: #141319;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* The app screenshots follow the page theme. */
.only-dark {
  display: none;
}
:root[data-theme='dark'] .only-dark {
  display: block;
}
:root[data-theme='dark'] .only-light {
  display: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* The stickers around the phones never cause sideways scrolling. */
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  line-height: 1.12;
}
h1,
h2 {
  font-family: 'Young Serif', Georgia, serif;
}
h1 {
  font-size: clamp(2.3rem, 7vw, 3.7rem);
  letter-spacing: -0.01em;
}
h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  margin-bottom: 12px;
}
h3 {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.08rem;
  line-height: 1.3;
}
p {
  margin: 0;
}
a {
  color: var(--primary-text);
  font-weight: 700;
}
picture {
  display: block;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.narrow {
  max-width: 720px;
}
.center {
  text-align: center;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 12px;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Young Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.35rem;
}
.brand img {
  border-radius: 10px;
}
.pill {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-text);
  background: var(--primary-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

/* Buttons (the app's Button3D) */
.btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: 16px;
  background: var(--primary);
  color: var(--on-primary);
  border-bottom: 4px solid var(--primary-edge);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  transition:
    transform 80ms ease,
    border-bottom-width 80ms ease;
}
.btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}
.btn:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom: 4px solid var(--line);
}
.btn-small {
  min-height: 42px;
  padding: 8px 16px;
  font-size: 0.95rem;
  border-bottom-width: 3px;
}

/* Hero */
.hero {
  padding: 40px 0 56px;
}
.hero-grid {
  display: grid;
  gap: 36px;
  align-items: center;
}
.hero-text {
  display: grid;
  gap: 18px;
}
.eyebrow {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-text);
}
.lead {
  font-size: 1.18rem;
  color: var(--muted);
  max-width: 34em;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.qr {
  display: none;
  align-items: center;
  gap: 16px;
  max-width: 30em;
  color: var(--muted);
  font-size: 0.95rem;
}
.qr img {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 6px;
}

/* Phone screenshots */
.phone {
  margin: 0 auto;
  width: min(300px, 82vw);
  border-radius: 34px;
  border: 8px solid var(--surface);
  outline: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--surface);
}
.phone-small {
  width: min(250px, 70vw);
  border-width: 6px;
  border-radius: 28px;
}
figure.phone-small {
  overflow: visible;
  outline: none;
  border: none;
  box-shadow: none;
  background: none;
}
.phone-small img {
  border-radius: 24px;
  border: 6px solid var(--surface);
  outline: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.phone-small figcaption {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

/* Sections */
.section {
  padding: 64px 0;
}
.section-soft {
  background: color-mix(in srgb, var(--primary-soft) 45%, var(--bg));
}
.section-lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 40em;
  margin-bottom: 28px;
}
.center .section-lead {
  margin-left: auto;
  margin-right: auto;
}
.note {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 16px;
}

/* Cards */
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  align-content: start;
}
.card p,
.card li {
  color: var(--muted);
}
.card .icon {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 12px;
  color: var(--primary-text);
  background: var(--primary-soft);
}
.card-accent {
  background: var(--primary);
  border-color: var(--primary);
}
.card-accent h3,
.card-accent p {
  color: var(--on-primary);
}
.card-accent .icon {
  color: var(--on-primary);
  background: color-mix(in srgb, var(--on-primary) 18%, transparent);
}
.card ul,
.card ol {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 6px;
}
.inline {
  vertical-align: -4px;
  margin-right: 8px;
  color: var(--primary-text);
}
.inline.big {
  width: 30px;
  height: 30px;
  vertical-align: -5px;
}

/* How it works */
.split {
  display: grid;
  gap: 36px;
  align-items: center;
}
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 20px;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 14px;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--on-primary);
  background: var(--primary);
  box-shadow: 0 3px 0 var(--primary-edge);
}
.steps p {
  color: var(--muted);
}

/* Features */
.features {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  display: grid;
  gap: 12px;
}
.features li,
.checks li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}
.features svg,
.checks svg {
  color: var(--primary-text);
}
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
}
.checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  font-size: 1.08rem;
}

/* Transparency, install */
.columns {
  display: grid;
  gap: 16px;
}

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.timeline li {
  display: grid;
  gap: 4px;
  padding-left: 20px;
  border-left: 4px solid var(--primary);
}
.timeline li + li {
  border-left-color: var(--line);
}
.when {
  font-weight: 800;
  color: var(--primary-text);
}

/* FAQ */
details {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: '+';
  color: var(--primary-text);
  font-size: 1.3rem;
  line-height: 1;
}
details[open] summary::after {
  content: '–';
}
details p {
  margin-top: 10px;
  color: var(--muted);
}

/* Final call and footer */
.final h2 {
  font-size: clamp(2rem, 5vw, 2.8rem);
}
.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  gap: 20px;
}
.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}
.brand-small {
  font-family: 'Young Serif', Georgia, serif;
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 6px;
}

/* Wider screens */
@media (min-width: 720px) {
  :root {
    --gutter: 24px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
  .columns {
    grid-template-columns: repeat(2, 1fr);
  }
  .timeline {
    grid-template-columns: repeat(3, 1fr);
  }
  .timeline li {
    border-left: none;
    padding-left: 0;
    padding-top: 16px;
    border-top: 4px solid var(--line);
  }
  .timeline li:first-child {
    border-top-color: var(--primary);
  }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr;
  }
}

@media (min-width: 960px) {
  .hero {
    padding: 72px 0 88px;
  }
  .hero-grid,
  .split {
    grid-template-columns: 1.2fr 1fr;
  }
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-accent {
    grid-column: span 3;
  }
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
  .section {
    padding: 88px 0;
  }
}

/* The QR code only where a phone camera makes sense: a computer. */
@media (min-width: 960px) and (hover: hover) and (pointer: fine) {
  .qr {
    display: flex;
  }
}

/* ---- Fun motion (all of it stops with "reduce motion") ---------------------- */

/* Hero: soft brand circles behind the phone, like the demo video. */
.hero-art {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  padding: 12px 8px;
}
.hero-art::before,
.hero-art::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: var(--primary-soft);
  z-index: -1;
}
.hero-art::before {
  width: min(360px, 92vw);
  aspect-ratio: 1;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
}
.hero-art::after {
  width: 120px;
  height: 120px;
  bottom: 4%;
  right: -10%;
  opacity: 0.7;
}
.hero {
  position: relative;
  isolation: isolate;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-12px) rotate(1.5deg);
  }
}
.floaty {
  animation: float 7s ease-in-out infinite;
}

/* Stickers pop in, then bob around the phone. */
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-12deg);
  }
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(var(--tilt, 0deg));
  }
  50% {
    transform: translateY(-8px) rotate(calc(var(--tilt, 0deg) * -1));
  }
}
.sticker {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  animation:
    pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    bob 4.5s ease-in-out infinite;
}
.sticker svg {
  width: 18px;
  height: 18px;
}
.sticker-streak {
  --tilt: -4deg;
  top: 14%;
  left: -14px;
  animation-delay: 0.3s, 0.9s;
}
.sticker-streak svg {
  color: #eb6202; /* the app's streak flame */
}
.sticker-coins {
  --tilt: 3deg;
  top: 44%;
  right: -18px;
  animation-delay: 0.6s, 1.6s;
}
.sticker-coins svg {
  color: #c99510; /* the app's coin, darker for contrast on white */
}
.sticker-done {
  --tilt: -2deg;
  bottom: 16%;
  left: -6px;
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
  animation-delay: 0.9s, 0.4s;
}

/* "Como funciona": a pulse like the rest timer. */
@keyframes ring {
  from {
    opacity: 0.55;
    transform: scale(0.96);
  }
  to {
    opacity: 0;
    transform: scale(1.12);
  }
}
.pulse {
  position: relative;
  overflow: visible;
}
.pulse::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 42px;
  border: 3px solid var(--primary);
  animation: ring 2.6s ease-out infinite;
  pointer-events: none;
}
.pulse img {
  border-radius: 26px;
}

/* Gallery: the phones tilt in as they scroll into view, and wiggle on hover. */
@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(3deg);
  }
}
.tilt:hover img {
  animation: wiggle 0.5s ease-in-out;
}
@keyframes tilt-in {
  from {
    opacity: 0.2;
    transform: translateY(48px) rotate(var(--from, -8deg));
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@supports (animation-timeline: view()) {
  .tilt {
    animation: tilt-in linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 35%;
  }
  .tilt + .tilt {
    --from: 8deg;
  }
}

/* Video */
.link-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  text-decoration: none;
}
.link-play svg {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 50%;
  color: var(--on-primary);
  background: var(--primary);
  fill: currentColor;
}
.video-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #000000;
}
.video-frame video {
  display: block;
  width: 100%;
  height: auto;
}

/* Header: theme button next to "Abrir o app" */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.icon-btn:hover {
  transform: rotate(-15deg);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}
.when-dark {
  display: none;
}
:root[data-theme='dark'] .when-dark {
  display: block;
}
:root[data-theme='dark'] .when-light {
  display: none;
}
/* Small phones: the "Alfa" pill makes room for the button (the hero says it). */
@media (max-width: 400px) {
  .brand .pill {
    display: none;
  }
}
@media (max-width: 380px) {
  .brand {
    gap: 8px;
    font-size: 1.15rem;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
  }
  .top-actions .btn-small {
    padding-inline: 12px;
  }
}
/* Very narrow screens: the icon alone stands for the name. */
@media (max-width: 340px) {
  .brand span {
    display: none;
  }
}

/* Rest screen: a live countdown drawn exactly over the screenshot's timer
   (the app's CountdownRing: 220 px box centered at 194.5 x 261.5 of 390 x 844). */
.shot {
  position: relative;
  container-type: inline-size;
}
/* "A seguir" card: the app's 64 px thumbnail (frame color, radius 12) at
   29 x 507, and the name (Nunito Bold 16/24) from x 106 on its line. */
.next-thumb {
  position: absolute;
  left: 7.436%;
  top: 60.071%;
  width: 16.41%;
  aspect-ratio: 1;
  border-radius: 3.077cqw;
  overflow: hidden;
  background: #f5efe8; /* the app's "frame" */
}
:root[data-theme='dark'] .next-thumb {
  background: #ebe7e2;
}
.next-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.next-name {
  position: absolute;
  left: 27.18%;
  top: 63.389%;
  min-width: 34%;
  padding-right: 2cqw;
  font-weight: 700;
  font-size: 4.103cqw; /* 16 px of 390 */
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ink);
  background: var(--surface);
}
.live-timer {
  position: absolute;
  left: 21.667%;
  top: 17.95%;
  width: 56.41%;
  aspect-ratio: 1;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
}
.live-timer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: none;
}
.live-timer circle {
  fill: none;
  stroke-width: 12;
}
.live-timer .track {
  stroke: var(--line);
}
.live-timer .arc {
  stroke: var(--primary);
  stroke-linecap: round;
}
.live-timer .time {
  font-weight: 800;
  font-size: 29.1cqw; /* 64 px of 220 */
  line-height: 1.0625;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.live-timer .caption {
  font-weight: 700;
  font-size: 5.91cqw; /* 13 px of 220 */
  line-height: 1.385;
  color: var(--muted);
}

/* "Reduce motion" (Windows: Efeitos de animação off; phones: Reduzir movimento):
   nothing travels, floats or turns. What stays: the countdown, the stickers
   fading in and the ring around the rest screen glowing in place. */
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes glow {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .floaty,
  .tilt,
  .tilt:hover img {
    animation: none;
  }
  .sticker {
    animation: fade-in 0.8s ease-out both;
  }
  .pulse::before {
    animation: glow 2.6s ease-in-out infinite alternate;
  }
  html {
    scroll-behavior: auto;
  }
  .btn,
  .icon-btn {
    transition: none;
  }
  .icon-btn:hover {
    transform: none;
  }
}
