/* Omelvian website. No scripts, self-hosted fonts, and the app's logo. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #eaf0eb;      /* graph paper */
  --paper-deep: #dde7df;
  --rule: #c3d1c7;
  --ink: #0c1d15;        /* the app's page colour */
  --ink-soft: #46574e;
  --night: #0c1d15;      /* header and footer, as the app */
  --night-ink: #e7f0ea;
  --night-muted: #8ea699;
  --night-rule: #26443a;
  --mint: #8fe3b0;       /* the app's accent: buttons, highlights */
  --mint-deep: #6fd49a;
  --green: #17703f;      /* the accent as text on paper (5.3:1) */
  --line: #23864f;       /* the accent as a chart line on paper */
  --logo-a: #8fe3b0;
  --logo-b: #3d95f0;
  --ochre: #b8892b;      /* forecast ranges */
  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --text: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --measure: 66ch;
  --header: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Sections land below the sticky header. On the sections, not the page: the phone menu is a
   fixed panel, and page-wide scroll padding would scroll the page when it opens. */
main [id] { scroll-margin-top: calc(var(--header) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--ink); text-decoration-color: var(--line); }
:focus-visible { outline: 3px solid var(--line); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 16px; top: -48px; padding: 8px 12px;
  background: var(--mint); color: var(--ink); z-index: 20;
}
.skip:focus { top: 12px; }

h1, h2, h3, dt {
  font-family: var(--display);
  font-variation-settings: "wdth" 88;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0;
  font-weight: 700;
}

.button {
  display: inline-block; padding: 11px 20px; border-radius: 999px;
  background: var(--mint); color: var(--ink); text-decoration: none; font-weight: 600;
  border: 2px solid var(--ink);
}
.button:hover { background: var(--mint-deep); color: var(--ink); }
.button.quiet { background: transparent; }
.button.quiet:hover { background: var(--ink); color: var(--paper); }

