/* ===========================================================
   Elena Vasquez — Executive Advisor
   Digilife Software · AUTHORITY package demo ($1,750)
   8 pages + blog + lead magnet. No external fonts or images.
   =========================================================== */

:root {
  --bg: var(--color-bg);
  --bg-alt: var(--color-bg-alt);
  --bg-deep: var(--color-inverse);
  --ink: var(--color-text);
  --muted: var(--color-text-muted);
  --accent: var(--color-primary);
  --accent-hover: var(--color-primary-hover);
  --accent-soft: var(--color-primary-soft);
  --gold: var(--color-tertiary);
  --border: var(--color-border);
  --radius: var(--radius-sm);
  --maxw: 1140px;
  --measure: 66ch;
  --font-head: var(--font-display);
  --font-body: var(--font-sans);
}

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.7rem);
}
h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.45rem);
}
h3 {
  font-size: 1.28rem;
}
h4 {
  font-size: 1.05rem;
}
p {
  margin: 0 0 1.15em;
}
a {
  color: var(--accent);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap--narrow {
  max-width: 760px;
}
.section {
  padding: 90px 0;
}
.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}
.section--deep {
  background: #17191c;
  background: var(--color-inverse, #17191c);
  color: #e9e7e2;
  color: var(--color-text-inverse, #e9e7e2);
}
.section--deep h2,
.section--deep h3 {
  color: #fff;
}
.section--deep .lede {
  color: #b3a996;
}

.eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.lede {
  font-size: 1.17rem;
  color: var(--muted);
  max-width: var(--measure);
}
.rule {
  width: 52px;
  height: 2px;
  background: var(--gold);
  margin: 0 0 26px;
}

.skip {
  position: absolute;
  left: -9999px;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  z-index: 200;
}
.skip:focus {
  left: 8px;
  top: 8px;
}

/* ---------- Ribbon ---------- */
.ribbon {
  background: #17191c;
  background: var(--color-inverse, #17191c);
  color: #e9e7e2;
  color: var(--color-text-inverse, #e9e7e2);
  font-size: 0.82rem;
  text-align: center;
  padding: 9px 16px;
}
.ribbon a {
  color: var(--gold);
  font-weight: 700;
}

/* ---------- Header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 252, 250, 0.94);
  background: color-mix(in srgb, var(--color-bg, #fdfcfa) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 74px;
}
.brand {
  font-family: var(--font-head);
  font-size: 1.24rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand em {
  font-style: normal;
  color: var(--accent);
}
.nav-links {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 27px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hover);
}
.btn--ghost {
  border-color: var(--border);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--gold {
  background: var(--gold);
  color: #1a1613;
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 76px;
}
.hero--sub {
  padding: 66px 0 46px;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 58px;
  align-items: center;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 28px;
}

.portrait {
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  background: linear-gradient(160deg, #e8ded0 0%, #d3c3ae 55%, #b9a58c 100%);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.portrait::after {
  content: "";
  position: absolute;
  inset: auto -25% -40% -25%;
  height: 65%;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--color-surface, #ffffff) 55%, transparent),
    transparent 70%
  );
}
.portrait-initials {
  font-family: var(--font-head);
  font-size: 4.6rem;
  color: #6d2f3d;
  opacity: 0.4;
  letter-spacing: 0.05em;
}

/* ---------- Credentials strip ---------- */
.creds {
  border-block: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 26px 0;
}
.creds-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 42px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ---------- Grids ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 44px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  margin-top: 44px;
}
.card {
  background: #ffffff;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.card p {
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0;
}
.card-num {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 12px;
}

/* ---------- Article cards ---------- */
.post {
  display: block;
  background: #ffffff;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.post:hover {
  border-color: var(--accent);
}
.post-meta {
  font-size: 0.79rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 12px;
}
.post h3 {
  margin-bottom: 10px;
}
.post p {
  color: var(--muted);
  font-size: 0.96rem;
  margin: 0 0 14px;
}
.post-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Article body ---------- */
.article {
  padding: 60px 0 90px;
}
.article-head {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}
.article-body {
  font-size: 1.08rem;
}
.article-body h2 {
  font-size: 1.6rem;
  margin-top: 1.8em;
}
.article-body h3 {
  font-size: 1.2rem;
  margin-top: 1.6em;
}
.article-body blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--gold);
  font-family: var(--font-head);
  font-size: 1.22rem;
  line-height: 1.5;
  color: var(--ink);
}
.article-body ul,
.article-body ol {
  padding-left: 22px;
  margin-bottom: 1.2em;
  color: var(--muted);
}
.article-body li {
  margin-bottom: 9px;
}
.back-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 26px;
  text-decoration: none;
}

