/* ============================================================
   Deltaplex — Corporate website shared styles (v1)
   Depends on colors_and_type.css for tokens.
   ============================================================ */

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  color: var(--fg1);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(99,102,241,0.22); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,0.28); border-radius: 4px; }
img, svg { display: block; max-width: 100%; }

/* ---------- Layout primitives ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

.section { padding: 112px 0; }
.section-tight { padding: 80px 0; }
.section-alt { background: var(--bg2); border-block: 1px solid var(--border-1); }

.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 32px; margin-bottom: 56px; flex-wrap: wrap;
}
.section-head .lede { max-width: 640px; }
.section-head .aside { max-width: 360px; color: var(--fg3); font-size: 15px; line-height: 1.6; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
}

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--fg-brand);
  margin-bottom: 16px;
}
.eyebrow--dark { color: #a5b4fc; }
.eyebrow--muted { color: var(--fg-muted); }

.display-1 {
  font-family: var(--font-sans); font-weight: 600;
  font-size: clamp(44px, 6.2vw, 76px);
  line-height: 1.04; letter-spacing: -0.035em;
  color: var(--fg1); margin: 0;
}
.display-2 {
  font-family: var(--font-sans); font-weight: 600;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08; letter-spacing: -0.03em;
  color: var(--fg1); margin: 0;
}
.display-3 {
  font-family: var(--font-sans); font-weight: 600;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2; letter-spacing: -0.02em;
  color: var(--fg1); margin: 0;
}
.title-sm {
  font-family: var(--font-sans); font-weight: 600;
  font-size: 18px; line-height: 1.35; letter-spacing: -0.01em;
  color: var(--fg1); margin: 0;
}

.lead { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; color: var(--fg3); margin: 20px 0 0; }
.prose { font-size: 16px; line-height: 1.65; color: var(--fg2); margin: 0; }
.prose-muted { font-size: 15px; line-height: 1.6; color: var(--fg3); margin: 0; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--fg-brand); }
.display-1 em, .display-2 em { font-style: normal; color: var(--fg-brand); }

.on-dark { color: #f1f5f9; }
.on-dark .prose, .on-dark .lead { color: #94a3b8; }
.on-dark .display-1 em, .on-dark .display-2 em { color: #a5b4fc; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 6px;
  font-family: var(--font-sans); font-weight: 500; font-size: 14px;
  line-height: 1; cursor: pointer; border: 1px solid transparent;
  transition: background 140ms var(--ease-out), color 140ms var(--ease-out), border-color 140ms var(--ease-out), transform 80ms var(--ease-out), box-shadow 140ms var(--ease-out);
  text-decoration: none; white-space: nowrap;
}
.btn svg { flex-shrink: 0; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

.btn-primary { background: #6366f1; color: #fff; box-shadow: 0 6px 20px -4px rgba(99,102,241,0.35); }
.btn-primary:hover { background: #4f46e5; }
.btn-primary:active { transform: scale(0.985); box-shadow: 0 3px 10px -2px rgba(99,102,241,0.3); }

.btn-secondary { background: #fff; color: var(--fg2); border-color: var(--border-2); }
.btn-secondary:hover { background: var(--bg3); color: var(--fg1); }

.btn-ghost { background: transparent; color: var(--fg2); }
.btn-ghost:hover { color: var(--fg-brand); }

.btn-dark-primary { background: #6366f1; color: #fff; }
.btn-dark-primary:hover { background: #4f46e5; }

.btn-dark-secondary { background: transparent; color: #c7d2fe; border-color: #4338ca; }
.btn-dark-secondary:hover { background: rgba(255,255,255,0.06); color: #e0e7ff; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row--center { justify-content: center; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--fg-brand);
  transition: gap 180ms var(--ease-out);
}
.link-arrow:hover { gap: 10px; }
.link-arrow svg { flex-shrink: 0; }

/* ---------- Site navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 60;
  height: 64px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-1);
}
.site-nav-inner {
  max-width: 1200px; margin: 0 auto; height: 100%; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-nav-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg1); }
.site-nav-brand-text {
  display: inline-flex; flex-direction: column; gap: 3px;
  font-weight: 300; font-size: 15px; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--fg1);
}
.site-nav-brand-text::after {
  content: ''; height: 1px; display: block;
  background: linear-gradient(90deg, #6366f1 0%, rgba(99,102,241,0) 100%);
}
.site-nav-links { display: flex; gap: 4px; align-items: center; }
.site-nav-links a {
  display: inline-flex; align-items: center; height: 32px;
  padding: 0 12px; border-radius: 6px;
  font-size: 14px; font-weight: 500; color: var(--fg2);
  transition: background 120ms var(--ease-out), color 120ms var(--ease-out);
}
.site-nav-links a:hover { background: var(--bg3); color: var(--fg1); }
.site-nav-links a.is-active { color: var(--fg1); background: var(--bg3); }
.site-nav-cta { display: inline-flex; align-items: center; gap: 10px; }

@media (max-width: 820px) {
  .site-nav { height: auto; }
  .site-nav-inner {
    padding: 12px 20px; flex-wrap: wrap; height: auto; gap: 12px;
  }
  .site-nav-links { order: 3; width: 100%; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; }
  .site-nav-links a { padding: 0 10px; font-size: 13px; white-space: nowrap; }
}

/* ---------- Hero shells ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 128px 24px 112px;
}
.hero-inner { position: relative; max-width: 1100px; margin: 0 auto; }
.hero-inner--center { text-align: center; }

.hero-dark {
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
}
.hero-dark::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(at 18% 0%, rgba(99,102,241,0.28) 0%, transparent 52%),
    radial-gradient(at 82% 28%, rgba(129,140,248,0.16) 0%, transparent 52%),
    radial-gradient(at 50% 100%, rgba(99,102,241,0.10) 0%, transparent 55%);
}
.hero-dark::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(148,163,184,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}
.hero-dark .hero-inner { position: relative; z-index: 1; }

.hero-light {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border-1);
}
.hero-page { padding: 96px 24px 80px; }

.hero-flow {
  position: absolute; bottom: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, #818cf8 50%, transparent);
  opacity: 0.5;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 6px; border-radius: 9999px;
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.28);
  font-size: 12px; color: #c7d2fe; margin-bottom: 28px;
}
.hero-badge .hero-badge-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #10b981; margin-left: 4px;
}
.hero-badge .hero-badge-label {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px;
  background: rgba(165,180,252,0.18); color: #c7d2fe;
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}

.hero-light .hero-badge {
  background: var(--bg-brand-subtle); border-color: var(--border-brand); color: var(--dp-indigo-800);
}
.hero-light .hero-badge .hero-badge-label {
  background: #fff; color: var(--fg-brand); border: 1px solid var(--border-brand);
}

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 1px solid var(--border-1); border-radius: 12px;
  padding: 32px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.card-link:hover { box-shadow: var(--shadow-md); }
.card-icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-brand-subtle); color: var(--fg-brand);
  margin-bottom: 4px;
}
.card-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg1); margin: 0; }
.card-body { font-size: 15px; line-height: 1.6; color: var(--fg3); margin: 0; }
.card-footer { margin-top: auto; padding-top: 4px; }

/* Hairline grid cards (used on homepage features). */
.card-grid--hairline {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border-1); border: 1px solid var(--border-1);
  border-radius: 12px; overflow: hidden;
}
.card-grid--hairline > .card {
  border: none; border-radius: 0; background: #fff;
  padding: 32px;
}
.card-grid--hairline > .card:hover { background: var(--bg2); box-shadow: none; }
@media (max-width: 820px) {
  .card-grid--hairline { grid-template-columns: 1fr; }
}

