/* aegbit — site styles */

:root {
  --paper: #ffffff;
  --ink: #000000;
  --ink-2: #5f5f5f;
  --rule: #e3e3e3;

  /* KalqiX brand palette, used only inside the KalqiX panel */
  --kx-bg: #0b0f0c;
  --kx-fg: #e9efea;
  --kx-muted: #8c988f;
  --kx-rule: #28332b;
  --kx-bid: #39ff14;
  --kx-ask: #f2696c;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 58ch;
  --gutter: 20px;
  --max: 1120px;
}

@media (min-width: 720px) {
  :root { --gutter: 48px; }
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

@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.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(0, 0, 0, 0.3);
}

a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 { font-weight: 500; }

p { margin: 0; }

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

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

/* Header */

.site-header { padding-block: 28px; }

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 24px;
  font-size: 15px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-2);
}

.site-nav a:hover { color: var(--ink); }

/* Hero */

.hero {
  padding-block: clamp(56px, 11vw, 150px) clamp(64px, 10vw, 128px);
}

.hero h1 {
  margin: 0 0 36px;
  font-size: clamp(2.5rem, 7.2vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 12ch;
  text-wrap: balance;
}

.hero p {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.5;
  margin-bottom: 36px;
}

.hero .email {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
}

/* Sections */

.section {
  border-top: 1px solid var(--rule);
  padding-block: clamp(56px, 8vw, 104px);
  scroll-margin-top: 24px;
}

.section .wrap {
  display: grid;
  gap: 28px;
}

@media (min-width: 720px) {
  .section .wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    gap: 48px;
  }
}

.section-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
}

/* Services */

.services {
  list-style: none;
  margin: 0;
  padding: 0;
}

.services li {
  display: grid;
  gap: 8px;
  padding-block: 24px;
  border-top: 1px solid var(--rule);
}

.services li:first-child {
  border-top: 0;
  padding-top: 0;
}

.services li:last-child { padding-bottom: 0; }

@media (min-width: 1000px) {
  .services li {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 48px;
    padding-block: 28px;
  }
}

.services h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.services p {
  color: var(--ink-2);
  max-width: 50ch;
}

.services-note {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
}

.services-note p { max-width: var(--measure); }

/* KalqiX panel */

.kalqix {
  background: var(--kx-bg);
  color: var(--kx-fg);
  padding-block: clamp(64px, 9vw, 128px);
  border-top: 0;
  scroll-margin-top: 0;
}

.kalqix a { text-decoration-color: rgba(233, 239, 234, 0.35); }
.kalqix a:hover { text-decoration-color: currentColor; }

.kalqix .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
}

@media (min-width: 880px) {
  .kalqix .wrap {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 96px;
    align-items: center;
  }
}

.kalqix h2 {
  margin: 0 0 28px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.kalqix .lede {
  max-width: 52ch;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.5;
}

.facts {
  margin: 40px 0 0;
  border-top: 1px solid var(--kx-rule);
}

.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 24px;
  padding-block: 14px;
  border-bottom: 1px solid var(--kx-rule);
}

.facts dt {
  color: var(--kx-muted);
}

.facts dd { margin: 0; }

.kalqix-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 36px;
}

/* Order book illustration */

.book {
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--kx-rule);
}

.book-head,
.book-row,
.book-spread {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 9px 14px;
}

.book-head {
  color: var(--kx-muted);
  font-size: 12px;
  border-bottom: 1px solid var(--kx-rule);
}

.book-row {
  position: relative;
  z-index: 0;
}

.book-row::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 2px;
  bottom: 2px;
  right: 0;
  width: var(--d);
  background: currentColor;
  opacity: 0.14;
  transform-origin: right center;
}

.book-row .size { color: var(--kx-fg); }

.book-row.ask { color: var(--kx-ask); }
.book-row.bid { color: var(--kx-bid); }

.book-spread {
  color: var(--kx-muted);
  font-size: 12px;
  border-top: 1px solid var(--kx-rule);
  border-bottom: 1px solid var(--kx-rule);
}

.book.is-armed .book-row::before { transform: scaleX(0); }

.book.is-in .book-row::before {
  transform: scaleX(1);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i) * 55ms);
}

@media (prefers-reduced-motion: reduce) {
  .book.is-armed .book-row::before { transform: none; }
  .book.is-in .book-row::before { transition: none; }
}

/* Contact */

.contact-email {
  display: inline-block;
  font-size: clamp(1.6rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 500;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}

.contact-note {
  margin-top: 20px;
  max-width: var(--measure);
  color: var(--ink-2);
}

.offices {
  display: grid;
  gap: 28px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

@media (min-width: 720px) {
  .offices { grid-template-columns: 1fr 1fr; gap: 48px; }
}

.office h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.office address {
  font-style: normal;
  color: var(--ink-2);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 28px;
  font-size: 14px;
  color: var(--ink-2);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* Prose pages (privacy) */

.prose {
  padding-block: clamp(40px, 7vw, 96px);
}

.prose h1 {
  margin: 0 0 32px;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.prose p {
  max-width: var(--measure);
  margin-bottom: 20px;
}

.prose .meta {
  color: var(--ink-2);
  font-size: 15px;
  margin-bottom: 40px;
}
