/* ============================================================
   Rayven Systems — layout and components.
   Colors and sizes come from tokens.css; nothing is hard-coded here.
   The page should feel like a well-set document, not a landing page:
   mostly single column, hairline rules, light purposeful motion.
   ============================================================ */

/* ---------- fonts (self-hosted, latin subsets) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-tight-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/inter-tight-700.woff2") format("woff2");
}

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

html { color-scheme: light; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 24rem),
    repeating-linear-gradient(90deg, rgba(47, 74, 85, 0.045) 0 1px, transparent 1px 6.5rem),
    var(--paper);
  color: var(--ink);
  font: 400 var(--size-body) / var(--leading-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 40em) {
  body { font-size: var(--size-body-lg); }
}

h1, h2, h3, p, dl, dd, ol, blockquote, figure { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

::selection { background: var(--ink); color: var(--paper); }

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

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

/* ---------- skip link ---------- */
.skip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus-visible { transform: none; }

/* ---------- header ---------- */
.site-header {
  padding: 0.95rem 0;
  border-bottom: var(--hairline);
}
.brand {
  display: block;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}
.brand-logo {
  width: auto;
  height: 42px;
  max-width: min(72vw, 15rem);
  object-fit: contain;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 5rem 0 2rem;
}
@media (min-width: 48em) {
  .hero { padding: 7.5rem 0 2.75rem; }
}
.hero::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line), rgba(215, 217, 211, 0));
}
.eyebrow {
  font: 600 var(--size-label) / 1.3 var(--font-body);
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--slate);
}
.hero .eyebrow { margin-bottom: 1.2rem; }
.hero h1 {
  font: 700 var(--size-h1) / 1.04 var(--font-display);
  letter-spacing: var(--track-display);
  text-wrap: balance;
}
.subhead {
  margin-top: 1.5rem;
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--slate);
  max-width: 36em;
}
@media (min-width: 40em) {
  .subhead { font-size: 1.25rem; }
}
.cta-row { margin-top: 2.25rem; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font: 600 1.0625rem / 1.2 var(--font-body);
  padding: 1rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--accent-deep); }
.btn:active { transform: translateY(1px); }
.cta-note {
  margin-top: 0.9rem;
  font-size: var(--size-small);
  color: var(--slate);
}

/* ---------- process ---------- */
.process {
  position: relative;
  z-index: 2;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(4.25rem, 9vh, 6.5rem) 0 clamp(5.25rem, 10vh, 7rem);
  background: var(--ink);
  color: var(--paper);
}
.process::before,
.process::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.process::before {
  opacity: 0.78;
  background-image:
    linear-gradient(rgba(243, 244, 241, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 244, 241, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(243, 244, 241, 0.17) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 244, 241, 0.17) 1px, transparent 1px);
  background-size:
    1rem 1rem,
    1rem 1rem,
    5rem 5rem,
    5rem 5rem;
}
.process::after {
  opacity: 0.38;
  background:
    repeating-radial-gradient(circle at 18% 36%, transparent 0 2.6rem, rgba(243, 244, 241, 0.32) 2.64rem 2.7rem, transparent 2.74rem 4.4rem),
    repeating-radial-gradient(circle at 77% 34%, transparent 0 3.1rem, rgba(46, 111, 145, 0.44) 3.14rem 3.2rem, transparent 3.24rem 5.2rem),
    linear-gradient(32deg, transparent 0 44%, rgba(243, 244, 241, 0.28) 44.08% 44.18%, transparent 44.26%),
    linear-gradient(126deg, transparent 0 55%, rgba(243, 244, 241, 0.18) 55.08% 55.18%, transparent 55.26%),
    linear-gradient(72deg, transparent 0 63%, rgba(212, 134, 37, 0.24) 63.08% 63.18%, transparent 63.26%);
}
.process-container {
  position: relative;
  width: min(100% - 2 * var(--gutter), 76rem);
  margin-inline: auto;
}
.process-container::before {
  content: "";
  position: absolute;
  top: -1.7rem;
  left: 0;
  right: 0;
  height: 0.45rem;
  background: repeating-linear-gradient(
    90deg,
    rgba(243, 244, 241, 0.62) 0 1px,
    transparent 1px 0.55rem
  );
  opacity: 0.5;
}
.process .label {
  color: rgba(243, 244, 241, 0.76);
  margin-bottom: 1.6rem;
}
.process-list {
  list-style: none;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 0;
  margin: 0;
  overflow: visible;
  counter-reset: none;
}
@media (min-width: 42em) {
  .process-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }
}
.process-item {
  --step-color: var(--process-blue);
  position: relative;
  min-width: 0;
  opacity: 0;
  transform: translateY(0.8rem);
  animation: process-rise 0.5s ease forwards;
  animation-delay: calc(var(--step-index) * 0.08s);
}
.process-item:nth-child(2) { --step-color: var(--process-green); }
.process-item:nth-child(3) { --step-color: var(--process-red); }
.process-item:nth-child(4) { --step-color: var(--process-orange); }
@media (min-width: 42em) {
  .process-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: calc(100% - 1.5rem);
    right: -1.25rem;
    bottom: -1.25rem;
    height: 2px;
    background: var(--step-color);
    opacity: 0.72;
  }
  .process-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -1.38rem;
    bottom: -1.48rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--step-color);
    box-shadow: 0 0 0 0.25rem var(--ink);
  }
}
.process-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 15.75rem;
  height: 100%;
  border: 1px solid rgba(17, 19, 21, 0.12);
  border-bottom: 0.32rem solid var(--step-color);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 244, 241, 0.94)),
    var(--surface);
  padding: 3.65rem 1.2rem 1.2rem;
  color: var(--ink);
  overflow: hidden;
  box-shadow:
    0 0.42rem 0 rgba(0, 0, 0, 0.18),
    0 1.2rem 2.4rem rgba(0, 0, 0, 0.22);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.process-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.62rem;
  width: 2.1rem;
  height: 0.18rem;
  border-radius: 999px;
  background: var(--step-color);
  opacity: 0.55;
  transform: translateX(-50%);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.process-card:hover,
