/* Heart: the shared layout of the Heart Apps sites. Each site sets its own colours and faces in
   its theme file; everything here reads only the tokens below. */

:root {
  --bg: #0E0D10;
  --surface: #18161B;
  --surface-2: #232026;
  --ink: #EFEDEA;
  --muted: #B3ACA2;
  --accent: #F2B84B;
  --accent-ink: #121110;
  --accent-hover: #F6C76E;
  --field: var(--accent);
  --field-ink: var(--accent-ink);
  --font-display: 'DM Sans', system-ui, sans-serif;
  --font-text: 'DM Sans', system-ui, sans-serif;
  --display-weight: 700;
  --display-track: -0.035em;
  --display-case: none;
  --s-small: 0.9375rem;
  --s-body: 1.0625rem;
  --s-lede: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem);
  --s-head: clamp(1.5rem, 1.15rem + 1vw, 2rem);
  --s-h2: clamp(2.25rem, 1.4rem + 3vw, 4rem);
  --s-h1: clamp(2.75rem, 1.2rem + 5.6vw, 6.25rem);
  --margin: clamp(1rem, 3vw, 2.5rem);
  --max: 1240px;
  --gap: clamp(1rem, 2.4vw, 2rem);
  --section: clamp(6rem, 11vw, 10rem);
  --radius: 28px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  /* Read from the colours above, so every theme gets its own lines, glows and shadows. */
  --line: color-mix(in srgb, var(--ink) 10%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 18%, transparent);
  --glow: color-mix(in srgb, var(--accent) 30%, transparent);
  --shadow: 0 30px 70px -28px rgb(0 0 0 / 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-color: color-mix(in srgb, var(--ink) 24%, transparent) var(--bg); caret-color: var(--accent); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--ink); font: 400 var(--s-body)/1.55 var(--font-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: from-font; }
p, li, dd, dt, summary, figcaption { text-wrap: pretty; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.nums { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--margin)); margin-inline: auto; padding-inline: var(--margin); }
.section { padding-block: var(--section) 0; }

/* The lit ground: the page's own colour glows from the top. */
main { position: relative; isolation: isolate; }
main::before { content: ''; position: absolute; inset: 0 0 auto; z-index: -1; pointer-events: none; }
main::before { height: min(1100px, 130vh); background: radial-gradient(60% 70% at 72% 0%, var(--glow), transparent 70%), radial-gradient(45% 55% at 8% 12%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); }

/* ---------- type ---------- */
.h1, .h2, .h3 { font-family: var(--font-display); font-weight: var(--display-weight); text-transform: var(--display-case); text-wrap: balance; }
.h1 { font-size: var(--s-h1); line-height: 0.98; letter-spacing: var(--display-track); }
.h2 { font-size: var(--s-h2); line-height: 1.04; letter-spacing: calc(var(--display-track) * 0.8); }
.h3 { font-size: var(--s-head); line-height: 1.15; letter-spacing: calc(var(--display-track) * 0.4); }
.lede { font-size: var(--s-lede); line-height: 1.45; max-width: 34ch; }
.soft { color: var(--muted); }
.copy p + p { margin-top: 0.9em; }
.head { display: grid; gap: 20px; max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.head p { font-size: var(--s-lede); line-height: 1.45; max-width: 40ch; color: var(--muted); }
.get .head p { color: inherit; }

/* ---------- controls ---------- */
.button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.25); transition: transform 160ms var(--ease-out), background-color 180ms ease, box-shadow 220ms ease; }
.button:active { transform: translateY(0) scale(0.96); }
.button-tone { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.button-small { min-height: 44px; padding: 0 20px; }
/* A link's underline: faint at rest, drawn across in full on hover. */
.link { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat, linear-gradient(color-mix(in srgb, currentColor 32%, transparent), color-mix(in srgb, currentColor 32%, transparent)) 0 100% / 100% 2px no-repeat; padding-bottom: 3px; transition: background-size 320ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgb(0 0 0 / 0.65), inset 0 1px 0 rgb(255 255 255 / 0.25); }
  .button:active { transform: translateY(0) scale(0.96); }
  .button-tone:hover { background: color-mix(in srgb, var(--surface-2) 80%, var(--ink) 10%); box-shadow: inset 0 0 0 1px var(--line-strong); }
  .link:hover { background-size: 100% 2px, 100% 2px; }
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }

