/* ==========================================================================
   Page-specific layouts
   ========================================================================== */

/* ---------- Page hero (shared by Home, Apps, About, Contact, App detail) ---------- */

.hero {
  position: relative;
  background: var(--sun);
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5.5rem) clamp(3.5rem, 2rem + 6vw, 7.5rem);
  overflow: hidden;
}
.hero__grid { display: grid; gap: clamp(2.5rem, 2rem + 3vw, 4rem); align-items: center; }
.hero__copy { display: grid; gap: var(--s-5); justify-items: start; }
.hero__copy h1 { max-width: 12.5ch; }
.hero .btn-row { margin-top: var(--s-2); }

@media (min-width: 64em) {
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

/* Short page hero (Apps, About, Contact) */
.page-hero {
  background: var(--sun);
  padding-block: clamp(2.5rem, 2rem + 3vw, 5rem) clamp(3rem, 2rem + 4vw, 5.5rem);
  border-bottom: 1px solid var(--line-strong);
}
.page-hero .container { display: grid; gap: var(--s-5); }
.page-hero h1 { max-width: 14ch; }

/* ---------- Hero stage: a storefront with the app's widgets on it ---------- */

.stage { position: relative; isolation: isolate; }
.stage__scene {
  position: relative;
  padding: clamp(1.5rem, 1rem + 3vw, 3rem) clamp(0.5rem, 0rem + 3vw, 3rem) clamp(4.5rem, 3.5rem + 3vw, 6rem);
}
.stage__scene::before {
  /* butter blob behind the store window */
  content: "";
  position: absolute;
  inset: 8% 0 4% 10%;
  border-radius: 48% 52% 44% 56% / 52% 44% 56% 48%;
  background: var(--butter);
  z-index: -1;
}

.store {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  max-width: 30rem;
  margin-inline: auto;
}
@media (min-width: 64em) {
  .store { max-width: 34rem; }
  .stage .mock { font-size: 0.9375rem; }
  .stage .mock-popup { width: 350px; }
}
.store__chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #f0ecd2;
}
.store__chrome i { width: 9px; height: 9px; border-radius: 50%; background: #e6e1c3; }
.store__chrome span {
  margin-left: 0.6rem;
  flex: 1;
  height: 20px;
  border-radius: var(--r-pill);
  background: #f7f4e2;
}
.store__body { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem; }
.store__image {
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  background: var(--sun);
  display: grid;
  place-items: center;
}
.store__image svg { width: 64%; height: auto; }
.store__info { display: grid; gap: 0.55rem; align-content: start; padding-top: 0.4rem; }
.store__line { height: 10px; border-radius: var(--r-pill); background: #efebd3; }
.store__line--80 { width: 80%; }
.store__line--70 { width: 70%; }
.store__line--60 { width: 60%; }
.store__title { font-stretch: var(--stretch-heading); font-weight: 780; font-size: 1.125rem; line-height: 1.15; }
.store__price { font-weight: 650; color: var(--ink-2); font-size: 0.9375rem; }
.store__cta {
  margin-top: 0.3rem;
  padding: 0.6rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.8125rem;
  font-weight: 650;
  text-align: center;
}

.stage .mock { position: absolute; }
.stage__sold { top: 0.25rem; right: 0; background: var(--card); }
.stage__stock { top: 46%; right: -0.25rem; }
.stage__popup { left: 0; bottom: 0; }

@media (max-width: 30em) {
  .stage__stock { display: none; }
  .stage__sold { right: 0.25rem; }
}

.stage__caption {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: var(--s-4);
  font-size: var(--text-xs);
  color: var(--ink-2);
}
.stage__pause {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card);
}
.stage__pause svg { width: 12px; height: 12px; }
.stage__pause[aria-pressed="true"] .icon-pause,
.stage__pause[aria-pressed="false"] .icon-play { display: none; }

/* The one orchestrated motion: the sales popup cycles like the real widget */
.stage__popup { transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
.stage__popup.is-out { opacity: 0; transform: translateY(14px) scale(0.98); }

/* ---------- Home: featured app band ---------- */

.featured-intro { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-5); }

/* ---------- Home: approach ---------- */

.approach { display: grid; gap: var(--s-7); }
@media (min-width: 64em) {
  .approach { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s-9); align-items: start; }
  .approach .section-head { position: sticky; top: calc(var(--header-h) + 2rem); margin-bottom: 0; }
}
.approach-list { display: grid; gap: 0; padding: 0; list-style: none; border-top: 1.5px solid var(--ink); }
.approach-list li {
  display: grid;
  gap: var(--s-2);
  padding-block: var(--s-6);
  border-bottom: 1px solid var(--line-strong);
}
.approach-list h3 {
  font-stretch: var(--stretch-display);
  font-weight: 820;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  line-height: 0.95;
}
.approach-list p { color: var(--ink-2); max-width: 50ch; font-size: var(--text-lg); line-height: 1.5; }

