:root {
  --navy: #12204b;
  --muted: #74798e;
  --line: #e7e7ef;
  --purple: #6842e8;
  --pink: #ef0b70;
  --page: #f8f8fc;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--navy);
  background:
    radial-gradient(circle at 8% 22%, rgba(0, 174, 181, .09), transparent 24rem),
    radial-gradient(circle at 92% 78%, rgba(239, 11, 112, .08), transparent 25rem),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  height: 68px;
  padding: 5px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, .95);
  border-bottom: 1px solid var(--line);
}

.brand { width: 150px; height: 54px; flex: 0 0 auto; }
.brand img { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.main-nav { display: flex; align-items: center; gap: 3px; margin-left: clamp(18px, 4vw, 55px); }
.main-nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: #686d82;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { color: var(--purple); background: #f0ecff; }

.compact-home {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 112px);
  max-width: 1120px;
  margin: auto;
  padding: 20px 24px 28px;
}

.welcome { margin-bottom: 18px; text-align: center; }
.eyebrow { color: var(--purple); font-size: 9px; letter-spacing: .17em; font-weight: 950; }
.welcome h1 { margin: 5px 0 2px; font-size: clamp(29px, 4vw, 43px); line-height: 1; letter-spacing: -.052em; }
.welcome p { margin: 0; color: var(--muted); font-size: 13px; }

.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.tool-card {
  --card: #f16f68;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 328px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  text-decoration: none;
  box-shadow: 0 9px 26px rgba(26, 28, 71, .055);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card) 36%, white);
  box-shadow: 0 17px 38px rgba(26, 28, 71, .12);
}
.tool-card.purple { --card: #6842e8; }
.tool-card.yellow { --card: #e3a200; }
.tool-card::after {
  content: "";
  position: absolute;
  width: 125px;
  height: 125px;
  right: -56px;
  top: -60px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--card) 10%, white);
}

.tool-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--card);
  background: color-mix(in srgb, var(--card) 11%, white);
  font-size: 11px;
  font-weight: 950;
}
.tool-card h2 { margin: 13px 0 4px; font-size: clamp(19px, 2vw, 23px); letter-spacing: -.04em; }
.tool-card > p { min-height: 36px; margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.choose-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  color: white;
  background: var(--card);
  font-size: 11px;
  font-weight: 900;
}
.choose-button b { font-size: 16px; line-height: 1; }

.card-demo {
  position: relative;
  display: block;
  flex: 1;
  min-height: 108px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 13px;
  background:
    linear-gradient(rgba(255,255,255,.58), rgba(255,255,255,.58)),
    repeating-linear-gradient(0deg, transparent 0 17px, color-mix(in srgb, var(--card) 9%, white) 18px),
    repeating-linear-gradient(90deg, transparent 0 17px, color-mix(in srgb, var(--card) 9%, white) 18px),
    color-mix(in srgb, var(--card) 6%, white);
}

