/* Confidential E2E Database Encryption — stylesheet
 * Professional light theme: Inter + JetBrains Mono, teal accent, slate palette
 */

/* Ensure [hidden] attribute always wins over class-level display rules */
[hidden] { display: none !important; }

/* ── Design tokens ────────────────────────────────────────────────────────── */
:root {
  --bg:            #ffffff;
  --bg-subtle:     #f8fafc;
  --bg-card:       #ffffff;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  --accent:       #0d9488;
  --accent-hover: #0f766e;
  --accent-light: #f0fdfa;
  --accent-mid:   #ccfbf1;

  --success:      #059669;
  --success-bg:   #f0fdf4;
  --success-text: #166534;
  --error:        #dc2626;
  --error-bg:     #fef2f2;
  --error-text:   #991b1b;
  --warning-bg:   #fffbeb;
  --warning-text: #92400e;

  --code-bg:   #1e293b;
  --code-text: #e2e8f0;

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
  --shadow:    0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --radius:    10px;
  --radius-sm: 6px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85em;
}

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

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.nav-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { background: var(--bg-subtle); color: var(--text-primary); text-decoration: none; }

.nav-link-demo {
  background: var(--text-primary);
  color: #fff;
  font-weight: 600;
  padding: 6px 16px;
}
.nav-link-demo:hover { background: #334155; color: #fff; text-decoration: none; }

.nav-link-cta {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 6px 16px;
}
.nav-link-cta:hover { background: var(--accent-hover); color: #fff; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
  line-height: 1;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: var(--shadow-sm); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-strong);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-subtle); color: var(--text-primary); }

.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── Section intro ────────────────────────────────────────────────────────── */
.section-intro {
  padding: 72px 0 60px;
  background: linear-gradient(160deg, #f0fdfa 0%, #ffffff 60%);
  border-bottom: 1px solid var(--border);
}

.intro-badge {
  display: inline-block;
  background: var(--accent-mid);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.intro-problems {
  max-width: 700px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.problem-line {
  display: block;
  font-size: clamp(19px, 3vw, 26px);
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.intro-solution {
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 600;
  color: var(--accent);
  max-width: 640px;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

.intro-sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 48px;
}

/* ── Concept cards ────────────────────────────────────────────────────────── */
.concept-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.concept-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 14px;
}

.concept-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.concept-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── Wake gate ────────────────────────────────────────────────────────────── */
.wake-gate {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  max-width: 560px;
}

.wake-gate-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.wake-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.wake-gate-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── CVM loading ──────────────────────────────────────────────────────────── */
.cvm-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
  background: var(--accent-light);
  border: 1px solid var(--accent-mid);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  margin-top: 20px;
}

.cvm-loading-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cvm-loading-msg {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent-hover);
}

.cvm-elapsed {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

/* Progress bar track */
.cvm-progress-track {
  width: 100%;
  height: 5px;
  background: var(--accent-mid);
  border-radius: 3px;
  overflow: hidden;
}

.cvm-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.9s ease;
}

.cvm-progress-bar.done {
  background: var(--success);
  transition: width 0.4s ease;
}

.cvm-loading-phase {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.4;
}

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--accent-mid);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.spinner-sm {
  width: 15px;
  height: 15px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error banner ─────────────────────────────────────────────────────────── */
.error-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: var(--error-bg);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: var(--error-text);
  font-size: 13.5px;
  max-width: 560px;
  margin-top: 16px;
  line-height: 1.5;
}

/* ── Sections (revealed demo) ─────────────────────────────────────────────── */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.section.visible { opacity: 1; transform: none; }
.section-last { border-bottom: none; }

.section-header { margin-bottom: 32px; }

.section-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.section-sub {
  font-size: 14.5px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.65;
}

/* ── Demo card ────────────────────────────────────────────────────────────── */
.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}

.demo-card-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--warning-text);
  background: var(--warning-bg);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  margin-bottom: 24px;
}

/* ── Architecture diagram ─────────────────────────────────────────────────── */
.section-arch { background: var(--bg-subtle); }

.arch-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

/* Outside-TEE zones (browser+website and PostgreSQL) */
.arch-zone {
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius);
  padding: 14px 20px;
}

.arch-zone-out {
  border: 2px dashed #94a3b8;
  background: #f8fafc;
}

