/* heymatric.com: one style sheet for every page. Plain CSS, no build step.
   The colours are the app's own (frontend/app/src/design/theme/colors.ts). The spacing, type scale and
   section rhythm follow website/docs/reference-notes.md. Phone first: the rules at the top are for
   phones, the @media blocks add to them for wider screens (768 px tablet, 992 px desktop). */

:root {
  --blue: #080AA0;        /* the app's primary colour */
  --blue-light: #0A0DC4;
  --blue-dark: #05066E;
  --navy: #0B0C3D;        /* the eyes of the mark */
  --yellow: #FDE68A;      /* "HEY" in the mark */
  --amber: #F59E0B;       /* the accent: small dots only, never body text */
  --tint: #F4F5FC;        /* the app's surface colour */
  --tint-2: #E8E9F8;
  --white: #FFFFFF;
  --text: #111827;
  --muted: #4B5563;
  --line: rgba(17, 24, 39, .14);
  --line-on-blue: rgba(255, 255, 255, .22);

  --font: "Noto Sans", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  --max: 1200px;
  --pad: 16px;            /* side padding */
  --section: 64px;        /* space above and below a section */
  --gap: 12px;

  --fs-hero: 2.75rem;     /* 44px */
  --fs-h2: 2.125rem;      /* 34px */
  --fs-h3: 1.25rem;       /* 20px */
  --fs-lead: 1.125rem;    /* 18px */
  --fs-body: 1rem;        /* 16px */
  --fs-small: .875rem;    /* 14px */
  --fs-label: .75rem;     /* 12px */
}
@media (min-width: 768px) {
  :root { --pad: 24px; --section: 96px; --gap: 16px;
    --fs-hero: 4rem; --fs-h2: 3rem; --fs-h3: 1.375rem; --fs-lead: 1.25rem; --fs-body: 1.0625rem; --fs-small: .9375rem; --fs-label: .8125rem; }
}
@media (min-width: 992px) {
  :root { --pad: 32px; --section: 128px;
    --fs-hero: 5rem; --fs-h2: 3.75rem; --fs-h3: 1.625rem; --fs-lead: 1.375rem; --fs-body: 1.125rem; --fs-small: 1rem; }
}

