/* ═══════════════════════════════════════════════
   MORPHOME — index.css  (Home page)
   ═══════════════════════════════════════════════ */

/* ── SECTION WRAPPERS ── */
.section {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 72px var(--page-pad);
}
.section-sm {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--page-pad) 72px;
}

/* ── HERO ── */
.hero {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 80px var(--page-pad) 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(53,96,240,.15);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2s infinite;
}
.hero h1 {
  font-size: 50px;
  font-weight: 500;
  line-height: 1.07;
  margin-bottom: 18px;
  color: var(--text);
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.72;
  max-width: 440px;
  margin-bottom: 32px;
  font-weight: 400;
}
.hero-ctas { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ── HERO VISUAL ── */
.hero-visual { position: relative; }
.hero-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 22px;
  display: block;
  box-shadow: 0 28px 72px rgba(10,20,40,.18);
  /* Subtle brightness lift — the hero render comes through WebP
     compression at q82 which can darken midtones a touch. 1.04 is
     visually imperceptible on uncompressed sources but recovers the
     punch we lose post-encode. */
  filter: brightness(1.04);
}
.hero-float {
  position: absolute;
  bottom: 18px; left: 18px; right: 18px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 6px 20px rgba(10,20,40,.12);
}
.float-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: #fff; font-size: 17px;
  flex-shrink: 0;
}
.float-title { font-size: 13px; font-weight: 600; margin-bottom: 1px; }
.float-sub   { font-size: 11px; color: var(--muted); }
.float-time  { margin-left: auto; font-size: 13px; color: var(--accent); font-weight: 600; }

/* ── STATS BAR ── */
.stats-bar {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  display: flex;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.stat-item {
  flex: 1;
  padding: 24px 20px;
  text-align: center;
  border-right: 1px solid var(--line);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-size: 26px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── BEFORE / AFTER ── */
.ba-wrap {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  margin-top: 36px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ba-side { position: relative; }
.ba-img  { width: 100%; height: 360px; object-fit: cover; display: block; }
.ba-tag  {
  position: absolute; top: 14px; left: 14px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(0,0,0,.52); backdrop-filter: blur(8px);
  color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .05em;
}
.ba-divider {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: #fff; font-size: 20px; font-weight: 300;
}

/* ── USE CASES ── */
.uc-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 16px;
  margin-top: 36px;
}
.uc-card {
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform .22s, box-shadow .22s;
}
.uc-card:hover { transform: translateY(-5px); box-shadow: 0 24px 56px rgba(10,20,40,.14); }
.uc-img {
  width: 100%; height: 200px; object-fit: cover; display: block;
  transition: transform .4s;
  overflow: hidden;
}
.uc-card:hover .uc-img { transform: scale(1.04); }
.uc-body  { padding: 16px 18px 18px; }
.uc-cat   { font-size: 10px; font-weight: 600; color: var(--accent); letter-spacing: .07em; text-transform: uppercase; margin-bottom: 4px; }
.uc-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.uc-desc  { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ── HOW IT WORKS ── */
.hiw-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 18px;
  margin-top: 36px;
}
.hiw-card {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 20px;
  padding: 26px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}
.hiw-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(53,96,240,.14);
  font-size: 20px;
  margin-bottom: 16px;
}
.hiw-title { font-size: 16px; font-weight: 600; margin-bottom: 7px; }
.hiw-desc  { font-size: 13px; color: var(--muted); line-height: 1.65; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .hero { gap: 40px; }
  .hero h1 { font-size: 40px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 52px; }
  .hero h1 { font-size: 34px; }
  .uc-grid { grid-template-columns: repeat(2,1fr); }
  .hiw-grid { grid-template-columns: 1fr; }
  .ba-wrap { grid-template-columns: 1fr; }
  .ba-divider { height: 44px; writing-mode: horizontal-tb; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 28px; }
  /* Stats bar adapts to narrow viewports. The default flex layout
     squeezes all five items into a single row, which on phones means
     "369K+" wraps and "100%" / "<45s" get clipped at the edges. We
     switch to a 2-column grid: items 1–4 sit in pairs, item 5 sits
     centered below them spanning both columns. Padding/font-size are
     also dialed down so the chips read comfortably in ~360px width. */
  .stats-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .stat-item {
    padding: 16px 10px;
    /* The default `border-right` divider only makes sense in a single
       row; in a 2-col grid we want a clean cell-grid look with both
       right and bottom hairlines (except the last column / last row). */
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  /* Reset borders for the right-edge column and the bottom-edge row. */
  .stat-item:nth-child(2n) { border-right: none; }
  .stat-item:nth-last-child(-n+1),
  .stat-item:nth-last-child(2):nth-child(odd) { border-bottom: none; }
  /* The 5th item is the lonely odd one out — span it across the full
     row so it doesn't sit awkwardly half-width. */
  .stat-item:nth-child(5) {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: none;
  }
  .stat-num  { font-size: 22px; }
  .stat-desc { font-size: 11px; }
}

/* ════════════════════════════════════════════════
   PRESETS section — multi-output one-click pipelines
   Sits between Before/After and Use cases on index.html.
   Visual structure mirrors .uc-card / .ba-* but with its own
   .ps-* namespace so future use-case redesigns don't drift.
   ════════════════════════════════════════════════ */

/* The hero demo: input photo + arrow + 2x2 grid of outputs.
   Three columns on desktop (input | arrow | output grid).
   Stacks vertically on mobile via media query at the bottom. */
.ps-demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr);
  gap: 28px;
  align-items: center;
  padding: 24px;
  /* margin-top matches the bottom-spacing of other sections —
     without this the section subtitle ("Curated multi-step pipelines…")
     visually sticks to the demo card. */
  margin-top: 28px;
  margin-bottom: 36px;
  background: linear-gradient(160deg, #fbfcff 0%, #f5f3ff 100%);
  border: 1px solid rgba(53, 96, 240, 0.08);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.ps-demo-input {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f0f0f5;
}
.ps-demo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ps-demo-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}

.ps-demo-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}
.ps-demo-arrow svg { display: block; }
.ps-demo-arrow-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ps-demo-output {
  position: relative;
}
.ps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.ps-grid-cell {
  position: relative;
  overflow: hidden;
  background: #f0f0f5;
}
.ps-grid-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.ps-demo:hover .ps-grid-cell img { transform: scale(1.03); }
.ps-grid-label {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* Three preset cards underneath the hero demo. Same hover lift
   as .uc-card so the page rhythm stays consistent. */
.ps-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

.ps-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.ps-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 56px rgba(10, 20, 40, .14);
  border-color: rgba(53, 96, 240, .25);
}

