/* ZenApps website. Layout and components from the "ZenApps website" Penpot file (Website + Web Components pages). */

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* scrollbar-gutter: keep the layout from jumping sideways between short pages (no scrollbar) and long ones */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--space-6); scrollbar-gutter: stable; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background-app);
  color: var(--text-primary);
  font-family: var(--font-family-ui);
  font-size: 17px;
  line-height: 1.529;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }

h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; }

a { color: inherit; text-decoration: none; }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-default);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: calc(var(--size-web-content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  --gutter: var(--space-4);
}
@media (min-width: 640px) { .container { --gutter: var(--space-6); } }

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--accent-default);
  color: var(--text-on-accent);
  font-weight: 600;
  z-index: 10;
}
.skip-link:focus { top: var(--space-4); }

.icon { width: var(--size-icon); height: var(--size-icon); flex: none; }

/* Inline SVG sprite at the top of each page (symbols only, nothing to render). */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Type (core type.* tokens + web set) ---------- */

.eyebrow {            /* type.overline */
  font-size: 12px;
  font-weight: 700;
  line-height: 1.333;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-default);
}
.eyebrow--muted { color: var(--text-tertiary); }

.page-title {         /* type.display -> type.web.h1 */
  font-family: var(--font-family-display);
  font-size: clamp(36px, 28px + 1.6vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.6px;
}

.lead {               /* type.body-l -> type.web.lead */
  font-size: clamp(17px, 15.5px + 0.4vw, 20px);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ---------- Site header ---------- */

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 52px;
  padding-block: var(--space-3);
}
@media (min-width: 640px) { .site-header .container { min-height: 70px; padding-block: var(--space-5); } }

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2-5, 10px);
  font-family: var(--font-family-display);
  font-size: 22px;     /* type.brand-name */
  font-weight: 700;
  line-height: 1.222;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}
.brand svg { width: 31px; height: 28px; }
@media (min-width: 640px) { .brand svg { width: 33px; height: 30px; } }

.site-nav ul { display: flex; gap: var(--space-5); }
@media (min-width: 640px) { .site-nav ul { gap: var(--space-8); } }
.site-nav a {
  font-size: 16px;     /* type.label */
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-secondary);
  transition: color 120ms ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text-primary); }

/* ---------- Site footer ---------- */

.site-footer { border-top: var(--border-width-thin) solid var(--border-subtle); }
.site-footer .container {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-5);
  padding-block: var(--space-8);
}
@media (min-width: 640px) {
  .site-footer .container { flex-direction: row; align-items: center; justify-content: space-between; }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2-5, 10px);
  font-size: 13px;     /* type.caption */
  font-weight: 500;
  color: var(--text-tertiary);
}
.footer-brand svg { width: 26px; height: 24px; }
.footer-links { display: flex; gap: var(--space-6); }
.footer-links a {
  font-size: 15px;     /* type.body-m */
  color: var(--text-secondary);
}
.footer-links a:hover { color: var(--text-primary); }

/* ---------- Landing: hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-12) var(--space-10);
  text-align: center;
}
@media (min-width: 640px) { .hero { gap: var(--space-5); padding-block: 96px 72px; } }

.hero-mark { width: 97px; height: 88px; overflow: visible; }
@media (min-width: 640px) { .hero-mark { width: 132px; height: 120px; } }

/*
 * Breathing Bloom: the splash "loop" from the apps (zenappsassets, *-splash-animation.html).
 * 2.8 s sine: side petals sway 2 deg, outer petals 3 deg trailing by 0.6 rad (0.27 s),
 * heart 100 <-> 101.2 %. The petals are full shapes (tools/bloom_geometry.py), each drawn in a group
 * placed at its base, so they rotate around that base (0 0). The heart grows from its tip at the bottom.
 */
.bloom-breathing path {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: 2.8s infinite;
}
.bloom-breathing .heart { transform-origin: 89.86px 160px; }
.bloom-breathing .petal { animation-name: bloom-sway; }
.bloom-breathing .petal-side.petal-left   { --sway: -2deg; }
.bloom-breathing .petal-side.petal-right  { --sway: 2deg; }
.bloom-breathing .petal-outer.petal-left  { --sway: -3deg; }
.bloom-breathing .petal-outer.petal-right { --sway: 3deg; }
.bloom-breathing .petal-outer { animation-delay: -2.533s; }   /* 2.8 s - 0.267 s lag */
.bloom-breathing .heart { animation-name: bloom-heart; }

