:root {
  color-scheme: light;
  --ag-blue-500: #4c6fff;
  --ag-blue-600: #3f5cf5;
  --ag-blue-700: #2f49d8;
  --ag-coral-500: #ff6b6b;
  --ag-yellow-500: #ffd166;
  --ag-lilac-500: #a78bfa;
  --ag-bg: #fafafc;
  --ag-shell: #f3f4fb;
  --ag-border: #e5e7eb;
  --ag-text-primary: #111827;
  --ag-text-secondary: #4b5563;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ag-bg);
  color: var(--ag-text-primary);
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

main {
  min-height: 100vh;
}

body:has(main[class*="lg:grid-cols"]) main,
main[class*="lg:grid-cols"] {
  display: grid;
  gap: 2rem;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(circle at top left, rgba(76, 111, 255, .16), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(255, 107, 107, .14), transparent 32rem),
    linear-gradient(135deg, #f8fbff 0%, #f3f7ff 42%, #fff8f4 100%);
}

@media (min-width: 1024px) {
  body:has(main[class*="lg:grid-cols"]) main,
  main[class*="lg:grid-cols"] {
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
  }
}

section {
  min-width: 0;
}

body:not(:has(aside)) main > section {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 44rem;
  font-size: clamp(2.45rem, 6vw, 4.75rem);
  line-height: .95;
  letter-spacing: -.055em;
  font-weight: 850;
}

h2 {
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: -.025em;
}

p {
  color: var(--ag-text-secondary);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--ag-border);
  border-radius: 1rem;
  background: #f6f7fb;
  padding: .85rem 1rem;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ag-blue-500);
  box-shadow: 0 0 0 4px rgba(76, 111, 255, .12);
}

