/* =====================================================
   Erik McNair — personal-brand editorial theme
   Warm paper · navy #15417a · cyan accent · Fraunces + Inter
   Unlayered: beats framework @layer styles by cascade rule.
   ===================================================== */

:root {
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;

  --paper: #fbf9f5;
  --paper-deep: #f3efe7;
  --surface: #ffffff;
  --ink: #16202e;
  --ink-soft: #3c4657;
  --muted: #6b7280;
  --line: #e7e2d7;

  --navy: #15417a;
  --navy-deep: #0f2f59;
  --cyan: #0b7fc4;
  --cyan-soft: #e3f2fb;

  --color-primary: var(--navy);
  --color-accent: var(--cyan);
  --color-text: var(--ink-soft);
  --color-dark: var(--ink);

  --r: 10px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(22, 32, 46, 0.06);
  --shadow-md: 0 10px 30px rgba(22, 32, 46, 0.08);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink-soft);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Restore the heading scale Tailwind preflight resets */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.45rem); }
h4 { font-size: 1.1rem; }

a { color: var(--cyan); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--navy); }

::selection { background: rgba(11, 127, 196, 0.18); }

/* ── Layout helpers ─────────────────────────────────── */
.em-wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.em-section { padding: 4.5rem 0; }
.em-section--deep { background: var(--paper-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.em-eyebrow {
  display: inline-block; font-family: var(--font-body);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 0.9rem;
}
.em-lead { font-size: 1.15rem; color: var(--muted); line-height: 1.75; }
.em-center { text-align: center; }
.em-head { max-width: 660px; margin: 0 auto 2.75rem; }

/* ── Buttons ────────────────────────────────────────── */
.em-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.9rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; font-family: var(--font-body);
  border: 1.5px solid transparent; cursor: pointer;
  transition: all .25s ease; text-decoration: none;
}
.em-btn--primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.em-btn--primary:hover { background: var(--navy-deep); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.em-btn--ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.em-btn--ghost:hover { background: var(--navy); color: #fff; }
.em-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ── Header ─────────────────────────────────────────── */
.em-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(251, 249, 245, 0.88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease;
}
.em-header.em-scrolled { box-shadow: var(--shadow-sm); }
.em-header-inner { display: flex; align-items: center; gap: 2rem; padding: 1rem 0; }
.em-brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.em-brand span { color: var(--cyan); }
.em-nav { margin-left: auto; }
.em-nav ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.em-nav a {
  color: var(--ink-soft); font-weight: 500; font-size: 0.95rem; text-decoration: none;
  padding: 0.3rem 0; position: relative;
}
.em-nav a::after {
  content: ''; position: absolute; left: 0; bottom: -3px; height: 2px; width: 0;
  background: var(--cyan); border-radius: 2px; transition: width .25s ease;
}
.em-nav a:hover { color: var(--ink); }
.em-nav a:hover::after { width: 100%; }
.em-header .em-btn { padding: 0.6rem 1.4rem; font-size: 0.9rem; }
.em-burger {
  display: none; background: none; border: none; cursor: pointer; padding: 0.5rem;
  flex-direction: column; gap: 5px; margin-left: auto;
}
.em-burger span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; display: block; }

/* Mobile menu */
.em-mobile {
  position: fixed; inset: 0; z-index: 900; display: none;
  background: rgba(251, 249, 245, 0.98); backdrop-filter: blur(10px);
  align-items: center; justify-content: center; text-align: center;
}
.em-mobile.open { display: flex; }
.em-mobile ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.4rem; }
.em-mobile a { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); text-decoration: none; }
.em-mobile a:hover { color: var(--cyan); }
.em-mobile-close {
  position: absolute; top: 1.2rem; right: 1.6rem; font-size: 2.4rem; line-height: 1;
  background: none; border: none; color: var(--ink); cursor: pointer;
}

/* ── Hero ───────────────────────────────────────────── */
.em-hero { padding: 6rem 0 5rem; position: relative; overflow: hidden; }
.em-hero::before {
  content: ''; position: absolute; top: -30%; right: -12%;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(11,127,196,0.09), transparent 65%);
  pointer-events: none;
}
.em-hero-inner { max-width: 780px; }
.em-hero h1 { margin-bottom: 1.4rem; }
.em-hero h1 em { font-style: italic; color: var(--navy); }
.em-hero .em-lead { font-size: 1.25rem; margin-bottom: 2.2rem; max-width: 640px; }

/* ── Cards / pillars ────────────────────────────────── */
.em-grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.em-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 2rem; box-shadow: var(--shadow-sm);
  transition: transform .3s ease, box-shadow .3s ease;
  display: flex; flex-direction: column;
}
.em-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.em-card h3 { margin-bottom: 0.7rem; }
.em-card p { color: var(--muted); margin: 0 0 1rem; }
.em-card .em-more { margin-top: auto; font-weight: 600; font-size: 0.92rem; }
.em-card-num {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 700;
  color: var(--cyan); margin-bottom: 1rem; display: block;
}

/* ── Split ──────────────────────────────────────────── */
.em-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; align-items: center; }
.em-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.em-fact {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm);
}
.em-fact b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--navy); margin-bottom: 0.2rem; }
.em-fact small { color: var(--muted); font-size: 0.85rem; line-height: 1.4; display: block; }

