/* ==========================================================================
   The Web Cafe - motion layer & layout corrections
   Loaded after the inline <style> so it overrides cleanly.
   Every effect degrades to "static but correct" without JS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. LAYOUT FIXES
   -------------------------------------------------------------------------- */

/* 1a. Pricing figures were wrapping into the "est. range" label.
       Give the number its own line, cap its size, stop the break. */
.price-card .cost {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.05;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.price-card .cost span {
  display: block;
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--slate);
  white-space: nowrap;
}

/* Four cards at 1440px leaves each ~300px. Let them breathe. */
@media (min-width: 1100px) {
  .pricing-grid {
    gap: 20px;
  }

  .price-card {
    padding: 30px 24px;
  }
}

/* 1b. Vertical rhythm. Sections were between 200px and 300px apart at random.
       One scale, applied everywhere. */
main > section {
  padding-block: clamp(72px, 9vw, 132px);
}

main > section:first-of-type {
  padding-block-start: 0;
}

.section-head {
  margin-bottom: clamp(38px, 5vw, 62px);
  max-width: 62ch;
}

hr.divider {
  margin-block: 0;
}

/* 1c. The Android cost note was slate-on-ink at 14px - below contrast minimums. */
#apps .eyebrow + p,
#apps [style*="dashed"] p {
  color: #A8B4C4 !important;
  font-size: 15px !important;
  line-height: 1.85 !important;
}

/* 1d. Footer was a single 10px hairline with nothing anchoring it. */
footer {
  padding-block: 54px 42px;
  border-top: 1px solid var(--rule-strong);
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(216, 162, 74, 0.05), transparent 62%);
}

footer .wrap,
footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: center;
  justify-content: space-between;
}

footer,
footer * {
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   2. MATERIAL - depth without frosted glass
   -------------------------------------------------------------------------- */

/* Film grain. Sits above the background, below all content. */
body::before {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: dw-grain 7s steps(6) infinite;
}

@keyframes dw-grain {

  0%,
  100% {
    transform: translate(0, 0)
  }

  20% {
    transform: translate(-3%, 2%)
  }

  40% {
    transform: translate(2%, -3%)
  }

  60% {
    transform: translate(-2%, -2%)
  }

  80% {
    transform: translate(3%, 3%)
  }
}

/* Warm vignette - pulls the eye to the centre column. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(115% 85% at 50% 32%, transparent 42%, rgba(6, 9, 15, 0.55) 100%);
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   3. SCROLL-DRIVEN REVEALS
   Native scroll timelines where supported, IntersectionObserver fallback.
   -------------------------------------------------------------------------- */

@supports (animation-timeline: view()) {
  .reveal {
    opacity: 1;
    transform: none;
    animation: dw-rise linear both;
    animation-timeline: view();
    animation-range: entry 6% cover 26%;
  }
}

@keyframes dw-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* Fallback path, driven by JS adding .in */
@supports not (animation-timeline: view()) {
  .reveal {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
    filter: blur(6px);
    transition:
      opacity .7s cubic-bezier(.22, 1, .36, 1),
      transform .7s cubic-bezier(.22, 1, .36, 1),
      filter .7s cubic-bezier(.22, 1, .36, 1);
  }

  .reveal.in {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* Children stagger in rather than arriving as a block. */
.services > *,
.port-grid > *,
.pricing-grid > *,
.process > * {
  --dw-i: 0;
  animation: dw-rise .78s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: calc(var(--dw-i) * 85ms);
}

@supports (animation-timeline: view()) {

  .services > *,
  .port-grid > *,
  .pricing-grid > *,
  .process > * {
    animation-timeline: view();
    animation-range: entry 2% cover 22%;
    animation-delay: 0s;
  }
}

/* --------------------------------------------------------------------------
   4. HERO HEADLINE - masked line wipe
   -------------------------------------------------------------------------- */

.dw-line {
  display: block;
  overflow: hidden;
}

.dw-line > span {
  display: inline-block;
  animation: dw-wipe 1.05s cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: calc(.18s + var(--dw-l, 0) * .12s);
}

@keyframes dw-wipe {
  from {
    transform: translate3d(0, 105%, 0) rotate(2.5deg);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   5. CURSOR SPOTLIGHT
   A warm light that follows the pointer across card grids.
   -------------------------------------------------------------------------- */

.dw-spot {
  position: relative;
  isolation: isolate;
}

.dw-spot::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
      rgba(216, 162, 74, 0.13), transparent 62%);
}

.dw-spot:hover::before {
  opacity: 1;
}

/* Border catches the light too. */
.dw-spot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  padding: 1px;
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
      rgba(216, 162, 74, 0.55), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.dw-spot:hover::after {
  opacity: 1;
}

.port-card,
.price-card,
.service {
  transition:
    transform .5s cubic-bezier(.22, 1, .36, 1),
    border-color .4s ease;
  will-change: transform;
}

.port-card:hover,
.price-card:hover {
  transform: translateY(-5px);
}

/* --------------------------------------------------------------------------
   6. MAGNETIC BUTTONS
   -------------------------------------------------------------------------- */

.dw-mag {
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}

.dw-mag > * {
  display: inline-block;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}

/* Sheen sweep on the primary action. */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
  transition: left .75s cubic-bezier(.22, 1, .36, 1);
}

.btn-primary:hover::after {
  left: 130%;
}

/* --------------------------------------------------------------------------
   7. HEADER - condenses on scroll
   -------------------------------------------------------------------------- */

header {
  transition: padding .45s ease, background .45s ease, border-color .45s ease;
}

header.dw-stuck {
  padding-block: 10px;
  background: rgba(14, 20, 32, .82);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--rule-strong);
}

/* Reading-progress hairline. */
#dwProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 10000;
  background: linear-gradient(90deg, var(--amber), #E9C27E);
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  #dwProgress {
    animation: dw-prog linear both;
    animation-timeline: scroll(root block);
  }

  @keyframes dw-prog {
    to {
      transform: scaleX(1);
    }
  }
}