/* ---------- Trust bar ---------- */
.trust-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: 28px 32px; border: 1px solid var(--border-1); border-radius: 12px;
  background: #fff; flex-wrap: wrap;
}
.trust-bar .caption { font-size: 14px; color: var(--fg3); line-height: 1.55; max-width: 280px; }
.trust-bar .caption strong { color: var(--fg1); font-weight: 600; }
.trust-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.trust-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 6px;
  background: var(--bg2); border: 1px solid var(--border-1);
  font-family: var(--font-mono); font-size: 12px; color: var(--fg2);
}
.trust-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-muted); }
.trust-chip.on .dot { background: var(--dp-success); }
.trust-chip.progress .dot { background: var(--dp-warning); }

/* ---------- Pillar / metric tiles ---------- */
.pillar {
  padding: 32px; border: 1px solid var(--border-1); border-radius: 12px; background: #fff;
  display: flex; flex-direction: column; gap: 12px; height: 100%;
}
.pillar .num {
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-brand); letter-spacing: 0.05em;
}
.pillar h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; color: var(--fg1); margin: 0; }
.pillar p { font-size: 15px; line-height: 1.65; color: var(--fg3); margin: 0; }

.metric-tile {
  padding: 28px; border: 1px solid var(--border-1); border-radius: 12px; background: #fff;
  display: flex; flex-direction: column; gap: 10px; height: 100%;
}
.metric-tile .k {
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-brand);
}
.metric-tile .v { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg1); }
.metric-tile .v.mono { font-family: var(--font-mono); font-weight: 500; font-size: 26px; }
.metric-tile p { font-size: 14px; line-height: 1.6; color: var(--fg3); margin: 0; }