.arch-zone-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.arch-zone-title-out { color: #64748b; }

.arch-zone-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Labelled arrow between zones */
.arch-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.arch-flow-label {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  max-width: 300px;
  line-height: 1.4;
}

.arch-tee-boundary {
  border: 2px solid #16a34a;
  border-radius: var(--radius);
  background: #f0fdf4;
  padding: 16px 24px;
  width: 100%;
  max-width: 540px;
}

.arch-tee-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.arch-tee-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.arch-key-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #15803d;
  margin-top: 12px;
  font-style: italic;
}

.arch-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  text-align: center;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 110px;
  box-shadow: var(--shadow-sm);
}

.arch-box small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.arch-box-acra { border-color: #16a34a; background: #f0fdf4; }
.arch-box-acra svg { color: #16a34a; }

.arch-box-pg   { border-color: #dc2626; }
.arch-box-pg small { color: var(--error); }

.arch-arrow {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 300;
}

.arch-arrow-down { font-size: 22px; }

.arch-pg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.arch-ciphertext-note {
  font-size: 12px;
  color: var(--error-text);
  background: var(--error-bg);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

input[type="text"],
input[type="email"] {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.12);
}

input.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgb(220 38 38 / 0.1);
}

/* Passport number field — full width below the 2-col row */
.form-group-full {
  margin-bottom: 16px;
}

.field-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.field-tag.encrypted {
  background: var(--accent-mid);
  color: var(--accent-hover);
}

/* ── Inline loading / error ───────────────────────────────────────────────── */
.inline-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 14px 0 4px;
}

.inline-error {
  font-size: 13.5px;
  color: var(--error-text);
  background: var(--error-bg);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 14px;
}

/* ── Ciphertext comparison ────────────────────────────────────────────────── */
#ciphertext-comparison {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.comparison-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.comparison-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.comparison-table th {
  background: var(--bg-subtle);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

.cell-plain { color: var(--text-primary); }

.cell-cipher code {
  font-size: 12px;
  color: #38bdf8;
  background: var(--code-bg);
  padding: 3px 8px;
  border-radius: 4px;
  word-break: break-all;
  display: inline-block;
  max-width: 340px;
  white-space: normal;
}

.cell-plain-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-left: 4px;
}

.ciphertext-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.decrypt-proof {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--success-text);
  background: var(--success-bg);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
}

.decrypt-proof svg { color: var(--success); flex-shrink: 0; }

/* ── HMAC info tooltip ────────────────────────────────────────────────────── */
.hmac-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  white-space: nowrap;
}

.info-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: none;
  border: none;
  cursor: help;
  color: var(--text-muted);
  padding: 0;
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
}
.info-icon-btn:hover,
.info-icon-btn:focus { color: var(--accent); outline: none; }

