/* ============================================================
   Trionis — marketing site
   Tokens: cool off-white surface, deep teal accent (matches the
   product's own brand), Fraunces for display (ledger/document
   gravitas), IBM Plex Sans for body, IBM Plex Mono for policy
   numbers, module codes and anything that reads as "data".
   ============================================================ */

:root {
  --bg: #F8FAF9;
  --surface: #FFFFFF;
  --canvas: #F0F4F1;
  --ink: #171717;
  --muted: #5F5E5A;
  --faint: #8B8A85;
  --border: #E5E3DC;
  --accent: #0F6E56;
  --accent-dark: #085041;
  --accent-tint: #E4F0EC;
  --accent-tint-2: #D8EBE3;
  --danger: #B4432E;

  --display: 'Fraunces', Georgia, serif;
  --body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;

  --container: 1180px;
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; font-weight: 600; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.eyebrow::before {
  content: '';
  width: 16px;
  height: 1.5px;
  background: var(--accent);
  display: inline-block;
}

p { margin: 0 0 1em; color: var(--muted); max-width: 62ch; }
p.lede { font-size: 1.15rem; color: var(--ink); max-width: 56ch; }

.mono { font-family: var(--mono); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(8,80,65,0.15); }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 6px 16px rgba(15,110,86,0.28); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-arrow { transition: transform 0.15s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248,250,249,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

nav.primary-nav { display: flex; align-items: center; gap: 2px; }
nav.primary-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
nav.primary-nav a:hover { color: var(--ink); background: var(--canvas); }
nav.primary-nav a.active { color: var(--accent-dark); font-weight: 600; }

.nav-cta { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 880px) {
  /* Position absolute dropdown overlay */
  nav.primary-nav { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    right: 0; 
    
    /* Allow the page behind to remain visible */
    height: auto; 
    max-height: calc(100vh - 80px);
    
    background: var(--surface); 
    flex-direction: column; 
    align-items: stretch; 
    padding: 8px 20px 16px; 
    gap: 0; 
    display: none; 
    overflow-y: auto; 
    z-index: 100;

    /* Add borders and shadow so page content stays visible underneath */
    border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
  }

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

  nav.primary-nav a { 
    padding: 14px 10px; 
    font-size: 1rem; 
    border-bottom: 1px solid var(--border); 
    border-radius: 0; 
  }

  nav.primary-nav a:last-child {
    border-bottom: none;
  }

  .nav-toggle { 
    display: flex; 
  }

  .nav-cta .btn-ghost { 
    display: none; 
  }
}

/* ---------- Sections ---------- */

section { padding: 88px 0; }
section.tight { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-canvas { background: var(--canvas); }

.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Hero ---------- */

.hero {
  padding: 76px 0 40px;
  position: relative;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 56px;
  align-items: center;
}
.hero h1 { margin-bottom: 22px; }
.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero-trust {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.hero-trust-item { font-size: 0.82rem; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.hero-trust-item svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }

@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 420px; margin: 0 auto 8px; }
}

/* ---------- Signature element: the policy schedule card ---------- */

.schedule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -20px rgba(15,110,86,0.22), 0 4px 16px rgba(23,23,23,0.05);
  overflow: hidden;
  transform: rotate(1.2deg);
  animation: card-in 0.9s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: rotate(1.2deg) translateY(18px) scale(0.98); }
  to { opacity: 1; transform: rotate(1.2deg) translateY(0) scale(1); }
}
.schedule-bar { height: 5px; background: linear-gradient(90deg, var(--accent), #1E9377); }
.schedule-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.schedule-brand { display: flex; align-items: center; gap: 9px; }
.schedule-brand .mark { width: 22px; height: 22px; border-radius: 5px; background: var(--accent); color: #fff; font-family: var(--mono); font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.schedule-brand span { font-family: var(--display); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.02em; }
.schedule-doctype { text-align: right; }
.schedule-doctype .type { font-size: 0.66rem; letter-spacing: 0.1em; color: var(--faint); text-transform: uppercase; }
.schedule-doctype .num { font-family: var(--mono); font-weight: 600; font-size: 0.92rem; margin-top: 2px; }
.schedule-body { padding: 20px 24px; }
.schedule-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 0.82rem; }
.schedule-row:last-of-type { border-bottom: none; }
.schedule-row .label { color: var(--faint); }
.schedule-row .val { font-family: var(--mono); font-weight: 600; }
.schedule-total { margin-top: 14px; padding-top: 14px; border-top: 1.5px solid var(--ink); display: flex; justify-content: space-between; align-items: baseline; }
.schedule-total .label { font-size: 0.78rem; color: var(--muted); }
.schedule-total .amount { font-family: var(--mono); font-weight: 700; font-size: 1.2rem; color: var(--accent-dark); }
.schedule-status { margin: 16px 24px 22px; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.schedule-status span { font-size: 0.76rem; color: var(--accent-dark); font-weight: 600; font-family: var(--mono); }

/* ---------- Feature grid / cards ---------- */

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.card-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--accent-tint);
  color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.card-icon svg { width: 20px; height: 20px; }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; font-size: 0.92rem; }

/* ---------- Module list (ledger-style) ---------- */

.module-list { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.module-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 28px 28px;
  border-bottom: 1px solid var(--border);
}
.module-row:last-child { border-bottom: none; }
.module-code { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); font-weight: 600; padding-top: 4px; }
.module-body h3 { margin-bottom: 8px; }
.module-body p { margin-bottom: 12px; font-size: 0.92rem; }
.module-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-family: var(--mono); font-size: 0.7rem; padding: 4px 9px; border-radius: 20px; background: var(--accent-tint); color: var(--accent-dark); }
.module-lines { text-align: right; font-family: var(--mono); font-size: 0.7rem; color: var(--faint); white-space: nowrap; padding-top: 4px; }

