/* High Five International — ledger identity. See DESIGN.md. */

:root {
  --paper: #E6ECE6;
  --sheet: #F7F9F6;
  --ink: #13231E;
  --graphite: #4A5A52;
  --rule: #B9C7BD;
  --stamp: #2A48A6;
  --error: #A33A2B;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 64px;
  --section-pad: clamp(36px, 4.5vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 3px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.btn-ink { background: var(--ink); color: var(--sheet); }
.btn-ink:hover { background: #24382F; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--sheet); }
.btn-paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-paper:hover { background: var(--sheet); }
.btn[disabled] { cursor: progress; opacity: .7; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color .2s ease, border-color .2s ease;
}
.site-header.is-scrolled {
  background: rgba(230, 236, 230, .94);
  border-bottom-color: var(--ink);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; gap: 24px;
}
.wordmark {
  font-weight: 750;
  font-variation-settings: "wdth" 86;
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 28px;
}
.nav a {
  font-size: 15px;
  text-decoration: none;
  padding-block: 6px;
  border-bottom: 1px solid transparent;
}
.nav a:hover { border-bottom-color: var(--ink); }
.nav-cta, .menu-toggle { display: none; }

.menu-toggle {
  margin-left: auto;
  min-height: 40px; padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--ink); border-radius: 2px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}

@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; align-items: center; }
  .header-cta { margin-left: auto; }
  .header-cta + .menu-toggle { margin-left: 0; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper);
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    padding: 8px var(--gutter) 20px;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
  .site-header.menu-open { background: var(--paper); border-bottom-color: var(--ink); }
}
@media (max-width: 560px) {
  .header-cta { display: none; }
  .header-cta + .menu-toggle { margin-left: auto; }
  .nav-cta { display: inline-flex; margin-top: 20px; min-height: 50px; }
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(48px, 7vw, 104px) clamp(64px, 8vw, 120px); }
.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 0;
  align-items: start;
}
.hero-title { grid-column: 1 / -1; }
.hero-lede { grid-column: 1 / span 6; }

.hero-title {
  font-weight: 680;
  font-variation-settings: "wdth" 80;
  font-size: clamp(46px, 6.6vw, 100px);
  line-height: .96;
  letter-spacing: -0.025em;
}
.hero-title .line { display: block; }
.hero-title .line-indent { padding-left: 1.1em; color: var(--ink); }

.hero-sub {
  margin-top: clamp(28px, 3vw, 40px);
  max-width: 34em;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.6;
  color: var(--graphite);
}
.hero-actions {
  margin-top: 36px;
  display: flex; flex-wrap: wrap; gap: 12px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-title .line {
    animation: settle .9s cubic-bezier(.2, .7, .1, 1) both;
  }
  .hero-title .line-indent { animation-delay: .14s; }
  @keyframes settle {
    from { opacity: 0; letter-spacing: .03em; }
    to   { opacity: 1; letter-spacing: -0.025em; }
  }
}

/* Operations log */
.oplog {
  grid-column: 7 / -1;
  margin-top: clamp(32px, 3.5vw, 48px);
  background: var(--sheet);
  border: 1px solid var(--ink);
  font-size: 15px;
}
.oplog-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink);
}
.oplog-head figcaption { font-weight: 650; }
.oplog-status {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--graphite);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--stamp);
}
.oplog-pause {
  background: none; border: 0; padding: 4px 2px;
  font-size: 13px; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}

.oplog-list {
  --row: 68px;
  height: calc(var(--row) * 6);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  /* Ledger margin: a double rule between time and entry. */
  background:
    linear-gradient(var(--rule), var(--rule)) calc(16px + 5.5ch + 6px) 0 / 1px 100% no-repeat,
    linear-gradient(var(--rule), var(--rule)) calc(16px + 5.5ch + 9px) 0 / 1px 100% no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 44px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 44px);
}
.oplog-row {
  flex: 0 0 auto;
  height: var(--row);
  display: grid;
  grid-template-columns: 5.5ch minmax(0, 1fr) 22px;
  column-gap: 22px;
  align-items: center;
  padding-inline: 16px;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.oplog-row:last-child { border-bottom: 0; }
.oplog-time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}
.oplog-task { min-width: 0; line-height: 1.3; }
.oplog-task b {
  display: block;
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.oplog-task small {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--graphite);
}

