/* ProfitHub — shared stylesheet
   Palette: sage-mist paper, pine ink, one vermilion accent.
   Type: Newsreader (display) / Hanken Grotesk (body) / IBM Plex Mono (labels). */

:root {
  --bg: oklch(0.968 0.008 150);
  --paper: oklch(0.99 0.004 150);
  --surface: oklch(0.935 0.013 150);
  --fg: oklch(0.22 0.035 165);
  --fg-hover: oklch(0.32 0.05 165);
  --muted: oklch(0.42 0.025 165);
  --border: oklch(0.86 0.016 155);
  --accent: oklch(0.67 0.19 40);
  --accent-ink: oklch(0.5 0.17 36);
  --deep: oklch(0.24 0.04 165);
  --deep-raise: oklch(0.29 0.042 165);
  --on-deep: oklch(0.955 0.01 150);
  --on-deep-muted: oklch(0.8 0.02 155);
  --deep-border: oklch(0.38 0.035 165);
  --focus: var(--accent-ink);

  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 10vw, 136px);
  --header-h: 72px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
p { text-wrap: pretty; }
a { color: inherit; }
svg { display: block; }
address { font-style: normal; }

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

.container {
  width: min(100% - 2 * var(--gutter), 1200px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}
.mark { width: 30px; height: 30px; flex: none; }
.mark__bg { fill: var(--fg); }
.mark__line { fill: none; stroke: var(--bg); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.mark__dot { fill: var(--accent); }
.on-deep .mark__bg { fill: var(--on-deep); }
.on-deep .mark__line { stroke: var(--deep); }

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--fg);
  border-radius: 3px;
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; transition: transform .18s ease; }
.btn:hover svg { transform: translateX(3px); }

.btn--solid { background: var(--fg); color: var(--bg); }
.btn--solid:hover { background: var(--fg-hover); border-color: var(--fg-hover); color: var(--bg); }

.btn--line { background: transparent; color: var(--fg); }
.btn--line:hover { background: var(--fg); color: var(--bg); }

.btn--sm { min-height: 44px; padding: 0 18px; font-size: .9375rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: var(--border);
  transition: text-decoration-color .18s ease;
}
.link-arrow:hover { text-decoration-color: var(--fg); }
.link-arrow svg { width: 16px; height: 16px; transition: transform .18s ease; }
.link-arrow:hover svg { transform: translateY(3px); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 16px 32px;
  min-height: var(--header-h);
}
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: clamp(18px, 2.6vw, 34px); }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 9px) / 0 1px no-repeat;
  transition: background-size .2s ease;
}
.site-nav a:hover { background-size: 100% 1px; }

/* ---------- Shared section furniture ---------- */

.section { padding-block: var(--section); }
.section--rule { border-top: 1px solid var(--border); }
.section--tint { background: var(--surface); }

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font: 500 .75rem/1.4 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.h2 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem); line-height: 1.08; }
.intro { font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); color: var(--muted); max-width: 46ch; }

.head {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 24px clamp(32px, 6vw, 96px);
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
}

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

.hero { padding-block: clamp(40px, 7vw, 96px) clamp(64px, 9vw, 120px); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(20px, 3vw, 32px);
  font: 500 .75rem/1.4 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.hero h1 {
  font-size: clamp(2.5rem, 1.35rem + 5vw, 4.875rem);
  line-height: 1.01;
  letter-spacing: -0.025em;
}
.hero h1 em { font-style: italic; }
.hero__lede {
  margin-top: clamp(22px, 3vw, 34px);
  max-width: 54ch;
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  color: var(--muted);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: clamp(28px, 4vw, 40px);
}
.hero__lines {
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font: 500 .8125rem/1.4 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Flow diagram */

.flow {
  padding: clamp(16px, 3vw, 28px);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.flow__cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: 500 .6875rem/1.4 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.flow__cap--top { margin-bottom: 12px; }
.flow__cap--bottom { margin-top: 12px; }
.flow__row { display: grid; grid-template-columns: repeat(3, 1fr); }
.flow__row li {
  position: relative;
  margin-inline: clamp(3px, 1vw, 7px);
  padding: 13px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  text-align: center;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.2;
}
.flow__row li::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--fg);
}
.flow__row--in li::after { bottom: -4px; }
.flow__row--out li::after { top: -4px; }

.flow__wires { width: 100%; height: clamp(48px, 7vw, 68px); overflow: visible; }
.flow__wires path { fill: none; vector-effect: non-scaling-stroke; }
.flow__wires .base { stroke: var(--border); stroke-width: 1; }
.flow__wires .pulse {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 2 12;
  animation: flow-run 1.4s linear infinite;
}
@keyframes flow-run { to { stroke-dashoffset: -28; } }

.flow__hub {
  padding: clamp(16px, 2.4vw, 22px);
  border-radius: 4px;
  background: var(--deep);
  color: var(--on-deep);
}
.flow__hub-name {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 14px;
  font: 500 1.25rem/1 var(--font-display);
  letter-spacing: -0.02em;
}
.flow__hub-name .mark { width: 24px; height: 24px; }
.flow__steps li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding-block: 11px;
  border-top: 1px solid var(--deep-border);
}
.flow__steps li:last-child { padding-bottom: 0; }
.flow__steps .n { font: 500 .6875rem/1 var(--font-mono); color: var(--on-deep-muted); }
.flow__steps .t { font-size: .9375rem; font-weight: 600; }
.flow__steps .d {
  margin-left: auto;
  font: 400 .6875rem/1.4 var(--font-mono);
  letter-spacing: .04em;
  color: var(--on-deep-muted);
}

