/* Kork public site. The page speaks the platform's shape language:
   every step family has one shape and one colour, the same as in the flow editor. */
:root {
  --night: #0f1d3a;
  --night-2: #172a50;
  --paper: #edf1f8;
  --ink: #142342;
  --muted: #56658a;
  --blue: #2563ff;
  --sun: #ffc53d;
  /* step families (apps/web/src/styles/flow-nodes.css) */
  --measure: #2563ff;
  --decide: #7c4dff;
  --system: #0e9384;
  --network: #0891b2;
  --wait: #f59e0b;
  --change: #e5484d;
  --talk: #db2777;
  --record: #64748b;
  --hex: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  --oct: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  --display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --text: "Onest", "Segoe UI", system-ui, sans-serif;
  --step-ms: 900ms;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--text); }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 999px; font: 600 16px/1 var(--text); text-decoration: none; white-space: nowrap; }
.button svg { width: 20px; height: 20px; flex: none; }
.button.sun { background: var(--sun); color: var(--night); }
.button.sun:hover { background: #ffd56b; }
.button.line { box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35); color: #fff; }
.button.line:hover { box-shadow: inset 0 0 0 2px #fff; }
.button.ink { background: var(--night); color: #fff; }
.button.ink:hover { background: var(--night-2); }
.button.small { min-height: 42px; padding: 0 18px; font-size: 15px; }

/* Top bar (on night) */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 24px/1 var(--display); letter-spacing: -.5px; }
.brand img { width: 40px; }
.bar nav { display: flex; align-items: center; gap: 6px; }
.bar nav a:not(.button) { padding: 10px 14px; border-radius: 999px; color: #c9d4ea; font-weight: 500; text-decoration: none; }
.bar nav a:not(.button):hover { color: #fff; background: rgb(255 255 255 / .08); }

/* Hero: a real flow running across the page */
.hero { position: relative; overflow: hidden; background: var(--night); color: #fff; padding-bottom: 88px; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgb(255 255 255 / .09) 1.2px, transparent 1.2px); background-size: 26px 26px; pointer-events: none; }
.hero > * { position: relative; }
.hero h1 { max-width: 12ch; margin: 40px 0 0; font: 700 clamp(40px, 6.4vw, 84px)/1.02 var(--display); letter-spacing: -.03em; }
.hero .lead { max-width: 52ch; margin: 26px 0 0; color: #b9c6e0; font-size: 19px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.run { margin-top: 72px; }
.run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 26px; color: #b9c6e0; font-size: 15px; }
.run-head b { color: #fff; font-weight: 600; }
.unit { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .08); color: #fff; font-weight: 500; }
.unit::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 4px rgb(61 220 151 / .18); }

.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.step { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
/* connector to the next step, with the travelling run */
.step:not(:last-child)::before { content: ""; position: absolute; top: 47px; left: 110px; right: 14px; height: 4px; border-radius: 4px; background: rgb(255 255 255 / .12); }
.step:not(:last-child)::after { content: ""; position: absolute; top: 47px; left: 110px; height: 4px; width: 0; max-width: calc(100% - 124px); border-radius: 4px; background: var(--sun); box-shadow: 0 0 14px rgb(255 197 61 / .7); }
.step.passed:not(:last-child)::after { width: calc(100% - 124px); transition: width var(--step-ms) cubic-bezier(.6, 0, .4, 1); }
.shape { display: grid; place-items: center; width: 96px; height: 96px; background: rgb(255 255 255 / .1); color: rgb(255 255 255 / .55); transition: background .35s, color .35s, transform .35s; }
.shape svg { width: 36px; height: 36px; }
.step.on .shape { color: #fff; transform: scale(1.06); }
.step[data-family="trigger"] .shape { border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 4px rgb(255 255 255 / .25); }
.step[data-family="trigger"].on .shape { box-shadow: inset 0 0 0 5px var(--blue); background: rgb(37 99 255 / .18); }
.step[data-family="system"] .shape { border-radius: 26%; }
.step[data-family="system"].on .shape { background: var(--system); }
.step[data-family="decide"] .shape { border-radius: 20%; transform: rotate(45deg) scale(.8); }
.step[data-family="decide"] .shape svg { transform: rotate(-45deg); }
.step[data-family="decide"].on .shape { background: var(--decide); transform: rotate(45deg) scale(.86); }
.step[data-family="change"] .shape { clip-path: var(--oct); }
.step[data-family="change"].on .shape { background: var(--change); }
.step[data-family="talk"] .shape { border-radius: 50% 50% 50% 14%; }
.step[data-family="talk"].on .shape { background: var(--talk); }
.step h3 { margin: 0; font: 600 17px/1.25 var(--text); }
.result { display: inline-flex; min-height: 30px; align-items: center; padding: 0 12px; border-radius: 999px; background: rgb(255 255 255 / .07); color: rgb(255 255 255 / .45); font-size: 14.5px; font-variant-numeric: tabular-nums; transition: background .35s, color .35s; }
.step.on .result { background: #fff; color: var(--night); font-weight: 600; }
.run-foot { min-height: 24px; margin: 30px 0 0; color: #b9c6e0; font-size: 15px; }

/* Sections */
section.band { padding: 112px 0; }
.band h2 { max-width: 20ch; margin: 0; font: 700 clamp(30px, 4.2vw, 52px)/1.08 var(--display); letter-spacing: -.025em; }
.band .intro { max-width: 56ch; margin: 18px 0 0; color: var(--muted); font-size: 18px; }

/* Shape legend: the language of a flow */
.legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px 32px; margin: 64px 0 0; padding: 0; list-style: none; }
.legend li { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 18px; }
.legend .glyph { width: 76px; height: 76px; }
.legend strong { display: block; font: 600 18px/1.2 var(--text); }
.legend span { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.glyph { display: inline-block; flex: none; }
.glyph.trigger { border-radius: 50%; box-shadow: inset 0 0 0 6px var(--blue); }
.glyph.measure { border-radius: 26%; background: var(--measure); }
.glyph.system { border-radius: 26%; background: var(--system); }
.glyph.decide { border-radius: 20%; background: var(--decide); transform: rotate(45deg) scale(.78); }
.glyph.network { clip-path: var(--hex); background: var(--network); }
.glyph.wait { border-radius: 50%; background: var(--wait); }
.glyph.change { clip-path: var(--oct); background: var(--change); }
.glyph.talk { border-radius: 50% 50% 50% 14%; background: var(--talk); }
.glyph.record { border-radius: 4px 4px 26% 26%; background: var(--record); }

/* Wall of real steps */
.steps-band { background: #fff; }
.wall { display: flex; flex-wrap: wrap; gap: 12px; margin: 56px 0 0; padding: 0; list-style: none; }
.wall li { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px 9px 10px; border-radius: 999px; background: var(--paper); font-weight: 500; font-size: 16px; }
.wall .glyph { width: 22px; height: 22px; }
.wall .glyph.trigger { box-shadow: inset 0 0 0 4px var(--blue); }

/* Approval band (sun) */
.approve { background: var(--sun); color: var(--night); }
.approve .wrap { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 64px; }
.approve .intro { color: rgb(15 29 58 / .75); }
.ask { position: relative; padding: 30px; border-radius: 34px 34px 34px 10px; background: var(--night); color: #fff; }
.ask p { margin: 0; font-size: 15px; color: #b9c6e0; }
.ask h3 { margin: 8px 0 22px; font: 600 22px/1.3 var(--text); color: #fff; }
.ask .who { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.ask .who .glyph { width: 40px; height: 40px; }
.ask .who b { display: block; font-weight: 600; }
.ask .who small { color: #b9c6e0; font-size: 14px; }
.ask .choices { display: flex; gap: 10px; }
.ask .choices span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 600; }
.ask .yes { background: var(--sun); color: var(--night); }
.ask .no { box-shadow: inset 0 0 0 2px rgb(255 255 255 / .3); }

/* Live band (teal) */
.live { background: var(--system); color: #fff; }
.live .wrap { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 64px; }
.live .intro { color: rgb(255 255 255 / .82); }
.fleet { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.fleet i { aspect-ratio: 1; border-radius: 26%; background: rgb(255 255 255 / .9); }
.fleet i.busy { background: var(--sun); }
.fleet i.off { background: rgb(255 255 255 / .22); }

/* Download band (blue) */
.get { background: var(--blue); color: #fff; }
.get .wrap { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 56px; }
.get .mascot { width: clamp(150px, 20vw, 240px); }
.get h2 { max-width: 18ch; }
.get .intro { color: rgb(255 255 255 / .85); }
.get .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.get .button.line { box-shadow: inset 0 0 0 2px rgb(255 255 255 / .5); }

footer { background: var(--night); color: #9fb0d0; font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 30px 0; }
footer nav { display: flex; gap: 22px; }
footer a { text-decoration: none; }
footer a:hover { color: #fff; }

/* Download page */
.dl { background: var(--night); color: #fff; min-height: 100vh; display: flex; flex-direction: column; }
.dl main { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; padding: 48px 0 96px; }
.dl h1 { margin: 0; font: 700 clamp(38px, 5.6vw, 72px)/1.02 var(--display); letter-spacing: -.03em; }
.dl .facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 34px; }
.dl .facts span { padding: 7px 14px; border-radius: 999px; background: rgb(255 255 255 / .08); color: #d5ddef; font-size: 15px; font-variant-numeric: tabular-nums; }
.dl .hash { max-width: 46ch; margin: 18px 0 0; color: #8fa0c4; font-size: 13px; line-height: 1.5; word-break: break-all; }
.dl .hash code { font-family: Consolas, ui-monospace, monospace; }
.install { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.install li { display: grid; grid-template-columns: 64px 1fr; gap: 20px; align-items: start; padding-bottom: 34px; position: relative; }
.install li:not(:last-child)::before { content: ""; position: absolute; left: 30px; top: 66px; bottom: 4px; width: 4px; border-radius: 4px; background: rgb(255 255 255 / .14); }
.install .glyph { width: 64px; height: 64px; }
.install strong { display: block; margin-top: 8px; font: 600 20px/1.2 var(--text); }
.install span { display: block; margin-top: 6px; color: #b9c6e0; font-size: 16px; }
.install code { padding: 2px 7px; border-radius: 6px; background: rgb(255 255 255 / .1); font: 14px Consolas, ui-monospace, monospace; }
.dl .note { margin: 0; color: #8fa0c4; font-size: 15px; }
.dl footer { background: transparent; }

/* 404 */
.missing { min-height: 100vh; display: grid; place-content: center; justify-items: start; gap: 22px; background: var(--night); color: #fff; padding: 24px; }
.missing .glyph { width: 88px; height: 88px; }
.missing h1 { margin: 0; font: 700 clamp(32px, 5vw, 56px)/1.05 var(--display); max-width: 14ch; }
.missing p { margin: 0; color: #b9c6e0; }

@media (max-width: 960px) {
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approve .wrap, .live .wrap, .get .wrap, .dl main { grid-template-columns: 1fr; gap: 48px; }
  .get .mascot { width: 150px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .bar nav a:not(.button) { display: none; }
  .hero h1 { margin-top: 28px; }
  .run { margin-top: 56px; }
  /* the flow runs downwards on narrow screens */
  .flow { grid-template-columns: 1fr; gap: 28px; }
  .step { display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto auto; column-gap: 18px; row-gap: 6px; align-items: center; }
  .step .shape { grid-row: 1 / 3; width: 72px; height: 72px; }
  .step .shape svg { width: 28px; height: 28px; }
  .step h3 { align-self: end; }
  .step .result { justify-self: start; align-self: start; }
  .step:not(:last-child)::before, .step:not(:last-child)::after { top: 80px; left: 34px; right: auto; width: 4px; height: 0; max-width: none; }
  .step:not(:last-child)::before { height: calc(100% - 52px); }
  .step.passed:not(:last-child)::after { width: 4px; height: calc(100% - 52px); transition: height var(--step-ms) cubic-bezier(.6, 0, .4, 1); }
  section.band { padding: 80px 0; }
  .legend { grid-template-columns: 1fr; gap: 26px; }
  .fleet { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shape, .result, .step.passed:not(:last-child)::after { transition: none !important; }
}
