/* ==========================================================================
   jamesranks.com - entity hub
   Design language: operator ledger. Sharp corners, hairline rules, mono data.
   Theme: dark-first, full light-mode parity via prefers-color-scheme.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts (self-hosted, no external requests)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Dark is the default expression of the brand. */
  --bg: #0b0b0c;
  --bg-alt: #111113;
  --surface: #141416;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --fg: #ededee;
  --fg-muted: #a6a6ac;
  --fg-faint: #82828a;
  --accent: #e8703f;
  --accent-hover: #f28254;
  --accent-fg: #0b0b0c;
  --focus: #8ab8ff;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  /* Single locked shape scale: everything is sharp. */
  --radius: 0px;

  --measure: 65ch;
  --page-max: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-y: clamp(4.5rem, 9vw, 8.5rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --z-nav: 50;
  --z-skip: 60;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfbfa;
    --bg-alt: #f2f2f0;
    --surface: #ffffff;
    --line: rgba(17, 17, 20, 0.14);
    --line-strong: rgba(17, 17, 20, 0.3);
    --fg: #17171a;
    --fg-muted: #52525a;
    --fg-faint: #6c6c75;
    --accent: #b3441a;
    --accent-hover: #963811;
    --accent-fg: #ffffff;
    --focus: #1f5fd0;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

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

img,
svg,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 560;
  letter-spacing: -0.022em;
  line-height: 1.1;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

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

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--line);
}

.section--flush {
  border-top: 0;
}

.section--alt {
  background: var(--bg-alt);
}

.skip {
  position: absolute;
  left: -9999px;
  z-index: var(--z-skip);
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* --------------------------------------------------------------------------
   Type scale
   -------------------------------------------------------------------------- */
.display {
  font-size: clamp(2.3rem, 5.8vw, 4.1rem);
  letter-spacing: -0.032em;
  line-height: 1.05;
}

.h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  letter-spacing: -0.026em;
}

.h3 {
  font-size: clamp(1.12rem, 1.7vw, 1.35rem);
  letter-spacing: -0.014em;
  line-height: 1.28;
}

.lede {
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  color: var(--fg-muted);
  max-width: 46ch;
}

.body {
  color: var(--fg-muted);
  max-width: var(--measure);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 500;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.accent {
  color: var(--accent);
}

/* Emphasis inside display type stays in-family (italic), never a second family. */
.display em,
.h2 em {
  font-style: italic;
  font-weight: 560;
  line-height: 1.12;
  padding-bottom: 0.08em;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   Navigation - single line, capped height
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  height: 68px;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
}

.nav__brand {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav__brand:hover {
  color: var(--accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
  font-size: 0.875rem;
}

.nav__links a {
  text-decoration: none;
  color: var(--fg-muted);
  white-space: nowrap;
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--fg);
}

@media (max-width: 640px) {
  .nav__links .nav__optional {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.78rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.925rem;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s var(--ease), background-color 0.18s var(--ease),
    border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-fg);
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--fg);
}

.btn--ghost:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.btn__arrow {
  transition: transform 0.18s var(--ease);
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Hero - asymmetric split
   -------------------------------------------------------------------------- */
.hero {
  padding-block: clamp(3rem, 6.5vw, 5rem) var(--section-y);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(3rem, 6vw, 5.5rem);
  }
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.hero__lede {
  margin-top: 1.5rem;
}

/* Entity ledger - real content, doubles as the hero's visual anchor */
.ledger {
  border: 1px solid var(--line);
  background: var(--surface);
}

.ledger__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.ledger__title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.ledger__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.2rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.ledger__row:last-child {
  border-bottom: 0;
}

@media (min-width: 480px) {
  .ledger__row {
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 1rem;
    align-items: baseline;
  }
}

.ledger__key {
  font-family: var(--font-mono);
  font-size: 0.735rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.ledger__val {
  font-size: 0.94rem;
  color: var(--fg);
}

.ledger__val a {
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

/* --------------------------------------------------------------------------
   Triples - the semantic core of the page
   -------------------------------------------------------------------------- */
.triples {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.triple {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 820px) {
  .triple {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: baseline;
  }
}

.triple__subject {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.triple__statement {
  font-size: clamp(1.04rem, 1.8vw, 1.28rem);
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--fg);
  max-width: 56ch;
}

.triple__statement b {
  font-weight: 560;
}

/* --------------------------------------------------------------------------
   Section headers
   -------------------------------------------------------------------------- */
.sec-head {
  max-width: 58ch;
  margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem);
}

.sec-head .eyebrow {
  display: block;
  margin-bottom: 1rem;
}

.sec-head .body {
  margin-top: 1.1rem;
}

/* --------------------------------------------------------------------------
   Product feature - split
   -------------------------------------------------------------------------- */
.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.25rem, 5vw, 4.5rem);
  align-items: center;
}

@media (min-width: 940px) {
  .feature {
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  }
}

.feature__media {
  border: 1px solid var(--line);
  background: var(--bg-alt);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  overflow: hidden;
}

.feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Carries a real asset at its own ratio, so no crop and no letterboxing. */
.feature__media--asset {
  aspect-ratio: 1200 / 630;
  padding: 0;
}

.feature__media--asset img {
  object-fit: contain;
}

.feature__media-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--fg-faint);
  max-width: 34ch;
}