/* ── Checklist ──────────────────────────────────────── */
.em-checks { list-style: none; padding: 0; margin: 1.2rem 0 0; display: flex; flex-direction: column; gap: 0.8rem; }
.em-checks li { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--ink-soft); }
.em-checks li::before {
  content: '✓'; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--cyan-soft); color: var(--cyan); font-weight: 700; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}

/* ── Writing feed ───────────────────────────────────── */
.em-posts { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.em-post {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.8rem; text-decoration: none; display: block;
  transition: transform .3s ease, box-shadow .3s ease;
}
.em-post:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.em-post time { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.em-post h3 { margin: 0.6rem 0 0.5rem; font-size: 1.2rem; }
.em-post p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ── CTA band ───────────────────────────────────────── */
.em-cta {
  background: var(--navy); border-radius: var(--r-lg);
  padding: 3.5rem 3rem; text-align: center; color: #dbe6f5;
  position: relative; overflow: hidden;
}
.em-cta::before {
  content: ''; position: absolute; bottom: -50%; left: -10%;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(11,127,196,0.35), transparent 65%);
}
.em-cta h2 { color: #fff; margin-bottom: 0.8rem; position: relative; }
.em-cta p { max-width: 560px; margin: 0 auto 1.8rem; position: relative; }
.em-cta .em-btn--primary { background: #fff; color: var(--navy); position: relative; }
.em-cta .em-btn--primary:hover { background: var(--cyan-soft); color: var(--navy-deep); }

/* ── Inner CMS pages ────────────────────────────────── */
.inner-hero { background: var(--paper-deep); border-bottom: 1px solid var(--line); }
.inner-hero-banner { background: linear-gradient(135deg, var(--paper-deep), #e9e2d4); }
.inner-hero-overlay { background: transparent; position: relative; padding: 4rem 1.5rem 3.2rem; }
.inner-hero h1 { color: var(--ink); max-width: 1120px; margin: 0 auto; }
.inner-content { color: var(--ink-soft); }
.inner-content h2 { color: var(--navy); margin: 2.2rem 0 0.8rem; }
.inner-content h3 { margin: 1.8rem 0 0.6rem; }
.inner-content p { margin-bottom: 1.1rem; }
.inner-content ul, .inner-content ol { margin: 0 0 1.2rem 1.4rem; }
.inner-content li { margin-bottom: 0.4rem; }
.inner-content blockquote {
  border-left: 3px solid var(--cyan); padding: 0.4rem 0 0.4rem 1.2rem;
  color: var(--muted); font-style: italic; margin: 1.5rem 0;
}
.inner-content img { max-width: 100%; height: auto; border-radius: var(--r); }

/* Homepage: let sections run full-bleed */
.em-home .inner-content { max-width: none; padding: 0; }

/* ── Contact form (ContactForm Mendol .cf-*) ────────── */
.contact-form-wrapper { max-width: 680px; }
.contact-form-wrapper .cf-label { color: var(--ink); font-weight: 600; font-size: 0.9rem; }
.contact-form-wrapper .cf-input {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 0.8rem 1rem; width: 100%;
}
.contact-form-wrapper .cf-input:focus {
  border-color: var(--cyan); outline: none;
  box-shadow: 0 0 0 3px rgba(11, 127, 196, 0.15);
}
.contact-form-wrapper button[type="submit"], .contact-form-wrapper [type="submit"] {
  background: var(--navy); color: #fff; border: none; border-radius: 999px;
  padding: 0.85rem 2rem; font-weight: 600; cursor: pointer; transition: background .25s ease;
}
.contact-form-wrapper button[type="submit"]:hover { background: var(--navy-deep); }

/* ── Blog listing (framework views) ─────────────────── */
.news-card, .blog-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

/* ── Footer ─────────────────────────────────────────── */
.em-footer { background: var(--navy-deep); color: #b9c7dc; margin-top: 4rem; }
.em-footer-inner { padding: 3.5rem 0 2rem; }
.em-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; margin-bottom: 2.5rem; }
.em-footer h4 { color: #fff; font-family: var(--font-body); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 1rem; }
.em-footer .em-brand { color: #fff; font-size: 1.3rem; display: inline-block; margin-bottom: 0.8rem; }
.em-footer p { font-size: 0.95rem; line-height: 1.7; max-width: 340px; }
.em-footer ul { list-style: none; padding: 0; margin: 0; }
.em-footer li { margin-bottom: 0.55rem; }
.em-footer a { color: #b9c7dc; text-decoration: none; }
.em-footer a:hover { color: #fff; }
.em-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1.5rem;
  font-size: 0.85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.em-footer-bottom a { color: #8fa5c4; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .em-nav, .em-header .em-btn { display: none; }
  .em-burger { display: flex; }
  .em-split { grid-template-columns: 1fr; gap: 2.2rem; }
  .em-footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .em-hero { padding: 4rem 0 3.5rem; }
  .em-section { padding: 3.2rem 0; }
  .em-cta { padding: 2.5rem 1.5rem; }
}
@media (max-width: 520px) {
  .em-facts { grid-template-columns: 1fr; }
}
