/* ============================================================
   Allos landing — styles.css
   Tokens mirror landing/DESIGN.md.
   ============================================================ */

:root {
  /* colors */
  --color-primary: #0E5C4A;
  --color-primary-hover: #0A4A3B;
  --color-on-primary: #FFFFFF;
  --color-accent: #B8422E;
  --color-accent-hover: #9C3724;
  --color-on-accent: #FFFFFF;
  --color-neutral: #F7F5F2;
  --color-surface: #FFFFFF;
  --color-ink: #1A1C1E;
  --color-muted: #6C7278;
  --color-border: #E3E0DB;
  --color-code-bg: #1A1C1E;
  --color-code-fg: #E8E6E3;

  /* radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* spacing */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 40px;
  --s-2xl: 64px;
  --s-3xl: 96px;

  /* type */
  --f-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* layout */
  --container: 1100px;
  --container-narrow: 760px;
  --nav-h: 64px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-neutral);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--f-sans);
  font-weight: 600;
  margin: 0;
  color: var(--color-ink);
}

p { margin: 0 0 var(--s-md) 0; }
p:last-child { margin-bottom: 0; }

code {
  font-family: var(--f-mono);
  font-size: 0.9em;
  background: rgba(26, 28, 30, 0.06);
  padding: 0.1em 0.35em;
  border-radius: var(--r-sm);
  color: var(--color-ink);
}

ul, ol { padding-left: 1.25em; margin: 0 0 var(--s-md) 0; }

/* ============================================================
   Layout primitives
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-lg);
}
@media (min-width: 768px) { .container { padding: 0 var(--s-xl); } }
@media (min-width: 1024px) { .container { padding: 0 var(--s-2xl); } }

.narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--s-2xl) 0;
}
@media (min-width: 768px) {
  .section { padding: var(--s-3xl) 0; }
}
.section--alt { background: var(--color-surface); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }

.eyebrow {
  display: inline-block;
  font-family: var(--f-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--s-md);
}

.section__title {
  font-size: 2rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: var(--s-lg);
  max-width: 720px;
}
@media (min-width: 768px) {
  .section__title { font-size: 2.5rem; }
}

.lead { font-size: 1.125rem; line-height: 1.6; color: var(--color-ink); }

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

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(247, 245, 242, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  transition: box-shadow 160ms ease;
}
.nav--scrolled { box-shadow: 0 1px 0 var(--color-border); }
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--s-md);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: var(--f-sans);
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
}
.nav__wordmark { font-size: 1.125rem; letter-spacing: -0.01em; }
.nav__links { display: none; gap: var(--s-lg); }
@media (min-width: 768px) { .nav__links { display: inline-flex; } }
.nav__link {
  font-family: var(--f-body);
  font-size: 0.9rem;
  color: var(--color-muted);
  text-decoration: none;
}
.nav__link:hover { color: var(--color-ink); text-decoration: none; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: var(--f-sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 14px 24px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.btn--primary:hover { background: var(--color-primary-hover); color: var(--color-on-primary); }
.btn--secondary {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-border);
}
.btn--secondary:hover { background: var(--color-neutral); color: var(--color-ink); }
.btn--sm { padding: 10px 16px; font-size: 0.8rem; }
.btn--lg { padding: 18px 32px; font-size: 1rem; }

/* ============================================================
   Pills
   ============================================================ */
.pill {
  display: inline-block;
  font-family: var(--f-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-neutral);
  border: 1px solid var(--color-border);
  border-radius: var(--r-full);
  padding: 6px 12px;
}
.section--alt .pill { background: var(--color-surface); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: var(--s-2xl) 0 var(--s-2xl);
}
@media (min-width: 768px) {
  .hero { padding: var(--s-3xl) 0 var(--s-3xl); }
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-2xl);
  align-items: center;
}
@media (min-width: 1024px) {
  .hero__grid {
    grid-template-columns: 7fr 5fr;
    gap: var(--s-2xl);
  }
}
.hero__title {
  font-size: clamp(2.5rem, 5vw + 1rem, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--s-lg);
}
.hero__sub {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-muted);
  max-width: 560px;
  margin-bottom: var(--s-xl);
}
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  margin-bottom: var(--s-xl);
}
.hero__pills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
}

/* ============================================================
   Hero visual — WhatsApp ⇄ Claude Code message round-trip
   ============================================================ */
.hero__visual {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: stretch;
  justify-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 360px;
  min-height: 460px;
  margin: 0 auto;
}