/* ---------- the bar: it stays at the top, over a frosted strip ---------- */
.bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px; min-height: 76px; }
.bar::before { content: ''; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid transparent; opacity: 0; transition: opacity 240ms ease, border-color 240ms ease; }
.bar.is-stuck::before { opacity: 1; border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--s-body); text-transform: var(--display-case); text-decoration: none; letter-spacing: -0.01em; }
.brand img { width: 40px; height: 40px; border-radius: 11px; transition: transform 300ms var(--ease-out); }
.bar nav { display: flex; gap: 4px; margin-left: auto; }
.bar nav + .button, .bar nav + .menu-button + .button { margin-left: 8px; }
.bar nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-weight: 500; transition: color 180ms ease, background-color 180ms ease; }
.menu-button { display: none; }
@media (hover: hover) and (pointer: fine) {
  .bar nav a:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
  .brand:hover img { transform: rotate(-8deg) scale(1.06); }
}

/* ---------- the hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap); align-items: center; padding-block: clamp(2rem, 6vw, 5rem) 0; }
.hero-text { display: grid; gap: 32px; align-content: center; }
.hero-text .lede { max-width: 30ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: var(--s-small); }
.facts li { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.facts li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero-media { position: relative; display: grid; justify-items: center; }
/* A soft pool of the accent colour under the hero's picture. */
.hero-media::before { content: ''; position: absolute; inset: 8% 4%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); filter: blur(30px); }

