/* ============================================================
   OpenACP Landing Page — Stylesheet
   Design system: Paperclip.ing-inspired LIGHT aesthetic
   ============================================================ */

/* --- Design Tokens --- */
:root {
  --color-bg: #fafaf8;
  --color-bg-alt: #f2f0ec;
  --color-surface: #eae6e0;
  --color-surface-raised: #e2ded8;
  --color-border: #d8d4ce;
  --color-text: #1a1a1a;
  --color-text-secondary: #4a4a4a;
  --color-text-muted: #7a7a72;
  --color-accent: #1a1a1a;

  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Courier New", monospace;

  --space-xs: .5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: clamp(2rem, calc(1.5rem + 1.5vw), 3rem);
  --space-xl: clamp(3rem, calc(2rem + 3vw), 5rem);
  --space-2xl: clamp(4rem, calc(2.5rem + 4.5vw), 7rem);
  --space-section: clamp(5rem, calc(3rem + 5.5vw), 9rem);
  --max-width: 1140px;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 100px;
  --radius-lg: 24px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

img, svg { display: block; }

/* --- Utility --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.heading-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.body-text {
  color: var(--color-text-muted);
  line-height: 1.65;
  font-size: .95rem;
}

.section {
  padding: var(--space-section) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-heading {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-top: var(--space-sm);
}

.badge {
  display: inline-block;
  font-size: .8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
  border-radius: var(--radius-pill);
  padding: .4em 1.1em;
  letter-spacing: .01em;
}

/* --- Animations --- */
.anim-fade {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease-out, transform .5s ease-out;
  transition-delay: calc(var(--i, 0) * .14s);
}

.anim-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 12px 0;
}

.navbar-inner {
  width: fit-content;
  margin: 0 auto;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08), inset 0 1px rgba(255, 255, 255, 0.25);
  padding: 1rem 1rem;
}