/* ---- base ---------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--font); font-size: var(--fs-body); line-height: 1.55; color: var(--text); background: var(--white); }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
h3 { line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; }
ol[role="list"] { list-style: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: var(--section) 0; }
.section--tint { background: var(--tint); }
.section--blue { background: var(--blue); color: var(--white); }

.skip { position: absolute; left: 8px; top: -100px; z-index: 10; padding: 12px 16px; background: var(--yellow); color: var(--navy); font-weight: 600; border-radius: var(--radius); }
.skip:focus { top: 8px; }

/* The small label above a heading: uppercase, with the amber square in front of it. */
.label { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: var(--fs-label); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.label::before { content: ""; width: 8px; height: 8px; background: var(--amber); border-radius: 2px; }
.section--blue .label, .hero .label { color: rgba(255, 255, 255, .78); }

.lead { font-size: var(--fs-lead); color: var(--muted); max-width: 40ch; }
.section-head { display: grid; gap: 20px; margin-bottom: 48px; }
.section-head h2 { font-size: var(--fs-h2); max-width: 18ch; }
@media (min-width: 992px) {
  .section-head { grid-template-columns: 1fr 1fr; align-items: end; gap: 32px; margin-bottom: 64px; }
}

/* ---- the mark (the M face, HEY, MATRIC) ------------------------------------------------------ */
.mark { display: inline-flex; align-items: center; gap: 8px; color: var(--white); text-decoration: none; font-weight: 700; font-size: 1rem; letter-spacing: .12em; }
.mark svg { width: 20px; height: 22px; }
.mark .hey { color: var(--yellow); }

/* ---- top bar ---------------------------------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.topbar a.top-link { color: var(--white); font-size: var(--fs-small); font-weight: 600; text-decoration: none; padding: 10px 16px; border: 1px solid var(--line-on-blue); border-radius: var(--radius); }
.topbar a.top-link:hover { background: rgba(255, 255, 255, .08); }

/* ---- buttons ---------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 14px; min-height: 56px; padding: 6px 22px 6px 6px; border-radius: var(--radius); background: var(--yellow); color: var(--navy); font-weight: 600; font-size: var(--fs-body); line-height: 1.2; text-decoration: none; transition: transform .15s ease; }
.btn:hover { transform: scale(.98); }
.btn .btn-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 5px; background: var(--navy); }
.btn .btn-icon svg { width: 18px; height: 18px; }
.btn small { display: block; font-size: .75rem; font-weight: 500; opacity: .8; }
.btn--blue { background: var(--blue); color: var(--white); }
.btn--blue .btn-icon { background: var(--white); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

/* ---- hero ------------------------------------------------------------------------------------- */
.hero { background: var(--blue); background-image: linear-gradient(160deg, var(--blue-light) 0%, var(--blue) 45%, var(--blue-dark) 100%); color: var(--white); overflow: hidden; }
.hero-body { display: grid; gap: 40px; padding: 56px 0 var(--section); }
.hero h1 { font-size: var(--fs-hero); }
.hero .intro { margin-top: 24px; font-size: var(--fs-lead); color: rgba(255, 255, 255, .86); max-width: 34ch; }
.hero .actions { margin-top: 40px; display: grid; gap: 16px; justify-items: start; }
.hero .free { font-size: var(--fs-small); color: rgba(255, 255, 255, .86); }
.hero .free strong { color: var(--yellow); font-weight: 600; }
.buddy { width: min(48%, 190px); justify-self: center; }
@media (min-width: 768px) {
  .hero-body { padding-top: 80px; }
}
@media (min-width: 992px) {
  .hero-body { grid-template-columns: 7fr 5fr; align-items: center; padding-top: 112px; }
  .buddy { width: 340px; justify-self: end; }
}

/* ---- cards ------------------------------------------------------------------------------------ */
.grid { display: grid; gap: var(--gap); }
@media (min-width: 768px) { .grid--2, .grid--4 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.card { display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
@media (min-width: 992px) { .card { padding: 32px; } }
.card h3 { font-size: var(--fs-h3); }
.card p { color: var(--muted); }
.card .num { font-size: var(--fs-small); font-weight: 600; color: var(--blue); letter-spacing: .04em; }
.card .icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius); background: var(--tint-2); color: var(--blue); margin-bottom: 12px; }
.card .icon svg { width: 22px; height: 22px; }
@media (min-width: 768px) { .step { min-height: 240px; } .step .num { margin-bottom: auto; } }

/* streams */
.stream h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stream h3 span { font-size: var(--fs-small); font-weight: 500; color: var(--muted); letter-spacing: 0; }
.papers { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.papers li { padding: 10px 12px; border-radius: 6px; background: var(--tint); font-size: var(--fs-small); font-weight: 500; }
.note { margin-top: 24px; font-size: var(--fs-small); color: var(--muted); }

/* price */
.price { display: grid; gap: var(--gap); }
@media (min-width: 992px) { .price { grid-template-columns: 5fr 7fr; } }
.price-main { background: var(--blue); color: var(--white); border: 0; }
.price-main h3 { font-size: var(--fs-h2); letter-spacing: -.03em; line-height: 1.1; }
.price-main p { color: rgba(255, 255, 255, .86); }
.ticks { list-style: none; display: grid; gap: 16px; }
.ticks li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; color: var(--muted); }
.ticks li strong { color: var(--text); font-weight: 600; }
.ticks li::before { content: ""; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%; background: var(--tint-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23080AA0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }

/* parents */
.split { display: grid; gap: 40px; }
@media (min-width: 992px) { .split { grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; } }
.split h2 { font-size: var(--fs-h2); }
.split .lead { margin-top: 20px; }
.report { margin: 0; padding: 24px; border-radius: var(--radius); background: var(--tint); border: 1px solid var(--line); }
.report-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.report-head strong { font-size: var(--fs-h3); letter-spacing: -.01em; }
.report-head span { color: var(--muted); font-size: var(--fs-small); }
.report dl { margin: 0; display: grid; gap: 8px; }
.report .row { display: flex; justify-content: space-between; padding: 10px 12px; background: var(--white); border-radius: 6px; font-size: var(--fs-small); }
.report dt { color: var(--muted); }
.report dd { margin: 0; font-weight: 600; }
.report .total { margin-top: 12px; display: flex; justify-content: space-between; font-weight: 600; }
.report .sample { margin-top: 12px; font-size: var(--fs-label); color: var(--muted); }

/* FAQ: <details> opens and closes without any script. */
.faq { border-top: 1px solid var(--line); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; padding: 16px 0; cursor: pointer; list-style: none; font-weight: 600; font-size: var(--fs-lead); letter-spacing: -.01em; line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); font-weight: 400; font-size: 1.25rem; color: var(--blue); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 24px; color: var(--muted); max-width: 64ch; }
.faq details p + p { margin-top: -12px; }

/* last call */
.cta { text-align: center; display: grid; justify-items: center; gap: 24px; }
.cta h2 { font-size: var(--fs-h2); max-width: 16ch; }
.cta p { color: rgba(255, 255, 255, .86); font-size: var(--fs-lead); max-width: 36ch; }

/* ---- footer ----------------------------------------------------------------------------------- */
.footer { background: var(--navy); color: rgba(255, 255, 255, .78); padding: 56px 0 32px; font-size: var(--fs-small); }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer .tag { margin-top: 12px; max-width: 32ch; }
.footer h2 { font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .6); margin-bottom: 12px; }
.footer ul { list-style: none; display: grid; gap: 4px; }
.footer a { color: var(--white); text-decoration: none; display: inline-block; padding: 6px 0; }
.footer a:hover { text-decoration: underline; }
.footer a.mark { display: inline-flex; padding: 0; }
.footer .legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: var(--fs-label); color: rgba(255, 255, 255, .6); }

/* ---- text pages (terms, privacy, 404) --------------------------------------------------------- */
.page-head { background: var(--blue); color: var(--white); }
.page-head .title { padding: 48px 0 64px; }
.page-head h1 { font-size: var(--fs-h2); }
.page-head p { margin-top: 16px; color: rgba(255, 255, 255, .86); }
.prose { max-width: 720px; padding: var(--section) 0; }
.prose h2 { font-size: var(--fs-h3); letter-spacing: -.01em; line-height: 1.3; margin: 48px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin: 0 0 16px; color: #1F2937; }
.prose ul { padding-left: 1.25em; }
.prose li { margin-bottom: 8px; }
.prose .meta { color: var(--muted); font-size: var(--fs-small); padding-bottom: 24px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
