/* Happy Operations — site styles. Happy brand palette (app theme.ts: Brand + Dark). */
:root {
  --coral: #E85A45;
  --coral-hi: #F2765F;    /* hover on dark */
  --yellow: #F5D23C;
  --blue: #3DC3E8;
  --bg: #111111;          /* app Dark.bg */
  --soft: #161616;        /* alternate sections */
  --surface: #1A1A1A;     /* app Dark.surface: cards */
  --raised: #242424;      /* app Dark.raised */
  --line: #2C2C2C;        /* borders */
  --text: #F0F0F0;        /* app Dark.text */
  --body-text: #D4D4D4;   /* long text on cards */
  --muted: #A3A3A3;       /* captions (7:1 on --soft) */
  --coral-tint: rgba(232, 90, 69, .15);
  --yellow-tint: rgba(245, 210, 60, .14);
  --blue-tint: rgba(61, 195, 232, .14);
  --radius: 16px;
  --display: Futura, "Futura PT", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: 20px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--coral); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* tri-colour stripe, as on the Happy SOPs */
.stripe { display: flex; height: 6px; }
.stripe span { flex: 1; }
.stripe span:nth-child(1) { background: var(--coral); }
.stripe span:nth-child(2) { background: var(--blue); }
.stripe span:nth-child(3) { background: var(--yellow); }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 26px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.brand img { width: 92px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1.1; letter-spacing: .01em; }
.brand:hover { color: var(--text); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; margin-left: auto; }
.site-nav a { color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 1rem; padding: 6px 0; border-bottom: 3px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--coral); color: var(--text); }
.nav-cta { background: var(--coral); color: var(--bg); padding: 9px 18px; border-radius: 999px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1rem; white-space: nowrap; }
.nav-cta:hover { background: var(--coral-hi); color: var(--bg); }