/* Quarter-period keyframes with ease-in-out between them follow a sine closely. */
@keyframes bloom-sway {
  0%, 50%, 100% { transform: rotate(0deg); animation-timing-function: ease-out; }
  25%           { transform: rotate(var(--sway)); animation-timing-function: ease-in; }
  75%           { transform: rotate(calc(-1 * var(--sway))); animation-timing-function: ease-in; }
}
@keyframes bloom-heart {
  0%, 50%, 100% { transform: scale(1); animation-timing-function: ease-out; }
  25%           { transform: scale(1.012); animation-timing-function: ease-in; }
  75%           { transform: scale(0.988); animation-timing-function: ease-in; }
}

@media (prefers-reduced-motion: reduce) {
  .bloom-breathing path { animation: none; }
}

.hero-title {          /* type.display -> type.web.hero */
  max-width: 760px;
  font-family: var(--font-family-display);
  font-size: clamp(36px, 24px + 3.2vw, 56px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: clamp(-1px, -0.3px - 0.05vw, -0.5px);
}
.hero .lead { max-width: 640px; }

/* ---------- Landing: apps ---------- */

.apps { padding-block: var(--space-2) var(--space-12); }
@media (min-width: 640px) { .apps { padding-block: var(--space-6) 96px; } }
.apps .eyebrow { color: var(--text-tertiary); margin-bottom: var(--space-4); }
@media (min-width: 640px) { .apps .eyebrow { margin-bottom: var(--space-6); } }

.app-grid { display: grid; gap: var(--space-4); }
@media (min-width: 800px) { .app-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); } }

.card {
  background: var(--background-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--elevation-card);
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-5);
}
@media (min-width: 640px) { .app-card { padding: var(--space-8); } }

.app-identity { display: flex; align-items: center; gap: var(--space-4); }
.app-mark { width: 61px; height: 56px; flex: none; }
@media (min-width: 640px) { .app-mark { width: 79px; height: 72px; } }

.app-title { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.app-name {            /* type.title-l */
  font-family: var(--font-family-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.286;
  letter-spacing: -0.25px;
}

.chip {                /* DS Chip · Neutral */
  display: inline-flex;
  align-items: center;
  padding: 4px var(--space-3);
  border-radius: var(--radius-full);
  background: var(--background-surface-muted);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.385;
}

.app-description { color: var(--text-secondary); }

.store-badges { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* Placeholder until the official Apple / Google badge artwork is added. */
.store-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--size-control);
  padding: 6px var(--space-4);
  border: var(--border-width-thin) solid var(--store-badge-border);
  border-radius: var(--radius-md);
  background: var(--store-badge-bg);
  color: var(--store-badge-text);
  line-height: 1.1;
  transition: transform 120ms ease;
}
.store-badge:hover { transform: translateY(-1px); }
.store-badge small { font-size: 12px; font-weight: 500; }
.store-badge strong { font-size: 18px; font-weight: 600; }

.text-links { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.text-links a, .text-link {
  font-size: 16px;     /* type.label */
  font-weight: 600;
  line-height: 1.25;
  color: var(--accent-default);
}
.text-links a:hover, .text-link:hover { color: var(--accent-pressed); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Legal pages ---------- */

.legal {
  display: grid;
  gap: var(--space-5);
  padding-block: var(--space-8) var(--space-12);
}
@media (min-width: 1024px) {
  .legal {
    grid-template-columns: 264px minmax(0, var(--size-web-prose));
    gap: 96px;
    padding-block: 64px 96px;
  }
}

.toc { display: none; }
@media (min-width: 1024px) {
  .toc { display: block; position: sticky; top: var(--space-6); align-self: start; }
}
.toc .eyebrow { color: var(--text-tertiary); margin-bottom: 10px; }
.toc ul { display: flex; flex-direction: column; gap: 2px; }
.toc a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.467;
  color: var(--text-secondary);
}
.toc a:hover { color: var(--text-primary); background: var(--background-surface); }
.toc a.is-active { background: var(--accent-soft); color: var(--accent-on-tonal); font-weight: 600; }

.article { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
@media (min-width: 1024px) { .article { gap: var(--space-6); } }

.segmented {           /* DS Segmented Control */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-lg);
  background: var(--background-surface-muted);
}
@media (min-width: 1024px) { .segmented { width: 400px; } }
.segmented a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}
.segmented a:hover { color: var(--text-primary); }
.segmented a[aria-current="page"] {
  background: var(--background-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.article-heading { display: flex; flex-direction: column; gap: var(--space-2); }
.updated { font-size: 13px; font-weight: 500; color: var(--text-tertiary); }

.toc-mobile {
  border: var(--border-width-thin) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--background-surface);
}
@media (min-width: 1024px) { .toc-mobile { display: none; } }
.toc-mobile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--space-4);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary .icon { color: var(--icon-default); transform: rotate(90deg); transition: transform 160ms ease; }
.toc-mobile[open] summary .icon { transform: rotate(-90deg); }
.toc-mobile ul { padding: 0 var(--space-2) var(--space-3); }
.toc-mobile a { display: block; padding: var(--space-2); border-radius: var(--radius-md); font-size: 15px; color: var(--text-secondary); }
.toc-mobile a:hover { color: var(--text-primary); background: var(--background-app); }

.divider { height: 1px; border: 0; margin: 0; background: var(--border-subtle); }

.legal-section { display: flex; flex-direction: column; gap: var(--space-3); scroll-margin-top: var(--space-6); }
.legal-section h2 {    /* type.title-m */
  font-size: 22px;
  font-weight: 600;
  line-height: 1.273;
}
.legal-section p { color: var(--text-secondary); }
.legal-section ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: 1.25em;
  list-style: disc;
  color: var(--text-secondary);
}
.legal-section li::marker { color: var(--brand-petal-side); }

