/* ==========================================================================
   MediTime landing page
   Hand-written, no framework, no external requests. Everything here is
   deliberately boring CSS so the page stays fast on a phone over 4G, which is
   where the ad traffic lands.
   ========================================================================== */

:root {
  /* Palette. The blues come from the app itself so the page and the product
     feel like one thing. Deliberately desaturated against the app's UI blue —
     a marketing page shouting in #2563EB everywhere reads cheap. */
  --ink:        #0a1122;
  --ink-2:      #16233c;
  --body:       #46566f;
  --muted:      #6c7c94;
  --line:       #e2e8f2;
  --bg:         #ffffff;
  --bg-2:       #f5f8fd;
  --bg-3:       #eef3fb;

  --blue:       #2563eb;
  --blue-deep:  #1749c0;
  --blue-soft:  #e8f0ff;
  --cyan:       #0fa9c4;
  --green:      #14893f;
  --green-soft: #e6f6ec;

  /* Fluid type. clamp() means no breakpoint juggling for headings. */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.12rem);
  --step-1:  clamp(1.20rem, 1.10rem + 0.45vw, 1.45rem);
  --step-2:  clamp(1.45rem, 1.25rem + 0.95vw, 2.05rem);
  --step-3:  clamp(1.85rem, 1.45rem + 1.90vw, 3.05rem);
  --step-4:  clamp(2.25rem, 1.60rem + 3.10vw, 4.10rem);

  --sp-1: 0.5rem;  --sp-2: 0.875rem; --sp-3: 1.25rem; --sp-4: 2rem;
  --sp-5: 3rem;    --sp-6: 4.5rem;   --sp-7: 6.5rem;

  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 34px;
  --shadow-1: 0 1px 2px rgba(10,17,34,.06), 0 4px 12px rgba(10,17,34,.05);
  --shadow-2: 0 2px 6px rgba(10,17,34,.07), 0 18px 44px rgba(10,17,34,.10);
  --shadow-3: 0 30px 70px rgba(10,17,34,.22);

  --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f6fd; --ink-2: #dce6f6; --body: #a7b6cd; --muted: #8496b1;
    --line: #22304a; --bg: #080d18; --bg-2: #0d1526; --bg-3: #121c31;
    --blue: #5b8dff; --blue-deep: #7ba5ff; --blue-soft: #14213c;
    --cyan: #35c3dc; --green: #3ac06d; --green-soft: #10281a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { color: var(--ink); line-height: 1.12; letter-spacing: -0.022em; margin: 0 0 var(--sp-2); font-weight: 700; }
h1 { font-size: var(--step-4); letter-spacing: -0.035em; }
h2 { font-size: var(--step-3); letter-spacing: -0.028em; }
h3 { font-size: var(--step-1); }
p  { margin: 0 0 var(--sp-3); }
a  { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
img, svg { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.15rem, 5vw, 2.5rem); }
.section { padding-block: var(--sp-6); }
.section--tight { padding-block: var(--sp-5); }
.center { text-align: center; }
.lede { font-size: var(--step-1); color: var(--body); max-width: 62ch; }
.eyebrow {
  font-size: var(--step--1); font-weight: 650; letter-spacing: .10em;
  text-transform: uppercase; color: var(--blue); margin: 0 0 var(--sp-2);
}
.fine { font-size: var(--step--1); color: var(--muted); line-height: 1.55; }

/* ---------- App Store badge ------------------------------------------------
   Apple's rule: use their artwork unmodified, minimum 40px tall, with clear
   space of a quarter of its height. The badge is never restyled — the
   persuasion sits in the text above and below it. */
.badge-link { display: inline-block; padding: calc(54px / 4); margin: calc(-54px / 4); border-radius: var(--r-sm); }
.badge-link img { height: 54px; width: auto; }
@media (min-width: 760px) { .badge-link img { height: 60px; } }