.process-card:focus,
.process-card:focus-visible {
  border-color: var(--step-color);
  box-shadow:
    0 0.42rem 0 rgba(0, 0, 0, 0.16),
    0 1.5rem 3rem rgba(0, 0, 0, 0.28);
  transform: translateY(-0.38rem);
}
.process-card:hover::after,
.process-card:focus::after,
.process-card:focus-visible::after {
  opacity: 0;
  transform: translate(-50%, 0.4rem);
}
.process-kicker {
  position: absolute;
  top: 0.85rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  min-width: 4.35rem;
  border-radius: 4px;
  background: var(--step-color);
  color: #fff;
  font: 700 0.8rem / 1 var(--font-display);
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 0.1rem 0.75rem 0;
  box-shadow: 0 0.45rem 1rem rgba(17, 19, 21, 0.12);
}
.process-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  color: var(--step-color);
}
.process-icon svg {
  width: 2.45rem;
  height: 2.45rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.process-card h3 {
  margin-top: 1.3rem;
  font: 700 1.35rem / 1.08 var(--font-display);
  letter-spacing: 0;
}
.process-summary {
  margin-top: 0.55rem;
  color: var(--slate);
  font-size: 0.94rem;
  line-height: 1.4;
}
.process-detail {
  position: absolute;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  width: auto;
  min-height: 100%;
  margin: 0;
  border: 0;
  border-top: 0.42rem solid var(--step-color);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(17, 19, 21, 0.94), var(--ink));
  padding: 2.85rem 1rem 1rem;
  color: var(--paper);
  font-size: 0.8rem;
  line-height: 1.38;
  pointer-events: none;
  transform: translateY(calc(100% - 0.58rem));
  transition:
    transform 0.26s cubic-bezier(0.2, 0.72, 0.2, 1);
}
.process-detail::before {
  content: "";
  position: absolute;
  top: 0.9rem;
  left: 1.05rem;
  width: 1.8rem;
  height: 0.16rem;
  border-radius: 999px;
  background: rgba(243, 244, 241, 0.62);
}
.process-card:hover .process-detail,
.process-card:focus .process-detail,
.process-card:focus-visible .process-detail {
  transform: translateY(0);
}
@media (max-width: 41.99em) {
  .process .label { margin-bottom: 1.35rem; }
  .process-card {
    min-height: 10.2rem;
    padding: 3.55rem 1.1rem 1.1rem 4.75rem;
  }
  .process-kicker {
    top: 1rem;
    left: 1rem;
    min-width: 4.15rem;
    font-size: 0.72rem;
  }
  .process-icon {
    position: absolute;
    left: 1.05rem;
    bottom: 1.1rem;
    width: 2.5rem;
    height: 2.5rem;
  }
  .process-card h3 { margin-top: 0; }
  .process-detail {
    width: 100%;
    min-height: 100%;
    padding: 2.8rem 1rem 1rem 4.75rem;
  }
  .process-detail::before {
    left: 4.75rem;
  }
}
@media (hover: none) {
  .process-card:focus .process-detail {
    transform: translateY(0);
  }
}
@keyframes process-rise {
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .process-item {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .process-card,
  .process-detail {
    transition: none;
  }
}

/* ---------- section rhythm ---------- */
.proof, .work, .closer {
  border-top: var(--hairline);
  padding: var(--space-section) 0;
}
.proof {
  background: var(--paper);
  color: var(--ink);
}
.work {
  background: var(--surface);
}
.closer {
  background: var(--paper);
}

.label {
  font: 600 var(--size-label) / 1 var(--font-body);
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--slate);
}