/* 1. Uma folha com várias artes se transforma em arquivos separados. */
.source-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 64px;
  transform: translate(-50%, -50%);
  border: 2px solid color-mix(in srgb, var(--card) 66%, #6e3157);
  border-radius: 8px;
  background: white;
  box-shadow: 0 6px 15px rgba(64, 45, 75, .12);
  animation: source-sheet 4s ease-in-out infinite;
}
.source-sheet em, .split-piece {
  position: absolute;
  display: block;
  border-radius: 50% 50% 44% 44%;
  background: linear-gradient(145deg, #ff8aa5, #f6c55b);
}
.source-sheet em:nth-child(1) { width: 20px; height: 22px; left: 8px; top: 8px; }
.source-sheet em:nth-child(2) { width: 18px; height: 19px; right: 9px; top: 10px; background: linear-gradient(145deg, #8c6bed, #61cbd0); }
.source-sheet em:nth-child(3) { width: 23px; height: 18px; left: 28px; bottom: 7px; background: linear-gradient(145deg, #f99f5d, #ee5e8d); }
.split-piece {
  left: 50%;
  top: 50%;
  width: 25px;
  height: 26px;
  opacity: 0;
  border: 2px solid white;
  box-shadow: 0 5px 13px rgba(60, 43, 83, .16);
  animation: split-piece-one 4s ease-in-out infinite;
}
.piece-two { background: linear-gradient(145deg, #8c6bed, #61cbd0); animation-name: split-piece-two; }
.piece-three { width: 28px; height: 22px; background: linear-gradient(145deg, #f99f5d, #ee5e8d); animation-name: split-piece-three; }
@keyframes source-sheet {
  0%, 28% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  42%, 80% { opacity: .16; transform: translate(-50%, -50%) scale(.88); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes split-piece-one {
  0%, 28% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  45%, 80% { opacity: 1; transform: translate(-105px, -35px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
}
@keyframes split-piece-two {
  0%, 28% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  45%, 80% { opacity: 1; transform: translate(70px, -35px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
}
@keyframes split-piece-three {
  0%, 28% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  45%, 80% { opacity: 1; transform: translate(-14px, 24px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
}

/* 2. A arte entra visualmente no molde. */
.box-template {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 124px;
  height: 72px;
  transform: translate(-50%, -45%);
  border: 2px solid #4f4b68;
  background: rgba(255,255,255,.82);
}
.box-template::before, .box-template::after {
  content: "";
  position: absolute;
  top: 15px;
  width: 24px;
  height: 38px;
  border: 2px solid #4f4b68;
  background: rgba(255,255,255,.62);
}
.box-template::before { left: -28px; border-right: 0; }
.box-template::after { right: -28px; border-left: 0; }
.box-template em { position: absolute; top: 0; bottom: 0; width: 1px; background: #77728c; }
.box-template em:nth-child(1) { left: 31px; }
.box-template em:nth-child(2) { left: 61px; }
.box-template em:nth-child(3) { right: 30px; }
.moving-art {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 46px;
  border-radius: 5px;
  background: linear-gradient(145deg, #fa7bae, #845ce7);
  box-shadow: 0 6px 14px rgba(65, 41, 127, .2);
  animation: place-art 3.8s ease-in-out infinite;
}
@keyframes place-art {
  0%, 18% { opacity: 0; transform: translate(90px, -65px) scale(.75) rotate(8deg); }
  38%, 72% { opacity: .88; transform: translate(-45px, -23px) scale(1) rotate(0); }
  82% { box-shadow: 0 0 0 4px rgba(104,66,232,.2), 0 6px 14px rgba(65,41,127,.2); }
  100% { opacity: 0; transform: translate(-45px, -23px) scale(1); }
}

/* 3. Arquivos entram na bandeja de download. */
.file {
  position: absolute;
  left: 50%;
  top: 14px;
  width: 47px;
  height: 57px;
  border: 2px solid #a57918;
  border-radius: 6px;
  background: #fff9e8;
  box-shadow: 0 5px 12px rgba(93, 68, 17, .13);
}
.file::before { content: ""; position: absolute; left: 9px; top: 14px; width: 25px; height: 3px; border-radius: 3px; background: #e9bd4e; box-shadow: 0 9px 0 #f0d27f, 0 18px 0 #f0d27f; }
.file-back { transform: translateX(-36px) rotate(-9deg); opacity: .65; }
.file-front { transform: translateX(-12px) rotate(5deg); }
.download-arrow {
  position: absolute;
  left: calc(50% + 48px);
  top: 16px;
  color: #b87e00;
  font-size: 34px;
  font-style: normal;
  font-weight: 950;
  animation: download-arrow 2.4s ease-in-out infinite;
}
.download-tray { position: absolute; left: calc(50% + 31px); bottom: 17px; width: 53px; height: 17px; border: 3px solid #b87e00; border-top: 0; border-radius: 0 0 8px 8px; }
@keyframes download-arrow {
  0%, 20% { opacity: 0; transform: translateY(-10px); }
  42%, 72% { opacity: 1; transform: translateY(14px); }
  100% { opacity: 0; transform: translateY(25px); }
}

.simple-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  color: #898da0;
  background: white;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

@media (max-height: 650px) and (min-width: 801px) {
  .compact-home { align-content: start; padding-top: 13px; }
  .welcome { margin-bottom: 10px; }
  .tool-card { min-height: 290px; }
  .card-demo { min-height: 76px; }
}

@media (max-width: 800px) {
  .topbar { height: auto; min-height: 64px; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; margin: 2px 0 5px; overflow-x: auto; }
  .main-nav a { font-size: 11px; }
  .compact-home { align-content: start; padding-top: 23px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
