/* happyfin.app. Colours come from tokens.css (Reagent Bloom). R1: a kit hue always means its reading. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  body { background: radial-gradient(120% 60% at 50% 0%, var(--groundGlow), var(--ground) 70%) var(--ground) no-repeat; }
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--marker); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif; letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 .5em; }
h1 { font-size: clamp(2.25rem, 7vw + .5rem, 4.25rem); font-weight: 800; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw + .8rem, 2.4rem); font-weight: 750; text-wrap: balance; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.ink2 { color: var(--ink2); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surfaceRaised); color: var(--onRaised); padding: 8px 14px; border-radius: 12px; z-index: 2; }
.skip:focus { left: 16px; }

.top, .foot, main > section, .doc { width: min(1120px, 100% - 32px); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.2rem; text-decoration: none; letter-spacing: -0.01em; }
.brand img { border-radius: 9px; }
.top nav a { font-weight: 600; text-decoration: none; padding: 10px 4px; }
.top nav a:hover { text-decoration: underline; }

/* Launch state */
.soon {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  padding: 12px 20px; border-radius: 28px; font-weight: 650;
  background: var(--surfaceRaised); color: var(--onRaised);
}
.badge { display: inline-block; }
.badge img { height: 50px; width: auto; }

/* Phone screenshots */
.shot img {
  width: 100%; border-radius: 13% / 6%;
  border: 1px solid var(--hairline);
  box-shadow: 0 30px 60px -30px rgba(16, 23, 42, .35), 0 8px 20px -12px rgba(16, 23, 42, .25);
}
@media (prefers-color-scheme: dark) { .shot img { box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 30px 80px -30px rgba(0,0,0,.8); } }

/* Hero A: promise and phone */
.hero { display: grid; gap: 32px; align-items: center; padding: 24px 0 56px; }
.hero .lede { font-size: 1.2rem; color: var(--ink2); max-width: 34em; }
.hero .shot { width: min(300px, 78vw); justify-self: center; }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.15fr .85fr; padding: 48px 0 88px; }
  .hero .shot { width: 330px; }
}

/* Hills: the model of the cycle, in the kit hues of its three readings */
.hills { margin: 0; }
.hills svg { width: 100%; overflow: visible; }
.h-ammonia, .h-nitrite, .h-nitrate { mix-blend-mode: multiply; fill-opacity: .6; stroke-width: 2; }
.h-ammonia { fill: var(--ammonia); stroke: var(--ammoniaLine); }
.h-nitrite { fill: var(--nitrite); stroke: var(--nitriteLine); }
.h-nitrate { fill: var(--nitrate); stroke: var(--nitrateLine); }
@media (prefers-color-scheme: dark) { .h-ammonia, .h-nitrite, .h-nitrate { mix-blend-mode: screen; fill-opacity: .75; } }
.h-base { stroke: var(--hairline); stroke-width: 1; }
.h-mark { stroke: var(--marker); stroke-width: 2; stroke-dasharray: 3 4; }
.h-dot { fill: var(--ground); stroke: var(--marker); stroke-width: 3; }
.h-pill { fill: var(--marker); }
.h-pilltext { fill: var(--onMarker); font: 700 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.hills figcaption { display: flex; gap: 18px; font-size: .9rem; font-weight: 650; margin-top: 8px; }
.t-am { color: var(--ammoniaText); } .t-ni { color: var(--nitriteText); } .t-na { color: var(--nitrateText); }

/* Hero B: hills band */
.hero-b { text-align: left; padding: 24px 0 56px; }
.hero-b .hills { margin: 8px 0 24px; max-width: 640px; }
.lines { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 14px; max-width: 34em; }
.lines li { padding-left: 16px; border-left: 3px solid var(--hairline); }
.lines b { display: block; }
.lines span { color: var(--ink2); }

/* Benefits */
.benefits { padding: 24px 0 40px; }
.benefit { display: grid; gap: 24px; align-items: center; padding: 40px 0; border-top: 1px solid var(--hairline); }
.benefit .shot { width: min(280px, 72vw); justify-self: center; }
.benefit p { color: var(--ink2); font-size: 1.125rem; max-width: 30em; }
@media (min-width: 860px) {
  .benefit { grid-template-columns: 1fr 1fr; gap: 64px; padding: 64px 0; }
  .benefit:nth-child(even) .shot { order: -1; }
  .benefit .shot { width: 300px; }
}

/* The promise card: the one primary card of the page */
.card {
  background: var(--surfaceRaised); color: var(--onRaised);
  border-radius: 32px; padding: clamp(28px, 5vw, 56px);
  margin: 24px auto 72px;
}
.card p { color: var(--onRaised2); font-size: 1.125rem; max-width: 36em; }
.card .facts { list-style: none; padding: 0; margin: 24px 0 32px; display: grid; gap: 10px; }
.card .facts li::before { content: "✓"; margin-right: 10px; font-weight: 800; }
.card .soon { background: var(--action); color: var(--onAction); }

/* Legal and support pages */
.doc { max-width: 720px; padding: 16px 0 64px; }
.doc h1 { font-size: clamp(2rem, 5vw + .5rem, 3rem); }
.doc h2 { font-size: 1.4rem; margin-top: 2em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: .4em; }
.doc .meta { color: var(--ink2); }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: .97rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hairline); }
.contact { background: var(--surface); border-radius: 24px; padding: 20px 24px; margin: 8px 0 32px; }
.contact .mail { font-size: 1.35rem; font-weight: 700; user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; margin: 0 0 4px; }
details { background: var(--surface); border-radius: 20px; padding: 16px 20px; margin: 0 0 12px; }
summary { font-weight: 700; cursor: pointer; }
details[open] summary { margin-bottom: 8px; }
details p:last-child { margin-bottom: 0; }

.foot { border-top: 1px solid var(--hairline); padding: 28px 0 40px; display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; color: var(--ink2); font-size: .95rem; }
.foot nav { display: flex; gap: 20px; }
.foot nav a { color: var(--ink); font-weight: 600; text-decoration: none; padding: 8px 0; }
.foot nav a:hover { text-decoration: underline; }
.foot p { margin: 0; user-select: all; -webkit-user-select: all; }
.foot p:last-child { user-select: auto; -webkit-user-select: auto; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Hero C: the phone first */
.hero-c .shot { width: min(240px, 62vw); }
@media (min-width: 860px) { .hero-c { grid-template-columns: .85fr 1.15fr; } .hero-c .shot { width: 330px; } }
