/* ========================================================================
   Power Dialer — Public Site
   Design system matched to PRD documents
   ======================================================================== */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --border: #e4e2da;
  --border-strong: #c8c5bc;
  --text-primary: #1a1916;
  --text-secondary: #6b6860;
  --text-tertiary: #9e9b93;
  --accent: #1a1916;
  --accent-fg: #f7f6f2;
  --green: #1d6a4a;
  --green-bg: #edf7f2;
  --green-light: #28845e;
  --amber: #92600a;
  --amber-bg: #fef8ec;
  --blue: #1a4b8c;
  --blue-bg: #eef3fb;
  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  --max-width: 960px;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---- Typography ---- */
h1 {
  font-family: var(--sans);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}

h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 24px 0 12px;
  color: var(--text-primary);
}

p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 680px;
}

.lead {
  font-size: 17px;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.6;
  max-width: 640px;
}

/* ---- Layout ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 72px 0;
}

section + section {
  border-top: 1px solid var(--border);
}

/* Section label (mono uppercase) */
.section-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--border-strong);
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.15s;
}

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

.nav-cta {
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  padding: 6px 14px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 6px;
  transition: opacity 0.15s;
  letter-spacing: 0.02em;
}

.nav-cta:hover {
  opacity: 0.85;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

/* ---- Hero ---- */
.hero {
  padding: 96px 0 72px;
  border-bottom: none;
}

.hero + section {
  border-top: none;
}

.hero h1 {
  margin-bottom: 20px;
  max-width: 600px;
}

.hero .lead {
  margin-bottom: 12px;
  max-width: 560px;
}

.hero-details {
  margin-bottom: 36px;
}

.hero-details p {
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1.7;
  max-width: 520px;
}

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

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

.btn-primary:hover {
  opacity: 0.85;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--bg);
}

/* ---- Code Blocks ---- */
pre {
  background: #1a1916;
  color: #d4d0c8;
  border-radius: 8px;
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 16px 0;
  max-width: 700px;
  -webkit-overflow-scrolling: touch;
}