.info-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: var(--text-primary);
  color: #f8fafc;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
  font-style: normal;
  white-space: normal;
}
.info-tooltip strong { color: #fff; }
.info-tooltip a { color: #93c5fd; text-decoration: underline; text-underline-offset: 2px; }
.info-tooltip a:hover { color: #bfdbfe; }

.hmac-info-wrap:hover .info-tooltip,
.hmac-info-wrap:focus-within .info-tooltip {
  opacity: 1;
  pointer-events: auto;
}

/* ── Search ───────────────────────────────────────────────────────────────── */
.search-suggestions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.suggestions-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.suggestion-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.suggestion-chip:hover { background: var(--accent-light); border-color: var(--accent); }

.search-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input-row input {
  flex: 1;
}

.search-row-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.search-row-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
}

.search-row-field .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.search-no-result {
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 12px 0;
}

.search-annotation {
  font-size: 13px;
  color: var(--accent-hover);
  background: var(--accent-light);
  border: 1px solid var(--accent-mid);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 4px;
  line-height: 1.65;
}

/* ── Attestation ──────────────────────────────────────────────────────────── */
.attest-summary {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.attest-status {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.attest-ok   { color: var(--success); }
.attest-fail { color: var(--error); }

.attest-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.attest-meta .label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  min-width: 130px;
}

.attest-meta code {
  font-size: 12px;
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  word-break: break-all;
}

.tag-ok   { color: var(--success-text); background: var(--success-bg); padding: 2px 9px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.tag-fail { color: var(--error-text);   background: var(--error-bg);   padding: 2px 9px; border-radius: 4px; font-size: 12px; font-weight: 600; }

.attest-checks {
  margin-top: 20px;
}

.checks-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-row {
  display: grid;
  grid-template-columns: 20px 180px 1fr;
  gap: 8px 12px;
  align-items: baseline;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
}

.check-pass { background: var(--success-bg); }
.check-fail { background: var(--error-bg); }

.check-icon {
  font-weight: 700;
  text-align: center;
}
.check-pass .check-icon { color: var(--success); }
.check-fail .check-icon { color: var(--error); }

.check-name { font-weight: 500; color: var(--text-primary); }
.check-detail { color: var(--text-secondary); font-size: 12.5px; }

.attest-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.copy-quote-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

.attest-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attest-closing {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── CTA Section ──────────────────────────────────────────────────────────── */
.section-cta {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  padding: 60px 0;
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.cta-text { flex: 1; min-width: 260px; }

.cta-headline {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.cta-sub {
  font-size: 14.5px;
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
  max-width: 500px;
}

.cta-btn {
  background: #fff;
  color: var(--accent-hover);
  flex-shrink: 0;
}
.cta-btn:hover { background: #f0fdfa; box-shadow: var(--shadow); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-brand { font-weight: 600; color: var(--text-primary); }
.footer-sep   { color: var(--text-muted); }

.footer-right {
  font-size: 12.5px;
  color: var(--text-muted);
}
.footer-right a { color: var(--text-secondary); }
.footer-right a:hover { color: var(--accent); text-decoration: none; }

.footer-dstack { color: var(--text-secondary); font-weight: 500; }
.footer-dstack:hover { color: var(--accent); }

/* ── Mobile comparison table — compact table, ciphertext truncated in JS ──── */
@media (max-width: 600px) {
  .comparison-table { font-size: 12px; table-layout: fixed; width: 100%; }
  .comparison-table th,
  .comparison-table td { padding: 8px 8px; }
  .comparison-table th:first-child,
  .comparison-table td:first-child { width: 28%; }
  .comparison-table th:nth-child(2),
  .comparison-table td:nth-child(2) { width: 28%; }
  .cell-cipher code { font-size: 10.5px; max-width: none; }
}

/* ── Ciphertext expand/collapse ───────────────────────────────────────────── */
.cipher-preview,
.cipher-full {
  display: inline;
  word-break: break-all;
  white-space: normal;
}

.cipher-ellipsis { color: var(--text-muted); font-style: normal; }

.cipher-toggle {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cipher-toggle:hover { color: var(--accent-hover); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-brand { min-width: 0; }
  .nav-brand span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-links { gap: 6px; }
  .nav-link-demo,
  .nav-link-cta { padding: 5px 10px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  .section-intro { padding: 40px 0 32px; }
  .section { padding: 40px 0; }
  .section-header { margin-bottom: 20px; }
  .concept-cards { grid-template-columns: 1fr 1fr; }
  .wake-gate { padding: 20px; max-width: 100%; }
  .wake-actions { flex-direction: column; align-items: stretch; }
  .wake-actions .btn { width: 100%; justify-content: center; }
  .demo-card { padding: 18px 16px; }
  .arch-tee-inner { flex-wrap: wrap; }
  .arch-zone-row { flex-direction: column; align-items: center; }
  .arch-zone { padding: 12px 14px; }
  .check-row { grid-template-columns: 20px 1fr; }
  .check-detail { grid-column: 2; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .search-input-row { flex-direction: column; align-items: stretch; }
  .search-row-card { grid-template-columns: 1fr; }
  .attest-meta .label { min-width: 0; width: auto; }
  .attest-actions { flex-direction: column; align-items: stretch; }
  .attest-actions .btn { width: 100%; justify-content: center; }
  .cta-inner { flex-direction: column; }
  .cta-btn { width: 100%; justify-content: center; }
  .info-tooltip { left: 0; transform: none; width: min(280px, calc(100vw - 48px)); }
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  .container { padding: 0 16px; }
  .intro-sub { font-size: 14.5px; }
  .concept-cards { grid-template-columns: 1fr; }
  .nav-brand span { display: none; } /* icon only — both buttons need the room */
  .nav-link-demo,
  .nav-link-cta { padding: 5px 9px; font-size: 11.5px; }
}
