/* ═══════════════════════════════════════════════════════════════════════════
   memosight AdAgent — website
   Emil Kowalski principles: spring easing, GPU-only transforms,
   transitions over keyframes for UI, <300ms interactions, ~550ms entrances
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::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;
  color: #15181d;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ─── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --rust:         #b04a2f;
  --rust-dark:    #8f3a22;
  --rust-light:   #f7ede9;
  --rust-shadow:  rgba(176, 74, 47, 0.28);
  --bg:           #f8f5f1;
  --surface:      #ffffff;
  --text:         #15181d;
  --muted:        #6b7280;
  --border:       #e3e6ec;
  --subtle:       #f4f6f9;

  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --radius-panel: 28px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.09), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 14px 44px rgba(0,0,0,0.11), 0 6px 16px rgba(0,0,0,0.06);

  --spring:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:     cubic-bezier(0.0, 0.0, 0.2, 1);
}

/* ─── Page background ────────────────────────────────────────────────────── */
body {
  background:
    radial-gradient(ellipse 80% 55% at 8%  58%, rgba(242, 195, 168, 0.30) 0%, transparent 65%),
    radial-gradient(ellipse 70% 50% at 92% 22%, rgba(248, 224, 166, 0.25) 0%, transparent 65%),
    radial-gradient(ellipse 55% 45% at 50% 105%,rgba(240, 208, 178, 0.18) 0%, transparent 65%),
    #f8f5f1;
  background-attachment: fixed;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  transition:
    background 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}
.nav.scrolled {
  background: rgba(248, 245, 241, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(0,0,0,0.05);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 28px;
  transition: padding 0.25s var(--ease-out);
}
.nav.scrolled .nav__inner { padding-top: 14px; padding-bottom: 14px; }

.nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.nav__brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  margin-top: -2px;
}
.nav__wordmark {
  font-family: 'Jost', sans-serif;
  font-size: 20px;    /* 17px × 1.2 */
  line-height: 1;
  color: var(--rust);
}
.nav__wordmark strong { font-weight: 500; }
.nav__wordmark span   { font-weight: 350; }
.nav__tag {
  font-family: 'Inter', sans-serif;
  font-size: 11px;    /* 9px × 1.2 */
  font-weight: 400;
  color: #9aa1ac;
  letter-spacing: 0.05em;
  /* No text-transform — "Ad Agent" is written directly in HTML */
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.16s var(--spring),
    box-shadow 0.16s var(--spring),
    background 0.16s var(--ease-out),
    border-color 0.16s var(--ease-out);
}
.btn:active { transform: scale(0.97) !important; }

.btn--primary {
  background: var(--rust);
  color: #fff;
  padding: 13px 28px;
  font-size: 15px;
  box-shadow: 0 2px 10px var(--rust-shadow);
}
.btn--primary:hover {
  background: var(--rust-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--rust-shadow);
}
.btn--primary-dark {
  background: #fff;
  color: var(--text);
  padding: 13px 28px;
  font-size: 15px;
}
.btn--primary-dark:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}
.btn--outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 11px 22px;
  box-shadow: var(--shadow-sm);
}
.btn--outline:hover {
  border-color: #c4c9d4;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--outline-dark {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 11px 22px;
}
.btn--outline-dark:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-1px);
}