/* ---------- Verticals ---------- */

.lines { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--fg); }
.lines li { padding: 28px clamp(16px, 2vw, 28px) 8px; border-left: 1px solid var(--border); }
.lines li:first-child { padding-left: 0; border-left: 0; }
.lines .tag {
  display: block;
  margin-bottom: clamp(36px, 5vw, 64px);
  font: 500 .75rem/1 var(--font-mono);
  letter-spacing: .1em;
  color: var(--muted);
}
.lines h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem); line-height: 1.1; margin-bottom: 12px; }
.lines p { font-size: 1rem; color: var(--muted); }

/* ---------- Services ---------- */

.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.split__aside { position: sticky; top: calc(var(--header-h) + 40px); }
.split__aside .intro { margin-top: 24px; }

.services { border-top: 1px solid var(--fg); }
.services li {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  padding-block: clamp(24px, 3vw, 34px);
  border-bottom: 1px solid var(--border);
}
.services .n { font: italic 400 1.5rem/1.25 var(--font-display); color: var(--muted); }
.services h3 { font-size: clamp(1.375rem, 1.2rem + .7vw, 1.75rem); line-height: 1.15; margin-bottom: 10px; }
.services p { max-width: 56ch; color: var(--muted); }

/* ---------- Process ---------- */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); }
.steps li { position: relative; padding-top: 28px; border-top: 1px solid var(--fg); }
.steps li::before {
  content: "";
  position: absolute;
  top: -5px; left: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--fg);
}
.steps .n { display: block; margin-bottom: 18px; font: 500 .8125rem/1 var(--font-mono); letter-spacing: .1em; color: var(--muted); }
.steps h3 { font-size: clamp(1.375rem, 1.2rem + .6vw, 1.625rem); line-height: 1.15; margin-bottom: 10px; }
.steps p { font-size: 1rem; color: var(--muted); }

/* ---------- Compliance (dark band) ---------- */

.on-deep {
  --focus: var(--on-deep);
  background: var(--deep);
  color: var(--on-deep);
}
.on-deep .kicker, .on-deep .intro { color: var(--on-deep-muted); }
.pull {
  display: block;
  margin-top: 14px;
  font: italic 400 clamp(1.375rem, 1.2rem + .7vw, 1.625rem)/1.25 var(--font-display);
  color: var(--on-deep);
}
.rules { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--deep-border); }
.rules li { padding: clamp(24px, 3.4vw, 40px) 0; border-bottom: 1px solid var(--deep-border); }
.rules li:nth-child(odd) { padding-right: clamp(24px, 4vw, 56px); border-right: 1px solid var(--deep-border); }
.rules li:nth-child(even) { padding-left: clamp(24px, 4vw, 56px); }
.rules h3 { font-size: clamp(1.375rem, 1.2rem + .7vw, 1.75rem); line-height: 1.15; margin-bottom: 10px; }
.rules p { max-width: 48ch; color: var(--on-deep-muted); }

/* ---------- Partners ---------- */

.partners { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.4vw, 28px); }
.partner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(24px, 3.4vw, 44px);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color .18s ease;
}
.partner:hover { border-color: var(--fg); }
.partner .tag { margin-bottom: 22px; font: 500 .75rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.partner h3 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); line-height: 1.1; margin-bottom: 14px; }
.partner > p { color: var(--muted); max-width: 44ch; }
.partner ul { align-self: stretch; margin-block: 26px 32px; border-top: 1px solid var(--border); }
.partner ul li {
  position: relative;
  padding: 12px 0 12px 26px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 500;
}
.partner ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.45em;
  width: 12px; height: 1px;
  background: var(--fg);
}
.partner .btn { margin-top: auto; }

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

.contact { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact h2 { font-size: clamp(2.125rem, 1.3rem + 3.2vw, 3.75rem); line-height: 1.04; letter-spacing: -0.02em; }
.contact__text { margin-top: 24px; max-width: 48ch; font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); color: var(--muted); }
.contact .btn { margin-top: 32px; max-width: 100%; }
.details { border-top: 1px solid var(--fg); }
.details > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 4px 16px; padding-block: 20px; border-bottom: 1px solid var(--border); }
.details dt { padding-top: .3em; font: 500 .75rem/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.details dd a { text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--muted); }
.details dd a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--fg); }

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