/* A phone: the screen in a bezel with a lit edge, standing off the page. */
.phone { position: relative; width: min(100%, 310px); padding: 10px; border-radius: 46px; background: linear-gradient(155deg, color-mix(in srgb, var(--surface-2) 70%, var(--ink) 14%), var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 80%, #000) 100%); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); }
.phone img { width: 100%; border-radius: 37px; background: var(--surface); }
.hero .phone { width: min(100%, 360px); }

/* ---------- feature rows: words on one side, one screen on the other ---------- */
.rows { display: grid; gap: clamp(4rem, 9vw, 8rem); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.row-media { position: relative; display: grid; justify-items: center; overflow: hidden; padding-block: clamp(2rem, 4vw, 3.5rem); border-radius: var(--radius); background: radial-gradient(70% 60% at 50% 38%, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface) 72%); box-shadow: inset 0 0 0 1px var(--line); }
.row-media > * { position: relative; z-index: 1; }
.row:nth-child(even) .row-media { order: -1; }
.row-text { display: grid; gap: 22px; max-width: 32rem; }
.row:nth-child(even) .row-text { justify-self: start; }
.ticks { display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 0.18em; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.ticks li::after { content: ''; position: absolute; left: 7px; top: 0.5em; width: 8px; height: 5px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.phone, .window { overflow: hidden; }
.phone img, .window img, .row-media img { transition: transform 600ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .row-media:hover .phone img, .row-media:hover .window img { transform: scale(1.025); }
}

/* ---------- everything else: small cards in columns ---------- */
.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 3.5vw, 3rem) var(--gap); }
.more div { position: relative; display: grid; gap: 8px; align-content: start; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.more div::before { content: ''; position: absolute; top: -2px; left: 0; width: 32px; height: 3px; border-radius: 2px; background: var(--accent); transform-origin: left; transition: transform 320ms var(--ease-out); }
.more div:hover::before { transform: scaleX(2); }
.more dt { font-weight: 700; font-size: 1.0625rem; }
.more dd { max-width: 38ch; color: var(--muted); }

/* ---------- get it: the one field of colour ---------- */
.get { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); padding: clamp(2rem, 4vw, 3.5rem); border-radius: calc(var(--radius) + 4px); background: radial-gradient(80% 120% at 0% 0%, color-mix(in srgb, var(--field) 82%, #fff), var(--field) 55%), var(--field); color: var(--field-ink); box-shadow: var(--shadow); }
.get::before { content: ''; position: absolute; right: -12%; bottom: -60%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--field-ink) 14%, transparent), transparent); pointer-events: none; }
.get > * { position: relative; }
.get .head { margin: 0; align-content: start; }
.ways { display: grid; gap: 10px; align-content: start; }
.way { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 18px; align-items: center; min-height: 84px; padding: 14px 22px 14px 18px; border-radius: 20px; background: color-mix(in srgb, var(--field-ink) 9%, transparent); text-decoration: none; transition: background-color 180ms ease, transform 160ms var(--ease-out), box-shadow 220ms ease; }
.way:active { transform: scale(0.985); }
.way img { width: 48px; height: 48px; border-radius: 12px; }
.way strong { display: block; }
.way span span { display: block; font-size: var(--s-small); opacity: 0.9; }
.way .go { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.way .go::after { content: '→'; transition: transform 220ms var(--ease-out); }
.way-main { background: var(--field-ink); color: var(--field); }
@media (hover: hover) and (pointer: fine) {
  .way:hover { background: color-mix(in srgb, var(--field-ink) 16%, transparent); transform: translateY(-2px); }
  .way-main:hover { background: color-mix(in srgb, var(--field-ink) 90%, var(--field)); box-shadow: 0 18px 30px -18px rgb(0 0 0 / 0.6); }
  .way:hover .go::after { transform: translateX(4px); }
  .way:active { transform: scale(0.985); }
}

/* ---------- questions ---------- */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--gap); }
.faq .head { align-content: start; margin: 0; }
.faq-list { display: grid; gap: 8px; }
.faq-list details { border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background-color 180ms ease, box-shadow 180ms ease; }
.faq-list details[open] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; padding: 16px 22px; font-weight: 700; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); font-weight: 400; font-size: 1.375rem; line-height: 1; transition: transform 240ms var(--ease-out), background-color 180ms ease, color 180ms ease; }
.faq-list details[open] summary::after { transform: rotate(45deg); background: var(--accent); color: var(--accent-ink); }
.faq-list details p { padding: 0 22px 20px; max-width: 72ch; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .faq-list details:not([open]):hover { background: var(--surface-2); } }

/* ---------- note from the maker ---------- */
.note { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--gap); }
.note .copy { font-size: var(--s-lede); line-height: 1.5; max-width: 40ch; }
.note .actions { margin-top: 28px; }

/* ---------- footer ---------- */
.foot { position: relative; margin-top: var(--section); padding-block: clamp(3rem, 6vw, 5rem) 32px; background: var(--surface); box-shadow: inset 0 1px 0 var(--line); overflow: hidden; }
.foot::before { content: ''; position: absolute; left: 50%; top: 0; width: min(900px, 90vw); height: 1px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.7; }
.foot-name { font-family: var(--font-display); font-weight: var(--display-weight); text-transform: var(--display-case); font-size: var(--s-h1); line-height: 0.9; letter-spacing: var(--display-track); white-space: nowrap; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 32px var(--gap); margin-top: clamp(2.5rem, 5vw, 4rem); }
.foot-cols h2 { font-size: var(--s-small); font-weight: 700; margin-bottom: 10px; }
.foot-cols a { display: block; padding-block: 5px; text-decoration: none; color: var(--muted); transition: color 180ms ease, transform 180ms var(--ease-out); }
.foot-cols a[href^="mailto:"] { white-space: nowrap; }
.foot-cols a:hover { color: var(--ink); }
/* Links to the other apps carry their icons. The link home to Heart Apps is a chip, its mark and name on one line. */
.foot-cols .to-app { display: flex; align-items: center; gap: 10px; }
/* The icons are dark tiles; the ring keeps their edge visible on a dark footer. */
.foot-cols .to-app img { flex: none; width: 24px; height: 24px; border-radius: 7px; box-shadow: 0 0 0 1px var(--surface-2); }
.foot-cols .to-home { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 16px 7px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 500; white-space: nowrap; }
.foot-cols .to-home img { flex: none; width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) { .foot-cols a:not(.to-home):hover { transform: translateX(3px); } }
.foot-last { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--s-small); }