.cta-block { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.cta-block .fine { max-width: 44ch; margin: 0; }
.center .cta-block { align-items: center; }
.center .cta-block .fine { text-align: center; }

/* ---------- Hero ---------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(37,99,235,.16), transparent 62%),
    radial-gradient(760px 520px at 6% 8%, rgba(15,169,196,.13), transparent 60%),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.75rem, 7vw, 5.5rem) clamp(2.5rem, 6vw, 4.5rem);
}
.hero__grid { display: grid; gap: clamp(2.25rem, 6vw, 3.5rem); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.06fr .94fr; } }
.hero h1 { max-width: 15ch; }
.hero__sub { font-size: var(--step-1); max-width: 46ch; color: var(--body); }

/* The device is deliberately capped so the badge is never the smaller element
   in the hero — Apple asks that the badge sit subordinate to the main message,
   not that it be hidden. */
.hero__shot { justify-self: center; width: min(100%, 340px); }
.hero__shot img {
  width: 100%; border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  border: 1px solid rgba(255,255,255,.10);
}

/* ---------- Fact chips (this is where a star rating would normally sit) ---- */
.facts { border-bottom: 1px solid var(--line); background: var(--bg); }
.facts__row { display: grid; gap: var(--sp-2); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 860px) { .facts__row { grid-template-columns: repeat(4, 1fr); } }
.fact {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  padding: var(--sp-3); border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--bg-2);
}
.fact svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--blue); margin-top: 1px; }
.fact b { display: block; color: var(--ink); font-size: var(--step-0); font-weight: 650; line-height: 1.3; }
.fact span { font-size: var(--step--1); color: var(--muted); }

/* ---------- Feature rows -------------------------------------------------- */
.features { display: grid; gap: var(--sp-4); }
@media (min-width: 820px) { .features { grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); } }
.feature__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue); margin-bottom: var(--sp-2);
}
.feature__icon svg { width: 24px; height: 24px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; }

/* ---------- Screenshot scroller ------------------------------------------- */
.shots {
  display: flex; gap: var(--sp-3); overflow-x: auto; padding-block: var(--sp-3) var(--sp-4);
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; margin-inline: calc(-1 * clamp(1.15rem, 5vw, 2.5rem));
  padding-inline: clamp(1.15rem, 5vw, 2.5rem);
}
.shots img {
  flex: 0 0 auto; width: 210px; border-radius: var(--r-lg);
  scroll-snap-align: center; box-shadow: var(--shadow-2);
  border: 1px solid var(--line); background: var(--bg-2);
}
@media (min-width: 760px) { .shots img { width: 246px; } }

/* ---------- Plan comparison ----------------------------------------------- */
.plans { display: grid; gap: var(--sp-3); }
@media (min-width: 820px) { .plans { grid-template-columns: 1fr 1fr; gap: var(--sp-4); } }
.plan {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem); background: var(--bg);
}
.plan--free { background: var(--bg-2); }
.plan--pro { border-color: var(--blue); box-shadow: var(--shadow-1); }
.plan__name { font-size: var(--step-1); font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.plan__price { font-size: var(--step--1); color: var(--muted); margin-bottom: var(--sp-3); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.plan li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--step-0); }
.plan li svg { flex: 0 0 auto; width: 19px; height: 19px; color: var(--green); margin-top: 3px; }
.callout {
  margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--blue); background: var(--blue-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--ink-2);
}
.callout p { margin: 0; }
.callout strong { color: var(--ink); }

/* ---------- Privacy ------------------------------------------------------- */
.privacy { background: var(--bg-2); border-block: 1px solid var(--line); }
.privacy__grid { display: grid; gap: var(--sp-4); }
@media (min-width: 880px) { .privacy__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-5); } }
.disclosure {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4); background: var(--bg);
}
.disclosure h3 { font-size: var(--step-0); margin-bottom: 6px; }
.disclosure p:last-child { margin-bottom: 0; }

/* ---------- Founder ------------------------------------------------------- */
.note {
  max-width: 60ch; margin-inline: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--bg-2);
}
.note p:last-of-type { margin-bottom: 0; }
.sig { margin-top: var(--sp-3); font-size: var(--step--1); color: var(--muted); }

