/* Mimeer — site styles. Tokens mirror the Mimeer Design System (tokens.json). */

:root {
  color-scheme: light dark;

  /* Brand */
  --brand-violet: #7f50ff;
  --brand-violet-deep: #6026ff;
  --brand-cyan: #74fff9;
  --brand-cyan-deep: #74cfe2;

  /* System (light) */
  --accent: #007aff;
  --bg: #ffffff;
  --bg-grouped: #f2f2f7;
  --bg-grouped-secondary: #ffffff;
  --fill-field: rgba(60, 60, 67, 0.18);
  --label: #000000;
  --label-secondary: rgba(60, 60, 67, 0.6);
  --stage: #f2f2f7; /* site-only: illustration panels */
  --stage-raised: #ffffff;
  --label-body: #3c3c43; /* site-only: long-form text at 10:1, where label-secondary would fail */
  --separator: rgba(60, 60, 67, 0.29);
  --on-activity: #ffffff;

  /* Activity palette (light) */
  --activity-red: #ff3b30;
  --activity-orange: #ff9500;
  --activity-yellow: #ffcc00;
  --activity-green: #34c759;
  --activity-mint: #00c7be;
  --activity-teal: #30b0c7;
  --activity-cyan: #32ade6;
  --activity-blue: #007aff;
  --activity-indigo: #5856d6;
  --activity-purple: #af52de;
  --activity-pink: #ff2d55;

  /* Scales */
  --space-1: 4px;
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 8px;
  --radius-list: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --content: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #0a84ff;
    --bg: #000000;
    --bg-grouped: #000000;
    --bg-grouped-secondary: #1c1c1e;
    --fill-field: rgba(235, 235, 245, 0.16);
    --label: #ffffff;
    --label-secondary: rgba(235, 235, 245, 0.6);
    --stage: #1c1c1e;
    --stage-raised: #2c2c2e;
    --label-body: rgba(235, 235, 245, 0.82);
    --separator: rgba(84, 84, 88, 0.6);

    --activity-red: #ff453a;
    --activity-orange: #ff9f0a;
    --activity-yellow: #ffd60a;
    --activity-green: #30d158;
    --activity-mint: #63e6e2;
    --activity-teal: #40cbe0;
    --activity-cyan: #64d2ff;
    --activity-blue: #0a84ff;
    --activity-indigo: #5e5ce6;
    --activity-purple: #bf5af2;
    --activity-pink: #ff375f;
  }
}