button {
  border: 1px solid var(--ag-border);
  border-radius: 1rem;
  background: #fff;
  padding: .8rem 1rem;
  color: var(--ag-text-primary);
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

button:hover {
  border-color: rgba(76, 111, 255, .45);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

button[class*="bg-[linear-gradient"],
button[class*="ag-blue-600"] {
  border-color: transparent;
  background: linear-gradient(135deg, var(--ag-blue-600), #4c7dff);
  color: white;
}

[class*="rounded-[32px]"],
[class*="rounded-2xl"][class*="bg-white"] {
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 2rem;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 28px 80px rgba(37, 84, 214, .14);
}

[class*="grid"][class*="grid-cols-4"] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
}

[class*="grid"][class*="grid-cols-4"] span {
  min-height: .5rem;
  border-radius: 999px;
}

[class*="bg-[var(--ag-coral-500)]"] {
  background: var(--ag-coral-500);
}

[class*="bg-[var(--ag-lilac-500)]"] {
  background: var(--ag-lilac-500);
}

[class*="bg-[var(--ag-yellow-500)]"] {
  background: var(--ag-yellow-500);
}

[class*="bg-[var(--ag-blue-500)]"],
[class*="bg-[var(--ag-blue-600)]"] {
  background: var(--ag-blue-600);
}

[class*="text-[var(--ag-blue-700)]"] {
  color: var(--ag-blue-700);
}

[class*="uppercase"] {
  text-transform: uppercase;
  letter-spacing: .12em;
}

[class*="font-extrabold"] {
  font-weight: 850;
}

[class*="text-white"] {
  color: white;
}

/* Internal animation preview resilience styles. These keep /animation-preview
   usable even when the framework-generated utility CSS is stale or delayed. */
.ag-animation-preview {
  min-height: 100vh;
  overflow-x: hidden;
  padding: 28px 20px;
  background:
    radial-gradient(circle at 8% 4%, rgba(76, 111, 255, .16), transparent 22rem),
    radial-gradient(circle at 92% 82%, rgba(255, 107, 107, .12), transparent 24rem),
    linear-gradient(135deg, #f8fbff 0%, #f3f7ff 45%, #fff8f4 100%);
}

.ag-animation-container {
  width: min(100%, 1280px);
  margin: 0 auto;
}

.ag-animation-header,
.ag-animation-ctas,
.ag-preview-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ag-animation-header {
  justify-content: space-between;
}

.ag-internal-pill,
.ag-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: var(--ag-blue-700);
  box-shadow: 0 8px 24px rgba(28, 35, 90, .08);
}

.ag-internal-pill {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ag-animation-hero {
  padding: 48px 0 56px;
  text-align: center;
}

.ag-hero-pill {
  margin: 0 auto 20px;
  padding: 8px 16px;
  font-size: 10px;
  font-weight: 900;
}

.ag-animation-title {
  max-width: 980px;
  margin: 0 auto;
  font-size: clamp(3.2rem, 7.4vw, 6.7rem);
  line-height: .92;
  letter-spacing: -.065em;
  font-weight: 900;
}

.ag-animation-copy {
  max-width: 780px;
  margin: 24px auto 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ag-text-secondary);
}

.ag-animation-ctas {
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.ag-primary-cta,
.ag-secondary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  padding: 14px 24px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.ag-primary-cta,
.ag-control-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--ag-blue-600), #4c7dff);
  color: white;
  box-shadow: 0 18px 35px rgba(63, 92, 245, .22);
}

.ag-secondary-cta,
.ag-control-secondary {
  border: 1px solid var(--ag-border);
  background: rgba(255, 255, 255, .84);
  color: var(--ag-blue-700);
}

.demo-shell {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 34px;
  background: rgba(255,255,255,.9);
  padding: 12px;
  box-shadow: 0 28px 90px rgba(37,84,214,.18);
}

.demo-shell > div {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 12%, #eaf2ff, transparent 30%),
    radial-gradient(circle at 82% 70%, #fff1ea, transparent 26%),
    linear-gradient(135deg, #ffffff, #f8faff);
}

.demo-shell > div > div:first-child {
  position: relative;
  min-height: 520px;
}

.piece {
  position: absolute;
  border: 1px solid rgba(0,0,0,.05);
  background: rgba(255,255,255,.9);
  box-shadow: 0 18px 50px rgba(28,35,90,.12);
  backdrop-filter: blur(10px);
}

.upload-card,
.analysis-card,
.preferences-card,
.opportunity-card,
.gmail-card,
.resume-card {
  border-radius: 28px;
  padding: 16px;
}

.pipeline-card {
  border-radius: 26px;
  padding: 16px;
}

.summary-card {
  border-radius: 34px;
}

.upload-card { left: 8%; top: 12%; width: min(330px, 42%); }
.analysis-card { right: 10%; top: 14%; width: min(340px, 40%); }
.preferences-card { left: 17%; top: 43%; width: min(330px, 40%); }
.opportunity-card { right: 8%; top: 38%; width: min(360px, 42%); }
.pipeline-card { bottom: 12%; left: 9%; width: min(390px, 44%); }
.gmail-card { right: 16%; bottom: 19%; width: min(320px, 38%); }
.resume-card { bottom: 9%; right: 8%; width: min(430px, 46%); }
.summary-card { inset: 13% 16%; }

.piece p,
.piece h3 {
  margin: 0;
}

.score-chip {
  border-radius: 999px;
  background: rgb(236 253 245);
  color: rgb(4 120 87);
  font-size: 10px;
  font-weight: 900;
  padding: 6px 10px;
}

.scene-labels {
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.scene-pill {
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 22px rgba(28,35,90,.08);
  color: rgb(148 143 139);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
  padding: 6px 9px;
  text-transform: uppercase;
}

.ag-preview-controls {
  position: sticky;
  bottom: 20px;
  z-index: 20;
  width: min(100%, 1024px);
  margin: 32px auto 0;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 28px;
  background: rgba(255,255,255,.92);
  padding: 16px;
  box-shadow: 0 24px 70px rgba(37,84,214,.18);
  backdrop-filter: blur(12px);
}

.ag-preview-controls-row {
  flex-wrap: wrap;
}

.ag-preview-controls button,
.ag-preview-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 900;
}

.ag-speed-control {
  display: flex;
  gap: 4px;
  border-radius: 16px;
  background: #eef4ff;
  padding: 4px;
}

.ag-speed-control button {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #8a8f9a;
}

@media (max-width: 760px) {
  .ag-animation-title {
    font-size: clamp(2.8rem, 16vw, 4.4rem);
  }

  .upload-card,
  .analysis-card,
  .preferences-card,
  .opportunity-card,
  .pipeline-card,
  .gmail-card,
  .resume-card {
    left: 7%;
    right: auto;
    top: 22%;
    width: 86%;
  }

  .summary-card {
    inset: 18% 7%;
  }

  .scene-labels {
    display: none;
  }
}

/* Homepage product demo scene animation fallback. Keep these rules after the
   older card fallback so the current larger-screen preview wins. */
.demo-shell {
  --demo-duration: 24s;
}

.demo-shell.is-paused * {
  animation-play-state: paused !important;
}

.scene-screen {
  animation-duration: var(--demo-duration);
  animation-fill-mode: both;
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(.2,.8,.2,1);
  border: 1px solid rgba(0,0,0,.05);
  background: rgba(255,255,255,.9);
  border-radius: 32px;
  box-shadow: 0 22px 70px rgba(28,35,90,.14);
  left: 5%;
  min-height: 72%;
  padding: 28px;
  position: absolute;
  top: 16%;
  width: 90%;
  z-index: 2;
}

.upload-screen { animation-name: trailerUpload; }
.analysis-screen { animation-name: trailerAnalysis; }
.preferences-screen { animation-name: trailerPreferences; }
.opportunities-screen { animation-name: trailerOpportunity; }
.pipeline-screen { animation-name: trailerPipeline; }
.gmail-screen { animation-name: trailerGmail; }
.resume-screen { animation-name: trailerResume; }
.summary-screen {
  animation-name: trailerSummary;
  inset: 14% 12%;
  min-height: auto;
  width: auto;
}

.opportunity-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.demo-progress {
  animation: progressFill var(--demo-duration) infinite cubic-bezier(.2,.8,.2,1);
}

.score-chip {
  animation: scorePulse var(--demo-duration) infinite cubic-bezier(.2,.8,.2,1);
}

.pipeline-dot.move {
  animation: pipelineMove var(--demo-duration) infinite cubic-bezier(.2,.8,.2,1);
}

.resume-highlight {
  animation: highlightSweep var(--demo-duration) infinite cubic-bezier(.2,.8,.2,1);
}

.demo-orbit {
  animation: orbitDrift var(--demo-duration) infinite linear;
}

.scene-pill {
  animation: scenePill var(--demo-duration) infinite cubic-bezier(.2,.8,.2,1);
}

.scene-pill-1 { animation-delay: 0s; }
.scene-pill-2 { animation-delay: calc(var(--demo-duration) * -0.875); }
.scene-pill-3 { animation-delay: calc(var(--demo-duration) * -0.75); }
.scene-pill-4 { animation-delay: calc(var(--demo-duration) * -0.625); }
.scene-pill-5 { animation-delay: calc(var(--demo-duration) * -0.5); }
.scene-pill-6 { animation-delay: calc(var(--demo-duration) * -0.375); }
.scene-pill-7 { animation-delay: calc(var(--demo-duration) * -0.25); }
.scene-pill-8 { animation-delay: calc(var(--demo-duration) * -0.125); }

@keyframes trailerUpload {
  0%, 10% { opacity: 1; transform: translate(0,0) scale(1); z-index: 5; }
  12.5%, 100% { opacity: 0; transform: translate(-18px,-14px) scale(.92); z-index: 1; }
}

@keyframes trailerAnalysis {
  0%, 12.4% { opacity: 0; transform: translate(24px,12px) scale(.9); }
  12.5%, 22.5% { opacity: 1; transform: translate(0,0) scale(1); z-index: 6; }
  25%, 100% { opacity: 0; transform: translate(18px,-12px) scale(.92); }
}

@keyframes trailerPreferences {
  0%, 24.9% { opacity: 0; transform: translateY(18px) scale(.9); }
  25%, 35% { opacity: 1; transform: translateY(0) scale(1); z-index: 6; }
  37.5%, 100% { opacity: 0; transform: translateY(-14px) scale(.92); }
}

@keyframes trailerOpportunity {
  0%, 37.4% { opacity: 0; transform: translateX(28px) scale(.9); }
  37.5%, 47.5% { opacity: 1; transform: translateX(0) scale(1); z-index: 7; }
  50%, 100% { opacity: 0; transform: translateX(-16px) scale(.92); }
}

@keyframes trailerPipeline {
  0%, 49.9% { opacity: 0; transform: translateY(20px) scale(.9); }
  50%, 60% { opacity: 1; transform: translateY(0) scale(1); z-index: 6; }
  62.5%, 100% { opacity: 0; transform: translateY(-14px) scale(.92); }
}

@keyframes trailerGmail {
  0%, 62.4% { opacity: 0; transform: translate(20px,18px) scale(.9); }
  62.5%, 72.5% { opacity: 1; transform: translate(0,0) scale(1); z-index: 8; }
  75%, 100% { opacity: 0; transform: translate(-14px,-12px) scale(.92); }
}

@keyframes trailerResume {
  0%, 74.9% { opacity: 0; transform: translateY(20px) scale(.9); }
  75%, 85% { opacity: 1; transform: translateY(0) scale(1); z-index: 8; }
  87.5%, 100% { opacity: 0; transform: translateY(-14px) scale(.92); }
}

@keyframes trailerSummary {
  0%, 87.4% { opacity: 0; transform: scale(.94); }
  87.5%, 98% { opacity: 1; transform: scale(1); z-index: 10; }
  100% { opacity: 0; transform: scale(.98); }
}

@keyframes progressFill {
  0%, 2% { width: 0%; }
  9%, 100% { width: 100%; }
}

@keyframes scorePulse {
  0%, 37.5% { transform: scale(.92); opacity: .7; }
  41%, 47.5% { transform: scale(1); opacity: 1; }
  100% { transform: scale(.96); opacity: .8; }
}

@keyframes pipelineMove {
  0%, 50% { transform: translateX(-70px); opacity: 0; }
  55%, 62.5% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(0); opacity: .65; }
}

@keyframes highlightSweep {
  0%, 75% { opacity: .45; filter: saturate(.8); }
  79%, 87.5% { opacity: 1; filter: saturate(1.2); }
  100% { opacity: .7; }
}

@keyframes orbitDrift {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scenePill {
  0%, 10% { color: var(--ag-blue-700); opacity: 1; transform: translateY(0); }
  12.5%, 100% { color: rgb(148 143 139); opacity: .42; transform: translateY(0); }
}

.demo-shell.is-reduced .scene-screen,
.demo-shell.is-reduced .scene-pill,
.demo-shell.is-reduced .demo-progress,
.demo-shell.is-reduced .score-chip,
.demo-shell.is-reduced .pipeline-dot,
.demo-shell.is-reduced .resume-highlight,
.demo-shell.is-reduced .demo-orbit {
  animation: none !important;
}

.demo-shell.is-reduced .scene-screen {
  opacity: 0;
}

.demo-shell.is-reduced .summary-screen {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .scene-screen,
  .scene-pill,
  .demo-progress,
  .score-chip,
  .pipeline-dot,
  .resume-highlight,
  .demo-orbit {
    animation: none !important;
  }

  .scene-screen { opacity: 0; }
  .summary-screen { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .scene-screen {
    left: 7%;
    min-height: 68%;
    overflow: hidden;
    padding: 18px;
    right: auto;
    top: 22%;
    width: 86%;
  }

  .summary-screen {
    inset: 18% 7%;
  }

  .opportunity-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
