/* Sections grow with their content at every size. A fixed height let content spill over the next section. */
html main > section.section.section:not(.hero) { height: auto; min-height: calc(var(--h, 1) * 100svh); }
html main > section.section > .wrap > .app.fill { flex: none; height: clamp(460px, 62svh, 680px); min-height: 0; }
html main > section#work.section.section, html main > section#services.section.section, html main > section#troverve.section.section { min-height: 0; padding-top: var(--s-9); padding-bottom: var(--s-9); }

html main > section.statement.statement.statement { height: auto; min-height: 0; padding-top: var(--s-10); padding-bottom: var(--s-10); }

html main > section.free.lead-hero.lead-hero.lead-hero { flex-direction: row; align-items: flex-end; }

/* Home hero: copy beside a layered scene of the four things we build */
html main > section.hero.hero--studio { position: relative; display: flex; align-items: center; height: auto; min-height: 100svh; padding: calc(var(--nav) + var(--s-7)) 0 var(--s-7); overflow: hidden; background: #01332b; }
html main > section.hero.hero--studio > .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7); align-items: center; height: auto; }
.terrain--hero { opacity: .7; }
.studio__text { display: grid; justify-items: start; gap: var(--s-4); }
.studio__text h1 { margin: 0; font-size: clamp(46px, 5.3vw, 76px); line-height: 1.02; letter-spacing: -.04em; }
.studio__text h1 span { display: block; white-space: nowrap; }
.studio__lead { margin: 0; max-width: 34em; font-size: var(--t-lead); line-height: 1.5; color: var(--ink); opacity: .86; }
.studio__text .btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }
.stage-hero { position: relative; aspect-ratio: 7 / 5.6; container-type: inline-size; }
.st { position: absolute; }
.st__in { animation: st-float 7s ease-in-out infinite; }
.st--ek { top: 0; right: 0; width: 66%; }
.st--ek .st__in { animation-delay: -2s; }
.st--tr { top: 21%; left: 0; width: 72%; }
.st--phone { bottom: 0; right: 4%; width: 21.5%; }
.st--phone .st__in { animation-delay: -4s; }
.st--card { bottom: 1%; left: 4%; width: 21%; }
.st--card .st__in { animation-delay: -1s; }
.st--pay { top: 6%; left: 8%; width: 31%; }
.st--pay .st__in { animation-delay: -5s; }
.stage-hero .browser { border-radius: 1.3cqw; }
.stage-hero .browser__bar { height: 3.6cqw; gap: 1.2cqw; padding: 0 1.4cqw; font-size: 1.5cqw; }
.stage-hero .browser__dots { gap: .5cqw; }
.stage-hero .browser__dots i { width: 1cqw; height: 1cqw; }
.stage-hero .browser__url { padding: .1cqw 1cqw; border-radius: .6cqw; }
.st__phone { aspect-ratio: 390 / 800; border-radius: 3.4cqw; overflow: hidden; border: .8cqw solid #0b1f1a; background: #fff; box-shadow: 0 24px 50px rgb(0 20 16 / .55); }
.st__phone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.st__card { display: grid; gap: .3cqw; padding: 1cqw; border-radius: 1.8cqw; background: #fff; color: #01332b; box-shadow: 0 20px 44px rgb(0 20 16 / .5); font-size: 1.65cqw; line-height: 1.25; }
.st__card img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; border-radius: 1cqw; }
.st__card b { margin-top: .5cqw; font-weight: 500; }
.st__card span { color: #3f5f56; }
.st__buy { margin-top: .5cqw; padding: .7cqw; border-radius: .9cqw; background: #01332b; color: #f7f8ef; font-style: normal; text-align: center; }
.st__pay { display: flex; align-items: center; gap: 1.1cqw; padding: 1.1cqw 1.4cqw; border-radius: 1.5cqw; background: #f7f8ef; color: #01332b; box-shadow: 0 16px 36px rgb(0 20 16 / .45); font-size: 1.75cqw; line-height: 1.25; }
.st__pay > i { flex: none; width: 3.6cqw; height: 3.6cqw; display: grid; place-items: center; border-radius: 50%; background: #01332b; color: #f7f8ef; }
.st__pay > i svg { width: 2cqw; height: 2cqw; }
.st__pay span { display: grid; }
.st__pay b { font-weight: 500; }
.st__pay small { font-size: 1.45cqw; color: #3f5f56; }
@keyframes st-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2cqw); } }
@media (prefers-reduced-motion: reduce) { .st__in { animation: none; } }

.m-rail, .rail-bar { display: none; }
.qa-list > details { padding: var(--s-4) 0; border-bottom: 1px solid color-mix(in srgb, var(--p-ink) 16%, transparent); }
.qa-list > details:first-child { padding-top: 0; }
.qa-list summary h3 { margin: 0; font: 500 var(--t-lead)/1.4 var(--font-text); letter-spacing: 0; }
.qa-list details p { margin: var(--s-2) 0 0; max-width: 64ch; }
.faq__item summary { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); list-style: none; cursor: pointer; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; flex: none; font-size: 24px; line-height: 1.1; transition: transform .25s; }
.faq__item[open] summary::after { transform: rotate(45deg); }

.mobile-cta { display: none; }

@media (max-width: 1023px) {
  html main > section.section.section:not(.hero) { min-height: 0; padding-top: var(--s-8); padding-bottom: var(--s-8); }
  html main > section.statement.statement.statement { padding-top: var(--s-9); padding-bottom: var(--s-9); }
  html main > section.free.lead-hero.lead-hero.lead-hero { min-height: 62svh; }
  html main > section.section > .wrap > .app.fill { height: auto; }
  html main > section#work.section.section, html main > section#services.section.section, html main > section#troverve.section.section { padding-top: var(--s-8); padding-bottom: var(--s-8); }


  html main > section.hero.hero--studio { min-height: 0; padding-bottom: var(--s-8); }
  html main > section.hero.hero--studio > .wrap { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .studio__text h1 { font-size: clamp(40px, 8vw, 64px); }
  .stage-hero { width: 100%; max-width: 640px; justify-self: center; }

  main section[id] { scroll-margin-top: calc(var(--nav) + 8px); }

  /* Comfortable tap targets */
  .nav__logo { min-height: 44px; }
  .hero .pill { min-height: 44px; }
  .site-footer__cols a { display: flex; align-items: center; min-height: 44px; }
  .site-footer__cols > div { gap: 0; }
  .site-footer__cols .foot-h { margin-bottom: var(--s-1); }
  .site-footer__word { min-height: 44px; }
  .who__card .link, .services-grid .link, .deck__text .link, .related__row .link, .svc__more .link, .finder .link, .proof__grid .link, .faq-free .link, .try .link { position: relative; justify-self: start; width: fit-content; }
  .who__card .link::before, .services-grid .link::before, .deck__text .link::before, .related__row .link::before, .svc__more .link::before, .finder .link::before, .proof__grid .link::before, .faq-free .link::before, .try .link::before { content: ""; position: absolute; inset: -10px -4px; }
  .chips span { padding: 12px var(--s-4); }
  .finder__again { min-height: 44px; display: inline-flex; align-items: center; }
  .process__steps button { min-height: 44px; }

  /* Project browser: tabs in a tidy grid, the whole screenshot visible */
  .app { display: block; }
  .app__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-right: 0; }
  .app__list button { min-height: 52px; padding: var(--s-2) var(--s-3); border-right: 1px solid color-mix(in srgb, var(--p-ink) 12%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--p-ink) 12%, transparent); }
  .app__open { aspect-ratio: 16 / 10; }
  .app__text { align-content: center; padding: var(--s-5); }
  .app__text h3 { font-size: 24px; }
  .app__text p { font-size: 16px; }

  /* Project deck */
  .deck__visual { height: auto; }
  .deck__visual img { height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
  .deck__built { padding: var(--s-5); }
  .deck__built ul { font-size: 20px; gap: var(--s-2); }
  .deck__stack { gap: var(--s-4); }

  /* Timeline becomes a vertical rail */
  .timeline__list { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); padding-left: var(--s-5); }
  .timeline__list::before { display: block; left: 6px; right: auto; top: 6px; bottom: 6px; width: 2px; height: auto; }
  .timeline__list li { padding-top: 0; }
  .timeline__list li::before { left: calc(-1 * var(--s-5)); top: 5px; }
}

@media (max-width: 639px) {
  html main > section.hero.hero--studio { padding-top: calc(var(--nav) + var(--s-6)); padding-bottom: var(--s-7); }
  html main > section.hero.hero--studio > .wrap { gap: var(--s-6); }
  .studio__text h1 { font-size: clamp(36px, 10.6vw, 44px); }
  .studio__text .btn-row, .studio__text .btn-row .btn { width: 100%; justify-content: center; }
  .stage-hero { aspect-ratio: 1 / .94; }
  .st--ek { width: 76%; }
  .st--tr { width: 84%; top: 25%; }
  .st--phone { width: 27%; right: 1%; }
  .st--card { width: 30%; left: 1%; }
  .st--pay { width: 50%; top: 4%; left: 0; }
  .stage-hero .browser__bar { height: 5.4cqw; font-size: 2.4cqw; }
  .stage-hero .browser__dots i { width: 1.4cqw; height: 1.4cqw; }
  .st__card { font-size: 2.6cqw; padding: 1.6cqw; }
  .st__buy { padding: 1.1cqw; }
  .st__pay { font-size: 3cqw; padding: 1.8cqw 2.2cqw; gap: 1.8cqw; }
  .st__pay small { font-size: 2.5cqw; }
  .st__pay > i { width: 6cqw; height: 6cqw; }
  .st__pay > i svg { width: 3.4cqw; height: 3.4cqw; }

  /* One tighter vertical rhythm */
  .who, .journal, .timeline, .proof, .faq-free, .finder, .lessons, .roles, .values, .svc, .deck, .try, .story, .facts { padding-top: var(--s-7) !important; padding-bottom: var(--s-7) !important; }
  html main > section.section.section:not(.hero), html main > section#work.section.section, html main > section#services.section.section, html main > section#troverve.section.section { padding-top: var(--s-7); padding-bottom: var(--s-7); }
  html main > section.statement.statement.statement { padding-top: var(--s-8); padding-bottom: var(--s-8); }
  html main > section.free.process.process.process { padding: var(--s-7) 0; }
  .contact { padding-bottom: var(--s-7) !important; }
  .section-head { margin-bottom: var(--s-5); }
  html main > section.free.lead-hero.lead-hero.lead-hero { min-height: 56svh; }
  .lead-hero .wrap { padding-top: calc(var(--nav) + var(--s-7)); padding-bottom: var(--s-6); }
  .lead-hero h1 { font-size: clamp(36px, 10.5vw, 44px); }
  .statement__line { font-size: clamp(48px, 15vw, 72px); }

  /* Header: the menu and the sticky bar carry the main action */
  .nav:not(.is-open) .nav__actions { display: none; }
  .nav:not(.is-open) .nav__bar .nav__toggle { margin-left: auto; }

  /* Cards become compact rows with the picture beside the words */
  .values__grid article { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: var(--s-4); row-gap: var(--s-1); min-height: 0; padding: var(--s-4); align-items: start; }
  .values__grid .picto { width: 40px; height: 40px; margin: 2px 0 0; grid-row: 1 / span 3; }
  .values__grid article > *:not(.picto) { grid-column: 2; margin: 0; }
  .values__grid { gap: var(--s-3); }
  .values h2 { margin-bottom: var(--s-5); }

  .facts__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
  .facts__grid > div { padding: var(--s-3); border-radius: 12px; }
  .facts__grid b { font-size: clamp(24px, 7.4vw, 30px); }
  .facts__grid span { font-size: 13px; line-height: 1.3; display: block; margin-top: var(--s-1); }

  .journal__grid { gap: 0; border-top: 1px solid color-mix(in srgb, var(--p-ink) 16%, transparent); }
  .journal__item { min-height: 56px; padding: var(--s-3) 0; align-items: center; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--p-ink) 16%, transparent); border-radius: 0; font-size: 17px; }
  .journal__item svg { margin-top: 0; }

  .gets__grid { gap: var(--s-3); }
  .gets__grid article, .roles .values__grid article { padding: var(--s-4); }

  /* Demos sized to what they show */
  .demo { height: auto; }
  .demo--code { height: 320px; }
  .code { font-size: 12px; padding: var(--s-3); }
  .store { height: 330px; }
  .store__screen { padding: var(--s-4); }
  .store__screen .store__img { height: 88px; }
  .demo--app { padding: var(--s-4) 0; }
  .minip { height: 300px; }
  .audit { height: 300px; padding: var(--s-3) var(--s-4); }
  .svc__grid, .svc--flip .svc__grid { gap: var(--s-5); }

  .stage { height: 196px; }
  .scene { padding: var(--s-4); }
  .sk--hero, .bl--hero { height: 64px; }
  .sk, .bl { height: 36px; }
  .status__text { padding: var(--s-4); }
  .brief { padding: var(--s-5); }
  .finder__card { padding: var(--s-5); min-height: 0; }
  .finder .btn-row .btn, .site-footer__cta .btn, .form .btn, .hero-cta .btn { width: 100%; justify-content: center; }
  .finder .btn-row { gap: var(--s-2); }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .try__grid { gap: var(--s-5); }
  .swipe__stack { height: 300px; }
  .proof__grid { gap: var(--s-5); }
  .faq-free__grid { gap: var(--s-4); }
  .site-footer { padding-top: var(--s-7); }
  .site-footer__cta { padding-bottom: var(--s-6); }
  .site-footer__cols { padding: var(--s-5) 0; gap: var(--s-4); }
  .site-footer__cols > div:last-child { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; column-gap: var(--s-5); }
  .site-footer__cols > div:last-child .foot-h { flex-basis: 100%; }

  /* Sticky main action */
  .mobile-cta { position: fixed; left: var(--s-3); right: var(--s-3); bottom: calc(var(--s-3) + env(safe-area-inset-bottom)); z-index: 45; display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; background: #01332b; color: #f7f8ef; font-weight: 500; text-decoration: none; box-shadow: 0 0 0 1px rgb(247 248 239 / .4), 0 10px 28px rgb(0 26 21 / .35); transform: translateY(calc(100% + 32px)); transition: transform .35s cubic-bezier(.19, 1, .22, 1); }
  .mobile-cta.is-on { transform: none; }
  .nav.is-open ~ .mobile-cta { display: none; }
}