/* ---------- CTA band ---------- */

.cta-band {
  display: grid;
  gap: var(--s-6);
  padding: clamp(2rem, 1.5rem + 3vw, 4.5rem);
  border-radius: var(--r-xl);
  background: var(--sun);
  border: 1.5px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
}
.cta-band h2 { max-width: 14ch; }
.cta-band p { color: var(--ink-2); font-size: var(--text-lg); max-width: 46ch; }
@media (min-width: 64em) {
  .cta-band { grid-template-columns: minmax(0, 1.3fr) auto; align-items: end; }
}

/* ---------- Apps page ---------- */

.apps-list { display: grid; gap: var(--s-6); }
.roadmap-note {
  display: grid;
  gap: var(--s-3);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border-radius: var(--r-xl);
  border: 1.5px dashed var(--line-strong);
  background: transparent;
}
.roadmap-note { margin-top: var(--s-6); }
.roadmap-note p { color: var(--ink-2); max-width: 60ch; }
.figure-note { margin-top: var(--s-5); }

/* ---------- App detail ---------- */

.app-hero__name { display: flex; align-items: center; gap: var(--s-4); }
.app-hero__icon { width: 64px; height: 64px; border-radius: 18px; box-shadow: var(--shadow-2); flex: none; }
.app-hero h1 { max-width: 12ch; }

.module-grid { display: grid; gap: var(--s-4); }
@media (min-width: 40em) { .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72em) { .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.module {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.module__preview {
  display: grid;
  place-items: center;
  min-height: 9.5rem;
  padding: var(--s-5);
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.module__preview .mock { box-shadow: var(--shadow-2); }
.module__body { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-5); }
.module__body h3 { font-stretch: var(--stretch-heading); font-size: var(--text-xl); font-weight: 780; }
.module__body p { color: var(--ink-2); font-size: var(--text-sm); line-height: 1.55; }
.module--lead { border: 1.5px solid var(--ink); grid-column: 1 / -1; }
.module--lead .module__preview { background: var(--sun); min-height: 12rem; }
@media (min-width: 48em) {
  .module--lead { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .module--lead .module__preview { border-bottom: 0; border-right: 1px solid var(--line); }
  .module--lead .module__body { align-content: center; padding: var(--s-6); }
  .module--lead .module__body h3 { font-size: var(--display-3); font-stretch: var(--stretch-display); font-weight: 820; line-height: 0.95; }
  .module--lead .module__body p { font-size: var(--text-md); }
}

.steps { display: grid; gap: var(--s-5); padding: 0; list-style: none; counter-reset: step; }
@media (min-width: 64em) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps li {
  counter-increment: step;
  display: grid;
  gap: var(--s-3);
  align-content: start;
  padding-top: var(--s-5);
  border-top: 1.5px solid var(--ink);
}
.steps li::before {
  content: counter(step);
  font-stretch: var(--stretch-display);
  font-weight: 820;
  font-size: 3.5rem;
  line-height: 0.85;
}
.steps h3 { font-size: var(--text-lg); font-weight: 720; }
.steps p { color: var(--ink-2); font-size: var(--text-sm); }

.benefits { display: grid; gap: var(--s-4); }
@media (min-width: 48em) { .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.benefit { display: grid; gap: var(--s-2); padding: var(--s-5) 0; border-top: 1px solid var(--line-strong); }
.benefit h3 { font-stretch: var(--stretch-heading); font-size: var(--text-xl); font-weight: 780; }
.benefit p { color: var(--ink-2); }

.split { display: grid; gap: var(--s-7); }
@media (min-width: 64em) { .split { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-9); align-items: start; } }

.support-grid { display: grid; gap: var(--s-4); }
@media (min-width: 48em) { .support-grid { grid-template-columns: 1.2fr 1fr; } }
.support-card { display: grid; gap: var(--s-3); align-content: start; }
.support-card .email-inline { font-stretch: var(--stretch-heading); font-weight: 780; font-size: var(--text-xl); color: var(--ink); }
.doc-links { display: grid; gap: var(--s-2); padding: 0; list-style: none; }
.doc-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 52px;
  padding: 0 var(--s-4);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--cream);
  font-weight: 650;
  text-decoration: none;
}
.doc-links a:hover { border-color: var(--ink); }
.doc-links svg { width: 18px; height: 18px; flex: none; }

/* ---------- About ---------- */

.about-intro {
  font-stretch: var(--stretch-heading);
  font-weight: 650;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem);
  line-height: 1.2;
  max-width: 30ch;
  letter-spacing: -0.01em;
}
.prose { max-width: var(--measure); color: var(--ink-2); font-size: var(--text-lg); line-height: 1.6; }
.prose p + p { margin-top: var(--s-4); }

