/* K³ Labs — sphere site. Green-black field, parchment ink, brass orbs.
   The left rail is the Biruni barometer: a stem, a current sphere that
   breathes, and a name that appears beside the node you are on. */

:root {
  color-scheme: dark;
  --bg: #0b1412;
  --page: #0b1412;
  --ink: #f1e9d6;
  --ink-soft: #ddd3bc;
  --body: #b3ab96;
  --quiet: #a59e8a;
  --muted: #8b8572;
  --faint: #5c5848;
  --line: rgba(236, 222, 190, 0.12);
  --quote: #8b8572;
  --orb: #d4a84b;
  --brass: #d4a84b;
  --brass-hi: #e8c475;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --serif: "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rail: 7.25rem;
  --label: 7.5rem;
  --content: 920px;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(212, 168, 75, 0.09), transparent 60%),
    radial-gradient(900px 600px at 0% 60%, rgba(108, 194, 168, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 40;
  padding: 8px 12px;
  background: var(--brass);
  color: var(--bg);
  transform: translateY(-140%);
}

.skip:focus {
  transform: none;
}

section[id] {
  scroll-margin-top: 20px;
}

.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;
}

/* One field for the whole viewport. Glows are painted here, not clipped
   inside the rail or a card. */

.k3-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── barometer: equal-row hits, names beside the curve ── */

.barometer {
  position: fixed;
  z-index: 2;
  inset: 0 auto 0 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  width: var(--rail);
  height: 100%;
  height: 100dvh;
  padding: 1.45rem 0 1.5rem;
  overflow: visible;
  background: transparent;
  pointer-events: none;
}

.barometer-mark,
.barometer-hits a,
.barometer-now {
  pointer-events: auto;
}

.barometer-mark {
  grid-row: 1;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.barometer-mark:hover {
  color: var(--brass);
}

.barometer-now {
  grid-row: 3;
  margin: 0;
  padding: 0 0.4rem;
  text-align: center;
  color: var(--brass);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.35;
}

.barometer-hits {
  grid-row: 2;
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0.6rem 0;
  list-style: none;
}

.barometer-hits a {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  color: transparent;
  font-size: 0;
  text-decoration: none;
}

.barometer-hits a::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% - 0.3rem);
  top: 50%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-4px, -50%);
  transition: opacity 0.2s ease, transform 0.24s ease;
}

.barometer-hits a:hover::after,
.barometer-hits a:focus-visible::after,
.barometer-hits a[aria-current="page"]::after {
  opacity: 1;
  color: var(--ink);
  transform: translate(0, -50%);
}

.barometer-hits a[aria-current="page"]::after {
  opacity: 1;
  color: var(--brass);
}

.barometer-hits a:focus-visible {
  outline: 1px solid var(--brass);
  outline-offset: -6px;
}

/* Card marks. Biruni's landing orbs, drawn in CSS so nothing can clip. */

.orb-slot {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  background: transparent;
}

.orb {
  position: relative;
  display: block;
  animation: orb-float 7s ease-in-out infinite;
}

.orb i {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.orb-seed {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orb);
}

.orb-clarify {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #f3e2b4 0%, #c9a24f 58%, #6e5524 100%);
  opacity: 0.8;
  filter: blur(0.4px);
}

.orb-explore,
.orb-refine {
  width: 64px;
  height: 52px;
}

.orb-explore i,
.orb-refine i {
  background: rgba(212, 168, 75, 0.22);
}

.orb-explore i:nth-child(1) {
  width: 40px;
  height: 40px;
  left: 2px;
  top: 8px;
  background: rgba(232, 196, 117, 0.24);
}

.orb-explore i:nth-child(2) {
  width: 36px;
  height: 36px;
  right: 2px;
  top: 6px;
  background: rgba(212, 168, 75, 0.18);
}

.orb-refine {
  width: 70px;
  height: 56px;
}

.orb-refine i:nth-child(1) {
  width: 38px;
  height: 38px;
  left: 4px;
  top: 10px;
  background: rgba(232, 196, 117, 0.2);
}

.orb-refine i:nth-child(2) {
  width: 42px;
  height: 42px;
  right: 6px;
  top: 4px;
  background: rgba(212, 168, 75, 0.16);
}

.orb-refine i:nth-child(3) {
  width: 28px;
  height: 28px;
  left: 22px;
  top: 14px;
  background: rgba(241, 233, 214, 0.22);
}

.orb-commit {
  width: 54px;
  height: 40px;
}

.orb-commit i {
  left: 0;
  right: 0;
  height: 18px;
  background: radial-gradient(ellipse at 50% 30%, #f3e2b4, #d4a84b 42%, #8a6a2c 78%);
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.5);
}

.orb-commit i:nth-child(1) { top: 0; opacity: 0.42; }
.orb-commit i:nth-child(2) { top: 10px; opacity: 0.7; }
.orb-commit i:nth-child(3) { top: 20px; }

.orb-verify {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 70% 22%, rgba(255, 246, 220, 0.75), transparent 22%),
    radial-gradient(circle at 32% 30%, rgba(255, 240, 200, 0.22), transparent 36%),
    radial-gradient(circle at 50% 48%, #d4a84b, #5a4218 64%, #1c1608 92%);
  box-shadow: 0 0 28px rgba(212, 168, 75, 0.28);
}

