/* The site's motion: the logo's own (brand/motion/, the same keyframes and pace as the app's
   src/brand/motion.css), the splash as the page opens, the hero coming in under it, and each
   section rising into place as it scrolls into view (motion.js marks them). */
:root {
  /* As the app: every one-shot logo move runs at 65% of the brand file's time. */
  --dc-pace: 0.65;
  /* How long the splash holds before it fades; the hero comes in from here. */
  --splash-hold: 1s;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* How far things rise as they come in (none when less motion is asked for, below). */
  --rise: 22px;
  --blur: 6px;
}

/* ── The logo's keyframes (brand/motion/dynacarta-motion.css) ─────────────────────────────── */
@keyframes dc-magnet-left {
  0%   { opacity: 0; transform: translateX(-86px); }
  22%  { opacity: 1; transform: translateX(-68px); }
  52%  { opacity: 1; transform: translateX(-34px); }
  72%  { opacity: 1; transform: translateX(3px); }
  85%  { opacity: 1; transform: translateX(-1.5px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes dc-magnet-right {
  0%   { opacity: 0; transform: translateX(58px); }
  22%  { opacity: 1; transform: translateX(46px); }
  52%  { opacity: 1; transform: translateX(22px); }
  72%  { opacity: 1; transform: translateX(-2px); }
  85%  { opacity: 1; transform: translateX(1px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes dc-spark-pulse {
  0%   { opacity: 0; stroke-dashoffset: 45; }
  20%  { opacity: 1; }
  100% { opacity: 0; stroke-dashoffset: -100; }
}
@keyframes dc-draw-letter {
  0%   { opacity: 0; stroke-dashoffset: 102; }
  5%   { opacity: 1; }
  100% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes dc-nav-left {
  0%   { transform: translateX(0); }
  35%  { transform: translateX(-24px); }
  74%  { transform: translateX(3px); }
  88%  { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}
@keyframes dc-nav-right {
  0%   { transform: translateX(0); }
  35%  { transform: translateX(14px); }
  74%  { transform: translateX(-2px); }
  88%  { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

/* The reveal (brand/motion/01): the D's halves snap together, a spark runs along the seam, the
   name draws itself letter by letter (each letter's delay is on it, in index.html). */
.dc-reveal .dc-left,
.dc-reveal .dc-right,
.dc-reveal .dc-spark,
.dc-reveal .dc-letter { opacity: 0; }
.dc-reveal .dc-left { animation: dc-magnet-left calc(0.72s * var(--dc-pace)) linear forwards; }
.dc-reveal .dc-right { animation: dc-magnet-right calc(0.72s * var(--dc-pace)) linear forwards; }
.dc-reveal .dc-spark {
  stroke-dasharray: 45 155;
  stroke-dashoffset: 45;
  animation: dc-spark-pulse calc(0.36s * var(--dc-pace)) var(--ease-out) calc(0.5s * var(--dc-pace)) forwards;
}
.dc-reveal .dc-letter {
  stroke-dasharray: 102;
  stroke-dashoffset: 102;
  animation: dc-draw-letter calc(0.45s * var(--dc-pace)) var(--ease-out) forwards;
}

/* The snap on hover (brand/motion/03): the navbar's logo. */
.dc-snap-on-hover:hover .dc-left { animation: dc-nav-left calc(0.55s * var(--dc-pace)) linear; }
.dc-snap-on-hover:hover .dc-right { animation: dc-nav-right calc(0.55s * var(--dc-pace)) linear; }

/* ── The splash: the reveal over the page, then a fade. CSS alone, so it goes even without JS. ── */
@keyframes splash-out {
  to { opacity: 0; visibility: hidden; }
}
@keyframes splash-logo-out {
  to { transform: scale(1.04); }
}
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  animation: splash-out 0.35s ease var(--splash-hold) forwards;
}
.splash svg {
  width: min(220px, 56vw);
  height: auto;
  overflow: visible;
  animation: splash-logo-out 0.35s var(--ease-out) var(--splash-hold) forwards;
}

/* ── The hero, coming in as the splash fades ───────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(var(--rise)); filter: blur(var(--blur)); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes rise-window {
  from { opacity: 0; transform: translateY(calc(var(--rise) * 2)) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(calc(var(--rise) / 2)) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes flow {
  to { stroke-dashoffset: -14; }
}
@keyframes drift {
  from { transform: translate(-50%, 0) scale(1); }
  to   { transform: translate(-46%, 18px) scale(1.08); }
}

.nav { animation: fade-in 0.6s ease var(--splash-hold) both; }
.hero .badge,
.hero h1,
.hero .lead,
.hero .waitlist { animation: rise 0.9s var(--ease-out) both; }
.hero .badge { animation-delay: var(--splash-hold); }
.hero h1 { animation-delay: calc(var(--splash-hold) + 0.08s); }
.hero .lead { animation-delay: calc(var(--splash-hold) + 0.16s); }
.hero .waitlist { animation-delay: calc(var(--splash-hold) + 0.24s); }
.hero .window { animation: rise-window 1.1s var(--ease-out) calc(var(--splash-hold) + 0.34s) both; }
/* Inside the window: the projects land one by one, then the AI's steps appear in order. */
.hero .proj,
.hero .ai-box > * { animation: pop 0.6s var(--ease-out) both; }
.hero .p-web { animation-delay: calc(var(--splash-hold) + 0.7s); }
.hero .p-api { animation-delay: calc(var(--splash-hold) + 0.8s); }
.hero .p-mob { animation-delay: calc(var(--splash-hold) + 0.9s); }
.hero .p-db  { animation-delay: calc(var(--splash-hold) + 1s); }
.hero .ai-box > :nth-child(1) { animation-delay: calc(var(--splash-hold) + 1.1s); }
.hero .ai-box > :nth-child(2) { animation-delay: calc(var(--splash-hold) + 1.35s); }
.hero .ai-box > :nth-child(3) { animation-delay: calc(var(--splash-hold) + 1.6s); }
.hero .ai-box > :nth-child(4) { animation-delay: calc(var(--splash-hold) + 1.85s); }
.hero .ai-box > :nth-child(5) { animation-delay: calc(var(--splash-hold) + 2.1s); }
.hero .links { animation: fade-in 0.8s ease calc(var(--splash-hold) + 1s) both; }
/* The link the AI is working along: its dashes flow. */
.hero .links path.hot { animation: flow 1.2s linear infinite; }
/* A soft indigo light behind the window, drifting slowly. */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 280px;
  width: min(1100px, 120vw);
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  filter: blur(20px);
  transform: translate(-50%, 0);
  animation: fade-in 1.4s ease calc(var(--splash-hold) + 0.4s) both, drift 14s ease-in-out calc(var(--splash-hold) + 0.4s) infinite alternate;
}

/* ── The sections, as they scroll into view ─────────────────────────────────────────────────
   motion.js marks each part with how it comes in, then adds .in the first time it is on screen.
   Slow, eased, one after another: words rise out of a mask, pictures are uncovered and settle,
   cards tilt up into place, figures count up. Only opacity, transform and clip-path move. */
:root {
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-time: 1.3s;
  --stagger: 110ms;
}

/* Headings: each line rises out of its own mask (motion.js wraps the lines). */
.lines .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.lines .line > span {
  display: block;
  transform: translateY(110%);
  transition: transform var(--reveal-time) var(--ease-smooth);
  transition-delay: calc(var(--d, 0s) + var(--line, 0) * 120ms);
}
.lines.in .line > span { transform: none; }

/* Words and small parts: a soft rise, a little out of focus at first. */
.reveal {
  opacity: 0;
  transform: translateY(var(--rise));
  filter: blur(var(--blur));
  transition: opacity var(--reveal-time) var(--ease-smooth), transform var(--reveal-time) var(--ease-smooth), filter var(--reveal-time) var(--ease-smooth);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* Tags and eyebrows: they come in as their letters close up. */
.reveal.label { letter-spacing: 0.18em; transition-property: opacity, transform, filter, letter-spacing; }
.reveal.label.in { letter-spacing: normal; }
.eyebrow.reveal.label.in { letter-spacing: .02em; }

/* A feature's picture: its panel is uncovered from its side, then the card inside settles in. */
.uncover {
  clip-path: inset(0 0 0 100% round calc(var(--radius) + 6px));
  transition: clip-path 1.5s var(--ease-smooth);
  transition-delay: var(--d, 0s);
}
.flip .uncover { clip-path: inset(0 100% 0 0 round calc(var(--radius) + 6px)); }
.uncover.in { clip-path: inset(0 0 0 0 round calc(var(--radius) + 6px)); }
.uncover > .card {
  opacity: 0;
  transform: translateY(36px) scale(0.97);
  transition: opacity 1.2s var(--ease-smooth), transform 1.4s var(--ease-smooth);
  transition-delay: calc(var(--d, 0s) + 0.45s);
}
.uncover.in > .card { opacity: 1; transform: none; }

/* Groups: their parts come in one after another. How each kind moves: */
.stagger > * {
  opacity: 0;
  transition: opacity 1s var(--ease-smooth), transform 1.2s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
  transition-delay: calc(var(--d, 0s) + var(--i, 0) * var(--stagger));
}
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > :hover { transition-delay: 0s; }
/* …rows slide in from the left (a card's lines being filled in)… */
.rows.stagger:not(.in) > *, .ticks.stagger:not(.in) > * { transform: translateX(-18px); }
/* …the pipeline's steps arrive left to right, each a touch later… */
.pipeline.stagger:not(.in) > * { transform: translateX(-28px) scale(0.98); }
/* …cards tilt up into place, as if laid down on the table… */
.modes.stagger:not(.in) > *, .three.stagger:not(.in) > *, .prices.stagger:not(.in) > * {
  transform: perspective(900px) rotateX(18deg) translateY(40px);
}
.modes.stagger > *, .three.stagger > *, .prices.stagger > * { transform-origin: 50% 0; }
/* …and the figures' tiles rise. */
.tiles.stagger:not(.in) > * { transform: translateY(20px); }

/* A row's status on the right comes in just after its row. */
.rows.stagger > .row > :last-child { opacity: 0; transition: opacity 0.8s ease; transition-delay: calc(var(--d, 0s) + var(--i, 0) * var(--stagger) + 0.5s); }
.rows.stagger.in > .row > :last-child { opacity: 1; }
/* Ticks pop in as their row lands. */
.stagger .check.on { transform: scale(0.4); opacity: 0; transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease; transition-delay: calc(var(--d, 0s) + var(--i, 0) * var(--stagger) + 0.4s); }
.stagger.in .check.on { transform: none; opacity: 1; }
/* Once the steps are in, the one available now glows once. */
@keyframes glow-once {
  0%   { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  100% { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 14px transparent; }
}
.pipeline.stagger.in > li.now { animation: glow-once 1.4s ease-out calc(var(--d, 0s) + 1.1s) both; }

/* The errors line draws itself from left to right. */
.uncover .spark svg { clip-path: inset(0 100% 0 0); transition: clip-path 1.8s var(--ease-smooth); transition-delay: calc(var(--d, 0s) + 1s); }
.uncover.in .spark svg { clip-path: inset(0 0 0 0); }
/* The proposed diff: the removed line fades back, the added lines light up one after another. */
.uncover .diff pre .add:not(.ln) {
  background: linear-gradient(var(--add-soft), var(--add-soft)) no-repeat 0 0 / 0% 100%;
  transition: background-size 0.8s var(--ease-smooth);
  transition-delay: calc(var(--d, 0s) + 1.1s + var(--i, 0) * 180ms);
}
.uncover.in .diff pre .add:not(.ln) { background-size: 100% 100%; }
.uncover .diff pre .del:not(.ln) { transition: opacity 0.8s ease calc(var(--d, 0s) + 0.9s); opacity: 1; }
.uncover:not(.in) .diff pre .del:not(.ln) { opacity: 0.3; }
/* "Live": its dot breathes. */
@keyframes breathe { 50% { opacity: 0.35; } }
.status.live::before { display: inline-block; animation: breathe 2.4s ease-in-out infinite; }

/* ── Small touches ────────────────────────────────────────────────────────────────────────── */
/* The nav gets its line once the page moves under it. */
.nav { transition: border-color 0.4s ease; }
.nav.scrolled { border-bottom-color: var(--line); }
/* Cards lift a little when pointed at. */
:where(.pipeline li, .mode, .opt, .price, .card) {
  transition: transform 0.45s var(--ease-smooth), box-shadow 0.45s var(--ease-smooth);
}
.pipeline li:hover, .mode:hover, .opt:hover, .price:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}
.opt.featured:hover, .price.featured:hover, .pipeline li.now:hover {
  box-shadow: inset 0 0 0 1.5px var(--accent), var(--shadow-soft);
}
/* Switching light and dark crossfades the page (where the browser can). */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; animation-timing-function: ease; }

/* Asked for less motion: as in the app, the brief one-time entrances still play (the splash, the
   hover snap, the sections coming in), but smaller: no blur, no tilt, half the distance. What
   repeats or drifts (the glow, the flowing link, the breathing dot) stays still. */
@media (prefers-reduced-motion: reduce) {
  :root { --rise: 11px; --blur: 0px; }
  .modes.stagger:not(.in) > *, .three.stagger:not(.in) > *, .prices.stagger:not(.in) > * { transform: translateY(20px); }
  .hero::before { animation: fade-in 1.4s ease calc(var(--splash-hold) + 0.4s) both; }
  .hero .links path.hot, .status.live::before { animation: none; }
  .pipeline li:hover, .mode:hover, .opt:hover, .price:hover { transform: none; }
}