/* Header: on the page's own paper, and it stays at the top as the page scrolls. The logo
   is the app's, with its letters in the app's dark green. ------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper); color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; gap: 28px;
  max-width: 1160px; min-height: var(--header); margin: 0 auto; padding: 0 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
}
.brand-mark { width: 36px; height: 24.5px; flex: none; }
.brand-mark circle { stroke-width: 3.5; }
.brand-mark .a { fill: rgba(143, 227, 176, 0.18); stroke: var(--logo-a); }
.brand-mark .b { fill: rgba(61, 149, 240, 0.18); stroke: var(--logo-b); }
.wordmark { height: 23.3px; width: auto; flex: none; overflow: visible; }
.wordmark .strokes {
  fill: none; stroke: var(--ink); stroke-width: 4.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.site-nav a, .menu-panel ul a:not(.button) {
  text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent;
}
.site-nav a { color: var(--ink); font-weight: 500; }
.menu-panel ul a:not(.button) { color: var(--night-ink); font-weight: 600; }
.site-nav a:hover { border-bottom-color: var(--line); color: var(--ink); }
/* The section you jumped to keeps its link underlined. */
body:has(#loop:target) :is(.site-nav, .menu-panel) a[href="/#loop"],
body:has(#use-cases:target) :is(.site-nav, .menu-panel) a[href="/#use-cases"],
body:has(#who:target) :is(.site-nav, .menu-panel) a[href="/#who"],
body:has(#data:target) :is(.site-nav, .menu-panel) a[href="/#data"],
body:has(#contact:target) :is(.site-nav, .menu-panel) a[href="/#contact"] {
  border-bottom-color: var(--line); color: var(--ink);
}
body:has(#loop:target) .menu-panel a[href="/#loop"],
body:has(#use-cases:target) .menu-panel a[href="/#use-cases"],
body:has(#who:target) .menu-panel a[href="/#who"],
body:has(#data:target) .menu-panel a[href="/#data"],
body:has(#contact:target) .menu-panel a[href="/#contact"] { color: var(--mint); border-bottom-color: var(--mint); }
.header-signin { padding: 8px 18px; }

/* Phones: a menu button opens the links below the header. It is a link to #menu, so it
   needs no script, and following any link in it closes it. */
.menu-open, .menu-close {
  display: none; width: 44px; height: 44px; border-radius: 10px;
  align-items: center; justify-content: center;
}
.menu-open { color: var(--ink); }
.menu-close { color: var(--night-ink); }
.menu-open svg, .menu-close svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round;
}
.menu-open:hover { box-shadow: inset 0 0 0 2px var(--line); }
.menu-close:hover { box-shadow: inset 0 0 0 2px var(--mint); }
/* Closing the menu targets this point, just before the menu button: it is fixed, so the page
   does not move, and the next Tab lands on the menu button. */
.menu-closed { position: fixed; top: 0; width: 0; height: 0; overflow: hidden; }
.menu-panel {
  display: none; position: fixed; inset: 0 0 auto 0; z-index: 11;
  background: var(--night); border-bottom: 1px solid var(--night-rule);
  padding: 12px 16px 24px;
}
.menu-panel:target { display: block; }
.menu-panel .menu-close { display: flex; margin-left: auto; }
.menu-panel ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.menu-panel ul a:not(.button) { display: block; padding: 12px 4px; font-size: 1.15rem; }
.menu-panel ul a:not(.button):hover { color: var(--mint); }
.menu-panel .button { margin-top: 12px; }

/* Hero: the page's one bold moment, on graph paper ------------------------------------- */

.hero {
  display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: center;
  max-width: 1160px; margin: 0 auto; padding: 56px 24px 72px;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  border-bottom: 1px solid var(--rule);
}
.hero-text { background: var(--paper); padding: 8px 8px 8px 0; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); font-weight: 760; max-width: 13ch; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 40ch; margin: 22px 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

.hero-chart { margin: 0; background: var(--paper); border: 1px solid var(--rule); padding: 12px; }
.hero-chart svg { display: block; width: 100%; height: auto; }
.hero-chart figcaption { font-size: 0.85rem; color: var(--ink-soft); padding: 6px 4px 0; }

.grid line { stroke: var(--rule); stroke-width: 1; }
.now { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 4; }
.axis, .labels text { font: 500 13px var(--text); fill: var(--ink-soft); }
.band { fill: var(--ochre); opacity: 0.22; }
.saved { fill: var(--mint); opacity: 0.55; }
.history, .forecast, .variant { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.history { stroke: var(--ink); stroke-width: 2.4; }
.forecast { stroke: var(--ink); stroke-width: 2.4; stroke-dasharray: 0.012 0.012; }
.variant { stroke: var(--line); stroke-width: 3; }
.labels .l-forecast { fill: var(--ink); font-weight: 700; }
.labels .l-band { fill: #8a6519; }
.labels .l-variant { fill: var(--green); font-weight: 800; }
.labels .l-saved { fill: var(--green); font-weight: 700; }
.labels .tick { stroke: var(--green); stroke-width: 1; }

/* The chart draws itself once: history, then the forecast, then the test. */
@media (prefers-reduced-motion: no-preference) {
  .history { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s ease-out forwards; }
  .band, .forecast, .l-forecast, .l-band { opacity: 0; animation: appear 0.6s ease-out 1.3s forwards; }
  .band { animation-name: appear-band; }
  .variant { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s ease-in-out 2s forwards; }
  .saved, .l-variant, .l-saved, .tick { opacity: 0; animation: appear 0.6s ease-out 2.8s forwards; }
  .saved { animation-name: appear-saved; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes appear-band { to { opacity: 0.22; } }
@keyframes appear-saved { to { opacity: 0.55; } }

/* Sections --------------------------------------------------------------------------- */

main > section:not(.hero) { max-width: 1160px; margin: 0 auto; padding: 80px 24px 24px; }
main h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 720; max-width: 22ch; }
.section-lede { color: var(--ink-soft); font-size: 1.12rem; max-width: 52ch; margin: 14px 0 0; }

/* The loop is a real sequence, so it is numbered. */
.steps {
  list-style: none; counter-reset: step; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
}
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 16px; }
.steps li::before {
  content: counter(step);
  display: block; font: 700 2.6rem/1 var(--display); color: var(--green); margin-bottom: 10px;
}
.steps li:last-child { border-top-color: var(--line); }
.steps h3 { font-size: 1.45rem; margin-bottom: 8px; }
.steps p { margin: 0; color: var(--ink-soft); }

/* From events to evidence: two places, one line between them that only totals cross. */
.flow-diagram {
  margin-top: 40px; display: grid; grid-template-columns: 2fr auto 3fr; gap: 0;
  align-items: stretch;
}
.flow-side { padding: 22px 22px 26px; }
.flow-side.inside { background: var(--paper-deep); border: 1px solid var(--rule); }
.flow-side.omelvian { background: var(--night); color: var(--night-ink); }
.flow-place { margin: 0 0 16px; font-weight: 700; font-size: 0.95rem; color: var(--ink-soft); }
.omelvian .flow-place { color: var(--mint); }
.flow-steps {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 18px;
  grid-auto-flow: column; grid-auto-columns: 1fr;
}
.flow-steps li { counter-increment: flow; position: relative; padding-top: 44px; }
.flow-steps { counter-reset: flow; }
.flow-steps[start="3"] { counter-reset: flow 2; }
.flow-steps li::before {
  content: counter(flow);
  position: absolute; top: 0; left: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font: 700 1rem/1 var(--display);
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
}
.omelvian .flow-steps li::before { background: var(--mint); border-color: var(--mint); }
.flow-steps li:not(:last-child)::after {  /* the arrow on to the next step */
  content: ""; position: absolute; top: 15px; left: 40px; right: -10px;
  border-top: 2px solid currentColor; opacity: 0.45;
}
.flow-steps h3 { font-size: 1.1rem; margin-bottom: 6px; }
.flow-steps p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
.omelvian .flow-steps p { color: var(--night-muted); }
.flow-line {
  margin: 0; width: 44px; position: relative; display: flex; justify-content: center;
  align-items: center; border-left: 3px dashed var(--line); margin-left: 20px;
}
.flow-line span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-weight: 700; font-size: 0.85rem; color: var(--green); background: var(--paper);
  padding: 8px 0; margin-left: -22px;
}

.cases {
  list-style: none; margin: 36px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.cases li { background: var(--paper-deep); border: 1px solid var(--rule); padding: 22px; }
.cases h3 { font-size: 1.2rem; margin-bottom: 8px; }
.cases p { margin: 0; color: var(--ink-soft); }
.cases .case-feature {
  grid-column: 1 / -1; background: var(--night); color: var(--night-ink); border-color: var(--night);
}
.cases .case-feature h3 { color: var(--mint); font-size: 1.45rem; }
.cases .case-feature p { color: var(--night-ink); max-width: 72ch; }

.audiences {
  margin: 36px 0 0; display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 40px 48px;
}
.audiences div { border-left: 4px solid var(--mint); padding-left: 20px; }
.audiences dt { font-size: 1.35rem; font-weight: 680; }
.audiences dd { margin: 10px 0 0; color: var(--ink-soft); max-width: 50ch; }

.facts { list-style: none; padding: 0; margin: 32px 0 0; max-width: var(--measure); }
.facts li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.facts li:first-child { border-top: 1px solid var(--rule); }
.facts strong { font-family: var(--display); font-weight: 700; font-size: 1.12rem; margin-right: 4px; }
.note { color: var(--ink-soft); font-size: 0.95rem; max-width: var(--measure); margin-top: 18px; }

main > section.contact { padding-bottom: 80px; }
/* Tally's form, at a fixed height: its auto-height needs a script, and this site runs none. */
.contact-form { display: block; width: 100%; max-width: 680px; height: 760px; border: 0; margin-top: 24px; }

/* Footer ------------------------------------------------------------------------------- */

.site-footer { background: var(--night); color: var(--night-muted); font-size: 0.95rem; }
.footer-inner {
  max-width: 1160px; margin: 0 auto; padding: 28px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.site-footer p { margin: 0; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--night-ink); text-decoration-color: var(--night-rule); }
.site-footer a:hover { color: var(--mint); text-decoration-color: var(--mint); }

/* Text pages: privacy, terms, accessibility, security ------------------------------------ */

.prose { max-width: var(--measure); margin: 0 auto; padding: 48px 24px 80px; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 740; margin-bottom: 12px; }
.prose h2 { font-size: 1.35rem; margin: 32px 0 8px; }
.prose .updated { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 24px; }

/* Smaller screens -------------------------------------------------------------------------- */

@media (max-width: 1020px) {
  .site-nav ul { gap: 18px; }
  .header-inner { gap: 20px; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .flow-diagram { grid-template-columns: 1fr; }
  .flow-line {
    width: auto; height: 44px; margin: 0 0 0 0; border-left: 0;
    border-top: 3px dashed var(--line); margin-top: 22px;
  }
  .flow-line { align-items: flex-start; }
  .flow-line span { writing-mode: horizontal-tb; transform: none; margin: -12px 0 0; padding: 0 10px; }
}
@media (max-width: 860px) {
  :root { --header: 60px; }
  .site-nav, .header-signin { display: none; }
  .menu-open { display: flex; margin-left: auto; }
  .flow-steps { grid-auto-flow: row; }
  .flow-steps li { padding: 0 0 0 46px; }
  .flow-steps li:not(:last-child)::after {
    top: 38px; left: 15px; right: auto; bottom: -14px; border-top: 0;
    border-left: 2px solid currentColor;
  }
  .cases { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .hero, main > section:not(.hero) { padding-left: 16px; padding-right: 16px; }
  .steps, .audiences { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; padding: 24px 16px; }
}