.node {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  isolation: isolate;
}
.node__icon {
  width: 144px;
  height: 144px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  filter: drop-shadow(0 16px 32px rgba(26, 28, 30, 0.16));
  transition: transform 200ms ease;
}
.node__icon svg { width: 100%; height: 100%; }
.node__label {
  font-family: var(--f-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.node__pulse {
  position: absolute;
  top: 50%; left: 50%;
  width: 144px; height: 144px;
  transform: translate(-50%, -50%);
  border-radius: var(--r-full);
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  box-shadow: 0 0 0 0 rgba(184, 66, 46, 0.45);
  animation: claude-pulse 4.8s ease-out infinite;
  animation-delay: 1.4s;
}
.node--claude .node__pulse { top: calc(50% - 14px); }

/* Claude logo rotation: spins during the "processing" window. */
.node__icon--rotates {
  animation: claude-spin 4.8s cubic-bezier(0.6, 0.05, 0.4, 0.95) infinite;
  transform-origin: center;
}

/* ============================================================
   Wire — vertical channel between the two cards
   ============================================================ */
.wire {
  position: relative;
  height: 96px;
  margin: 0 auto;
  width: 100%;
  max-width: 240px;
}
.wire__line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed var(--color-border);
  opacity: 0.9;
}
.wire__line--left  { left: 30%; }
.wire__line--right { left: 70%; }

/* Bubbles travelling on the wire. They start at one end, animate to
   the other, fade out, and reset. Two bubbles, opposite phases. */
.bubble {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-50%) scale(0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 44px;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px 14px 14px 4px;
  font-family: var(--f-mono);
  box-shadow: 0 6px 18px -6px rgba(26, 28, 30, 0.32);
  opacity: 0;
  will-change: top, opacity, transform;
}
.bubble--out {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: 14px 14px 4px 14px; /* bubble-tail toward sender (top) */
  top: 0;
  animation: bubble-down 4.8s cubic-bezier(0.45, 0.05, 0.3, 1) infinite;
}
.bubble--in {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-radius: 14px 14px 14px 4px;
  top: 100%;
  animation: bubble-up 4.8s cubic-bezier(0.45, 0.05, 0.3, 1) infinite;
  animation-delay: 2.4s;
}
.bubble__dot {
  width: 6px; height: 6px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.92);
  animation: dot-blink 1s ease-in-out infinite;
}
.bubble__dot:nth-child(2) { animation-delay: 0.15s; }
.bubble__dot:nth-child(3) { animation-delay: 0.30s; }

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes bubble-down {
  0%   { top: 0%;   opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  10%  { top: 5%;   opacity: 1; transform: translate(-50%, -50%) scale(1); }
  35%  { top: 92%;  opacity: 1; transform: translate(-50%, -50%) scale(1); }
  45%  { top: 100%; opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  100% { top: 100%; opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
}
@keyframes bubble-up {
  0%   { top: 100%; opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  10%  { top: 95%;  opacity: 1; transform: translate(-50%, -50%) scale(1); }
  35%  { top: 8%;   opacity: 1; transform: translate(-50%, -50%) scale(1); }
  45%  { top: 0%;   opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  100% { top: 0%;   opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
}
@keyframes claude-spin {
  /* rest -> rest: 0%-45%; spin while processing: 45%-75%; rest tail: 75%-100% */
  0%, 45%   { transform: rotate(0deg); }
  75%       { transform: rotate(360deg); }
  100%      { transform: rotate(360deg); }
}
@keyframes claude-pulse {
  0%, 45%   { opacity: 0; box-shadow: 0 0 0 0 rgba(184, 66, 46, 0.45); }
  55%       { opacity: 0.9; box-shadow: 0 0 0 0 rgba(184, 66, 46, 0.45); }
  75%       { opacity: 0; box-shadow: 0 0 0 28px rgba(184, 66, 46, 0); }
  100%      { opacity: 0; box-shadow: 0 0 0 0 rgba(184, 66, 46, 0); }
}
@keyframes dot-blink {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-1px); }
}

/* ============================================================
   Reuse: code-block (used in Quickstart section)
   ============================================================ */
.prompt { color: #61C554; user-select: none; }
.muted { color: rgba(232, 230, 227, 0.55); }
.hl { color: var(--color-accent); }

/* ============================================================
   Code block (light section context)
   ============================================================ */
.code-block {
  background: var(--color-code-bg);
  color: var(--color-code-fg);
  border-radius: var(--r-md);
  padding: var(--s-lg);
  font-family: var(--f-mono);
  font-size: 0.875rem;
  line-height: 1.55;
  overflow-x: auto;
  margin: 0 0 var(--s-md) 0;
}
.code-block code { background: transparent; color: var(--color-code-fg); padding: 0; font-size: 1em; }

/* ============================================================
   How it works
   ============================================================ */
.how__diagram {
  margin: var(--s-xl) 0 var(--s-2xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: var(--s-xl);
}
.how__diagram img {
  width: 100%;
  height: auto;
}
.how__steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-lg);
}
@media (min-width: 768px) {
  .how__steps { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .how__steps { grid-template-columns: repeat(5, 1fr); gap: var(--s-md); }
}
.how__num {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--color-accent);
  margin-bottom: var(--s-sm);
}
.how__title {
  font-size: 1.125rem;
  margin-bottom: var(--s-sm);
}
.how__steps p {
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* ============================================================
   Features grid
   ============================================================ */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-md);
  margin-top: var(--s-xl);
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .features { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
  transition: box-shadow 160ms ease, transform 80ms ease;
}
.card:hover { box-shadow: 0 1px 3px rgba(26, 28, 30, 0.06); }

.feature__title {
  font-size: 1.125rem;
  margin-bottom: var(--s-sm);
}
.feature p { color: var(--color-muted); font-size: 0.95rem; margin: 0; }

/* ============================================================
   Quickstart
   ============================================================ */
.qs {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-lg);
  margin-top: var(--s-xl);
  align-items: stretch;
}
@media (min-width: 1024px) {
  /* minmax(0, 1fr) prevents long code-blocks from forcing one column wide */
  .qs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.qs__step {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
  display: flex;
  flex-direction: column;
  min-width: 0; /* allow children with overflow-x: auto to shrink */
  position: relative;
}
.qs__step::before {
  content: "";
  position: absolute;
  top: 0; left: var(--s-lg); right: var(--s-lg);
  height: 3px;
  background: var(--color-primary);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  opacity: 0.9;
}
.qs__head {
  display: flex;
  align-items: center;
  gap: var(--s-md);
  margin-bottom: var(--s-md);
}
.qs__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--f-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--r-full);
  flex-shrink: 0;
  margin: 0;
}
.qs__title {
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
  word-wrap: break-word;
  flex: 1;
}
.qs__note { color: var(--color-muted); font-size: 0.9rem; margin: var(--s-sm) 0 0 0; }
.qs__step .code-block {
  font-size: 0.78rem;
  padding: var(--s-md);
}
.qs__bonus {
  margin-top: var(--s-xl);
  padding: var(--s-lg);
  background: var(--color-neutral);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  color: var(--color-ink);
  font-size: 0.95rem;
}

/* ============================================================
   Docs grid
   ============================================================ */
.docs {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-md);
  margin-top: var(--s-xl);
}
@media (min-width: 640px) { .docs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .docs { grid-template-columns: repeat(3, 1fr); } }

.doc {
  text-decoration: none;
  color: var(--color-ink);
  display: flex;
  flex-direction: column;
}
.doc:hover { text-decoration: none; box-shadow: 0 1px 3px rgba(26, 28, 30, 0.06); }
.doc__title { font-size: 1.05rem; margin-bottom: var(--s-xs); font-family: var(--f-mono); font-weight: 500; }
.doc__sub { color: var(--color-muted); font-size: 0.9rem; margin: 0; }

/* ============================================================
   FAQ
   ============================================================ */
.faq {
  margin: var(--s-xl) 0 0 0;
  padding: 0;
}
.faq__item {
  border-top: 1px solid var(--color-border);
  padding: var(--s-lg) 0;
}
.faq__item:last-child { border-bottom: 1px solid var(--color-border); }
.faq dt {
  font-family: var(--f-sans);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--s-sm);
}
.faq dd {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* ============================================================
   Final CTA
   ============================================================ */
.cta {
  padding: var(--s-3xl) 0;
  background: var(--color-primary);
  color: var(--color-on-primary);
  text-align: center;
}
.cta__title {
  font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
  letter-spacing: -0.02em;
  color: var(--color-on-primary);
  margin-bottom: var(--s-md);
}
.cta__sub {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  margin-bottom: var(--s-xl);
}
.cta .btn--primary {
  background: var(--color-on-primary);
  color: var(--color-primary);
}
.cta .btn--primary:hover {
  background: var(--color-neutral);
  color: var(--color-primary);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--s-xl) 0;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--s-sm);
  align-items: flex-start;
}
@media (min-width: 768px) {
  .footer__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  margin: 0;
  font-family: var(--f-sans);
  font-weight: 600;
  color: var(--color-ink);
}
.footer__meta {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}
.footer__meta a { color: var(--color-muted); text-decoration: underline; }
.footer__meta a:hover { color: var(--color-ink); }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  /* Keep one bubble visible at the Claude card so the message round-trip
     is still legible without motion. */
  .bubble--out { opacity: 1 !important; top: 90% !important; }
  .bubble--in  { opacity: 0 !important; }
  .node__icon--rotates { transform: rotate(0deg) !important; }
}
