/* ═══════════════════════════════════════════════════════
   rosary — ritual interface
   agent first / cyberpunk / anime / desert at night
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,700;0,800;1,300;1,400&display=swap');

/* ── Palette ── */
:root {
  --void:       #08080E;
  --bg:         #0C0C14;
  --surface:    #12121E;
  --raised:     #18182A;
  --elevated:   #1E1E32;
  --text:       #E0D9C7;
  --text-2:     #9E97A8;
  --text-3:     #6B6578;
  --text-4:     #3E3850;
  --border:     #242038;
  --border-lit: #342E50;
  --mint:       #A0D8C8;
  --teal:       #88CCCC;
  --periwinkle: #A8B4E8;
  --lavender:   #B8A0D8;
  --lilac:      #C8B0E0;
  --rose:       #E8A0B8;
  --pink:       #F0B8D0;
  --sage:       #8ECFA0;
  --amber:      #E8A878;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Texture layers ── */
#beadchain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Rosary spans full viewport as ambient background */
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.45;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 512px 512px;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 0%,
    rgba(8, 8, 14, 0.5) 100%
  );
}

/* ── Page structure ── */
.page {
  position: relative;
  z-index: 1;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Nav ── */
nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.sigil-nav {
  transition: filter 400ms cubic-bezier(0.23, 1, 0.32, 1);
  flex-shrink: 0;
}

.logo:hover .sigil-nav {
  filter: drop-shadow(0 0 6px rgba(240, 184, 208, 0.5))
          brightness(1.2);
}

.logo-text {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  transition: color 300ms ease;
  position: relative;
}

.nav-links a:hover { color: var(--text); }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--rose);
  transition: width 300ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-links a:hover::after { width: 100%; }

.btn-nav {
  padding: 6px 18px !important;
  font-size: 0.6875rem !important;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: all 300ms cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
  border: none;
  text-transform: lowercase;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 0.8125rem;
}

.btn-primary {
  background: var(--rose);
  color: var(--void);
  box-shadow: 0 0 24px rgba(232, 160, 184, 0.2),
              0 0 60px rgba(232, 160, 184, 0.06);
}

.btn-primary:hover {
  background: var(--pink);
  box-shadow: 0 0 32px rgba(240, 184, 208, 0.3),
              0 0 80px rgba(240, 184, 208, 0.1);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-lit);
  background: rgba(232, 160, 184, 0.03);
}

/* ═══════ HERO ═══════ */
.hero {
  padding: 140px 0 100px;
  position: relative;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-marker {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.marker-line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, var(--lavender), transparent);
}

.marker-text {
  font-size: 0.625rem;
  color: var(--lavender);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 300;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 40px;
  max-width: 600px;
}

.h1-dim {
  display: inline;
  color: var(--text-3);
  font-weight: 300;
  font-style: italic;
}

