/* SIDIX site styles. Every colour is a token from tokens.css; no raw colour literals here. */

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

* { box-sizing: border-box; }

a { color: var(--signal); }
a:hover { color: var(--ink); }

h1, h2, h3, p, ol, ul { margin: 0; }

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

/* Progress bar */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--signal);
  width: 0%;
  z-index: 20;
}

/* Skip link */

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--signal);
  color: var(--on-signal);
  padding: 10px 16px;
  font: 500 14px/20px var(--font-sans);
  text-decoration: none;
  z-index: 30;
  outline: none;
}
.skip-link:focus-visible {
  top: 12px;
  box-shadow: var(--focus-ring);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark-link {
  display: flex;
  align-items: center;
  padding: 8px 0;
  outline: none;
}
.wordmark-link:focus-visible { box-shadow: var(--focus-ring); }

.wordmark {
  position: relative;
  display: block;
  width: 120px;
  height: 25px;
}
.wordmark img { width: 120px; height: auto; }

.wordmark-cover {
  position: absolute;
  top: 0;
  right: 0;
  width: 8%;
  height: 100%;
  background: var(--ground);
  opacity: 0;
  animation: sx-cover 1s steps(1, end) 10;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font: 400 14px/20px var(--font-sans);
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 120ms ease-out;
  outline: none;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:focus-visible { box-shadow: var(--focus-ring); }

@media (max-width: 799px) {
  .nav-links { display: none; }
}

.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  font: 500 16px/26px var(--font-sans);
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  transition: background 120ms ease-out;
  outline: none;
  white-space: nowrap;
}
.cta-secondary:hover { background: var(--surface-raised); color: var(--ink); }
.cta-secondary:active { background: var(--surface); }
.cta-secondary:focus-visible { box-shadow: var(--focus-ring); }

.cta-label-short { display: none; }
@media (max-width: 799px) {
  .cta-label-long { display: none; }
  .cta-label-short { display: inline; }
}

/* Main and section shells */

.main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 clamp(16px, 4vw, 32px);
}