/* ---------- Case ---------- */
.case {
  background: #ffffff;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  margin-bottom: 26px;
}
.case-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 13px;
  border-radius: 99px;
  margin-bottom: 15px;
}
.case-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.metric-num {
  font-family: var(--font-head);
  font-size: 1.85rem;
  color: var(--accent);
  line-height: 1.1;
}
.metric-label {
  font-size: 0.87rem;
  color: var(--muted);
}

/* ---------- Lead magnet ---------- */
.magnet {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 48px;
  align-items: center;
}
.magnet-cover {
  aspect-ratio: 3 / 4;
  max-width: 320px;
  border-radius: 3px;
  background: linear-gradient(150deg, #6d2f3d 0%, #4a1f29 100%);
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 18px 40px rgba(30, 18, 12, 0.18);
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f3e9d9;
}
.magnet-cover .kicker {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.magnet-cover .title {
  font-family: var(--font-head);
  font-size: 1.75rem;
  line-height: 1.2;
}
.magnet-cover .byline {
  font-size: 0.85rem;
  color: #c3b49b;
}

/* ---------- Forms ---------- */
.field {
  margin-bottom: 17px;
}
.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  background: var(--color-surface, #ffffff);
  font: inherit;
  font-size: 0.96rem;
  color: var(--ink);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.field textarea {
  min-height: 125px;
  resize: vertical;
}
.form-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 13px 0 0;
}
.form-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.form-inline input {
  flex: 1 1 240px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
}
.checklist li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 0.99rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
}

.quote-feature {
  margin: 0;
  text-align: center;
  max-width: 780px;
  margin-inline: auto;
}
.quote-feature blockquote {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  line-height: 1.45;
  margin: 0 0 22px;
  color: #fff;
}
.quote-feature figcaption {
  font-size: 0.92rem;
  color: #b3a996;
}

.cta-band {
  text-align: center;
}

/* ---------- Footer ---------- */
.site-foot {
  background: #17191c;
  background: var(--color-inverse, #17191c);
  color: #e9e7e2;
  color: var(--color-text-inverse, #e9e7e2);
  padding: 52px 0 30px;
  font-size: 0.93rem;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 34px;
}
.site-foot h4 {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 15px;
}
.site-foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-foot li {
  margin-bottom: 9px;
}
.site-foot a {
  color: #b3a996;
  text-decoration: none;
}
.site-foot a:hover {
  color: var(--gold);
}
.foot-legal {
  margin: 34px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.83rem;
  color: #857c6f;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid,
  .magnet,
  .foot-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .grid-3,
  .grid-2,
  .case-metrics {
    grid-template-columns: 1fr;
  }
  .portrait,
  .magnet-cover {
    max-width: 320px;
  }
  .nav-links {
    display: none;
  }
  .section {
    padding: 64px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}


/* ============================================================
   Motion support — added with the motion system
   ============================================================ */

.hero,
.hero--sub,
.section--deep {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero > .wrap,
.hero--sub > .wrap {
  position: relative;
  z-index: 1;
}

/* Image slot keeps the gradient as a fallback until a photo is added */
.portrait.media img,
.media img {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.portrait .portrait-initials {
  position: relative;
  z-index: 0;
}

/* Cards sit above hero decoration */
.card,
.post,
.case,
.stat,
.quote,
.figure-panel {
  position: relative;
  z-index: 1;
}

/* Signature: editorial shimmer + marquee credentials */
.creds { overflow: hidden; }
.creds-row { flex-wrap: nowrap; white-space: nowrap; }

.post { transition: transform 0.5s cubic-bezier(0.22,1,0.36,1), border-color 0.3s ease, box-shadow 0.5s ease; }
.post-more { display: inline-block; transition: transform 0.4s cubic-bezier(0.22,1,0.36,1); }
.post:hover .post-more { transform: translateX(6px); }

.rule { transform-origin: 0 50%; animation: rule-in 0.9s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes rule-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.magnet-cover {
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1), box-shadow 0.6s ease;
}
.magnet-cover:hover { box-shadow: 0 34px 70px rgba(30, 18, 12, 0.32); }

.article-body blockquote {
  position: relative;
  transition: border-color 0.4s ease;
}
.article-body blockquote::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: 0 0;
  transition: transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.article-body blockquote.m-in::before { transform: scaleY(1); }

@media (prefers-reduced-motion: reduce) {
  .rule { animation: none; }
}


/* ---------- Theme-aware surfaces (was hardcoded white) ---------- */
.card,
.stat,
.quote,
.post,
.case,
.field input,
.field select,
.field textarea,
.slot,
.section--alt .card {
  background: var(--color-surface);
  color: var(--color-text);
}
.figure-panel {
  background: var(--color-surface-2);
}
.btn--primary {
  color: var(--color-on-primary);
}
.btn--light {
  background: var(--color-surface);
}
.site-head {
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
}
.bar-track {
  background: var(--color-border);
}
.portrait,
.media {
  border-color: var(--color-border);
}


/* ---------- Decorative surfaces follow the active theme ---------- */
.portrait {
  background:
    linear-gradient(155deg,
      color-mix(in srgb, var(--color-primary) 16%, var(--color-bg-alt)) 0%,
      color-mix(in srgb, var(--color-primary) 30%, var(--color-bg-alt)) 55%,
      color-mix(in srgb, var(--color-primary) 46%, var(--color-bg-alt)) 100%);
}
.portrait-initials {
  color: color-mix(in srgb, var(--color-primary) 70%, var(--color-text));
}
.magnet-cover {
  background: linear-gradient(150deg,
    var(--brand-primary) 0%,
    color-mix(in srgb, var(--brand-primary) 62%, black) 100%);
  color: color-mix(in srgb, var(--color-tertiary) 32%, white);
}
.magnet-cover .kicker { color: var(--brand-tertiary); }
.magnet-cover .byline { color: color-mix(in srgb, var(--brand-tertiary) 55%, white); }

.card:hover .card-icon {
  background: color-mix(in srgb, var(--color-primary) 22%, var(--color-surface));
}
.card-icon svg { stroke: var(--color-primary); }

.ribbon a,
.site-foot a:hover { color: var(--color-tertiary); }
.brand span,
.brand em { color: var(--color-primary); }

/* Always-dark bands keep readable text in either mode */
.section--deep h2,
.section--deep h3,
.site-foot h4 { color: #fff; }

/* Form controls need a 3:1 boundary under WCAG 1.4.11 */
.field input,
.field select,
.field textarea,
.form-inline input,
.slot {
  border-color: var(--color-border-strong);
}

/* ============================================================
   FIX — always-dark bands (ribbon / footer / deep sections)
   ------------------------------------------------------------
   These bands must stay dark in BOTH themes. Deriving them from
   --ink was the bug: --ink maps to --color-text, which flips to
   near-white in dark mode, leaving light text on a light band.
   --color-inverse is dark in both modes; --color-text-inverse is
   light in both. Verified by _shared/tools/check-contrast.py.
   ============================================================ */
.ribbon,
.site-foot,
.section--deep {
  background: #17191c;
  background: var(--color-inverse, #17191c);
  color: #e9e7e2;
  color: var(--color-text-inverse, #e9e7e2);
}
.ribbon strong,
.site-foot strong,
.section--deep h2,
.section--deep h3,
.site-foot h4 {
  color: #ffffff;
}
.section--deep .lede,
.site-foot p,
.site-foot li,
.site-foot a,
.stat-band .stat-label {
  color: color-mix(in srgb, var(--color-text-inverse) 82%, var(--color-inverse));
}
.foot-legal {
  color: color-mix(in srgb, var(--color-text-inverse) 62%, var(--color-inverse));
}
.stat-band .stat-num {
  color: #ffffff;
}
.section--deep .stat,
.stat-band .stat {
  background: transparent;
  border-color: color-mix(in srgb, var(--color-text-inverse) 24%, transparent);
}
.ribbon a,
.site-foot a:hover {
  color: var(--color-tertiary);
}
.skip {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