/* When scrolled past hero into light content — same shape, just color swap */
.navbar.scrolled .navbar-inner {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

.navbar.scrolled .nav-links a {
  color: var(--color-text-secondary);
}

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

.navbar.scrolled .nav-github-btn {
  background: var(--color-text);
  color: #fff !important;
  border-color: var(--color-text);
}

.nav-logo {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.nav-logo-img {
  height: 22px;
  width: auto;
}

.nav-logo-white { display: block; }
.nav-logo-dark { display: none; }

.navbar.scrolled .nav-logo-white { display: none; }
.navbar.scrolled .nav-logo-dark { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-links a {
  font-size: .85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  transition: color .3s ease;
}

.nav-links a:hover {
  color: #ffffff;
}

/* GitHub button - black pill with white icon */
.nav-github-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 500;
  color: #fff !important;
  background: #1a1a1a;
  padding: .4rem .9rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: opacity .2s, background .3s ease, border-color .3s ease;
}

.nav-github-btn svg {
  display: inline;
  flex-shrink: 0;
}

.nav-github-btn:hover {
  opacity: .85;
  color: #fff !important;
}

/* --- Hero --- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-image {
  position: relative;
  height: 65vh;
  min-height: 400px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgb(250 250 248 / 0%) 40%,
    rgb(250 250 248 / 0.85) 70%,
    #fafaf8 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  margin-top: -6rem;
  text-align: center;
  padding: 0 var(--space-md);
  padding-bottom: var(--space-xl);
}

.hero-headline {
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 0 auto var(--space-lg);
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  padding: .8rem 2rem;
  cursor: pointer;
  transition: all .2s ease;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #333333;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

.btn-outline:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-surface-raised);
  transform: translateY(-1px);
}

.btn-sm {
  font-size: .85rem;
  padding: .6rem 1.5rem;
}

.text-link {
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color .2s;
}

.text-link:hover {
  color: var(--color-text);
}

/* --- Quickstart --- */
.quickstart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.quickstart-copy .badge {
  margin-bottom: var(--space-sm);
}

.quickstart-copy .section-heading {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

.quickstart-copy .body-text {
  margin-bottom: var(--space-lg);
}

.quickstart-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* --- Terminal --- */
.terminal {
  background: #1a1a1a;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #222222;
  position: relative;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3a3a;
}

.terminal-copy {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color .2s, background .2s;
  display: flex;
  align-items: center;
}

.terminal-copy:hover {
  color: #aaa;
  background: rgba(255, 255, 255, 0.06);
}

.terminal-copy.copied {
  color: #4ade80;
}

.terminal-body {
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: .85rem;
  line-height: 1.8;
  color: #f0f0f0;
}

.terminal-line {
  white-space: nowrap;
}

.terminal-prompt {
  color: #888888;
  margin-right: .75em;
  user-select: none;
}

.terminal-output {
  color: #999999;
  padding-left: 1.7em;
}

.terminal-success {
  color: #4ade80;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: #f0f0f0;
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- Steps --- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.step-card {
  background: var(--color-bg);
  padding: var(--space-lg) var(--space-md);
}

.step-number {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: var(--space-sm);
}

.step-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.feature-card {
  background: var(--color-bg);
  padding: var(--space-lg) var(--space-md);
}

.feature-icon {
  width: 28px;
  height: 28px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.feature-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

/* --- Feature Detail --- */
.feature-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.feature-detail-reverse {
  direction: rtl;
}

.feature-detail-reverse > * {
  direction: ltr;
}

.feature-detail-copy .badge {
  margin-bottom: var(--space-sm);
}

.feature-detail-copy .section-heading {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

.feature-detail-visual {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

/* Agents grid */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--color-bg);
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-chip-more {
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  justify-content: center;
  font-size: .8rem;
}

/* Platforms */
.platforms-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.platform-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
}

.platform-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.platform-icon svg {
  width: 24px;
  height: 24px;
}

.platform-card strong {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .1rem;
}

.platform-card .body-text {
  font-size: .82rem;
  line-height: 1.4;
  margin: 0;
}

/* --- Comparison Table --- */
.comparison-table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 780px;
  margin: 0 auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.comparison-table thead th {
  background: var(--color-bg-alt);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  font-size: .85rem;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.comparison-table thead th:first-child {
  width: 160px;
}

.comparison-table tbody td {
  padding: .75rem var(--space-md);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody td:first-child {
  font-weight: 500;
  color: var(--color-text-secondary);
}

.comparison-table tbody td.highlight {
  color: var(--color-text);
  font-weight: 600;
}

/* --- Pillars Grid --- */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pillar-card {
  background: var(--color-bg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.pillar-icon {
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
  margin: 0 auto var(--space-sm);
}

.pillar-card .feature-title {
  margin-bottom: var(--space-xs);
}

/* --- CTA Section --- */
.cta-section {
  text-align: center;
}

.cta-content .section-heading {
  margin-bottom: var(--space-lg);
}

.cta-terminal {
  max-width: 520px;
  margin: 0 auto var(--space-lg);
}

.cta-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* --- Footer --- */
/* --- Light Footer --- */
.footer-light {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.footer-col ul li {
  margin-bottom: .6rem;
}

.footer-col ul li a {
  font-size: .88rem;
  color: var(--color-text-secondary);
  transition: color .2s;
}

.footer-col ul li a:hover {
  color: var(--color-text);
}

.footer-bottom-light {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
  font-size: .8rem;
  color: var(--color-text-muted);
}

/* --- Star count badge --- */
.nav-star-count {
  font-size: .7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  padding: .1rem .4rem;
  border-radius: 9999px;
  margin-left: .2rem;
  color: rgba(255, 255, 255, 0.8);
}

.navbar.scrolled .nav-star-count {
  background: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
}

/* --- Cowork --- */
.cowork-section { background: var(--color-bg-alt); }

.cowork-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cowork-card {
  background: var(--color-bg);
  padding: var(--space-lg) var(--space-md);
}

.cowork-card-visual {
  margin-bottom: var(--space-md);
  display: flex;
  justify-content: center;
}

.cowork-orbit {
  position: relative;
  width: 160px;
  height: 160px;
}

.cowork-center-node {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .02em;
  z-index: 2;
}

.cowork-sat {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-62px) rotate(calc(-1 * var(--angle)));
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: .7rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  z-index: 3;
}

.cowork-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cowork-orbit::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1.5px dashed var(--color-border);
  border-radius: 50%;
}

.cowork-card-icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-sm);
  color: var(--color-text-muted);
}

.cowork-card-icon svg { width: 100%; height: 100%; }

.cowork-card .feature-title { margin-bottom: .3rem; }
.cowork-card .body-text { font-size: .9rem; }

/* --- Roadmap --- */
.roadmap-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.roadmap-col {
  background: var(--color-bg);
  padding: var(--space-lg) var(--space-md);
}

.roadmap-col-header {
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .35em .8em;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: var(--space-md);
}

.roadmap-col-header.shipped { background: #dcfce7; color: #166534; }
.roadmap-col-header.active { background: var(--color-text); color: var(--color-bg); }
.roadmap-col-header.upcoming { background: var(--color-surface); color: var(--color-text-muted); }

.roadmap-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.roadmap-col ul li {
  font-size: .88rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  padding-left: .9rem;
  position: relative;
}

.roadmap-col ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .5em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .navbar-inner {
    max-width: 100%;
    height: 48px;
    padding: 0 var(--space-sm);
    gap: var(--space-xs);
  }

  .nav-links {
    gap: var(--space-sm);
  }

  .nav-links a {
    font-size: .78rem;
  }

  .nav-logo span {
    font-size: .85rem;
  }

  .nav-logo {
    margin: 0 var(--space-xs);
  }

  .hero-image {
    height: 50vh;
    min-height: 300px;
  }

  .hero-content {
    margin-top: -4rem;
  }

  .quickstart-grid,
  .feature-detail,
  .feature-detail-reverse {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .cowork-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .roadmap-cards {
    grid-template-columns: 1fr;
  }

  .feature-detail-reverse {
    direction: ltr;
  }

  .steps-grid,
  .features-grid,
  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .agents-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .comparison-table-wrap {
    overflow-x: auto;
  }
}

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

  .cowork-grid {
    grid-template-columns: 1fr;
  }

  .agents-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