.feature__list {
  display: grid;
  gap: 0;
  margin-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.feature__list li {
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.feature__list b {
  color: var(--fg);
  font-weight: 550;
}

.feature__actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Flow - indexed process steps, numbered without "Stage N" labels
   -------------------------------------------------------------------------- */
.flow {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}

.flow__step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding-block: clamp(1.6rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 820px) {
  .flow__step {
    grid-template-columns: 3.5rem minmax(0, 3.5fr) minmax(0, 6fr);
    gap: clamp(1.25rem, 3vw, 3rem);
    align-items: baseline;
  }
}

.flow__index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.flow__label {
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  font-weight: 560;
  letter-spacing: -0.016em;
}

.flow__desc {
  color: var(--fg-muted);
  font-size: 0.96rem;
  max-width: 58ch;
}

/* --------------------------------------------------------------------------
   Index list - capabilities, two grouped columns
   -------------------------------------------------------------------------- */
.index-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
}

@media (min-width: 780px) {
  .index-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.index-group__title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line-strong);
}

.index-group li {
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.96rem;
  color: var(--fg-muted);
}

.index-group li b {
  display: block;
  color: var(--fg);
  font-weight: 550;
  margin-bottom: 0.15rem;
}

/* --------------------------------------------------------------------------
   FAQ - native disclosure, high AI extractability
   -------------------------------------------------------------------------- */
.faq {
  border-top: 1px solid var(--line);
}

.faq__item {
  border-bottom: 1px solid var(--line);
}

.faq__q {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.35rem;
  cursor: pointer;
  list-style: none;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  font-weight: 550;
  letter-spacing: -0.014em;
  transition: color 0.18s var(--ease);
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q:hover {
  color: var(--accent);
}

.faq__sign {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--fg-faint);
  flex: none;
  transition: transform 0.22s var(--ease), color 0.18s var(--ease);
}

.faq__item[open] .faq__sign {
  transform: rotate(45deg);
  color: var(--accent);
}

.faq__a {
  padding-bottom: 1.5rem;
  color: var(--fg-muted);
  max-width: var(--measure);
}

.faq__a p + p {
  margin-top: 0.85rem;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: end;
}

@media (min-width: 860px) {
  .contact__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 2.75rem 3.25rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 760px) {
  .footer__grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 3rem;
  }
}

.footer__title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 1rem;
}

.footer__links li {
  padding-block: 0.3rem;
}

.footer__links a {
  text-decoration: none;
}

.footer__bottom {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  color: var(--fg-faint);
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.crumb {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  padding-top: clamp(2rem, 4vw, 3rem);
}

.crumb a {
  text-decoration: none;
}

.crumb i {
  font-style: normal;
  padding-inline: 0.45rem;
}

/* --------------------------------------------------------------------------
   Prose - subpage article body
   -------------------------------------------------------------------------- */
.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: 1.15rem;
}

.prose h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  letter-spacing: -0.02em;
  margin-top: 2.75rem;
}

.prose h3 {
  font-size: clamp(1.05rem, 1.7vw, 1.18rem);
  margin-top: 2rem;
}

.prose p {
  color: var(--fg-muted);
}

.prose b,
.prose strong {
  color: var(--fg);
  font-weight: 550;
}

.prose ul {
  display: grid;
  border-top: 1px solid var(--line);
}

.prose ul li {
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--line);
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   Scroll reveal - opt-in, transform/opacity only, reduced-motion safe
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }

  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

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