.tick { width: 22px; height: 22px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tick circle { stroke: var(--rule); stroke-width: 1.5; transition: stroke .3s ease; }
.tick path { stroke: var(--stamp); stroke-width: 2; stroke-dasharray: 16; stroke-dashoffset: 16; }
.is-done .tick circle, .pain-turn .tick circle { stroke: var(--stamp); }
.is-done .tick path, .pain-turn .tick path { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: no-preference) {
  .oplog-row.is-entering { animation: row-in .45s cubic-bezier(.2, .7, .1, 1) both; }
  @keyframes row-in {
    from { height: 0; opacity: 0; }
    to   { height: var(--row); opacity: 1; }
  }
  .oplog-row .tick path { transition: stroke-dashoffset .45s cubic-bezier(.4, 0, .2, 1); }
  .is-working .tick circle { stroke: var(--graphite); stroke-dasharray: 3 3.6; animation: work 2.4s linear infinite; transform-origin: center; }
  @keyframes work { to { transform: rotate(360deg); } }
}

@media (max-width: 1100px) {
  .hero-lede, .oplog { grid-column: 1 / -1; }
  .oplog { max-width: 640px; margin-top: 56px; }
}
@media (max-width: 480px) {
  .oplog-list { --row: 78px; height: calc(var(--row) * 5); }
  .oplog-row { column-gap: 16px; padding-inline: 12px; font-size: 14px; }
  .oplog-task b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .oplog-list {
    background:
      linear-gradient(var(--rule), var(--rule)) calc(12px + 5.5ch + 4px) 0 / 1px 100% no-repeat,
      linear-gradient(var(--rule), var(--rule)) calc(12px + 5.5ch + 7px) 0 / 1px 100% no-repeat;
  }
  .oplog-status { display: none; }
  .oplog-pause { margin-left: auto; }
  .hero-title .line-indent { padding-left: .6em; }
}

/* ---------- Ledger sections ---------- */

.section { padding-block: var(--section-pad); }
.section .ledger { position: relative; }
.ledger {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
}
.ledger::before {
  content: "";
  grid-column: 1 / -1;
  height: 1px;
  background: var(--ink);
  margin-bottom: clamp(28px, 3.5vw, 48px);
}
.section-title {
  grid-column: 1 / span 4;
  font-weight: 650;
  font-variation-settings: "wdth" 84;
  font-size: clamp(28px, 2.7vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  padding-right: 24px;
}
.ledger-body { grid-column: 5 / -1; }

.body-lg { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.6; max-width: 38em; }
.measure { max-width: 36em; }

@media (max-width: 900px) {
  .section-title, .ledger-body { grid-column: 1 / -1; }
  .section-title { margin-bottom: 28px; }
}

/* Problems */
.pain-lead {
  font-weight: 620;
  font-variation-settings: "wdth" 84;
  font-size: clamp(30px, 3.8vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 14em;
}
.pain-columns {
  margin-top: clamp(28px, 3vw, 40px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.pain-columns li {
  padding: 22px 20px 26px;
  font-variation-settings: "wdth" 88;
  font-size: clamp(21px, 2vw, 30px);
  line-height: 1.15;
  color: var(--graphite);
}
.pain-columns li:first-child { padding-left: 0; }
.pain-columns li + li { border-left: 1px solid var(--rule); }

.pain-turn {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 26px;
  border-top: 3px double var(--ink);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  font-size: clamp(20px, 1.9vw, 28px);
  line-height: 1.4;
  font-weight: 520;
  max-width: 40em;
}
.pain-turn .tick { width: 30px; height: 30px; margin-top: .12em; }

@media (max-width: 640px) {
  .pain-columns { grid-template-columns: 1fr; }
  .pain-columns li { padding: 16px 0; }
  .pain-columns li + li { border-left: 0; border-top: 1px solid var(--rule); }
}

/* Solution */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(32px, 4vw, 64px);
  row-gap: 48px;
  align-items: center;
}
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

.schematic {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 48px minmax(0, 1fr);
  align-items: center;
  max-width: 520px;
}
.tools { display: grid; gap: 10px; }
.tools li {
  position: relative;
  font-family: var(--mono);
  font-size: 14px;
  padding: 9px 12px;
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-radius: 2px;
}
/* Each tool connects right to the bus. */
.tools li::after {
  content: "";
  position: absolute; left: 100%; top: 50%;
  width: 24px; height: 1px; background: var(--ink);
}
.bus {
  align-self: stretch;
  position: relative;
  margin-block: 21px; /* runs from first to last chip centre */
  border-left: 1px solid var(--ink);
  margin-left: 24px;
}
.bus::after {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 24px; height: 1px; background: var(--ink);
}
.agent-node {
  background: var(--ink);
  color: var(--sheet);
  padding: 22px 16px;
  text-align: center;
  font-weight: 650;
  font-variation-settings: "wdth" 86;
  font-size: 20px;
  line-height: 1.2;
  border-radius: 2px;
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 24px;
  counter-reset: none;
}
.steps li {
  position: relative;
  padding-top: 64px;
  padding-right: 12px;
}
/* Continuous track with a tick at each step. */
.steps li::before {
  content: "";
  position: absolute; left: 0; right: -24px; top: 19px;
  height: 1px; background: var(--ink);
}
.steps li:last-child::before { right: 0; }
.step-num {
  position: absolute; left: 0; top: 0;
  width: 39px; height: 39px;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 500; font-size: 16px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 50%;
}
.steps p {
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.5;
  max-width: 20em;
}
@media (max-width: 767px) {
  .steps { grid-template-columns: 1fr; row-gap: 36px; }
  .steps li { padding-top: 6px; padding-left: 64px; min-height: 40px; }
  .steps li::before { left: 19px; right: auto; top: 39px; bottom: -36px; width: 1px; height: auto; }
  .steps li:last-child::before { display: none; }
}

/* Benefits */
.cascade {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 6px;
  font-weight: 640;
  font-variation-settings: "wdth" 80;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.cascade span { display: block; }
.cascade .c1 { grid-column: 1 / -1; font-size: clamp(48px, 7vw, 108px); }
.cascade .c2 { grid-column: 4 / -1; font-size: clamp(30px, 3.6vw, 56px); color: var(--graphite); margin-top: 8px; }
.cascade .c3 { grid-column: 1 / -1; font-size: clamp(34px, 4.4vw, 68px); margin-top: 18px; }
.cascade .c4 { grid-column: 3 / -1; font-size: clamp(26px, 3vw, 44px); color: var(--graphite); margin-top: 10px; }

.benefits-close {
  grid-column: 1 / -1;
  margin-top: clamp(56px, 7vw, 104px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--ink);
  font-weight: 560;
  font-variation-settings: "wdth" 92;
  font-size: clamp(26px, 3.2vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
@media (max-width: 640px) {
  .cascade { grid-template-columns: 1fr; }
  .cascade .c1, .cascade .c2, .cascade .c3, .cascade .c4 { grid-column: 1; }
  .cascade .c2 { padding-left: 1.2em; }
  .cascade .c4 { padding-left: .8em; }
}

/* ---------- Closing band ---------- */

.cta-band {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(64px, 9vw, 120px);
}
.cta-band :focus-visible { outline-color: var(--paper); }
.cta-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 32px;
  align-items: end;
}
.cta-title {
  grid-column: 1 / span 7;
  font-weight: 660;
  font-variation-settings: "wdth" 80;
  font-size: clamp(40px, 5.4vw, 80px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.cta-side { grid-column: 9 / -1; }
.cta-side p { font-size: 18px; line-height: 1.6; margin-bottom: 28px; color: #D3DCD5; }
@media (max-width: 1023px) {
  .cta-title, .cta-side { grid-column: 1 / -1; }
  .cta-side { max-width: 34em; }
}

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

.site-footer { padding-block: 56px 40px; font-size: 15px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 36px;
}
.footer-id { grid-column: 1 / span 4; display: grid; gap: 10px; align-content: start; }
.footer-address { font-style: normal; color: var(--graphite); line-height: 1.5; }
.footer-email { color: var(--graphite); }
.footer-nav { grid-column: 5 / span 4; display: grid; gap: 8px; align-content: start; }
.footer-nav a, .footer-legal a { text-decoration: none; width: fit-content; }
.footer-nav a:hover, .footer-legal a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-legal { grid-column: 9 / -1; display: grid; gap: 8px; align-content: start; }
.footer-legal p { margin-top: 16px; color: var(--graphite); font-size: 14px; }
@media (max-width: 767px) {
  .footer-id, .footer-nav, .footer-legal { grid-column: 1 / -1; }
}

/* ---------- Contact dialog ---------- */

.contact {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(19, 35, 30, .28);
}
.contact::backdrop { background: rgba(19, 35, 30, .55); }
@media (prefers-reduced-motion: no-preference) {
  .contact[open] { animation: dialog-in .22s cubic-bezier(.2, .7, .1, 1); }
  @keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
}
.contact-inner { padding: clamp(20px, 4vw, 32px); }
.contact-head {
  display: flex; align-items: start; justify-content: space-between; gap: 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--ink);
}
.contact-head h2 {
  font-weight: 660; font-variation-settings: "wdth" 84;
  font-size: 30px; line-height: 1.1; letter-spacing: -0.015em;
}
.contact-close {
  flex: none; width: 40px; height: 40px; margin: -6px -8px 0 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 2px; cursor: pointer;
}
.contact-close svg { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 1.8; fill: none; }
.contact-close:hover { background: var(--paper); }

.contact-intro { margin: 16px 0 8px; color: var(--graphite); font-size: 16px; }
.field { margin-top: 16px; }
.field label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--graphite);
  border-radius: 2px;
  font-size: 16px;
  line-height: 1.4;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--stamp); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error, .form-error { color: var(--error); font-size: 14px; line-height: 1.4; }
.field-error:not(:empty) { margin-top: 6px; }
.form-error:not(:empty) { margin-top: 16px; }
.contact-submit { margin-top: 24px; width: 100%; }

.contact-done { padding: 28px 0 4px; display: grid; justify-items: start; gap: 18px; }
.contact-done .tick { width: 44px; height: 44px; }
.contact-done .tick circle { stroke: var(--stamp); }
.contact-done .tick path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .contact-done:not([hidden]) .tick path { animation: draw .5s .1s cubic-bezier(.4, 0, .2, 1) both; }
  @keyframes draw { from { stroke-dashoffset: 16; } to { stroke-dashoffset: 0; } }
}
.contact-done-title { font-size: 22px; line-height: 1.35; font-weight: 560; outline: none; }

/* ---------- Legal page ---------- */

.legal { padding-block: clamp(48px, 7vw, 96px); }
.legal h1 {
  font-weight: 680; font-variation-settings: "wdth" 80;
  font-size: clamp(40px, 5vw, 72px); line-height: 1; letter-spacing: -0.025em;
}
.legal .updated { margin-top: 16px; color: var(--graphite); }
.legal-body { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--ink); max-width: 44em; }
.legal-body h2 {
  margin-top: 40px; font-weight: 650; font-variation-settings: "wdth" 88;
  font-size: 24px; line-height: 1.2;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body ul { margin-top: 12px; }
.legal-body ul { list-style: disc; padding-left: 1.25em; }
.legal-body li + li { margin-top: 6px; }