.principles { display: grid; gap: 0; padding: 0; list-style: none; }
.principles li {
  display: grid;
  gap: var(--s-2);
  padding-block: var(--s-5);
  border-top: 1px solid var(--line-strong);
}
@media (min-width: 48em) {
  .principles li { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s-6); }
}
.principles h3 { font-stretch: var(--stretch-heading); font-size: var(--text-xl); font-weight: 780; }
.principles p { color: var(--ink-2); }

/* ---------- Contact ---------- */

.contact-topics { display: grid; gap: var(--s-4); }
@media (min-width: 64em) { .contact-topics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.contact-topic { display: grid; gap: var(--s-3); align-content: start; }
.contact-topic h2 { font-stretch: var(--stretch-heading); font-size: var(--text-xl); font-weight: 780; }
.contact-topic p, .contact-topic li { color: var(--ink-2); }
.contact-topic ul { display: grid; gap: var(--s-2); padding-left: 1.1rem; font-size: var(--text-sm); }

/* ---------- 404 ---------- */

.not-found { display: grid; gap: var(--s-5); justify-items: start; padding-block: var(--section-y); }
.not-found h1 { max-width: 12ch; }

/* ---------- Home hero: app portfolio panel (rendered from js/apps-data.js) ---------- */

.shelf {
  position: relative;
  isolation: isolate;
  padding: 3.25rem 0 4.25rem;
}
.shelf::before {
  content: "";
  position: absolute;
  inset: 6% -2% 2% 12%;
  border-radius: 48% 52% 44% 56% / 52% 44% 56% 48%;
  background: var(--butter);
  z-index: -1;
}
.shelf__window {
  max-width: 32rem;
  margin-inline: auto;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.shelf__bar { display: flex; align-items: center; gap: 6px; padding: 0.7rem 0.9rem; border-bottom: 1px solid #f0ecd2; }
.shelf__bar i { width: 9px; height: 9px; border-radius: 50%; background: #e6e1c3; }
.shelf__bar span { margin-left: 0.6rem; flex: 1; height: 20px; border-radius: var(--r-pill); background: #f7f4e2; }
.shelf__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 1.25rem 1.25rem 0.5rem;
}
.shelf__title { font-stretch: var(--stretch-heading); font-weight: 800; font-size: 1.5rem; line-height: 1.1; }
.shelf__count { font-size: var(--text-xs); font-weight: 650; color: var(--ink-3); }
.shelf__list { display: grid; gap: 0.25rem; padding: 0.5rem 0.5rem 0.75rem; list-style: none; }
.shelf__item {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  transition: background-color var(--dur-1) var(--ease);
}
.shelf__item:not(.is-soon):hover { background: var(--cream); }
.shelf__icon { width: 52px; height: 52px; border-radius: 14px; }
.shelf__ghost { width: 52px; height: 52px; border-radius: 14px; border: 1.5px dashed var(--line-strong); background: var(--cream); }
.shelf__text { display: grid; gap: 0.1rem; min-width: 0; }
.shelf__name { font-weight: 700; line-height: 1.25; color: var(--ink); text-decoration: none; }
a.shelf__name::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
a.shelf__name:focus-visible { outline: none; box-shadow: none; }
a.shelf__name:focus-visible::after { outline: 3px solid var(--ink); outline-offset: 2px; }
.shelf__desc { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.35; }
.is-soon .shelf__name { color: var(--ink-3); font-weight: 650; }
.shelf__go { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--leaf); color: var(--ink); }
.shelf__go svg { width: 16px; height: 16px; }

.shelf .shelf__pill { position: absolute; max-width: calc(100% - 1rem); background: var(--card); font-size: var(--text-sm); }
.shelf__pill--a { top: 0.5rem; right: 0; }
.shelf__pill--b { bottom: 0.75rem; left: 0; }
.shelf__pill svg { width: 18px; height: 18px; }
@media (min-width: 64em) {
  .shelf__pill--a { right: -0.5rem; }
  .shelf__pill--b { left: -0.5rem; }
}