/* ---------- Closing CTA --------------------------------------------------- */
.close {
  background:
    radial-gradient(900px 500px at 50% -20%, rgba(37,99,235,.30), transparent 62%),
    var(--ink);
  color: #cddaf0; text-align: center; padding-block: var(--sp-6);
}
.close h2 { color: #fff; max-width: 18ch; margin-inline: auto; }
.close .fine { color: #90a4c4; }

/* ---------- Footer -------------------------------------------------------- */
.foot { background: var(--ink); color: #8fa3c2; padding-block: var(--sp-4); border-top: 1px solid rgba(255,255,255,.09); }
.foot a { color: #cddaf0; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot__row { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center; justify-content: space-between; }
.foot__links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); font-size: var(--step--1); }
.disclaimer { font-size: var(--step--1); color: #7c90b0; margin-top: var(--sp-3); max-width: 70ch; }

/* Reveal-on-scroll, opt-out respected. Nothing load-bearing depends on JS:
   without it the .reveal class simply never applies and everything is visible. */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* ==========================================================================
   Portfolio homepage. Shares every token above with the landing page so the
   two never drift apart.
   ========================================================================== */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-block: 0.85rem; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav__links { display: flex; gap: var(--sp-3); font-size: var(--step--1); }
.nav__links a { color: var(--body); text-decoration: none; }
.nav__links a:hover { color: var(--ink); }
@media (max-width: 620px) { .nav__links { display: none; } }

.masthead {
  background:
    radial-gradient(900px 520px at 80% -10%, rgba(37,99,235,.14), transparent 60%),
    radial-gradient(680px 460px at 4% 4%, rgba(15,169,196,.11), transparent 58%),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(3rem, 8vw, 5.5rem);
}
.masthead h1 { max-width: 17ch; }
.masthead .lede { margin-top: var(--sp-3); }

/* App grid ---------------------------------------------------------------- */
.group + .group { margin-top: var(--sp-5); }
.group__head {
  display: flex; align-items: baseline; gap: var(--sp-3);
  margin-bottom: var(--sp-3); padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--line);
}
.group__head h2 { font-size: var(--step-1); margin: 0; }
.group__head span { font-size: var(--step--1); color: var(--muted); }

.apps { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .apps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .apps { grid-template-columns: repeat(3, 1fr); } }

.app {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg); text-decoration: none; color: inherit;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.app:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.app__icon { width: 58px; height: 58px; border-radius: 13px; flex: 0 0 auto; box-shadow: var(--shadow-1); }
.app__name { color: var(--ink); font-weight: 650; font-size: var(--step-0); line-height: 1.28; margin-bottom: 3px; }
.app__blurb { font-size: var(--step--1); color: var(--body); margin: 0 0 6px; }
.app__meta { font-size: 0.78rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }

/* The flagship card gets one row to itself. */
.flagship {
  display: grid; gap: var(--sp-4); align-items: center;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--blue); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--blue-soft), var(--bg));
  margin-bottom: var(--sp-5);
}
@media (min-width: 820px) { .flagship { grid-template-columns: 92px 1fr auto; } }
.flagship img.icon { width: 92px; height: 92px; border-radius: 21px; box-shadow: var(--shadow-2); }
.flagship h3 { margin-bottom: 4px; }
.flagship p { margin: 0; }
.btn {
  display: inline-block; padding: 0.8rem 1.35rem; border-radius: 999px;
  background: var(--blue); color: #fff; font-weight: 650; text-decoration: none;
  font-size: var(--step-0); white-space: nowrap;
  transition: background .18s ease;
}
.btn:hover { background: var(--blue-deep); }

.allapps { text-align: center; padding-block: var(--sp-4); }

/* ---------- Long-form legal pages ---------------------------------------- */
.prose { max-width: 74ch; margin-inline: auto; }
.prose h1 { font-size: var(--step-3); margin-bottom: var(--sp-3); }
.prose h2 { font-size: var(--step-2); margin-top: var(--sp-5); }
.prose h3 { font-size: var(--step-1); margin-top: var(--sp-4); }
.prose h4 { font-size: var(--step-0); margin-top: var(--sp-3); color: var(--ink); font-weight: 650; }
.prose p, .prose li { color: var(--body); }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 var(--sp-3); }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-3); font-size: var(--step--1); display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: var(--sp-4); }
.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--blue);
  background: var(--bg-2); border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
}
.notice p { margin: 0; font-size: var(--step--1); }

/* ---------- Consent banner ------------------------------------------------
   Only ever rendered by consent.js, and only when a Pixel ID is configured. */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: var(--bg); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 32px rgba(10,17,34,.14);
  padding: var(--sp-3) 0 calc(var(--sp-3) + env(safe-area-inset-bottom));
}
.consent__inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding-inline: clamp(1.15rem, 5vw, 2.5rem);
  display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between;
}
.consent__text { margin: 0; font-size: var(--step--1); color: var(--body); max-width: 62ch; line-height: 1.55; }
.consent__actions { display: flex; gap: var(--sp-2); flex: 0 0 auto; }
/* Equal weight on both buttons, deliberately. */
.consent__btn {
  font: inherit; font-size: var(--step--1); font-weight: 650;
  padding: 0.65rem 1.35rem; min-width: 116px; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--blue);
  background: var(--blue); color: #fff; cursor: pointer;
}
.consent__btn--ghost { background: transparent; color: var(--blue); }
.consent__btn:hover { filter: brightness(1.06); }
@media (max-width: 640px) {
  .consent__actions { width: 100%; }
  .consent__btn { flex: 1; }
}