@media (max-width: 359px) {
  .facts__grid { grid-template-columns: minmax(0, 1fr); }
  .brief__needs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process__steps b { font-size: 15px; }
}

/* Home on phones: swipe rails, bold tiles, overlapping phones */
@media (max-width: 639px) {
  html main > section.hero.hero--studio { padding-top: calc(var(--nav) + var(--s-5)); padding-bottom: var(--s-6); }
  html main > section.hero.hero--studio > .wrap { gap: var(--s-5); }
  .studio__text { gap: var(--s-3); }
  .studio__lead { font-size: 17px; }
  .studio__text .btn-row { flex-wrap: nowrap; gap: var(--s-2); }
  .studio__text .btn-row .btn { flex: 1 1 0; width: auto; min-width: 0; min-height: 48px; padding-inline: var(--s-2); white-space: nowrap; }
  .studio__text .btn--secondary { border: 1px solid rgb(247 248 239 / .35); text-decoration: none; }

  html main > section .wrap > .app.fill { display: none; }
  .m-rail, main .who .grid[data-rail] { display: flex; gap: var(--s-3); margin: var(--s-5) calc(-1 * var(--gut)) 0; padding: 0 var(--gut); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .m-rail::-webkit-scrollbar, main .who .grid[data-rail]::-webkit-scrollbar { display: none; }
  .rail-bar { display: block; height: 3px; margin-top: var(--s-4); border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--p-ink) 14%, transparent); }
  .rail-bar i { display: block; height: 100%; width: 100%; background: var(--p-ink); transform: scaleX(.25); transform-origin: left; }

  .m-slide { flex: 0 0 84%; scroll-snap-align: start; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: #01332b; color: #f7f8ef; text-decoration: none; }
  .m-slide img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: top; }
  .m-slide__word { display: flex; align-items: center; justify-content: center; aspect-ratio: 5 / 4; font-family: var(--font-display); font-weight: 500; font-size: 56px; letter-spacing: -.05em; background: #0f5044; }
  .m-slide--soft { background: #dfe5d3; color: #01332b; }
  .m-slide--soft .m-slide__word { background: #cfd9c3; }
  .m-slide__info { display: grid; gap: 2px; padding: var(--s-4); }
  .m-slide__info b { font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
  .m-slide__info span { opacity: .8; font-size: 15px; }

  main .who .who__card { flex: 0 0 76%; scroll-snap-align: start; min-height: 262px; padding: var(--s-5); border-radius: 18px; background: var(--p-surface); }
  main .who .who__card:nth-child(odd) { background: #01332b; color: #f7f8ef; --ink: #f7f8ef; }
  main .who .who__card:nth-child(odd) :is(h3, p, .link, .picto) { color: #f7f8ef; }

  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
  .services-grid .card { grid-column: auto / span 1; position: relative; min-height: 172px; padding: var(--s-4); gap: var(--s-2); border-radius: 16px; }
  .services-grid .card > p, .services-grid .tools { display: none; }
  .services-grid .card > .picto { width: 44px; height: 44px; margin: 0; }
  .services-grid .card > h3 { font-size: 18px; line-height: 1.2; margin-bottom: auto; }
  .services-grid .card .link { position: static; margin-top: var(--s-2); font-size: 14px; }
  .services-grid .card .link::before { inset: 0; }
  .services-grid .card:nth-child(1), .services-grid .card:nth-child(4) { background: #01332b; color: #f7f8ef; border-color: transparent; }
  .services-grid .card:nth-child(1) :is(h3, .link, .picto), .services-grid .card:nth-child(4) :is(h3, .link, .picto) { color: #f7f8ef; }

  #troverve .phones.phones { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; gap: var(--s-3); margin-top: var(--s-5); }
  #troverve .phones .phone { display: block; aspect-ratio: 390 / 690; border-width: 4px; border-radius: 22px; }
  #troverve .phones .phone + .phone { margin-top: var(--s-6); }

  .faq__item summary { min-height: 44px; align-items: center; }
  .faq__item summary h3 { margin: 0; }
}
