/* ============================================
   MARGINALIA LABS — Shared Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Tokens --- */
:root {
  --navy:       #0f172a;
  --navy-mid:   #1e293b;
  --navy-light: #334155;
  --slate:      #64748b;
  --slate-light:#94a3b8;
  --silver:     #cbd5e1;
  --cream:      #f8fafc;
  --warm-cream: #faf8f5;
  --white:      #ffffff;
  --cyan:       #38bdf8;
  --cyan-dark:  #0ea5e9;
  --cyan-glow:  rgba(56,189,248,.15);
  --amber:      #f59e0b;
  --amber-light:#fbbf24;
  --emerald:    #10b981;
  --rose:       #f43f5e;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --max-w:      1200px;
  --max-w-narrow: 860px;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.12);
  --shadow-glow:0 0 40px rgba(56,189,248,.12);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--navy);
  background: var(--cream);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- Utilities --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
.container--narrow { max-width: var(--max-w-narrow); margin: 0 auto; padding: 0 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.text-slate { color: var(--slate); }
.text-cyan { color: var(--cyan-dark); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); letter-spacing: -.01em; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; }
p { max-width: 65ch; }
.lead { font-size: 1.15rem; color: var(--slate); line-height: 1.8; }
.label {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-light);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
}
.btn--primary {
  background: var(--navy);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--navy-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--cyan {
  background: var(--cyan-dark);
  color: var(--white);
}
.btn--cyan:hover {
  background: var(--cyan);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}
.btn--outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--silver);
}
.btn--outline:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--slate);
  padding: .5rem 1rem;
}
.btn--ghost:hover { color: var(--navy); }
.btn svg { width: 18px; height: 18px; }

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(248,250,252,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(203,213,225,.4);
  transition: background .3s;
}
.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}
.nav__brand svg { width: 28px; height: 28px; }
.nav__links {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.nav__link {
  padding: .45rem .9rem;
  font-size: .88rem;
  font-weight: 450;
  color: var(--slate);
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.nav__link:hover, .nav__link--active {
  color: var(--navy);
  background: rgba(30,41,59,.04);
}
.nav__link--active { font-weight: 550; }
.nav__mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: .5rem;
  cursor: pointer;
  color: var(--navy);
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav__mobile-toggle { display: block; }
  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--white);
    border-bottom: 1px solid var(--silver);
    padding: 1rem;
    gap: .25rem;
  }
  .nav__links.open { display: flex; }
  .nav__link { width: 100%; padding: .75rem 1rem; }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--navy);
  color: var(--slate-light);
  padding: 4rem 0 2rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer__brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: .75rem;
}
.footer__tagline {
  font-size: .9rem;
  color: var(--slate);
  max-width: 280px;
  line-height: 1.6;
}
.footer__heading {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 1rem;
}
.footer__link {
  display: block;
  font-size: .9rem;
  color: var(--slate-light);
  padding: .3rem 0;
  transition: color .2s;
}
.footer__link:hover { color: var(--white); }
.footer__bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--navy-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: var(--slate);
}
@media (max-width: 768px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer__bottom { flex-direction: column; gap: .5rem; text-align: center; }
}
@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ============================================
   HOMEPAGE — HERO
   ============================================ */
.hero {
  padding: 10rem 0 6rem;
  background: linear-gradient(165deg, var(--cream) 0%, var(--warm-cream) 40%, #f0f4ff 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(56,189,248,.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245,158,11,.05) 0%, transparent 70%);
  pointer-events: none;
}
.hero__label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 1rem;
  background: var(--white);
  border: 1px solid var(--silver);
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--slate);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.hero__label span { color: var(--cyan-dark); }
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 em {
  font-style: italic;
  color: var(--cyan-dark);
}
.hero .lead { margin-bottom: 2.5rem; max-width: 55ch; }
.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================
   PRODUCT CARDS — HOMEPAGE
   ============================================ */
.products {
  padding: 5rem 0;
}
.products__header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.products__header .lead { margin: 1rem auto 0; }
.products__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.product-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid rgba(203,213,225,.5);
  overflow: hidden;
  transition: all .35s ease;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.product-card__visual {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-card__visual--bc {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.product-card__visual--rc {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-light) 100%);
}
.product-card__icon {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  z-index: 1;
}
.product-card__visual::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  opacity: .08;
  background: white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.product-card__body { padding: 2rem; }
.product-card__name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: .25rem;
}
.product-card__name span { color: var(--cyan-dark); }
.product-card__desc {
  color: var(--slate);
  font-size: .95rem;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}
.product-card__features {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.product-card__tag {
  font-size: .78rem;
  font-weight: 500;
  padding: .3rem .7rem;
  border-radius: 100px;
  background: var(--cream);
  color: var(--slate);
  border: 1px solid rgba(203,213,225,.5);
}
.product-card__actions {
  display: flex;
  gap: .75rem;
}
@media (max-width: 768px) {
  .products__grid { grid-template-columns: 1fr; }
}

/* ============================================
   VALUES / PHILOSOPHY SECTION
   ============================================ */
.values {
  padding: 5rem 0;
  background: var(--navy);
  color: var(--white);
}
.values__header {
  text-align: center;
  margin-bottom: 3rem;
}
.values__header h2 { color: var(--white); }
.values__header .lead { color: var(--slate-light); margin: 1rem auto 0; }
.values__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.value-card {
  padding: 2rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  transition: all .3s;
}
.value-card:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(56,189,248,.2);
}
.value-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  background: rgba(56,189,248,.1);
  color: var(--cyan);
}
.value-card h3 {
  color: var(--white);
  margin-bottom: .6rem;
  font-size: 1.2rem;
}
.value-card p {
  color: var(--slate-light);
  font-size: .9rem;
  line-height: 1.7;
}
@media (max-width: 768px) {
  .values__grid { grid-template-columns: 1fr; }
}