/* shared bits */
.eyebrow { font-family: var(--display); font-weight: 600; font-size: .82rem; letter-spacing: .22em; text-transform: uppercase; color: var(--coral); margin: 0 0 14px; }
.lede { font-size: 1.2rem; color: var(--body-text); max-width: 40em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.section { padding: 76px 0; }
.section-soft { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 34px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid var(--coral); }
.btn-primary { background: var(--coral); color: var(--bg); }
.btn-primary:hover { background: var(--coral-hi); border-color: var(--coral-hi); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--text); border-color: #5A5A5A; }
.btn-ghost:hover { background: var(--text); border-color: var(--text); color: var(--bg); }

.icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px; flex: none; }
.icon svg { width: 26px; height: 26px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-coral { background: var(--coral-tint); }
.icon-coral svg { stroke: var(--coral); }
.icon-blue { background: var(--blue-tint); }
.icon-blue svg { stroke: var(--blue); }
.icon-yellow { background: var(--yellow-tint); }
.icon-yellow svg { stroke: var(--yellow); }

/* hero */
.hero {
  padding: 60px 0 44px;
  background:
    radial-gradient(ellipse 42% 60% at 92% 22%, rgba(61, 195, 232, .10), transparent 70%),
    radial-gradient(ellipse 46% 58% at 0% 58%, rgba(232, 90, 69, .11), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; }

/* hero illustration: a phone showing the app's home screen (pure HTML/CSS, app dark theme) */
.phone { justify-self: center; width: 290px; background: #000; border: 1px solid #333; border-radius: 46px; padding: 11px; box-shadow: 0 40px 80px -36px rgba(0, 0, 0, .9), 0 0 0 6px rgba(255, 255, 255, .03); }
.phone-screen { background: var(--bg); color: var(--text); border-radius: 36px; overflow: hidden; min-height: 580px; display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; }
.phone-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px 4px; font-size: 12px; font-weight: 600; }
.phone-island { width: 84px; height: 24px; background: #000; border-radius: 999px; }
.phone-head { padding: 12px 18px 12px; }
.phone-head small { display: block; font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--coral); }
.phone-head strong { font-family: var(--display); font-size: 20px; }
.phone-card { margin: 0 12px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.phone-card .label { font-weight: 700; font-size: 12.5px; }
.phone-card .sub { color: #9A9A9A; font-size: 11.5px; margin-top: 2px; }
.bar { height: 6px; background: var(--raised); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar span { display: block; width: 66%; height: 100%; background: var(--blue); border-radius: inherit; }
.phone-alert { background: var(--coral-tint); border-color: rgba(232, 90, 69, .45); }
.phone-alert .label { color: var(--coral-hi); }
.task { display: flex; align-items: center; gap: 9px; padding-top: 8px; font-size: 12.5px; }
.task + .task { border-top: 1px solid var(--line); margin-top: 8px; }
.check { flex: none; width: 17px; height: 17px; border-radius: 50%; border: 2px solid #555; }
.task.done .check { border-color: var(--coral); background: var(--coral) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4 4 9-9.5'/%3E%3C/svg%3E") center / 10px no-repeat; }
.task.done .t { color: #8A8A8A; text-decoration: line-through; }
.task .who { margin-left: auto; font-size: 10.5px; color: #9A9A9A; white-space: nowrap; }
.phone-tabs { margin-top: auto; display: flex; justify-content: space-around; border-top: 1px solid var(--line); background: var(--surface); padding: 10px 4px 18px; font-family: var(--display); font-size: 10.5px; color: #9A9A9A; }
.phone-tabs .on { color: var(--coral); font-weight: 700; }

/* quick facts under the hero */
.factstrip-wrap { padding-bottom: 64px; }
.factstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.factstrip div { background: var(--surface); padding: 20px 22px; }
.factstrip strong { display: block; font-family: var(--display); font-size: 1.3rem; line-height: 1.2; margin-bottom: 4px; }
.factstrip div:nth-child(4n+1) strong { color: var(--coral); }
.factstrip div:nth-child(4n+2) strong { color: var(--blue); }
.factstrip div:nth-child(4n+3) strong { color: var(--yellow); }
.factstrip span { color: var(--muted); font-size: .92rem; line-height: 1.5; display: block; }

/* the app: capability cards */
.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cap { --accent: var(--coral); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 24px; }
.cap-blue { --accent: var(--blue); }
.cap-yellow { --accent: var(--yellow); }
.cap h3 { display: flex; align-items: center; gap: 12px; font-size: 1.12rem; margin: 0 0 14px; }
.cap .icon { width: 40px; height: 40px; border-radius: 12px; margin: 0; }
.cap .icon svg { width: 22px; height: 22px; }
.cap ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cap li { position: relative; padding-left: 20px; font-size: .95rem; line-height: 1.5; color: var(--body-text); }
.cap li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* how it works: three numbered steps */
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: how; }
.how-steps li { --accent: var(--coral); counter-increment: how; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px 24px; }
.how-steps li:nth-child(2) { --accent: var(--blue); }
.how-steps li:nth-child(3) { --accent: var(--yellow); }
.how-steps li::before { content: counter(how); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--bg); font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin-bottom: 16px; }
.how-steps h3 { font-size: 1.25rem; margin-bottom: .35em; }
.how-steps p { margin: 0; color: var(--body-text); }

/* about */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px 48px; align-items: start; }
.about-grid .section-head { margin-bottom: 0; }
.about-copy .lede { color: var(--text); margin-bottom: .8em; }
.about-copy p:last-child { margin-bottom: 0; color: var(--body-text); }

/* contact */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 760px; }
.contact-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--surface); }
.contact-card h3 { font-size: .9rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.contact-card p { margin: 0; }
.contact-card .big { font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }

/* inner pages */
.page-head { padding: 56px 0 8px; }
.updated { color: var(--muted); font-size: .95rem; }
.prose { padding: 16px 0 72px; color: var(--body-text); }
.prose h2 { color: var(--text); font-size: 1.45rem; margin-top: 2em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.prose h2:first-of-type { margin-top: 1.2em; }
.prose h3 { color: var(--text); margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .45em; }
.summary { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--coral); border-radius: 12px; padding: 20px 24px; margin: 24px 0 8px; }
.summary p:last-child, .summary ul:last-child { margin-bottom: 0; }

/* footer */
.site-footer { background: #0B0B0B; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 28px; font-size: .96rem; }
.footer-brand img { width: 88px; margin-bottom: 14px; }
.footer-brand p { color: var(--muted); }
.footer-brand strong { color: var(--text); }
.footer-head { font-family: var(--display); font-size: .82rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-base { border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 28px; font-size: .88rem; color: var(--muted); }
.footer-base p { margin: 0; }

/* 404 */
.notfound { padding: 96px 0 120px; text-align: center; }
.notfound .lede { margin: 0 auto; }
.notfound .btn-row { justify-content: center; }

/* responsive */
@media (max-width: 980px) {
  .app-grid, .factstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-steps { grid-template-columns: 1fr; max-width: 680px; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 40px 0 36px; }
  .section { padding: 58px 0; }
  .factstrip-wrap { padding-bottom: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  body { font-size: 16.5px; }
  .app-grid, .contact-grid { grid-template-columns: 1fr; }
  .factstrip div { padding: 16px; }
  .factstrip strong { font-size: 1.1rem; }
  .phone { width: 264px; border-radius: 42px; }
  .phone-screen { min-height: 0; border-radius: 32px; }
  .phone-head strong { font-size: 18px; }
  h1 { font-size: 2rem; }
  .brand img { width: 56px; }
  .brand { gap: 8px; }
  .brand-name { font-size: .98rem; }
  .site-nav { order: 3; width: 100%; margin-left: 0; gap: 4px 18px; }
  .site-nav a { font-size: .95rem; }
  .header-row { column-gap: 12px; }
  .nav-cta { margin-left: auto; padding: 7px 13px; font-size: .92rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .lede { font-size: 1.1rem; }
}
@media (max-width: 380px) {
  .factstrip { grid-template-columns: 1fr; }
  .brand img { width: 48px; }
  .brand-name { font-size: .9rem; }
  .nav-cta { padding: 6px 11px; font-size: .86rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