.h1-glow {
  display: inline;
  color: var(--pink);
  text-shadow:
    0 0 30px rgba(240, 184, 208, 0.25),
    0 0 60px rgba(184, 160, 216, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-body {
  max-width: 480px;
}

.hero-body p {
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.9;
  margin-bottom: 36px;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Decorative vertical rule */
.hero-rule {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  opacity: 0.15;
}

.rule-glyph {
  font-size: 0.5rem;
  color: var(--lavender);
  padding: 4px;
}

.rule-line {
  width: 1px;
  height: 200px;
  background: linear-gradient(180deg, transparent, var(--lavender), transparent);
}

/* ═══════ SECTION SHARED ═══════ */
.section-header {
  margin-bottom: 60px;
  max-width: 480px;
  opacity: 0;
  transform: translateY(16px);
  transition: all 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

.section-header.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-tag {
  display: inline-block;
  font-size: 0.5625rem;
  color: var(--text-4);
  letter-spacing: 0.35em;
  margin-bottom: 20px;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.section-desc {
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.9;
  font-weight: 300;
}

/* ═══════ PIPELINE FLOW ═══════ */
.section-loop {
  padding: 120px 0;
}

.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 48px;
}

.pf-step {
  flex: 1;
  padding: 28px 16px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  transition: all 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.pf-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.pf-step:nth-child(1) { transition-delay: 0ms; }
.pf-step:nth-child(3) { transition-delay: 80ms; }
.pf-step:nth-child(5) { transition-delay: 160ms; }
.pf-step:nth-child(7) { transition-delay: 240ms; }
.pf-step:nth-child(9) { transition-delay: 320ms; }

.pf-step::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.pf-step[data-color="mint"]::before       { background: var(--mint); box-shadow: 0 0 12px rgba(160,216,200,0.3); }
.pf-step[data-color="teal"]::before       { background: var(--teal); box-shadow: 0 0 12px rgba(136,204,204,0.3); }
.pf-step[data-color="periwinkle"]::before { background: var(--periwinkle); box-shadow: 0 0 12px rgba(168,180,232,0.3); }
.pf-step[data-color="lavender"]::before   { background: var(--lavender); box-shadow: 0 0 12px rgba(184,160,216,0.3); }
.pf-step[data-color="pink"]::before       { background: var(--pink); box-shadow: 0 0 12px rgba(240,184,208,0.3); }

.pf-step[data-color="mint"]       .pf-name { color: var(--mint); }
.pf-step[data-color="teal"]       .pf-name { color: var(--teal); }
.pf-step[data-color="periwinkle"] .pf-name { color: var(--periwinkle); }
.pf-step[data-color="lavender"]   .pf-name { color: var(--lavender); }
.pf-step[data-color="pink"]       .pf-name { color: var(--pink); }

.pf-step:hover {
  background: var(--raised);
  border-color: var(--border-lit);
}

.pf-num {
  display: block;
  font-size: 0.5625rem;
  color: var(--text-4);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.pf-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.pf-desc {
  display: block;
  font-size: 0.625rem;
  color: var(--text-3);
}

.pf-connector {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pf-connector span {
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--border), var(--border-lit), var(--border));
}

/* Lifecycle bar */
.lifecycle-bar {
  display: flex;
  gap: 2px;
}

.lc {
  flex: 1;
  padding: 16px 12px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--c);
  position: relative;
  overflow: hidden;
}

.lc::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.5;
}

.lc-label, .lc-sub { position: relative; z-index: 1; }

.lc-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lc-sub {
  display: block;
  font-size: 0.5625rem;
  color: var(--text-3);
  margin-top: 2px;
  font-style: italic;
  font-weight: 300;
}

/* ═══════ CARD MOSAIC ═══════ */
.section-beads { padding: 120px 0; }

.card-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  gap: 3px;
}

.card {
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: all 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:nth-child(1) { transition-delay: 0ms; }
.card:nth-child(2) { transition-delay: 80ms; grid-row: span 2; }
.card:nth-child(3) { transition-delay: 160ms; }
.card:nth-child(4) { transition-delay: 240ms; }
.card:nth-child(5) { transition-delay: 320ms; grid-column: 1 / -1; }

.card-glass {
  background: linear-gradient(135deg, rgba(18, 18, 30, 0.8), rgba(24, 24, 42, 0.6));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  transition: all 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

.card-glass:hover {
  border-color: var(--border-lit);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Glowing edge accent */
.card-edge {
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  transition: box-shadow 400ms ease;
}

.card[data-accent="mint"]       .card-edge { background: var(--mint); box-shadow: 0 0 8px rgba(160,216,200,0.2); }
.card[data-accent="lavender"]   .card-edge { background: var(--lavender); box-shadow: 0 0 8px rgba(184,160,216,0.2); }
.card[data-accent="pink"]       .card-edge { background: var(--pink); box-shadow: 0 0 8px rgba(240,184,208,0.2); }
.card[data-accent="periwinkle"] .card-edge { background: var(--periwinkle); box-shadow: 0 0 8px rgba(168,180,232,0.2); }
.card[data-accent="rose"]       .card-edge { background: var(--rose); box-shadow: 0 0 8px rgba(232,160,184,0.2); }

.card:hover .card-edge {
  box-shadow: 0 0 16px rgba(232, 160, 184, 0.35);
}

.card-glyph {
  font-size: 1.25rem;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
  opacity: 0.6;
}

.card[data-accent="mint"]       .card-glyph { color: var(--mint); }
.card[data-accent="lavender"]   .card-glyph { color: var(--lavender); }
.card[data-accent="pink"]       .card-glyph { color: var(--pink); }
.card[data-accent="periwinkle"] .card-glyph { color: var(--periwinkle); }

.card h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  line-height: 1.4;
}

.card p {
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.8;
  font-weight: 300;
}

/* Statement card — the manifesto panel */
.card-statement {
  background: linear-gradient(135deg, rgba(232, 160, 184, 0.04), rgba(184, 160, 216, 0.03));
  border: 1px solid rgba(232, 160, 184, 0.12);
  text-align: center;
  padding: 48px 40px;
}

.card-statement h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
  color: var(--pink);
}

.card-statement p {
  max-width: 500px;
  margin: 0 auto;
  font-style: italic;
}

/* ═══════ MCP ═══════ */
.section-mcp { padding: 120px 0; }

.mcp-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: all 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

.mcp-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.mcp-left {
  padding: 40px 32px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.mcp-left h3 {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.mcp-left p {
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.9;
  margin-bottom: 20px;
  font-weight: 300;
}

.mcp-endpoint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.75rem;
}

.endpoint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px rgba(160, 216, 200, 0.5);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(160, 216, 200, 0.5); }
  50% { opacity: 0.5; box-shadow: 0 0 4px rgba(160, 216, 200, 0.2); }
}

.endpoint-url {
  color: var(--rose);
  font-weight: 500;
}

.endpoint-status {
  color: var(--mint);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.mcp-right {
  background: var(--void);
  padding: 32px;
  display: flex;
  align-items: center;
}

.mcp-right pre {
  font-family: inherit;
  font-size: 0.6875rem;
  line-height: 2;
  color: var(--text-2);
  white-space: pre;
  font-weight: 300;
}

.syn-c  { color: var(--text-4); }
.syn-k  { color: var(--mint); }
.syn-f  { color: var(--text-3); }
.syn-u  { color: var(--rose); font-weight: 500; }
.syn-fn { color: var(--lavender); }

/* ═══════ CTA ═══════ */
.section-cta {
  padding: 140px 0 120px;
  text-align: center;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  transition: all 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

.section-cta.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-cta .section-tag {
  display: block;
  margin-bottom: 24px;
}

.section-cta h2 {
  margin-bottom: 16px;
  color: var(--pink);
  text-shadow: 0 0 40px rgba(240, 184, 208, 0.15);
}

.section-cta p {
  color: var(--text-2);
  font-size: 0.8125rem;
  margin-bottom: 40px;
  font-weight: 300;
}

.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════ FOOTER ═══════ */
footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.5625rem;
  color: var(--text-4);
  letter-spacing: 0.06em;
}

footer a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 300ms ease;
}

footer a:hover { color: var(--text-2); }

.footer-links {
  display: flex;
  gap: 20px;
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 768px) {
  main { padding: 0 20px; }
  nav { padding: 20px; }

  .hero { min-height: auto; padding: 100px 0 60px; }
  .hero h1 { font-size: 2rem; }
  .hero-rule { display: none; }

  .pipeline-flow { flex-direction: column; }
  .pf-connector { width: auto; height: 16px; }
  .pf-connector span { width: 1px; height: 16px; }

  .card-mosaic { grid-template-columns: 1fr; }
  .card:nth-child(2) { grid-row: auto; }
  .card:nth-child(5) { grid-column: auto; }

  .mcp-panel { grid-template-columns: 1fr; }
  .mcp-left { border-right: none; border-bottom: 1px solid var(--border); }

  .lifecycle-bar { flex-direction: column; gap: 2px; }
}

@media (max-width: 480px) {
  nav { flex-direction: column; gap: 16px; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .hero h1 { font-size: 1.75rem; }
  footer { flex-direction: column; gap: 12px; text-align: center; }
}