.ps-card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eee;
}
.ps-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.ps-card:hover .ps-card-cover img { transform: scale(1.05); }

/* Video preview inside a preset card.
   Absolute-fill the cover area so the <video> element's intrinsic
   sizing (which can leave letterbox bars on flexible parents that
   stretch beyond the video's aspect ratio — e.g. when the last
   card spans 2 columns at the 980px breakpoint) cannot peek through
   as background colour bands. The cover container has aspect-ratio
   16/10, which can be wider than 16:10 when the card spans columns;
   absolute positioning + min-width/height: 100% + object-fit: cover
   guarantees the video frame always paints over the entire box.

   No hover-scale transform on video — pixel-zoom on motion looks
   shimmery rather than premium. */
.ps-card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
  background: var(--surface);
}
/* Disable the cover-image hover-zoom on cards that contain a video. */
.ps-card--has-video:hover .ps-card-cover img,
.ps-card--has-video:hover .ps-card-video {
  transform: none;
}

.ps-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, .92);
  color: var(--accent);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}
/* Video pill — different accent so the third card visually reads as
   "this one outputs video, not 4 stills". */
.ps-card-badge.ps-badge-video {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.ps-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.ps-card-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.005em;
}
.ps-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}
.ps-card-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .02em;
  margin-top: 4px;
}

/* "Browse all presets" footer link — small, low-key. */
.ps-foot {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.ps-foot-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  transition: color .18s, background .18s;
}
.ps-foot-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Responsive: tablet — keep 2x2 demo grid but stack arrow vertically */
@media (max-width: 980px) {
  .ps-cards { grid-template-columns: 1fr 1fr; }
  .ps-cards .ps-card:last-child { grid-column: span 2; }
}

/* Mobile: stack input/arrow/output vertically */
@media (max-width: 720px) {
  .ps-demo {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .ps-demo-arrow svg { transform: rotate(90deg); }
  .ps-demo-arrow { padding: 4px 0; }
  .ps-cards { grid-template-columns: 1fr; }
  .ps-cards .ps-card:last-child { grid-column: span 1; }
  .ps-grid { aspect-ratio: 4 / 3; }
}