/* ---------- Use-case row (homepage, product) ---------- */
.use-case {
  display: grid; grid-template-columns: 1fr 2fr 200px; align-items: center; gap: 32px;
  padding: 40px 0; border-top: 1px solid var(--border-1);
}
.use-case:last-child { border-bottom: 1px solid var(--border-1); }
.use-case .idx {
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); letter-spacing: 0.05em;
}
.use-case .headline { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; color: var(--fg1); margin: 0 0 6px; }
.use-case .eyebrow { margin-bottom: 8px; }
.use-case p { font-size: 15px; line-height: 1.65; color: var(--fg3); margin: 0; }
.use-case .cta { text-align: right; }
@media (max-width: 900px) {
  .use-case { grid-template-columns: 1fr; gap: 16px; padding: 28px 0; }
  .use-case .cta { text-align: left; }
}

/* ---------- Pipeline / product preview (simple diagram) ---------- */
.pipeline-visual {
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 24px;
  padding: 40px; border: 1px solid var(--border-1); border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg2) 100%);
}
.pv-col { display: flex; flex-direction: column; gap: 10px; }
.pv-col h4 {
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--fg-muted); margin: 0 0 4px;
}
.pv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  background: #fff; border: 1px solid var(--border-1);
  font-family: var(--font-mono); font-size: 12px; color: var(--fg2);
}
.pv-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-brand); }
.pv-core {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 32px 20px; border-radius: 12px;
  background: linear-gradient(180deg, #0f172a, #1e1b4b);
  color: #f1f5f9; min-height: 160px; justify-content: center;
  position: relative; overflow: hidden;
}
.pv-core::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(at 50% 50%, rgba(99,102,241,0.25) 0%, transparent 65%);
}
.pv-core > * { position: relative; }
.pv-core .pv-glyph { width: 38px; height: 38px; }
.pv-core .pv-label { font-weight: 300; letter-spacing: 0.25em; font-size: 12px; text-transform: uppercase; color: #e0e7ff; }
.pv-core .pv-sub { font-size: 12px; color: #94a3b8; font-family: var(--font-mono); }
.pv-arrow {
  font-family: var(--font-mono); color: var(--border-2); text-align: center;
}
@media (max-width: 820px) {
  .pipeline-visual { grid-template-columns: 1fr; }
  .pv-arrow { display: none; }
}

/* ---------- Forms ---------- */
.form {
  display: flex; flex-direction: column; gap: 20px;
  padding: 36px; border: 1px solid var(--border-1); border-radius: 16px;
  background: #fff; box-shadow: var(--shadow-sm);
}
.form-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; color: var(--fg1); margin: 0; }
.form-help { font-size: 13px; color: var(--fg3); line-height: 1.55; margin: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px; font-weight: 600; color: var(--fg2); letter-spacing: 0.02em;
}
.field-label .req { color: var(--dp-error); margin-left: 2px; }
.field-input, .field-textarea, .field-select {
  font-family: var(--font-sans); font-size: 14px; color: var(--fg1);
  padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 6px;
  background: #fff; transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
  width: 100%;
}
.field-input:focus, .field-textarea:focus, .field-select:focus {
  outline: none; border-color: var(--border-brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
.field-input:invalid:not(:placeholder-shown) { border-color: var(--dp-error); }
.field-textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.field-help { font-size: 12px; color: var(--fg-muted); line-height: 1.5; }

.checkbox { display: inline-flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--fg2); line-height: 1.55; }
.checkbox input { margin-top: 2px; accent-color: var(--fg-brand); }
.form-submit { margin-top: 4px; }

.form-success {
  padding: 36px; border: 1px solid var(--border-brand); border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, var(--bg-brand-subtle));
  text-align: center;
}
.form-success h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg1); margin: 0 0 8px; }
.form-success p { font-size: 15px; color: var(--fg3); line-height: 1.6; margin: 0; }
.form-success .check {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 18px;
  background: #fff; border: 1px solid var(--border-brand); color: var(--fg-brand);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Steps / timeline (Trial page) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--border-1); border-radius: 12px; overflow: hidden; background: #fff; }
.step { position: relative; padding: 28px; border-right: 1px solid var(--border-1); }
.step:last-child { border-right: 0; }
.step-num {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--fg-brand); text-transform: uppercase; font-weight: 600; margin-bottom: 10px;
}
.step-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg1); margin: 0 0 6px; }
.step-body { font-size: 14px; line-height: 1.6; color: var(--fg3); margin: 0; }
@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--border-1); }
  .step:last-child { border-bottom: 0; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: #111827; color: #94a3b8; padding: 72px 24px 36px;
  border-top: 1px solid #1e293b;
}
.site-footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 48px;
}
.footer-brand-block .brand { display: inline-flex; align-items: center; gap: 10px; color: #f1f5f9; }
.footer-brand-block .brand span {
  display: inline-flex; flex-direction: column; gap: 3px;
  font-weight: 300; letter-spacing: 0.25em; text-transform: uppercase; font-size: 14px;
}
.footer-brand-block .brand span::after {
  content: ''; height: 1px; display: block;
  background: linear-gradient(90deg, #818cf8 0%, rgba(129,140,248,0) 100%);
}
.footer-brand-block p { font-size: 13px; line-height: 1.6; color: #64748b; max-width: 260px; margin: 16px 0 0; }
.footer-col h4 {
  font-size: 10px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: #94a3b8; margin: 0 0 14px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col li { font-size: 13px; color: #64748b; }
.footer-col a:hover { color: #cbd5e1; }
.footer-bottom {
  max-width: 1200px; margin: 48px auto 0; padding-top: 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid #1e293b; color: #475569; font-size: 12px;
}
.footer-bottom .ops { display: inline-flex; gap: 8px; align-items: center; color: #94a3b8; }
.footer-bottom .ops .dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; }
.footer-bottom a { color: #94a3b8; }
.footer-bottom a:hover { color: #f1f5f9; }
@media (max-width: 820px) {
  .site-footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand-block { grid-column: 1 / -1; }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 24px; }
.mt-8 { margin-top: 48px; }

/* ---------- Enter animation (use sparingly) ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.fade-up { animation: fade-up 520ms var(--ease-out) both; }
.delay-1 { animation-delay: 80ms; }
.delay-2 { animation-delay: 160ms; }
.delay-3 { animation-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