.section {
  width: 100%;
  padding: clamp(48px, 7vw, 80px) 0;
  scroll-margin-top: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.section-narrow { max-width: 720px; }
.section-wide { max-width: 1120px; }

.hairline {
  width: 100%;
  max-width: 1120px;
  height: 1px;
  background: var(--line);
}

.eyebrow {
  font: 500 12px/16px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.headline {
  margin-top: 12px;
  font-weight: 600;
  font-size: clamp(28px, 2.6vw, 32px);
  line-height: 1.19;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.prose {
  margin-top: 32px;
  max-width: 720px;
  font: 400 16px/26px var(--font-sans);
  color: var(--ink);
  text-wrap: pretty;
}

.prose-small {
  margin-top: 16px;
  font: 400 14px/20px var(--font-sans);
  color: var(--ink-muted);
}

/* Hero */

.hero {
  position: relative;
  width: 100%;
  max-width: 1120px;
  padding: clamp(56px, 9vw, 128px) 0 clamp(48px, 7vw, 96px);
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.28;
  mask-image: linear-gradient(black 20%, transparent 100%);
  -webkit-mask-image: linear-gradient(black 20%, transparent 100%);
  pointer-events: none;
}

.hero-scan {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--signal);
  opacity: 0.35;
  animation: sx-scan 11s linear infinite;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 48px 64px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 600px;
}

.hero-eyebrow {
  opacity: 0;
  animation: sx-rise 700ms cubic-bezier(.2,.7,.2,1) forwards;
}

.hero-title {
  margin-top: 12px;
  font-weight: 600;
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.07;
  letter-spacing: -0.025em;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25em;
}

.hero-word {
  display: inline-block;
  opacity: 0;
  animation: sx-rise 700ms cubic-bezier(.2,.7,.2,1) forwards;
}
.hero-word:nth-child(1) { animation-delay: 80ms; }
.hero-word:nth-child(2) { animation-delay: 160ms; }
.hero-word:nth-child(3) { animation-delay: 240ms; }
.hero-word:nth-child(4) { animation-delay: 320ms; }
.hero-word:nth-child(5) { animation-delay: 400ms; }
.hero-word:nth-child(6) { animation-delay: 560ms; }
.hero-word:nth-child(7) { animation-delay: 640ms; }
.hero-word:nth-child(8) { animation-delay: 720ms; }

.hero-sub {
  margin-top: 24px;
  font: 400 clamp(17px, 1.4vw, 18px)/1.56 var(--font-sans);
  color: var(--ink-muted);
  text-wrap: pretty;
  opacity: 0;
  animation: sx-rise 700ms cubic-bezier(.2,.7,.2,1) 900ms forwards;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}
.hero .cta-row {
  opacity: 0;
  animation: sx-rise 700ms cubic-bezier(.2,.7,.2,1) 1050ms forwards;
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  font: 500 16px/26px var(--font-sans);
  color: var(--on-signal);
  text-decoration: none;
  background: var(--signal);
  border: 1px solid var(--signal);
  transition: filter 120ms ease-out;
  outline: none;
}
.cta-primary:hover { filter: brightness(1.06); color: var(--on-signal); }
.cta-primary:active { filter: brightness(0.94); }
.cta-primary:focus-visible { box-shadow: var(--focus-ring); }

.cta-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  font: 400 16px/26px var(--font-sans);
  color: var(--ink);
  text-decoration: none;
  outline: none;
  transition: color 120ms ease-out;
}
.cta-inline:hover { color: var(--ink-muted); }
.cta-inline:focus-visible { box-shadow: var(--focus-ring); }

.cta-inline-arrow {
  display: inline-block;
  animation: sx-bob 1.6s ease-in-out infinite;
}

.status {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 12px/16px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.hero .status {
  opacity: 0;
  animation: sx-rise 700ms cubic-bezier(.2,.7,.2,1) 1200ms forwards;
}

#close .status { margin-top: 0; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--live);
  display: inline-block;
  animation: sx-pulse 2s ease-in-out infinite;
}

.status-fragment { color: var(--ink-muted); }

/* Agent feed */

.feed {
  width: 100%;
  min-height: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(16px, 2.5vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  animation: sx-rise 900ms cubic-bezier(.2,.7,.2,1) 700ms forwards;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: 500 12px/16px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.feed-head-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.feed-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--live);
  display: inline-block;
  animation: sx-pulse 2s ease-in-out infinite;
}

.feed-lines-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}

.feed-lines .log-line {
  display: flex;
  gap: 16px;
  padding: 0 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  background: transparent;
  font: 400 clamp(13px, 1.2vw, 14px)/1.57 var(--font-mono);
  color: var(--ink);
}
.feed-lines .log-line.log-line-hit { background: var(--signal-soft); }
.feed-lines .log-time { flex: none; width: 5ch; color: var(--ink-muted); }
.feed-lines .log-verb { font-weight: 500; color: var(--signal); }

.feed-caret {
  display: flex;
  gap: 16px;
  font: 400 14px/22px var(--font-mono);
  color: var(--ink-muted);
}
.feed-caret-time { width: 5ch; flex: none; }
.feed-caret-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--ink);
  margin-top: 4px;
  animation: sx-caret 1s steps(1, end) infinite;
}

/* Ticker */

.ticker {
  width: 100%;
  max-width: 1120px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 12px 0;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: sx-ticker 46s linear infinite;
}