/* ============================================
   PRODUCT PAGE — HERO
   ============================================ */
.product-hero {
  padding: 9rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.product-hero--bc {
  background: linear-gradient(165deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  color: var(--white);
}
.product-hero--rc {
  background: linear-gradient(165deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy-light) 100%);
  color: var(--white);
}
.product-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(56,189,248,.08) 0%, transparent 70%);
  pointer-events: none;
}
.product-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.product-hero__content .label { color: var(--cyan); margin-bottom: 1rem; display: block; }
.product-hero__content h1 { color: var(--white); margin-bottom: 1rem; }
.product-hero__content h1 em { color: var(--cyan); font-style: italic; }
.product-hero__content .lead { color: var(--slate-light); margin-bottom: 2rem; }
.product-hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.product-hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-hero__mockup {
  width: 100%;
  max-width: 480px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.1);
}
@media (max-width: 768px) {
  .product-hero__grid { grid-template-columns: 1fr; gap: 2rem; }
  .product-hero__visual { order: -1; }
}

/* ============================================
   FEATURES SECTION (PRODUCT PAGES)
   ============================================ */
.features {
  padding: 5rem 0;
}
.features__header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.features__header .lead { margin: 1rem auto 0; }
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.feature-card {
  background: var(--white);
  border: 1px solid rgba(203,213,225,.5);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all .3s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--cyan);
}
.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}
.feature-card__icon--cyan   { background: rgba(56,189,248,.1);  color: var(--cyan-dark); }
.feature-card__icon--amber  { background: rgba(245,158,11,.1);  color: var(--amber); }
.feature-card__icon--emerald{ background: rgba(16,185,129,.1);  color: var(--emerald); }
.feature-card__icon--rose   { background: rgba(244,63,94,.1);   color: var(--rose); }
.feature-card__icon--navy   { background: rgba(30,41,59,.08);   color: var(--navy); }
.feature-card h3 { margin-bottom: .5rem; font-size: 1.15rem; }
.feature-card p { color: var(--slate); font-size: .9rem; line-height: 1.7; }

@media (max-width: 768px) {
  .features__grid { grid-template-columns: 1fr; }
}

/* ============================================
   HIGHLIGHT / CALLOUT SECTION
   ============================================ */
.callout {
  padding: 5rem 0;
  background: var(--warm-cream);
}
.callout__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.callout__content h2 { margin-bottom: 1rem; }
.callout__content p { color: var(--slate); margin-bottom: 1.5rem; line-height: 1.8; }
.callout__image {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(203,213,225,.3);
}
@media (max-width: 768px) {
  .callout__inner { grid-template-columns: 1fr; gap: 2rem; }
}

/* ============================================
   PRICING / CTA SECTION
   ============================================ */
.cta {
  padding: 5rem 0;
  text-align: center;
}
.cta h2 { margin-bottom: 1rem; }
.cta .lead { margin: 0 auto 2rem; }
.cta__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cta__note {
  margin-top: 1.5rem;
  font-size: .85rem;
  color: var(--slate);
}

/* ============================================
   SUPPORT PAGE
   ============================================ */
.support-hero {
  padding: 9rem 0 3rem;
  text-align: center;
  background: var(--warm-cream);
}
.support-hero .lead { margin: 1rem auto 0; }
.support-content {
  padding: 3rem 0 5rem;
}
.support__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.support-card {
  background: var(--white);
  border: 1px solid rgba(203,213,225,.5);
  border-radius: var(--radius);
  padding: 2rem;
}
.support-card h3 { margin-bottom: .75rem; }
.support-card p { color: var(--slate); font-size: .92rem; line-height: 1.7; margin-bottom: 1rem; }
.support-card a.link {
  color: var(--cyan-dark);
  font-weight: 500;
  font-size: .92rem;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.support-card a.link:hover { border-bottom-color: var(--cyan-dark); }
@media (max-width: 768px) {
  .support__grid { grid-template-columns: 1fr; }
}

/* ============================================
   PRIVACY PAGE
   ============================================ */
.legal-hero {
  padding: 9rem 0 3rem;
  text-align: center;
  background: var(--warm-cream);
}
.legal-content {
  padding: 3rem 0 5rem;
}
.legal-content h2 {
  margin-top: 2.5rem;
  margin-bottom: .75rem;
  font-size: 1.4rem;
}
.legal-content h3 {
  margin-top: 1.5rem;
  margin-bottom: .5rem;
  font-size: 1.1rem;
}
.legal-content p {
  color: var(--slate);
  margin-bottom: 1rem;
  font-size: .95rem;
}
.legal-content ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  list-style: disc;
}
.legal-content li {
  color: var(--slate);
  font-size: .95rem;
  margin-bottom: .35rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up {
  opacity: 0;
  animation: fadeUp .7s ease forwards;
}
.fade-up--d1 { animation-delay: .1s; }
.fade-up--d2 { animation-delay: .2s; }
.fade-up--d3 { animation-delay: .3s; }
.fade-up--d4 { animation-delay: .4s; }
.fade-up--d5 { animation-delay: .5s; }

/* Scroll-triggered */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