.proof h2,
.work h2 {
  margin-top: 0.9rem;
  font: 700 var(--size-h2) / 1.08 var(--font-display);
  letter-spacing: var(--track-display);
  text-wrap: balance;
}

.section-lede {
  margin-top: 1rem;
  color: var(--slate);
  max-width: 35em;
}
.proof .eyebrow,
.proof .section-lede,
.proof .source {
  color: var(--slate);
}

/* ---------- proof ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-top: 2rem;
}
@media (min-width: 42em) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat {
  border: var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem;
  min-width: 0;
  color: var(--ink);
  box-shadow: 0 0.6rem 1.4rem rgba(17, 19, 21, 0.06);
}
.stat:nth-child(1) { border-top: 0.28rem solid var(--process-blue); }
.stat:nth-child(2) { border-top: 0.28rem solid var(--process-green); }
.stat:nth-child(3) { border-top: 0.28rem solid var(--process-orange); }
.stat-grid .stat {
  opacity: 0;
  transform: translateY(0.65rem);
  animation: process-rise 0.5s ease forwards;
}
.stat-grid .stat:nth-child(2) { animation-delay: 0.07s; }
.stat-grid .stat:nth-child(3) { animation-delay: 0.14s; }
@media (prefers-reduced-motion: reduce) {
  .stat-grid .stat {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
.stat-value {
  font: 700 2.65rem / 0.95 var(--font-display);
  letter-spacing: 0;
}
.stat-unit {
  display: inline-block;
  font-size: 1.02rem;
  line-height: 1;
  white-space: nowrap;
}
.stat h3 {
  margin-top: 0.9rem;
  font: 600 1.02rem / 1.25 var(--font-display);
  letter-spacing: 0;
}
.stat p:last-child {
  margin-top: 0.8rem;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--slate);
}
.source {
  margin-top: 1rem;
  font-size: var(--size-small);
  line-height: 1.5;
  color: var(--slate);
}
.source + .source { margin-top: 0.45rem; }
.proof .source a {
  color: var(--ink);
  text-decoration-color: var(--line);
}
.proof .source a:hover {
  text-decoration-color: var(--ink);
}

/* ---------- work ---------- */
.work-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  border-top: var(--hairline);
}
.work-list li {
  display: grid;
  gap: 0.55rem;
  padding: 1.3rem 0;
  border-bottom: var(--hairline);
}
@media (min-width: 46em) {
  .work-list li {
    grid-template-columns: 14rem 1fr;
    gap: 2rem;
  }
}
.work-list h3 {
  font: 600 1.1rem / 1.3 var(--font-display);
  letter-spacing: 0;
}
.work-list p {
  color: var(--slate);
}
.principle {
  margin-top: 2rem;
  border: var(--hairline);
  border-radius: 6px;
  padding: 1.15rem 1.25rem;
  font: 600 1.08rem / 1.45 var(--font-display);
}

/* ---------- close ---------- */
.closer h2 {
  font: 600 var(--size-h2) / 1.1 var(--font-display);
  letter-spacing: var(--track-display);
}
.closer-body {
  margin-top: 1.1rem;
  font-size: 1.125rem;
  color: var(--slate);
  max-width: 32em;
}
.closer .cta-row { margin-top: 2rem; }
.closer-alt {
  margin-top: 1.4rem;
  font-size: var(--size-small);
  color: var(--slate);
}
.closer-alt a,
.source a,
.site-footer a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.closer-alt a:hover,
.source a:hover,
.site-footer a:hover { text-decoration-color: var(--ink); }

/* ---------- footer ---------- */
.site-footer {
  border-top: var(--hairline);
  padding: 2.4rem 0 3rem;
  font-size: var(--size-small);
  color: var(--slate);
}
.site-footer p + p { margin-top: 0.4rem; }

/* ---------- legal pages ---------- */
.prose-page { padding: clamp(3.5rem, 9vh, 5.5rem) 0 var(--space-section); }
.prose-page h1 {
  font: 600 2.25rem / 1.1 var(--font-display);
  letter-spacing: var(--track-display);
}
.prose-page .effective {
  margin-top: 0.6rem;
  font-size: var(--size-small);
  color: var(--slate);
}
.prose-page h2 {
  margin-top: 2.4rem;
  font: 600 1.25rem / 1.3 var(--font-display);
}
.prose-page p { margin-top: 0.9rem; }
.prose-page a { text-underline-offset: 3px; }