.site-footer { padding-block: clamp(48px, 6vw, 80px) 32px; }
.site-footer__top { display: grid; grid-template-columns: 7fr 5fr; gap: 32px clamp(32px, 6vw, 96px); }
.site-footer .disclaimer { margin-top: 20px; max-width: 58ch; font-size: .9375rem; color: var(--on-deep-muted); }
.footer-nav ul { display: grid; grid-template-rows: repeat(3, auto); grid-auto-flow: column; grid-auto-columns: max-content; gap: 0 clamp(32px, 5vw, 72px); justify-content: end; }
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 9px) / 0 1px no-repeat;
  transition: background-size .2s ease;
}
.footer-nav a:hover { background-size: 100% 1px; }
.site-footer__line {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--deep-border);
  font: 400 .75rem/1.6 var(--font-mono);
  letter-spacing: .04em;
  color: var(--on-deep-muted);
}

/* ---------- Legal & 404 ---------- */

.legal { padding-block: clamp(48px, 7vw, 96px) var(--section); }
.legal .container { max-width: 760px; }
.legal__head { padding-bottom: clamp(28px, 4vw, 44px); margin-bottom: clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--fg); }
.legal h1 { font-size: clamp(2.5rem, 1.6rem + 4vw, 4rem); line-height: 1.02; letter-spacing: -0.025em; }
.legal__date { margin-top: 20px; font: 500 .8125rem/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.legal section + section { margin-top: clamp(36px, 5vw, 52px); }
.legal h2 { font-size: clamp(1.5rem, 1.3rem + .8vw, 1.875rem); line-height: 1.15; margin-bottom: 14px; }
.legal p + p, .legal p + ul, .legal ul + p, .legal p + address { margin-top: 14px; }
.legal ul { display: grid; gap: 10px; }
.legal ul li { position: relative; padding-left: 26px; }
.legal ul li::before { content: ""; position: absolute; left: 0; top: .8em; width: 12px; height: 1px; background: var(--fg); }
.legal a { text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--muted); }
.legal a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--fg); }

.notfound { display: grid; align-content: center; min-height: 62vh; padding-block: var(--section); }
.notfound__code { margin-bottom: 20px; font: 500 .8125rem/1.4 var(--font-mono); letter-spacing: .12em; color: var(--muted); }
.notfound h1 { font-size: clamp(2.75rem, 1.6rem + 5vw, 5rem); line-height: 1; letter-spacing: -0.025em; }
.notfound p:not(.notfound__code) { margin-top: 20px; max-width: 44ch; font-size: 1.125rem; color: var(--muted); }
.notfound .btn { margin-top: 32px; justify-self: start; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .hero__grid, .split, .contact { grid-template-columns: minmax(0, 1fr); }
  .hero__figure { max-width: 560px; }
  .split__aside { position: static; }
  .head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .lines, .steps { grid-template-columns: repeat(2, 1fr); }
  .lines { border-top: 0; }
  .lines li, .lines li:first-child { padding: 24px 24px 28px 0; border-left: 0; border-top: 1px solid var(--fg); }
  .lines .tag { margin-bottom: 28px; }
  .steps { row-gap: 44px; }
}

@media (max-width: 720px) {
  :root { --header-h: 0px; }
  .site-header { position: static; }
  .site-header__inner { flex-wrap: wrap; gap: 0 16px; padding-top: 10px; }
  .site-header .btn { margin-left: auto; }
  .site-nav { order: 3; width: 100%; margin: 6px 0 0; border-top: 1px solid var(--border); }
  .site-nav ul { justify-content: space-between; gap: 8px; }
  .site-nav a { font-size: .875rem; }

  .partners, .rules, .site-footer__top { grid-template-columns: minmax(0, 1fr); }
  .rules li, .rules li:nth-child(odd), .rules li:nth-child(even) { padding-inline: 0; border-right: 0; }
  .footer-nav ul { justify-content: start; }
  .details > div { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .lines, .steps { grid-template-columns: minmax(0, 1fr); }
  .lines li, .lines li:first-child { padding-right: 0; }
  .steps { row-gap: 36px; }
  .services li { grid-template-columns: 2.25rem 1fr; }
  .hero__actions .btn, .contact .btn, .partner .btn { width: 100%; }
  .flow__row li { font-size: .8125rem; }
  .flow__steps .d { margin-left: 0; width: 100%; padding-left: 26px; }
  .contact .btn { padding-inline: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .site-header, .skip-link, .hero__figure { display: none; }
  body { background: white; font-size: 12pt; }
}