code {
  font-family: var(--mono);
  font-size: 13px;
  background: #eae8e0;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.code-comment { color: #6b6860; }
.code-keyword { color: #a8d4bc; }
.code-string { color: #c9a96e; }
.code-function { color: #8ac4e8; }
.code-tag { color: #c98e8e; }
.code-attr { color: #c4a8e8; }

/* ---- Architecture Diagram ---- */
.arch-diagram {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 24px;
  margin: 24px 0;
  position: relative;
}

.arch-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arch-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.arch-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  transition: border-color 0.15s;
}

.arch-box:hover {
  border-color: var(--border-strong);
}

.arch-col-platform .arch-box {
  border-color: var(--border-strong);
}

.arch-box-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.arch-box-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.arch-box-content code {
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
  line-height: 1.6;
}

/* Vertical arrows between boxes */
.arch-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 0;
  color: var(--text-tertiary);
}

.arch-arrow-line {
  width: 1px;
  height: 16px;
  background: var(--border-strong);
}

.arch-arrow-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.arch-arrow-head {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--border-strong);
}

.arch-arrow-down {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
}

/* Horizontal arrows between columns */
.arch-connector {
  position: absolute;
  top: 50%;
  width: calc(100% / 3 - 24px);
  display: flex;
  align-items: center;
}

.arch-caption {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.arch-caption p {
  font-size: 14px;
  margin-bottom: 8px;
}

.arch-caption-note {
  display: block;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

/* ---- Steps Section ---- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 24px 0;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.step-card h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 8px;
}

.step-card pre {
  margin: 8px 0 0;
  padding: 12px 14px;
  font-size: 12px;
  max-width: none;
}

.step-card p {
  font-size: 13px;
}

/* ---- Stack Section ---- */
.stack-block {
  margin-bottom: 24px;
}

.stack-block-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Feature Cards Grid ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.feature-card-icon {
  font-size: 20px;
  margin-bottom: 10px;
  display: block;
  line-height: 1;
}

.feature-card h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
}

.feature-card p {
  font-size: 13px;
  margin: 0;
  color: var(--text-secondary);
}

/* ---- Compliance Checklist ---- */
.compliance-list {
  margin: 20px 0;
}

.compliance-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

.compliance-item:last-child {
  border-bottom: none;
}

.compliance-check {
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.compliance-note {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---- Pricing Card ---- */
.pricing-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  max-width: 440px;
  width: 100%;
}

.pricing-amount {
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.pricing-period {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
}

.pricing-features {
  margin-top: 24px;
}

.pricing-features li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pricing-features li::before {
  content: '\2713';
  color: var(--green);
  font-weight: 600;
  flex-shrink: 0;
  font-size: 13px;
}

.pricing-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-tertiary);
}

.pricing-cta {
  margin-top: 24px;
}

/* ---- Endpoint Group (API section) ---- */
.endpoint-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0;
  max-width: 700px;
}

.endpoint-group-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.endpoint {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.endpoint:last-child { border-bottom: none; }

.method {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 6px;
  border-radius: 4px;
  text-align: center;
  letter-spacing: 0.02em;
}

.method.post { background: #e8f5ed; color: #1d6a4a; }
.method.get { background: var(--blue-bg); color: var(--blue); }
.method.patch { background: var(--amber-bg); color: var(--amber); }

.endpoint-path {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-primary);
}

.endpoint-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}

.api-details {
  margin-top: 20px;
}

.api-details p {
  font-size: 14px;
  margin-bottom: 8px;
}

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

.cta-section h2 {
  margin-bottom: 20px;
}

.cta-section .lead {
  margin: 0 auto 24px;
}

.cta-code {
  display: inline-block;
  text-align: left;
  margin-bottom: 24px;
}

.cta-code pre {
  margin: 0;
}

.cta-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.cta-tagline {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

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

.footer-link {
  font-size: 12px;
  color: var(--text-tertiary);
  transition: color 0.15s;
}

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

.footer-copy {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---- Legal Pages ---- */
.legal {
  padding: 64px 0 96px;
}

.legal h1 {
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 8px;
}

.legal .legal-updated {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 40px;
}

.legal h2 {
  font-size: 18px;
  font-weight: 500;
  margin-top: 48px;
  margin-bottom: 12px;
}

.legal h3 {
  font-size: 15px;
  font-weight: 500;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal p {
  margin-bottom: 12px;
  font-size: 14px;
  max-width: none;
}

.legal ul, .legal ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }

.legal li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.65;
}

.legal a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal a:hover {
  color: var(--green-light);
}

.legal strong {
  color: var(--text-primary);
  font-weight: 500;
}

.legal blockquote {
  margin: 16px 0;
  padding: 14px 18px;
  background: var(--bg);
  border-left: 3px solid var(--border-strong);
  border-radius: 0 6px 6px 0;
}

.legal blockquote p {
  margin-bottom: 6px;
}

.legal blockquote p:last-child {
  margin-bottom: 0;
}

.legal code {
  font-family: var(--mono);
  font-size: 12px;
  background: #eae8e0;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Consent mockup card */
.consent-mockup {
  margin: 20px 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.consent-mockup h4 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
}

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.consent-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--green);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.consent-item label { cursor: pointer; }

.consent-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 20px;
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Audit trail table */
.legal .audit-table {
  width: 100%;
  margin: 12px 0 20px;
  border-collapse: collapse;
  font-size: 13px;
}

.legal .audit-table th,
.legal .audit-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.legal .audit-table th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg);
}

.legal .audit-table td {
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 12px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  html { font-size: 14px; }

  h1 { font-size: 28px; }
  h2 { font-size: 20px; }

  section { padding: 48px 0; }

  .hero { padding: 64px 0 48px; }

  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
  }

  .nav-links.open { display: flex; }

  .nav-cta {
    text-align: center;
    width: 100%;
    display: block;
  }

  /* Architecture diagram stacks vertically */
  .arch-diagram {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .arch-col-platform { order: -1; }

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

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

  .pricing-card { padding: 24px; }
  .pricing-amount { font-size: 36px; }

  pre {
    font-size: 12px;
    padding: 14px 16px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .legal .audit-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 24px; }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .cta-links {
    flex-direction: column;
    align-items: center;
  }

  .cta-links .btn {
    width: 100%;
    justify-content: center;
  }

  .endpoint {
    grid-template-columns: 48px 1fr;
  }

  .endpoint-desc {
    display: none;
  }
}