/* --------------------------------------------------------------------------
   8. PORTFOLIO - real screenshots
   -------------------------------------------------------------------------- */

.port-shot {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--ink-2);
}

.port-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transform: scale(1.005);
  transition: transform 1.1s cubic-bezier(.22, 1, .36, 1), filter .6s ease;
  filter: saturate(.92);
}

.port-card:hover .port-shot img {
  transform: scale(1.055);
  filter: saturate(1.05);
}

.port-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(14, 20, 32, .55));
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   9. LINKS
   -------------------------------------------------------------------------- */

.view,
.nav-links a {
  position: relative;
}

.view::after,
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}

.view:hover::after,
.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

/* --------------------------------------------------------------------------
   10. VIEW TRANSITIONS
   -------------------------------------------------------------------------- */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: dw-vt-out .34s cubic-bezier(.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: dw-vt-in .46s cubic-bezier(0, 0, .2, 1) both;
}

@keyframes dw-vt-out {
  to {
    opacity: 0;
    transform: scale(.985);
  }
}

@keyframes dw-vt-in {
  from {
    opacity: 0;
    transform: scale(1.012);
  }
}

/* --------------------------------------------------------------------------
   11. REDUCED MOTION - everything above becomes static and correct
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .dw-line > span,
  .services > *,
  .port-grid > *,
  .pricing-grid > *,
  .process > * {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  body::before {
    animation: none;
  }
}

/* Touch devices: no pointer, so no spotlight or magnetism. */
@media (hover: none) {

  .dw-spot::before,
  .dw-spot::after {
    display: none;
  }

  .port-card:hover,
  .price-card:hover {
    transform: none;
  }
}

/* ==========================================================================
   12. PRICING ROW ALIGNMENT
   Cards were laying out independently, so a four-line description on one
   card pushed its price a row lower than the rest. Subgrid makes all four
   cards share the same row tracks.
   ========================================================================== */

.pricing-grid {
  align-items: stretch;
}

/* Each card contributes six rows: title, description, price, features,
   primary button, demo link. The .pop-badge is absolutely positioned and
   does not take part. */
.price-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  row-gap: 0;
  height: 100%;
}

@supports (grid-template-rows: subgrid) {
  .price-card {
    grid-row: span 6;
    grid-template-rows: subgrid;
  }
}

/* Fallback for anything without subgrid: reserve the tallest description. */
@supports not (grid-template-rows: subgrid) {
  .price-card .desc {
    min-height: 5.4em;
  }
}

/* The rule under the price belongs to the price row, so it lands at the
   same height in every card. */
.price-card .cost {
  align-self: end;
  width: 100%;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--rule-strong);
}

.price-card .desc {
  margin-bottom: 20px;
}

/* Feature list takes the flexible row, so short lists leave the space
   above the buttons rather than pulling the buttons up. */
.price-card ul {
  align-self: start;
  margin-bottom: 22px;
}

.price-card .select-pricing {
  align-self: end;
  width: 100%;
  box-sizing: border-box;
}

/* The "view plan demo" link is the sixth row in every card. */
.price-card > a:last-child {
  align-self: end;
  margin-top: 12px;
}

@media (max-width: 700px) {

  /* Single column - alignment across cards is meaningless, so release it. */
  .price-card {
    grid-row: auto;
    grid-template-rows: none;
    display: flex;
    flex-direction: column;
  }

  .price-card .desc {
    min-height: 0;
  }

  .price-card ul {
    flex: 1;
  }
}