.ticker-item {
  padding-right: 40px;
  font: 500 12px/16px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Proof / log */

.log {
  width: 100%;
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(16px, 2.5vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 12px/16px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.log-live-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--live);
  display: inline-block;
}

.log .log-line {
  display: flex;
  gap: 16px;
  padding: 0 8px;
  margin: 0 -8px;
  font: 400 clamp(13px, 1.2vw, 14px)/1.57 var(--font-mono);
  color: var(--ink);
}
.log .log-line.log-line-hit {
  border-radius: var(--radius-sm);
  background: var(--signal-soft);
}
.log .log-time { flex: none; width: 5ch; color: var(--ink-muted); }
.log .log-verb { font-weight: 500; color: var(--signal); }

/* Card grid */

.card-grid {
  width: 100%;
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(280px, 45%)), 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(16px, 2.5vw, 24px);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  transition: border-color 200ms ease-out, background 200ms ease-out;
}
.card:hover { border-color: var(--line-strong); background: var(--surface-raised); }

.card-mark {
  font: 500 16px/16px var(--font-mono);
  color: var(--signal);
}

.card-title {
  margin-top: 12px;
  font: 600 20px/28px var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.card-body {
  margin-top: 8px;
  font: 400 16px/26px var(--font-sans);
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* Figure grid */

.figure-grid {
  width: 100%;
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(240px, 30%)), 1fr));
  gap: 24px;
}

.figure {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.figure-value {
  font: 600 clamp(32px, 3vw, 40px)/1.1 var(--font-mono);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.figure-value-signal { color: var(--signal); }

.figure-note {
  font: 400 14px/20px var(--font-sans);
  color: var(--ink-muted);
}

/* How-it-runs flow diagram */

.flow {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}

.flow-node {
  flex: 1 1 200px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font: 500 12px/16px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  animation: sx-node 4.8s ease-in-out infinite;
}
.flow-node-2 { animation-delay: 1.6s; }
.flow-node-3 { animation-delay: 3.2s; }

.flow-wire {
  flex: none;
  align-self: center;
  width: 24px;
  height: 1px;
  background: var(--line);
  animation: sx-wire 4.8s ease-in-out 0.8s infinite;
}
.flow-wire-2 { animation-delay: 2.4s; }

/* Founder */

.founder-grid {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  align-items: flex-start;
}

.founder-photo {
  width: 240px;
  height: 240px;
  flex: none;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.founder-photo span {
  font: 500 12px/16px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.founder-text {
  flex: 1 1 320px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.founder-text .prose { margin-top: 0; max-width: none; color: var(--ink); }

.founder-name {
  font-weight: 600;
  font-size: clamp(28px, 2.6vw, 32px);
  line-height: 1.19;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.founder-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font: 400 14px/20px var(--font-sans);
  color: var(--ink-muted);
}
.founder-links a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 12px 0;
  outline: none;
  transition: color 120ms ease-out;
}
.founder-links a:hover { color: var(--ink); }
.founder-links a:focus-visible { box-shadow: var(--focus-ring); }

/* Close */

.close-body {
  margin-top: 16px;
  font: 400 clamp(17px, 1.4vw, 18px)/1.56 var(--font-sans);
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* Footer */

.site-footer {
  width: 100%;
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 32px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-brand span {
  font: 400 14px/20px var(--font-sans);
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  font: 400 14px/20px var(--font-sans);
  color: var(--ink-muted);
}
.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 12px 0;
  outline: none;
  transition: color 120ms ease-out;
}
.footer-links a:hover { color: var(--ink); }
.footer-links a:focus-visible { box-shadow: var(--focus-ring); }

/* Keyframes, copied from the v2 canvas */

@keyframes sx-cover { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes sx-caret { 0%, 49% { opacity: 1; } 50% { opacity: 0; } }
@keyframes sx-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes sx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sx-scan { from { left: -2px; } to { left: 100%; } }
@keyframes sx-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes sx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes sx-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes sx-node {
  0%, 8% { border-color: var(--line); color: var(--ink-muted); background: transparent; }
  12%, 30% { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
  36%, 100% { border-color: var(--line); color: var(--ink-muted); background: transparent; }
}
@keyframes sx-wire {
  0%, 10% { background: var(--line); }
  14%, 28% { background: var(--line-strong); }
  34%, 100% { background: var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
