/* AIOS marketing site — hand-authored, no build step.
   Design system: typographic hierarchy first, minimal decoration,
   light/dark via prefers-color-scheme. */

:root {
  /* Type scale (fluid) */
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.15rem, 1rem + 0.6vw, 1.35rem);
  --text-xl: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem);
  --text-2xl: clamp(1.9rem, 1.4rem + 2vw, 2.9rem);
  --text-3xl: clamp(2.4rem, 1.7rem + 3.2vw, 3.9rem);

  /* Spacing scale */
  --space-2xs: 0.375rem;
  --space-xs: 0.625rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6.5rem;

  /* Layout */
  --width-page: 64rem;
  --width-prose: 42rem;
  --radius: 10px;

  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Color — light */
  --color-bg: #ffffff;
  --color-surface: #f5f6f8;
  --color-text: #14161a;
  --color-muted: #545b68;
  --color-border: #e2e4e9;
  --color-accent: #2b46c8;
  --color-accent-contrast: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0c0e11;
    --color-surface: #14171c;
    --color-text: #e8eaed;
    --color-muted: #9aa1ad;
    --color-border: #242a32;
    --color-accent: #8ea3ff;
    --color-accent-contrast: #0c0e11;
  }
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 640;
  text-wrap: balance;
  margin: 0 0 var(--space-sm);
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--space-sm);
  color: var(--color-text);
}

a {
  color: var(--color-accent);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration: none;
}

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

/* Layout helpers */
.wrap {
  width: 100%;
  max-width: var(--width-page);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.measure {
  max-width: var(--width-prose);
}

.section {
  padding-block: var(--space-2xl);
}

.section > .wrap + .wrap {
  margin-top: var(--space-lg);
}

.section--surface {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
  margin-bottom: var(--space-xs);
}

.lede {
  font-size: var(--text-lg);
  color: var(--color-muted);
  max-width: var(--width-prose);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  z-index: 10;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-sm);
}

.wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
}

.nav-link {
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
}

.nav-link:hover {
  border-color: var(--color-accent);
}

/* Hero */
.hero {
  padding-top: var(--space-2xl);
}

.hero__actions {
  margin-top: var(--space-md);
}

.button {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.7em 1.2em;
  border-radius: var(--radius);
}

.button:hover {
  filter: brightness(1.06);
}

/* Flow */
.flow-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.flow-step {
  counter-increment: step;
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.section--surface .flow-step {
  background: var(--color-bg);
}

.flow-step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  display: block;
  margin-bottom: var(--space-2xs);
}

.flow-step h3 {
  margin-bottom: var(--space-2xs);
}

.flow-step p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* Flow diagram (inline SVG) */
.flow-diagram {
  display: block;
  width: 100%;
  height: auto;
  margin-top: var(--space-md);
  overflow: visible;
}

.flow-diagram .node {
  fill: var(--color-bg);
  stroke: var(--color-border);
  stroke-width: 1.5;
}

.flow-diagram .node-num {
  fill: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.flow-diagram .node-label {
  fill: var(--color-text);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.flow-diagram .edge {
  stroke: var(--color-muted);
  stroke-width: 1.5;
}

.flow-diagram .arrow {
  fill: var(--color-muted);
}

.flow-diagram .edge-return {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}

.flow-diagram .arrow-return {
  fill: var(--color-accent);
}

.flow-diagram .return-label {
  fill: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: no-preference) {
  .flow-diagram .edge-return {
    animation: flow-march 9s linear infinite;
  }
}

@keyframes flow-march {
  to {
    stroke-dashoffset: -90;
  }
}

/* Wide viewports: show the diagram, keep the ordered list for assistive tech only. */
@media (min-width: 48em) {
  .flow-steps.is-fallback {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

/* Narrow viewports: hide the diagram, show the ordered list. */
@media (max-width: 47.99em) {
  .flow-diagram {
    display: none;
  }
}

/* Value groups */
.value-groups {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.value-group h3 {
  margin-bottom: var(--space-xs);
}

.value-group ul {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: var(--space-2xs);
}

.value-group li {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* Closing */
.closing {
  text-align: center;
}

.closing .lede {
  margin-inline: auto;
}

.closing .hero__actions {
  display: flex;
  justify-content: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-lg);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  align-items: center;
  font-size: var(--text-sm);
  color: var(--color-muted);
  font-family: var(--font-mono);
}

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

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

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -3rem;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  padding: 0.5em 0.9em;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.15s ease;
  z-index: 20;
}

.skip-link:focus {
  top: var(--space-sm);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