/* ─── Section chrome ─────────────────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-header .eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 14px;
}
.section-header h2 {
  font-family: 'Jost', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 14px;
}
.section-header p {
  font-size: 16px;
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.7;
}
/* Dark variants */
.section-header--dark h2  { color: #ffffff; }
.section-header--dark p   { color: rgba(255,255,255,0.55); }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero__left {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.hero__headline {
  font-family: 'Jost', sans-serif;
  font-size: clamp(33px, 4.9vw, 54px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
}
.headline-line { display: block; white-space: nowrap; }
.hero__sub {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 460px;
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ─── Hero mockup ────────────────────────────────────────────────────────── */
.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.mockup {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: float 7s ease-in-out infinite;
}
.mockup-card {
  background: #ffffff;
  border: 1px solid rgba(227, 230, 236, 0.8);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.09), 0 2px 8px rgba(0,0,0,0.05);
}

/* Main KPI card */
.mockup-card--main {}
.mockup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.mockup-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pulse-dot {
  width: 7px; height: 7px;
  background: #059669;
  border-radius: 50%;
  animation: pulse 2.2s ease-in-out infinite;
}
.mockup-period {
  font-size: 11px;
  color: #9aa1ac;
}
.mockup-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mockup-kpi {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kpi-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9aa1ac;
}
.kpi-val {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #15181d;
  line-height: 1;
}
.kpi-delta {
  font-size: 10px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}
.kpi-delta--up   { color: #059669; }
.kpi-delta--down { color: #dc2626; }

/* SVG sparkline — matches app's Sparkline component */
.kpi-spark {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 8px;
}

/* Anomaly card */
.mockup-card--alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: float 7s ease-in-out infinite;
  animation-delay: -2.3s;
}
.alert-icon-wrap {
  width: 32px; height: 32px;
  background: #fef3f2;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.alert-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #15181d;
  margin-bottom: 3px;
}
.alert-sub {
  display: block;
  font-size: 11px;
  color: #9aa1ac;
}
.alert-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: #b04a2f;
  background: #f7ede9;
  border-radius: 100px;
  padding: 3px 9px;
}

/* Actions card */
.mockup-card--actions {
  display: flex;
  align-items: center;
  gap: 14px;
  animation: float 7s ease-in-out infinite;
  animation-delay: -4.6s;
}
.actions-count {
  width: 36px; height: 36px;
  background: var(--rust);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.actions-label {
  font-size: 13px;
  font-weight: 500;
  color: #15181d;
  flex: 1;
}
.actions-cta {
  font-size: 12px;
  color: var(--rust);
  font-weight: 600;
  background: var(--rust-light);
  border-radius: 6px;
  padding: 5px 12px;
  white-space: nowrap;
  transition: background 0.15s var(--ease-out);
}
.actions-cta:hover { background: #f0ddd8; }

/* ─── Panel fold system ───────────────────────────────────────────────────── */
/* Each .panel slides up over the previous section, overlapping by radius-panel px */
.panel {
  background: var(--panel-bg, #ffffff);
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  margin-top: calc(-1 * var(--radius-panel));
  position: relative;
  z-index: var(--panel-z, 1);
  box-shadow: 0 -6px 40px rgba(0,0,0,0.07);
  overflow: hidden;
}
.panel--dark {
  --panel-bg: #15181d;
  color: rgba(255,255,255,0.75);
}
.panel--subtle { --panel-bg: #f4f6f9; }
.panel--white  { --panel-bg: #ffffff; }

/* ─── Features section ───────────────────────────────────────────────────── */
.features { padding: 100px 0 80px; }

.features__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.features__grid .feature-card:nth-child(5) {
  grid-column: 1 / -1;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 34px 30px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.22s var(--spring),
    box-shadow 0.22s var(--spring),
    border-color 0.18s var(--ease-out);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #d0d4de;
}
.feature-icon {
  width: 44px; height: 44px;
  background: var(--rust-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feature-icon svg {
  width: 21px; height: 21px;
  stroke: var(--rust);
  fill: none;
}
.feature-card h3 {
  font-family: 'Jost', sans-serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--text);
}
.feature-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
}

/* ─── Security section (dark panel) ──────────────────────────────────────── */
.security { padding: 100px 0; }

.security__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  margin-top: 56px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.security-item {
  padding: 36px 32px;
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s var(--ease-out);
}
.security-item:hover { background: rgba(255,255,255,0.04); }

.security-item__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: rgba(176, 74, 47, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.security-item__icon svg {
  width: 20px; height: 20px;
  stroke: var(--rust);
  fill: none;
}
.security-item h3 {
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.security-item p {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.75;
}

/* ─── Connectors section ─────────────────────────────────────────────────── */
.connectors { padding: 100px 0; }

.connectors__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}
.connector-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s var(--spring),
    box-shadow 0.2s var(--spring);
}
.connector-pill--active {
  border-color: rgba(5, 150, 105, 0.22);
  background: rgba(5, 150, 105, 0.04);
}
.connector-pill--active:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.connector-pill--soon {
  opacity: 0.45;
  pointer-events: none;
}
.connector-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.connector-pill--active .connector-dot { background: #059669; }
.connector-pill--soon .connector-dot   { background: #d1d5db; }
.connector-soon-tag {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

/* ─── Contact section ────────────────────────────────────────────────────── */
.contact { padding: 100px 0; }

.contact__card {
  max-width: 580px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 52px 48px;
  box-shadow: var(--shadow-md);
}
.contact__card .section-header {
  text-align: left;
  margin-bottom: 34px;
}
.contact__card .section-header h2 { font-size: 28px; }
.contact__card .section-header p  { margin: 0; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  resize: vertical;
  transition:
    border-color 0.14s var(--ease-out),
    background 0.14s var(--ease-out),
    box-shadow 0.14s var(--ease-out);
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: #a8b0bf;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21, 24, 29, 0.05);
}
.form-group textarea { min-height: 100px; }

.form-feedback {
  display: none;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
}
.form-feedback--success {
  background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
}
.form-feedback--error {
  background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
/* Logo + "A product by Decision Foundry" on the same line */
.footer__identity {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer__logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer__wordmark {
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  color: var(--rust);
  line-height: 1;
}
.footer__wordmark strong { font-weight: 500; }
.footer__wordmark span  { font-weight: 350; }
.footer__divider {
  width: 1px;
  height: 16px;
  background: var(--border);
}
.footer__byline {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.footer__links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer__links a {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.14s var(--ease-out), background 0.14s var(--ease-out);
}
.footer__links a:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.footer__links .sep { font-size: 13px; color: var(--border); user-select: none; }

/* ─── Keyframe animations ────────────────────────────────────────────────── */
/* Float — for decorative mockup only, not interactive UI */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}
/* Pulse — for live indicator dot */
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
  60%       { opacity: 0.8; box-shadow: 0 0 0 5px rgba(5, 150, 105, 0); }
}

/* ─── Scroll entrance animations ─────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.55s var(--spring),
    transform 0.55s var(--spring);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Hero stagger */
.hero-d0 { transition-delay: 0ms;   }
.hero-d1 { transition-delay: 80ms;  }
.hero-d2 { transition-delay: 155ms; }
.hero-d3 { transition-delay: 225ms; }

/* Feature grid stagger */
.feat-d0 { transition-delay: 0ms;   }
.feat-d1 { transition-delay: 75ms;  }
.feat-d2 { transition-delay: 150ms; }
.feat-d3 { transition-delay: 225ms; }
.feat-d4 { transition-delay: 300ms; }

/* Connector stagger */
.conn-d0 { transition-delay: 0ms;   }
.conn-d1 { transition-delay: 55ms;  }
.conn-d2 { transition-delay: 110ms; }
.conn-d3 { transition-delay: 165ms; }
.conn-d4 { transition-delay: 220ms; }

/* Security items stagger */
.sec-d0 { transition-delay: 0ms;   }
.sec-d1 { transition-delay: 80ms;  }
.sec-d2 { transition-delay: 160ms; }
.sec-d3 { transition-delay: 240ms; }

/* ─── Legal pages ────────────────────────────────────────────────────────── */
.legal-page { padding: 130px 0 100px; min-height: 100vh; }
.legal-inner { max-width: 740px; }
.legal-header { margin-bottom: 48px; }
.legal-header h1 {
  font-family: 'Jost', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 10px;
}
.legal-header .meta { font-size: 14px; color: var(--muted); }
.legal-header .meta a {
  color: var(--rust);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-body h2 {
  font-family: 'Jost', sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.legal-body h3 { font-size: 15.5px; font-weight: 600; margin: 24px 0 8px; }
.legal-body p  { font-size: 15px; color: #374151; line-height: 1.85; margin-bottom: 14px; }
.legal-body ul, .legal-body ol { padding-left: 22px; margin-bottom: 14px; }
.legal-body li { font-size: 15px; color: #374151; line-height: 1.85; margin-bottom: 6px; }
.legal-body a  { color: var(--rust); text-decoration: underline; text-underline-offset: 3px; }
.legal-body a:hover { color: var(--rust-dark); }
.legal-body strong { color: var(--text); font-weight: 600; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .hero__visual { order: -1; } /* mockup above headline on mobile */
  .mockup { max-width: 340px; margin: 0 auto; }
  .security__grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .features__grid { grid-template-columns: 1fr; }
  .features__grid .feature-card:nth-child(5) { grid-column: auto; max-width: none; }
  .form-row { grid-template-columns: 1fr; }
  .contact__card { padding: 36px 24px; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero__headline { font-size: 30px; }
}
@media (max-width: 480px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
}