.orb-mature {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #e8c475 0 28%, transparent 29% 46%, rgba(212, 168, 75, 0.55) 47% 62%, transparent 63%);
  box-shadow: inset 0 0 0 7px var(--bg), 0 0 0 1px rgba(212, 168, 75, 0.45);
}

@keyframes orb-float {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ── page frame ── */

.shell {
  position: relative;
  z-index: 1;
  margin-left: calc(var(--rail) + var(--label));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-right: 36px;
}

.page {
  width: min(var(--content), calc(100% - 72px));
  margin: 0 auto;
  flex: 1;
}

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.mast-end {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--quiet);
}

.mast-end .rule {
  display: block;
  width: 44px;
  height: 1px;
  background: var(--brass);
}

.hero {
  padding: 28px 0 8px;
}

.eyebrow,
.kicker,
.prose > p.kicker,
.doc p.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--brass);
}

h1,
.hero h1,
.doc h1,
.section h2,
.close h2 {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero h1,
.doc h1,
.page > .section:first-child h1,
main > h1 {
  margin: 18px 0 0;
  font-size: clamp(52px, 7vw, 96px);
  line-height: 0.95;
}

.lede,
.prose > p,
.doc p,
.doc li,
.card p,
.note p {
  color: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

.lede {
  max-width: 38rem;
  margin: 20px 0 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  min-width: 196px;
  margin-top: 28px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--brass);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}

.cta .arrow {
  display: inline-block;
  transition: transform 160ms var(--ease);
}

.cta:hover {
  background: var(--brass-hi);
  transform: translateY(-1px);
}

.cta:hover .arrow {
  transform: translateX(2px);
}

.cta:focus-visible,
.card-link:focus-visible,
.text-link:focus-visible,
.site-footer a:focus-visible,
.wordmark:focus-visible,
.barometer-mark:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.section {
  padding: 72px 0 8px;
}

.section h2,
.close h2 {
  margin: 12px 0 0;
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 0.98;
}

.section .lede,
.prose > p {
  max-width: 40rem;
}

.prose > p,
.doc p {
  margin: 1rem 0 0;
}

.prose h2,
.doc h2 {
  margin: 2.4rem 0 0;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.prose h3,
.doc h3 {
  margin: 1.6rem 0 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
}

.prose ul,
.doc ul {
  margin: 0.8rem 0 0;
  padding: 0 0 0 1.15rem;
}

.prose li + li,
.doc li + li {
  margin-top: 0.45rem;
}

.doc {
  padding-bottom: 24px;
}

.doc a,
.prose a,
.note a {
  color: var(--brass-hi);
  text-underline-offset: 3px;
}

.stance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 2px solid var(--brass);
}

.stance h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
}

.stance p {
  margin: 8px 0 0;
  color: var(--body);
  font-size: 15px;
  line-height: 1.5;
}

.cards {
  margin-top: 12px;
}

.card-link {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px 18px;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color 200ms var(--ease);
}

a.card-link:hover {
  background: rgba(212, 168, 75, 0.05);
}

.cards .card-link:last-child,
.note {
  border-bottom: 1px solid var(--line);
}

.card-link h3 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
}

.card-link p {
  margin: 8px 0 0;
  max-width: 40rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

.patent {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid rgba(212, 168, 75, 0.5);
  border-radius: 999px;
  color: var(--brass-hi);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.text-link {
  color: var(--brass);
  font-family: var(--sans);
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note {
  margin-top: 8px;
  padding: 22px 0 28px;
}

.note h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}

.close {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  margin-top: 72px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.close p {
  max-width: 28rem;
  margin: 14px 0 0;
  color: var(--body);
}

.contact-lines {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.contact-lines li + li {
  margin-top: 8px;
}

.contact-lines a {
  color: var(--brass-hi);
  font-size: 18px;
  text-decoration: none;
}

.contact-lines a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.meta-note {
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 28px;
  width: min(var(--content), calc(100% - 72px));
  margin: 48px auto 0;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.site-footer a {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

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

@media (max-width: 760px) {
  :root {
    --rail: 3.1rem;
    --label: 0px;
  }

  .barometer-mark,
  .barometer-now,
  .barometer-hits a::after {
    display: none;
  }

  .shell {
    margin-left: var(--rail);
    padding-right: 0;
  }

  .page,
  .site-footer {
    width: min(var(--content), calc(100% - 40px));
  }

  .mast {
    height: 56px;
  }

  .mast-end {
    display: none;
  }

  .hero h1,
  .doc h1,
  main > h1 {
    font-size: 48px;
  }

  .section {
    padding-top: 48px;
  }

  .stance,
  .close {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .card-link {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }

  .orb-slot {
    width: 72px;
    height: 72px;
  }

  .orb-clarify { width: 32px; height: 32px; }
  .orb-explore { width: 52px; height: 42px; }
  .orb-refine { width: 56px; height: 46px; }
  .orb-commit { width: 46px; height: 36px; }
  .orb-mature { width: 36px; height: 36px; box-shadow: inset 0 0 0 5px var(--bg), 0 0 0 1px rgba(212, 168, 75, 0.45); }
  .orb-verify { width: 40px; height: 40px; }

  .cta {
    width: 100%;
  }

  section[id] {
    scroll-margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .cta,
  .cta .arrow,
  .orb,
  .barometer-hits a::after {
    animation: none;
    transition: none;
  }
}
