@import url('/assets/fonts/fonts.css');

/* ==========================================================================
   OHealth Apps Studio
   Palette: eucalyptus green on a warm paper ground. Neutrals carry a slight
   green bias so they read as chosen rather than inherited. Amber is reserved
   for star ratings and never used as a general accent.
   ========================================================================== */

:root {
  --paper:        #F6F7F3;
  --surface:      #FFFFFF;
  --surface-sunk: #EDF0EA;
  --ink:          #17211B;
  --ink-2:        #46544B;
  --muted:        #78877D;
  --rule:         #DFE5DA;
  --rule-firm:    #C6D0C0;

  --accent:       #2F6B4F;
  --accent-hover: #245640;
  --accent-ink:   #FFFFFF;
  --accent-wash:  #E7F0E9;

  --star:         #B07D2A;

  --shadow-sm: 0 1px 2px rgba(23,33,27,.05);
  --shadow-md: 0 2px 4px rgba(23,33,27,.04), 0 12px 28px -18px rgba(23,33,27,.30);
  --shadow-lg: 0 4px 8px rgba(23,33,27,.05), 0 24px 48px -28px rgba(23,33,27,.36);

  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body:    'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --page:  min(72rem, 100% - 2.5rem);
  --prose: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #10150F;
    --surface:      #171E18;
    --surface-sunk: #1E271F;
    --ink:          #E9EFE7;
    --ink-2:        #B4C2B6;
    --muted:        #82927F;
    --rule:         #27312A;
    --rule-firm:    #3A473C;

    --accent:       #7DC49A;
    --accent-hover: #9AD4B1;
    --accent-ink:   #10150F;
    --accent-wash:  #1A2A20;

    --star:         #DDA94F;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 2px 4px rgba(0,0,0,.3), 0 12px 28px -18px rgba(0,0,0,.8);
    --shadow-lg: 0 4px 8px rgba(0,0,0,.3), 0 24px 48px -28px rgba(0,0,0,.9);
  }
}

:root[data-theme="dark"] {
  --paper:        #10150F;
  --surface:      #171E18;
  --surface-sunk: #1E271F;
  --ink:          #E9EFE7;
  --ink-2:        #B4C2B6;
  --muted:        #82927F;
  --rule:         #27312A;
  --rule-firm:    #3A473C;

  --accent:       #7DC49A;
  --accent-hover: #9AD4B1;
  --accent-ink:   #10150F;
  --accent-wash:  #1A2A20;

  --star:         #DDA94F;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 2px 4px rgba(0,0,0,.3), 0 12px 28px -18px rgba(0,0,0,.8);
  --shadow-lg: 0 4px 8px rgba(0,0,0,.3), 0 24px 48px -28px rgba(0,0,0,.9);
}

/* ---------- base ---------- */

*, *::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; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.015em;
  text-wrap: balance;
  margin: 0;
  /* Fraunces ships a "soft" axis; a little softness suits a health brand. */
  font-variation-settings: 'SOFT' 20, 'WONK' 0;
}

p { margin: 0; }
img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }

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

.wrap { width: var(--page); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: .7rem 1.1rem; border-radius: 0 0 6px 6px; font-weight: 600;
  transition: top .18s ease;
}
.skip-link:focus { top: 0; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header[data-stuck="true"] { border-bottom-color: var(--rule); }

.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--display); font-weight: 600; font-size: 1.06rem;
  color: var(--ink); text-decoration: none; letter-spacing: -.015em;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand .mark { width: 1.75rem; height: 1.75rem; flex: none; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.6rem; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-size: .94rem; font-weight: 500;
}
.site-nav a:hover { color: var(--ink); }
@media (max-width: 44rem) { .site-nav .hide-sm { display: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--body); font-weight: 600; font-size: .95rem;
  padding: .78rem 1.35rem; border-radius: 999px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); transform: translateY(-1px); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule-firm); }
.btn-quiet:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-2); }
.btn-sm { padding: .55rem 1rem; font-size: .88rem; }

/* ---------- hero ---------- */

.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero .wrap { display: flex; flex-direction: column; gap: 1.6rem; align-items: flex-start; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  color: var(--accent); background: var(--accent-wash);
  padding: .4rem .85rem; border-radius: 999px;
}

.hero h1 {
  font-size: clamp(2.6rem, 7.5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.03em;
  max-width: 16ch;
  font-weight: 600;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
}

.hero .lede {
  font-size: clamp(1.06rem, 2.3vw, 1.3rem);
  color: var(--ink-2);
  max-width: 40ch;
  line-height: 1.55;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .4rem; }

/* ---------- proof strip ---------- */

.proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1px;
  margin-top: 1.5rem;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}
.proof div { background: var(--surface); padding: 1.15rem 1.3rem; }
.proof b {
  display: block;
  font-family: var(--display); font-weight: 600;
  font-size: 1.9rem; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin-bottom: .3rem;
}
.proof span { font-size: .84rem; color: var(--muted); }

/* ---------- sections ---------- */