@media (max-width: 720px) {
  .module-row { grid-template-columns: 1fr; gap: 10px; }
  .module-lines { text-align: left; }
}

/* ---------- Clause blocks (numbered, for genuinely sequential content) ---------- */

.clauses { counter-reset: clause; }
.clause {
  counter-increment: clause;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 22px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.clause:last-child { border-bottom: none; }
.clause::before {
  content: counter(clause, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  padding-top: 3px;
}
.clause h3 { margin-bottom: 6px; }
.clause p { margin: 0; font-size: 0.92rem; }

/* ---------- Security list ---------- */

.security-row { display: flex; gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.security-row:last-child { border-bottom: none; }
.security-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--accent-tint); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.security-icon svg { width: 19px; height: 19px; }
.security-row h3 { margin-bottom: 6px; font-size: 1.08rem; }
.security-row p { margin: 0; font-size: 0.92rem; max-width: none; }
.security-list { max-width: 760px; margin: 0 auto; }

/* ---------- Stats strip (real, structural — not fabricated metrics) ---------- */

.strip { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.strip-item { flex: 1 1 200px; padding: 26px 28px; border-right: 1px solid var(--border); }
.strip-item:last-child { border-right: none; }
.strip-item .n { font-family: var(--mono); font-weight: 700; font-size: 1.5rem; color: var(--accent-dark); }
.strip-item .l { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--ink);
  color: #F4F2EC;
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-band h2 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.2rem); }
.cta-band p { color: #B9B7AF; margin-top: 10px; }
.cta-band .btn-primary { background: var(--accent); }

/* ---------- Forms ---------- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 7px; }
.field .hint { font-size: 0.78rem; color: var(--faint); margin-top: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  font-family: var(--body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.field textarea { min-height: 120px; resize: vertical; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-row-2 { grid-template-columns: 1fr; } }
.form-success { display: none; text-align: center; padding: 30px 10px; }
.form-success.show { display: block; }
.form-success .mark { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.form-success .mark svg { width: 26px; height: 26px; }

/* ---------- Footer ---------- */

footer.site-footer { border-top: 1px solid var(--border); padding: 56px 0 32px; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 40px; }
.footer-brand p { font-size: 0.88rem; max-width: 32ch; margin-top: 12px; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col { margin-right: 0; min-width: 120px; }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 14px; font-weight: 600; font-family: var(--body); }
.footer-col a { display: block; font-size: 0.88rem; color: var(--muted); text-decoration: none; margin-bottom: 10px; }
.footer-col a:hover { color: var(--accent-dark); }
.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: var(--faint); }

@media (max-width: 560px) {
  .footer-cols { flex-direction: column; gap: 28px; }
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero { padding: 64px 0 24px; }
.page-hero .eyebrow { margin-bottom: 16px; }
.page-hero p.lede { margin-top: 18px; }

/* ---------- Utility ---------- */

.center { text-align: center; margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.spacer-lg { height: 80px; }