@property --card-color { syntax: "<color>"; inherits: true; initial-value: #007aff; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 var(--space-6); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--space-4); top: var(--space-4); z-index: 10; background: var(--bg); padding: var(--space-2) var(--space-4); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 0.5px solid var(--separator); }
.site-header--hero { background: transparent; border-bottom-color: transparent; position: absolute; left: 0; right: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--label); }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: var(--space-6); font-size: 15px; }
.site-nav a { color: var(--label); }
.site-header--hero .brand, .site-header--hero .site-nav a { color: #fff; }

/* ---------- Buttons ---------- */
.btn-store { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 22px 0 18px; border-radius: 12px; background: #000; color: #fff; font-weight: 600; font-size: 17px; line-height: 1.1; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); }
.btn-store:hover { text-decoration: none; background: #1c1c1e; }
.btn-store svg { width: 26px; height: 26px; flex: none; }
.btn-store small { display: block; font-size: 11px; font-weight: 500; opacity: 0.85; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 22px; border-radius: 12px; color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6); }
.btn-ghost:hover { text-decoration: none; background: rgba(255, 255, 255, 0.12); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(180deg, var(--brand-violet) 0%, #6f52c8 58%, #5a3cad 100%); padding: 128px 0 0; text-align: center; } /* lower stops match the device render's baked-in ground */
.hero h1 { font-size: clamp(40px, 6.4vw, 72px); font-weight: 800; max-width: 14ch; margin: 0 auto; }
.hero p.lede { font-size: clamp(18px, 2vw, 21px); max-width: 34ch; margin: var(--space-6) auto 0; color: rgba(255, 255, 255, 0.9); }
.hero .ctas { display: flex; gap: var(--space-4); justify-content: center; flex-wrap: wrap; margin-top: var(--space-8); }
.hero .devices { margin: 40px auto 0; width: 100%; max-width: 1200px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(transparent, #000 14%, #000 86%, transparent);
  mask-composite: intersect; }
.hero .platforms { margin-top: var(--space-4); font-size: 14px; color: rgba(255, 255, 255, 0.85); }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-grouped { background: var(--bg-grouped); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-violet); }
@media (prefers-color-scheme: dark) { .eyebrow { color: #a98bff; } }
.section-title { font-size: clamp(32px, 4.4vw, 48px); font-weight: 800; margin-top: var(--space-2); max-width: 20ch; }
.section-lede { font-size: 19px; color: var(--label-body); margin-top: var(--space-4); max-width: 46ch; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); margin-top: 56px; }
.step h3 { font-size: 21px; margin-top: var(--space-6); }
.step p { color: var(--label-body); margin-top: var(--space-2); }
.step .stage { display: grid; place-items: center; background: var(--stage); border-radius: var(--radius-lg); height: 240px; padding: var(--space-6); overflow: hidden; }
.step .stage > * { width: 100%; max-width: 236px; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--brand-violet); color: #fff; font-size: 14px; font-weight: 700; margin-right: var(--space-2); vertical-align: 2px; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-4); margin-top: 56px; }
.feature { background: var(--bg-grouped-secondary); border-radius: var(--radius-lg); padding: var(--space-8); overflow: hidden; display: flex; flex-direction: column; gap: var(--space-2); grid-column: span 2; }
.feature--wide { grid-column: span 3; }
.feature--full { grid-column: span 6; }
.feature h3 { font-size: 22px; }
.feature p { color: var(--label-body); }
.feature .art { margin-top: auto; padding-top: var(--space-6); }
.feature-shot { border-radius: 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12); max-width: 260px; margin: 0 auto -120px; }
.mac-shot { width: 100%; max-height: 440px; object-fit: cover; object-position: top left; border-radius: 12px 12px 0 0; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14); margin-bottom: calc(-1 * var(--space-8)); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches span { width: 28px; height: 28px; border-radius: var(--radius-full); }
.tiles { display: flex; gap: 10px; flex-wrap: wrap; }

/* Open source */
.oss { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-8); align-items: center; background: var(--stage); border-radius: var(--radius-lg); padding: 40px; }
.oss .mark { width: 72px; height: 72px; }
.oss h2 { font-size: 28px; }
.oss p { color: var(--label-body); margin-top: var(--space-2); max-width: 52ch; }
.btn-outline { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 12px; font-weight: 600; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); white-space: nowrap; }
.btn-outline:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Final CTA */
.cta-final { text-align: center; color: #fff; background: linear-gradient(160deg, var(--brand-violet), var(--brand-violet-deep)); }
.cta-final img.icon { width: 120px; height: 120px; margin: 0 auto var(--space-6); border-radius: 27px; }
.cta-final h2 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 800; }
.cta-final p { margin: var(--space-4) auto var(--space-8); color: rgba(255, 255, 255, 0.9); font-size: 19px; }

/* Footer */
.site-footer { padding: 40px 0 56px; font-size: 14px; color: var(--label-secondary); border-top: 0.5px solid var(--separator); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.site-footer nav { display: flex; gap: var(--space-6); }
.site-footer a { color: var(--label-body); }

/* ---------- Document pages (privacy, support, 404) ---------- */
.doc { padding: 72px 0 96px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(36px, 5vw, 52px); font-weight: 800; }
.doc .meta { color: var(--label-secondary); margin-top: var(--space-2); font-size: 15px; }
.doc h2 { font-size: 24px; margin: 48px 0 var(--space-4); }
.doc p, .doc li { color: var(--label-body); }
.doc p + p { margin-top: var(--space-4); }
.doc ul { padding-left: 1.2em; margin: var(--space-4) 0 0; }
.doc li + li { margin-top: var(--space-2); }
.doc strong { color: var(--label); }
.summary { margin-top: var(--space-8); background: var(--stage); border-radius: var(--radius-md); padding: var(--space-6); }
.summary ul { margin: 0; }

.faq { margin-top: var(--space-6); background: var(--stage); border-radius: var(--radius-md); padding: 0 var(--space-6); }
.faq details { border-top: 0.5px solid var(--separator); }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; color: var(--label); display: flex; justify-content: space-between; gap: var(--space-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 var(--space-6); }
.contact { margin-top: 48px; display: flex; gap: var(--space-6); align-items: center; background: var(--stage); border-radius: var(--radius-md); padding: var(--space-6); }
.contact .m-tile { flex: none; }
.contact h2 { margin: 0 0 var(--space-1); font-size: 20px; }

/* ---------- Product components (from the design system bundle.css) ---------- */
.m-sym { display: block; width: 100%; height: 100%; }
.m-card { --card-color: var(--activity-blue); aspect-ratio: 4 / 3; border-radius: var(--radius-md); padding: var(--space-4); background: var(--card-color); color: var(--on-activity); display: flex; flex-direction: column; overflow: hidden; text-align: left; position: relative; }
.m-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-1); }
.m-card__icon { width: 48px; height: 48px; flex: none; }
.m-card__date { font-size: 15px; line-height: 20px; text-align: right; font-variant-numeric: tabular-nums; max-width: 60%; }
.m-card__title { margin-top: auto; font-size: 17px; line-height: 22px; font-weight: 600; }
.m-tile { --card-color: var(--activity-green); background: var(--card-color); color: var(--on-activity); display: inline-flex; flex: none; }
.m-tile--sm { width: 36px; height: 36px; border-radius: var(--radius-sm); padding: var(--space-2); }
.m-tile--md { width: 72px; height: 72px; border-radius: var(--radius-md); padding: var(--space-4); }
.m-tile--lg { width: 108px; height: 108px; border-radius: var(--radius-lg); padding: var(--space-6); }

/* Editor mock (step 1) */
.editor { background: var(--stage-raised); border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.editor .pick { position: relative; }
.editor .badge { position: absolute; top: -12px; right: -12px; width: 30px; height: 30px; border-radius: var(--radius-full); background: var(--accent); color: #fff; padding: 2px; }
.editor .field { width: 100%; text-align: center; font-weight: 700; font-size: 20px; padding: 10px; border-radius: 12px; background: var(--fill-field); }
.editor .tile-swap { animation: tile-swap 6s infinite steps(1); }
@keyframes tile-swap { 0% { --card-color: var(--activity-green); } 33% { --card-color: var(--activity-orange); } 66% { --card-color: var(--activity-indigo); } }

/* Long-press logging (step 2) — mirrors ActivityCardView.AnimationPhase */
.m-card--demo .m-card__date, .m-card--demo .m-card__title { animation: details 4s infinite; }
.m-card--demo .m-card__icon { animation: grow 4s infinite; transform-origin: top left; }
.m-card--demo .glyph-check { opacity: 0; }
.m-card--demo .glyph-check, .m-card--demo .glyph-main { position: absolute; inset: 0; }
.m-card--demo .m-card__icon { position: relative; }
.m-card--demo .glyph-main { animation: glyph-out 4s infinite; }
.m-card--demo .glyph-check { animation: glyph-in 4s infinite; }
.m-card--demo .press { position: absolute; width: 44px; height: 44px; border-radius: 50%; right: 22%; bottom: 26%; background: rgba(255, 255, 255, 0.45); animation: press 4s infinite; }
@keyframes details { 0%, 18% { opacity: 1; transform: none; } 24%, 82% { opacity: 0; transform: translateY(12px); } 90%, 100% { opacity: 1; transform: none; } }
@keyframes grow { 0%, 24% { transform: none; } 36%, 80% { transform: translate(58px, 24px) scale(1.9); } 90%, 100% { transform: none; } }
@keyframes glyph-out { 0%, 44% { opacity: 1; } 50%, 84% { opacity: 0; } 90%, 100% { opacity: 1; } }
@keyframes glyph-in { 0%, 44% { opacity: 0; transform: scale(0.6); } 52% { opacity: 1; transform: scale(1.12); } 58%, 82% { opacity: 1; transform: scale(1); } 88%, 100% { opacity: 0; } }
@keyframes press { 0% { opacity: 0; transform: scale(0.4); } 6%, 50% { opacity: 1; transform: scale(1); } 56%, 100% { opacity: 0; transform: scale(1.4); } }

/* Gallery mini (step 3) */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gallery .m-card { padding: 10px; border-radius: 12px; }
.gallery .m-card__icon { width: 24px; height: 24px; }
.gallery .m-card__date { font-size: 11px; line-height: 14px; }
.gallery .m-card__title { font-size: 13px; line-height: 16px; }

/* Widget mock */
.widget { --card-color: var(--activity-cyan); width: 160px; height: 160px; border-radius: 26px; padding: var(--space-4); background: var(--card-color); color: #fff; display: flex; flex-direction: column; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.15); }
.widget .m-card__icon { width: 36px; height: 36px; }
.widget .title { margin-top: auto; font-weight: 600; line-height: 22px; }
.widget .date { font-size: 13px; line-height: 18px; }
.widgets { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; }
.widgets > * { flex: none; }
.lock { width: 170px; padding: 10px 12px; border-radius: 16px; background: rgba(120, 120, 128, 0.16); display: flex; gap: 10px; align-items: center; }
.lock .ic { width: 24px; height: 24px; color: var(--label); }
.lock b { display: block; font-size: 14px; line-height: 18px; }
.lock span { font-size: 12px; color: var(--label-secondary); }

/* Insights mock */
.insights { --card-color: var(--activity-pink); background: var(--stage); border-radius: var(--radius-md); padding: var(--space-4); }
.measures { display: flex; justify-content: space-between; font-size: 15px; }
.metric { color: var(--card-color); display: flex; align-items: baseline; gap: var(--space-1); }
.metric b { font-family: var(--font-mono); font-size: 24px; font-weight: 600; }
.metric span { font-size: 14px; font-weight: 600; text-transform: uppercase; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 80px; margin-top: var(--space-4); border-bottom: 0.5px solid var(--separator); }
.bars i { flex: 1; background: var(--card-color); background-image: linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)); border-radius: 2px 2px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  section { padding: 72px 0; }
  .steps { grid-template-columns: 1fr; gap: 48px; }
  .features { grid-template-columns: 1fr; }
  .feature, .feature--wide, .feature--full { grid-column: auto; }
  .oss { grid-template-columns: 1fr; text-align: left; padding: var(--space-8); }
  .site-nav { gap: var(--space-4); }
  .site-nav .hide-sm { display: none; }
  .hero { padding-top: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