.callout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--accent-on-tonal);
}
@media (min-width: 640px) { .callout { padding: var(--space-6); } }
.callout strong { font-size: 16px; font-weight: 600; line-height: 1.25; }
.callout p { font-size: 15px; line-height: 1.467; }
.callout a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Support ---------- */

.page-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-block: var(--space-8) var(--space-6);
}
@media (min-width: 640px) { .page-hero { gap: var(--space-3); padding-block: 64px var(--space-10); } }
.page-hero .lead { max-width: 640px; }

.support-cards { display: grid; gap: var(--space-4); }
@media (min-width: 800px) { .support-cards { grid-template-columns: 1fr 1fr; gap: var(--space-6); } }

.support-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
}
@media (min-width: 640px) { .support-card { padding: var(--space-8); } }

.icon-bubble {
  display: grid;
  place-items: center;
  width: var(--size-control);
  height: var(--size-control);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--icon-default);
}
.card-title { font-size: 22px; font-weight: 600; line-height: 1.273; }  /* type.title-m */
.card-text { display: flex; flex-direction: column; gap: var(--space-1); }
.card-text p { color: var(--text-secondary); }

.button {              /* DS Button · Primary */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--size-control);
  padding: 0 var(--space-7);
  border-radius: var(--radius-md);
  background: var(--accent-default);
  color: var(--text-on-accent);
  font-size: 16px;
  font-weight: 600;
  transition: background-color 120ms ease;
}
.button:hover { background: var(--accent-pressed); }

.link-list {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--border-subtle);
}
.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--space-4);
  background: var(--background-app);
  font-size: 16px;
  font-weight: 600;
  transition: background-color 120ms ease;
}
.link-list a:hover { background: var(--background-surface-muted); }
.link-list .icon { color: var(--icon-default); }

.faq-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-block: var(--space-10) var(--space-12);
}
@media (min-width: 640px) { .faq-section { padding-block: 72px 96px; } }
.faq-section .eyebrow { color: var(--text-tertiary); }

.faq {
  max-width: 792px;
  overflow: hidden;
  border: var(--border-width-thin) solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.faq details { background: var(--background-surface); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--icon-default); transform: rotate(90deg); transition: transform 160ms ease; }
.faq details[open] summary .icon { transform: rotate(-90deg); }
.faq details p {
  padding: 0 64px var(--space-5) var(--space-6);
  margin-top: calc(-1 * var(--space-3));
  font-size: 15px;
  line-height: 1.467;
  color: var(--text-secondary);
}

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

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding-block: 96px;
  text-align: center;
}
.not-found .lead { max-width: 480px; }
.not-found .button { margin-top: var(--space-4); }