section { scroll-margin-top: 5rem; }
.band { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band-sunk { background: var(--surface-sunk); }

.sec-intro { max-width: var(--prose); display: flex; flex-direction: column; gap: .9rem; }
.sec-intro h2 { font-size: clamp(1.8rem, 4.2vw, 2.6rem); letter-spacing: -.022em; }
.sec-intro p { color: var(--ink-2); font-size: 1.05rem; }

/* ---------- category ---------- */

.category { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.category + .category { margin-top: clamp(3rem, 6vw, 4.5rem); }

.cat-head {
  display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  padding-bottom: .85rem; border-bottom: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}
.cat-head h3 { font-size: 1.4rem; letter-spacing: -.018em; }
.cat-head .blurb { color: var(--muted); font-size: .95rem; flex: 1 1 22rem; min-width: 0; }
.cat-head .tally {
  font-size: .8rem; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ---------- app grid ---------- */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: .9rem;
}

.app {
  position: relative;
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.app:hover {
  border-color: var(--rule-firm);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.app:hover .app-name { color: var(--accent); }
/* Keyboard focus lands on the inner link, so lift the ring to the whole card. */
.app:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.app img {
  width: 3.5rem; height: 3.5rem; flex: none;
  border-radius: 12px;
  background: var(--surface-sunk);
}

.app-body { min-width: 0; display: flex; flex-direction: column; gap: .2rem; }

.app-name {
  font-family: var(--display); font-weight: 600; font-size: 1.04rem;
  letter-spacing: -.012em; line-height: 1.2;
  color: var(--ink); text-decoration: none;
  transition: color .18s ease;
}
/* Stretch the Play link across the card so the whole tile is clickable
   without nesting anchors. Anything that must stay separately clickable
   raises itself above this layer. */
.app-name::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
}
.app-name:focus-visible { outline: none; }
.app-sub { font-size: .82rem; color: var(--muted); }
.app-tag { font-size: .88rem; color: var(--ink-2); margin-top: .3rem; line-height: 1.45; }

.app-meta {
  display: flex; align-items: center; gap: .75rem;
  margin-top: .55rem; font-size: .8rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.app-meta .rating { display: inline-flex; align-items: center; gap: .25rem; color: var(--ink-2); font-weight: 600; }
.app-meta .rating svg { width: .85em; height: .85em; fill: var(--star); }
.app-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--rule-firm); }

/* App Store link, shown only on the apps published on both platforms.
   Sits above the stretched Play link so it remains independently clickable. */
.store-ios {
  position: relative; z-index: 1;
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .6rem;
  padding: .25rem .55rem .25rem .45rem;
  border: 1px solid var(--rule-firm);
  border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .01em;
  color: var(--ink-2); text-decoration: none;
  background: var(--surface);
  transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}
.store-ios svg { width: .82em; height: .82em; }
.store-ios:hover {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.badge-new {
  position: absolute; top: .8rem; right: .9rem;
  font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent);
  padding: .2rem .45rem; border-radius: 4px;
}

/* ---------- about ---------- */

.about-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.6rem; margin-top: 2.5rem;
}
.about-card { display: flex; flex-direction: column; gap: .5rem; }
.about-card .ico {
  width: 2.4rem; height: 2.4rem; margin-bottom: .3rem;
  display: grid; place-items: center;
  background: var(--accent-wash); border-radius: 10px; color: var(--accent);
}
.about-card .ico svg { width: 1.25rem; height: 1.25rem; }
.about-card h3 { font-size: 1.08rem; }
.about-card p { color: var(--ink-2); font-size: .96rem; }

/* ---------- contact ---------- */

.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem; margin-top: 2.5rem;
}
.contact-card {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.4rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
  text-decoration: none; color: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
a.contact-card:hover { border-color: var(--rule-firm); box-shadow: var(--shadow-md); color: inherit; }
.contact-card .label {
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.contact-card .value { font-size: 1.02rem; font-weight: 500; overflow-wrap: anywhere; }
a.contact-card:hover .value { color: var(--accent); }
.contact-card .note { font-size: .87rem; color: var(--muted); }

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0;
  margin-top: clamp(3rem, 7vw, 5rem);
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center;
}
.site-footer .copy { color: var(--muted); font-size: .9rem; }
.site-footer nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 1.4rem; }
.site-footer nav a { color: var(--ink-2); text-decoration: none; font-size: .9rem; }
.site-footer nav a:hover { color: var(--accent); }

/* ---------- legal pages ---------- */

.legal { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.legal .wrap { max-width: var(--prose); }
.legal h1 { font-size: clamp(2.1rem, 5.5vw, 3rem); letter-spacing: -.025em; margin-bottom: .6rem; }
.legal .updated { color: var(--muted); font-size: .9rem; margin-bottom: 2.5rem; }

.legal-body { display: flex; flex-direction: column; gap: 1.15rem; }
.legal-body h2 {
  font-size: 1.3rem; margin-top: 1.6rem; letter-spacing: -.015em;
}
.legal-body h3 { font-size: 1.08rem; margin-top: 1rem; }
.legal-body p, .legal-body li { color: var(--ink-2); }
.legal-body ul, .legal-body ol { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .5rem; }
.legal-body strong { color: var(--ink); font-weight: 600; }

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

.notfound { padding: clamp(4rem, 12vw, 8rem) 0; text-align: center; }
.notfound h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); margin-bottom: .8rem; }
.notfound p { color: var(--ink-2); max-width: 34ch; margin: 0 auto 2rem; }