/* ---------- light that follows the pointer across a card ---------- */
[data-spot] { position: relative; isolation: isolate; }
[data-spot]::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgb(255 255 255 / 0.13), transparent 45%); opacity: 0; transition: opacity 300ms ease; }
@media (hover: hover) and (pointer: fine) { [data-spot]:hover::after { opacity: 1; } }

/* ---------- entrance: the first screen rises once on load; nothing else waits to be shown ---------- */
@keyframes heart-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes heart-lift { from { opacity: 0; transform: translateY(40px) scale(0.97); } to { opacity: 1; transform: none; } }
.hero [data-reveal], .intro [data-reveal], .hero-side, .hero h1 { animation: heart-rise 900ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 60ms); }
.hero-media, .hero .stage, .hero .window { animation: heart-lift 1100ms var(--ease-out) both; animation-delay: 220ms; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- tablet ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
  .more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .get, .faq, .note { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- phone: its own composition, one column, the menu behind a button ---------- */
@media (max-width: 680px) {
  .bar { min-height: 64px; gap: 8px; }
  .brand { white-space: nowrap; gap: 10px; }
  .brand img { width: 36px; height: 36px; }
  .bar nav { display: none; }
  .bar > .button { margin-left: auto; min-height: 44px; padding: 0 16px; white-space: nowrap; font-size: 0.9375rem; }
  .menu-button { order: 9; flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
  .menu-button span, .menu-button span::before, .menu-button span::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 240ms var(--ease-out), opacity 180ms ease; }
  .menu-button span { position: relative; }
  .menu-button span::before, .menu-button span::after { content: ''; position: absolute; left: 0; }
  .menu-button span::before { top: -6px; }
  .menu-button span::after { top: 6px; }
  .bar.is-open .menu-button span { background: transparent; }
  .bar.is-open .menu-button span::before { transform: translateY(6px) rotate(45deg); }
  .bar.is-open .menu-button span::after { transform: translateY(-6px) rotate(-45deg); }
  .bar.is-open::before { opacity: 1; }
  .bar.is-open nav { display: grid; position: fixed; left: 0; right: 0; top: 64px; bottom: 0; align-content: start; gap: 4px; padding: 16px var(--margin) 32px; background: var(--bg); overflow-y: auto; }
  .bar.is-open nav a { min-height: 56px; padding: 0 4px; border-bottom: 1px solid var(--line); border-radius: 0; font-family: var(--font-display); font-weight: var(--display-weight); text-transform: var(--display-case); font-size: 1.75rem; }
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 16px; }
  .hero-text { gap: 24px; }
  .hero .phone { width: min(78%, 320px); }
  .row { grid-template-columns: 1fr; gap: 28px; }
  .row .row-media, .row:nth-child(even) .row-media { order: 0; }
  .row:nth-child(even) .row-text { justify-self: start; }
  .row-text { padding: 0 !important; }
  .row .phone { width: min(74%, 290px); }
  .more { grid-template-columns: 1fr; }
  .get { padding: 28px 18px; }
  .way { grid-template-columns: 40px minmax(0, 1fr); padding: 14px 16px; }
  .way img { width: 40px; height: 40px; }
  .way .go { display: none; }
  .foot-name { white-space: normal; }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) { .foot-cols { grid-template-columns: 1fr; } }
