/* ==========================================================================
   UrbOvan home: nursery row, promises, scroll-linked leaves and the
   auto-scrolling app screens inside the phone mockup.
   ========================================================================== */

/* ---------- Nurseries: partner nursery + partner-with-us card ---------- */
.nursery-grid.two { grid-template-columns: 1.7fr 1fr; }
.nursery-grid.two .media { aspect-ratio: 16 / 8; }
.nursery-grid.two .nursery-card:last-child .media { aspect-ratio: auto; height: 100%; max-height: 260px; }
.nursery-card .desc { grid-column: 1; margin-top: 4px; font-size: .88rem; color: var(--muted); max-width: 52ch; }

/* ---------- Leaves follow the scroll (transform set from JS) ---------- */
.leaf-deco[data-rot] { will-change: transform; transition: transform .25s linear; }

/* ---------- Promises ---------- */
.promises { display: grid; gap: 14px; }
.promise { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.promise .ic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--sage); color: var(--forest); }
.promise h3 { font-family: var(--font-body); font-size: 1rem; margin-bottom: 4px; }
.promise p { font-size: .9rem; color: var(--muted); }

/* ---------- App screens inside the phone ---------- */
.phone .screen { background: #f7f4ec; }
.phone .notch { z-index: 5; }
.screens { position: absolute; inset: 0; transition: transform .9s cubic-bezier(.65, 0, .35, 1); }
.app-screen { height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 40px 12px 16px; background: #f7f4ec; overflow: hidden; }
.as-bar b { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--forest-deep); line-height: 1.2; }
.as-bar small { font-size: .7rem; color: var(--muted); }

.sun-photo { position: relative; height: 210px; border-radius: 16px; overflow: hidden; flex: none; }
.sun-photo img { width: 100%; height: 100%; object-fit: cover; }
.sun-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .25), transparent 55%); }
.sun-arc { position: absolute; left: 6%; right: 6%; top: 10px; z-index: 1; width: 88%; height: auto; overflow: visible; filter: drop-shadow(0 0 6px rgba(246, 195, 74, .8)); }
.sun-photo .tag { position: absolute; bottom: 8px; z-index: 1; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .9); font-size: .62rem; font-weight: 700; color: var(--forest-deep); }
.sun-photo .tag.e { left: 8px; }
.sun-photo .tag.w { right: 8px; }
.as-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.as-tiles div { padding: 8px 6px; border-radius: 12px; background: #fff; text-align: center; box-shadow: var(--shadow-sm); }
.as-tiles small { display: block; font-size: .6rem; color: var(--muted); }
.as-tiles b { font-size: .82rem; color: var(--forest-deep); }
.as-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 12px; background: #fff6e2; font-size: .7rem; line-height: 1.35; color: var(--ink); }
.as-note .icon { flex: none; width: 18px; height: 18px; color: #c88a12; }

.wipe { position: relative; height: 250px; flex: none; border-radius: 16px; overflow: hidden; }
.wipe img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wipe .after { clip-path: inset(0 0 0 100%); }
.wipe .handle { position: absolute; top: 0; bottom: 0; left: 100%; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, .35); }
.wipe .handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-md); }
.app-screen.active .wipe .after { animation: wipe-clip 3.2s .3s ease-in-out forwards; }
.app-screen.active .wipe .handle { animation: wipe-handle 3.2s .3s ease-in-out forwards; }
@keyframes wipe-clip { 0% { clip-path: inset(0 0 0 100%); } 70%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes wipe-handle { 0% { left: 100%; opacity: 1; } 70% { left: 0%; opacity: 1; } 100% { left: 0%; opacity: 0; } }
.wipe .lbl { position: absolute; top: 8px; z-index: 1; padding: 3px 9px; border-radius: 999px; font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wipe .lbl.b { left: 8px; background: rgba(255, 255, 255, .92); color: var(--ink); }
.wipe .lbl.a { right: 8px; background: var(--forest); color: #fff; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.as-chips span { padding: 4px 10px; border-radius: 999px; background: var(--sage); color: var(--forest-deep); font-size: .68rem; font-weight: 600; }
.as-btn { display: block; margin-top: auto; padding: 11px; border-radius: 12px; background: var(--clay); color: #fff; text-align: center; font-size: .78rem; font-weight: 700; }

.as-hero { height: 130px; flex: none; border-radius: 16px; overflow: hidden; }
.as-hero img { width: 100%; height: 100%; object-fit: cover; }
.as-plants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.as-plants figure { margin: 0; padding: 6px 4px 6px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); text-align: center; }
.as-plants img { width: 100%; height: 62px; object-fit: contain; mix-blend-mode: multiply; }
.as-plants figcaption { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: .6rem; font-weight: 600; color: var(--ink); }
.as-plants i { width: 6px; height: 6px; border-radius: 50%; background: #43a047; }
.as-plants i.warn { background: #f0a020; }
.as-task { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); font-size: .66rem; color: var(--muted); }
.as-task .icon { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: #e3f0fb; color: #2f7fc1; flex: none; }
.as-task b { display: block; font-size: .74rem; color: var(--ink); }
.as-task span { flex: 1; }
.as-task em { font-style: normal; padding: 4px 8px; border-radius: 8px; background: var(--sage); color: var(--forest); font-weight: 700; }

.earth { height: 150px; flex: none; border-radius: 16px; overflow: hidden; }
.earth img { width: 100%; height: 100%; object-fit: cover; }
.as-impact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.as-impact div { padding: 8px 4px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); text-align: center; }
.as-impact b { display: block; font-family: var(--font-display); font-size: .95rem; color: var(--forest-deep); }
.as-impact small { font-size: .56rem; color: var(--muted); line-height: 1.2; display: block; }
.as-score { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); font-size: .66rem; color: var(--muted); }
.as-score > span:last-child b { display: block; font-size: .78rem; color: var(--ink); }
.ring { position: relative; display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: conic-gradient(var(--forest) calc(var(--p) * 1%), #e6e0d2 0); }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.ring b { position: relative; font-size: .8rem; color: var(--forest-deep); }

.screen-dots { position: absolute; right: 6px; top: 50%; z-index: 4; display: grid; gap: 5px; transform: translateY(-50%); }
.screen-dots i { width: 5px; height: 5px; border-radius: 3px; background: rgba(30, 70, 52, .25); transition: height .3s, background-color .3s; }
.screen-dots i.on { height: 16px; background: var(--forest); }

/* feature list doubles as screen selector */
.app-feats button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 6px 12px 6px 6px; border: 1px solid transparent; border-radius: 999px;
  background: none; font-size: .95rem; color: var(--ink); text-align: left; transition: background-color .3s, border-color .3s;
}
.app-feats button:hover { background: rgba(255, 255, 255, .6); }
.app-feats button[aria-current="true"] { background: #fff; border-color: var(--line); box-shadow: var(--shadow-sm); font-weight: 600; }
.app-feats button[aria-current="true"] .ic { background: var(--forest); color: #fff; border-color: var(--forest); }
.app-feats .ic { transition: background-color .3s, color .3s; }

@media (max-width: 1100px) {
  .nursery-grid.two { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .nursery-grid.two { grid-template-columns: 1fr; }
  .nursery-grid.two .nursery-card:last-child .media { height: auto; aspect-ratio: 16 / 9; }
  .sun-photo { height: 180px; }
  .wipe { height: 210px; }
  .as-hero { height: 100px; }
  .earth { height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .screens { transition: none; }
  .app-screen.active .wipe .after { animation: none; clip-path: inset(0 0 0 50%); }
  .app-screen.active .wipe .handle { animation: none; left: 50%; }
  .leaf-deco[data-rot] { transition: none; }
}

/* phones: keep smaller drifting leaves peeking in from the edges */
@media (max-width: 860px) {
  .leaf-deco[data-rot] { display: block; width: 120px !important; opacity: .9; }
  .leaf-deco[data-rot][style*="left"] { left: -46px !important; }
  .leaf-deco[data-rot][style*="right"] { right: -46px !important; }
  .phone-wrap .leaf-deco[data-rot] { width: 150px !important; }
}
@media (max-width: 860px) {
  #services > .leaf-deco[data-rot] { top: -70px !important; }
  .h3-section > .leaf-deco[data-rot] { z-index: 0; opacity: .85; }
}

/* never allow sideways scrolling: decorations are clipped at the screen edge */
html, body { overflow-x: clip; }
.h3-section, .h3-hero { overflow-x: clip; }

/* ---------- Home: phone layout ---------- */
@media (max-width: 560px) {
  .h3-section { padding: 48px 0; }
  .h3-head { margin-bottom: 20px; }
  .h3-head h2 { font-size: 1.65rem; }
  .svc4 { gap: 16px; }
  .svc4-card .media { aspect-ratio: 16 / 9; }
  .svc4-card .body { padding: 30px 16px 16px; }
  .nursery-grid.two .media { aspect-ratio: 16 / 9; }
  .space-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .space-tile { aspect-ratio: 1 / 1; }
  .space-tile figcaption { font-size: .72rem; padding: 4px 8px; }
  .phone-wrap { padding: 10px 0; }
  .app-feats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .app-feats button { flex-direction: column; gap: 6px; padding: 10px 6px; border-radius: 16px; font-size: .82rem; text-align: center; line-height: 1.25; }
  .app-feats .ic { width: 40px; height: 40px; }
  .how3-steps { gap: 24px 8px; }
  .how3-ring { width: 80px; height: 80px; }
  .how3-ring .icon { width: 30px; height: 30px; }
  .promise { padding: 16px; }
  .cta-band .container { min-height: 0; padding-top: 40px; padding-bottom: 40px; }
}
@media (max-width: 560px) {
  /* section leaves sit in the top corner, away from headings and text */
  .h3-section > .leaf-deco[data-rot] { top: -48px !important; bottom: auto !important; width: 92px !important; }
  .h3-section > .leaf-deco[data-rot][style*="left"] { left: -40px !important; }
  .h3-section > .leaf-deco[data-rot][style*="right"] { right: -40px !important; }
}

/* nursery row: equal photo heights and equal card heights on desktop/tablet */
.nursery-grid.two { align-items: stretch; }
.nursery-grid.two .media,
.nursery-grid.two .nursery-card:last-child .media { aspect-ratio: auto; height: 300px; max-height: none; }
.nursery-grid.two .body { flex: 1; align-content: start; }
@media (max-width: 560px) {
  .nursery-grid.two .media,
  .nursery-grid.two .nursery-card:last-child .media { height: 200px; }
}

/* app store buttons: Play Store live, App Store coming soon */
.store.live { transition: transform .2s var(--ease), box-shadow .2s; }
.store.live:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.store.soon { background: #fff; color: var(--muted); border: 1px dashed var(--line-strong); cursor: default; }
.store.soon b { color: var(--ink); }

/* ---------- Climbing vine (Services section, left edge) ---------- */
.climber { position: absolute; left: 0; top: 0; bottom: 0; z-index: 0; pointer-events: none; }
.climber svg { display: block; overflow: visible; }
.cl-stem { fill: none; stroke: #4f7f35; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dashoffset .18s linear; }
.cl-rib { fill: none; stroke: rgba(235, 245, 220, .45); stroke-width: 1; stroke-linecap: round; }
.cl-grow { transform: scale(0); transform-box: fill-box; transform-origin: 0% 50%; transition: transform .55s cubic-bezier(.3, 1.45, .55, 1); }
.cl-grow.on { transform: scale(1); }
.cl-tip .cl-grow { transition-duration: .3s; }
@media (prefers-reduced-motion: reduce) { .cl-stem, .cl-grow { transition: none; } }
@media (max-width: 760px) {
  /* the climbing vine is a desktop/tablet detail only */
  .climber { display: none; }
}

.cl-stem-shade { stroke: #3d6a2a; }
.cl-stem-light { stroke: #8cb85a; opacity: .85; }
.climber image { filter: drop-shadow(0 3px 4px rgba(30, 50, 25, .22)); }

.store.soon small { opacity: 1; color: #4f5a52; }

/* ---------- Hero: sunlight with moving leaf shadows + hanging vines ---------- */
.h3-hero .hero-sun {
  position: absolute; left: 0; top: 0; bottom: 0; width: 60%; z-index: 0; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 92%); mask-image: linear-gradient(90deg, #000 45%, transparent 92%);
}
.h3-hero .hero-sun::before { /* warm sunlight pooling from the top-left */
  content: ""; position: absolute; inset: -20% 0 0 -20%;
  background: radial-gradient(ellipse 70% 60% at 18% 8%, rgba(255, 214, 140, .38), rgba(255, 214, 140, 0) 70%);
  animation: sun-breathe 11s ease-in-out infinite alternate;
}
.h3-hero .hero-shadow {
  position: absolute; left: -6%; top: -8%; height: 118%; width: auto; max-width: none; opacity: .85;
  transform-origin: 0 0; animation: leaf-breeze 9s ease-in-out infinite alternate;
}
@keyframes leaf-breeze {
  0% { transform: rotate(-1.2deg) translate(0, 0); }
  45% { transform: rotate(.5deg) translate(8px, 5px); }
  100% { transform: rotate(1.6deg) translate(-5px, 10px); }
}
@keyframes sun-breathe { from { opacity: .75; } to { opacity: 1; } }
.h3-hero .hero-vines { position: absolute; left: 0; top: 0; bottom: 0; z-index: 0; pointer-events: none; }
.h3-hero .hero-vines svg { display: block; overflow: visible; }
.hero-vines .hv { animation: vine-sway var(--sway-dur, 6s) ease-in-out var(--sway-delay, 0s) infinite alternate; }
@keyframes vine-sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
@media (max-width: 1100px) { .h3-hero .hero-vines { display: none; } }
@media (max-width: 860px) { .h3-hero .hero-sun { display: none; } }
@media (prefers-reduced-motion: reduce) { .h3-hero .hero-shadow, .h3-hero .hero-sun::before, .hero-vines .hv { animation: none; } }

/* ---------- Full-page climber (left side of the home page) ---------- */
.page-vine { position: absolute; left: 0; z-index: 3; pointer-events: none; }
.page-vine svg { display: block; overflow: visible; }
.page-vine .pv-twin { opacity: .9; }
.page-vine .pv-young image { filter: saturate(1.15) brightness(1.18) hue-rotate(-8deg); }
.page-vine .pv-tendril { fill: none; stroke: #6f9a45; stroke-width: 1.3; stroke-linecap: round; opacity: 0; transition: opacity .6s ease; }
.page-vine .pv-tendril.on { opacity: .9; }
.page-vine .pv-bloom { transform: scale(0) rotate(-35deg); transform-box: fill-box; transform-origin: 50% 50%; transition: transform .9s cubic-bezier(.3, 1.5, .5, 1); }
.page-vine .pv-bloom.on { transform: scale(1) rotate(0); }
.page-vine image { filter: drop-shadow(0 3px 4px rgba(30, 50, 25, .2)); }
@media (max-width: 1100px) { .page-vine { display: none; } }
@media (prefers-reduced-motion: reduce) { .page-vine .pv-bloom, .page-vine .pv-tendril { transition: none; } }

/* Hero fills exactly the first screen below the sticky header on desktops and laptops */
@media (min-width: 861px) {
  .h3-hero { min-height: calc(100vh - 73px); min-height: calc(100svh - 73px); height: calc(100svh - 73px); max-height: none; }
  .h3-hero .copy { padding-top: 24px; padding-bottom: 24px; }
}
@media (min-width: 861px) and (max-height: 640px) {
  .h3-hero { height: auto; min-height: 560px; } /* very short windows: never squash the headline */
}
