/* ============================================
   Echelon 9 Consulting — shared site styles
   Loaded on every page. Page-specific styles
   stay inline in each .html file's <style> block.
   ============================================ */

/* ---- Self-hosted fonts ----
   These @font-face rules look for files in /fonts/.
   If the files aren't there yet, the browser silently falls
   back to the Google Fonts CDN <link> still in each HTML page.
   To go fully self-hosted: drop the .woff2 files into the
   `fonts/` folder, then run `python3 tools/install_fonts.py`
   which removes the CDN <link> from every page.
============================================== */
@font-face{font-family:"Inter";font-style:normal;font-weight:400;font-display:swap;
  src:url("../fonts/inter-400.woff2") format("woff2");}
@font-face{font-family:"Inter";font-style:normal;font-weight:500;font-display:swap;
  src:url("../fonts/inter-500.woff2") format("woff2");}
@font-face{font-family:"Inter";font-style:normal;font-weight:600;font-display:swap;
  src:url("../fonts/inter-600.woff2") format("woff2");}
@font-face{font-family:"Fraunces";font-style:normal;font-weight:400;font-display:swap;
  src:url("../fonts/fraunces-400.woff2") format("woff2");}
@font-face{font-family:"Fraunces";font-style:normal;font-weight:500;font-display:swap;
  src:url("../fonts/fraunces-500.woff2") format("woff2");}
@font-face{font-family:"Fraunces";font-style:normal;font-weight:600;font-display:swap;
  src:url("../fonts/fraunces-600.woff2") format("woff2");}

/* ---- Tokens ---- */
:root{
  --paper:#F6F2E6;
  --paper-2:#EFEAD9;
  --ink:#101013;
  --text:#26262c;
  --muted:#5f5f68;
  --line:#E2DCCB;
  --purple:#7B4FC9;
  --violet:#9A5FE0;
  --teal:#177078;            /* darkened from #2FA9B2 for WCAG AA contrast on cream / white */
  --sky:#5BA8E8;
  --grad:linear-gradient(90deg,#7B4FC9,#36C7D0);
  --grad-btn:linear-gradient(90deg,#7B4FC9,#5BA8E8);
  --max:1200px;
  --read:760px;
}

/* ---- Reset / base ---- */
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:var(--paper);
  color:var(--text);
  font-family:"Inter",system-ui,-apple-system,sans-serif;
  font-size:17px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{
  font-family:"Fraunces",Georgia,serif;
  font-weight:500;
  color:#1d1d22;
  line-height:1.16;
  margin:0;
}
a{color:inherit;text-decoration:none;}

/* ---- Layout helpers ---- */
.wrap{max-width:var(--max);margin:0 auto;}
/* Horizontal padding only when the viewport is narrow enough that .wrap fills
   it (≤ --max = 1200px). At wider viewports, .wrap is centered with side-margin
   so content can be full-bleed within the container. */
@media (max-width:1200px){
  .wrap{padding-left:28px;padding-right:28px;}
}
.grad-text{
  background:var(--grad);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

/* ---- Header / nav (sticky brand bar) ---- */
header{
  position:sticky;top:0;z-index:20;
  background:rgba(246,242,230,0.85);
  backdrop-filter:blur(8px);
  border-bottom:1px solid rgba(0,0,0,0.06);
}
.nav{display:flex;align-items:center;justify-content:space-between;height:68px;}
.brand-logo{height:50px;width:auto;display:block;}
.nav-links{display:flex;align-items:center;gap:26px;font-size:15px;color:#3a3a40;}
.nav-links a:hover{color:var(--purple);}

/* ---- Mobile menu (hidden on desktop) ---- */
.navtoggle-cb{position:absolute;left:-9999px;}
.navtoggle-btn{display:none;}

/* ---- Buttons ---- */
.btn{
  display:inline-block;border:none;cursor:pointer;
  font-family:inherit;font-size:15px;font-weight:500;
  border-radius:10px;padding:11px 22px;
  transition:transform .15s ease,opacity .15s ease;
}
.btn:hover{transform:translateY(-1px);}
.btn-primary{background:var(--grad-btn);color:#fff;}
.btn-solid{background:var(--purple);color:#fff;padding:9px 18px;}
.btn-ghost{background:transparent;color:var(--purple);border:1px solid var(--purple);}
.btn-light{
  display:inline-block;background:#fff;color:var(--purple);
  font-weight:500;border-radius:10px;padding:10px 20px;font-size:15px;
}

/* ---- Eyebrow + arrow link utilities ---- */
.eyebrow{
  font-size:13px;letter-spacing:1.8px;text-transform:uppercase;
  color:var(--teal);font-weight:600;margin:0 0 18px;
}
.link-arrow{font-size:15px;color:var(--purple);font-weight:500;}
.link-arrow:hover{opacity:.8;}

/* ---- Sections ---- */
section{padding:72px 0;}
section[id]{scroll-margin-top:88px;}

/* ---- Page-head (services, insights, etc.) ---- */
.page-head{padding-top:66px;padding-bottom:8px;}
.page-head h1{font-size:46px;margin:0 0 16px;}
.page-head p{font-size:19px;color:var(--muted);max-width:600px;margin:0;}

/* ---- Section head pattern ---- */
.sec-head{max-width:620px;margin:0 0 44px;}
.sec-head h2{font-size:36px;margin:0 0 14px;}
.sec-head p{color:var(--muted);font-size:18px;margin:0;}

/* ---- Brand-purple CTA band (used on multiple pages) ----
   Deep brand purple — clearly the brand colour, just darker than the primary
   #7B4FC9 so it can carry white text and read as an anchor element. */
.cta{
  background:#5d3aa0;border-radius:22px;padding:48px 44px;
  text-align:center;color:#e8e2f6;
}
.cta h2{color:#fff;font-size:36px;margin:0 0 14px;}
.cta p{color:#d4cee8;font-size:18px;max-width:480px;margin:0 auto 28px;}

/* Modifier: anchor variant for the main contact CTA on the home page.
   Two-column on desktop (headline on the left, action stack on the right)
   so the wider content uses the horizontal space instead of stacking
   everything in one centered column. */
.cta.cta-anchor{
  display:grid;
  grid-template-columns:1.1fr 1fr;
  gap:48px;
  align-items:center;
  text-align:left;
  padding:56px 56px;
}
.cta-anchor .cta-left h2{font-size:34px;margin:0 0 12px;}
.cta-anchor .cta-left p{font-size:17px;margin:0;max-width:none;color:#d4cee8;}
.cta-anchor .cta-right{display:flex;flex-direction:column;align-items:flex-end;gap:18px;}
.cta-anchor .cta-right > p.avail{margin:0;}
@media (max-width:820px){
  .cta.cta-anchor{
    grid-template-columns:1fr;
    text-align:center;
    padding:40px 28px;
    gap:28px;
  }
  .cta-anchor .cta-right{align-items:center;}
}

/* ---- Footer ---- */
footer{padding:48px 0 56px;}
.foot{
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:18px;border-top:1px solid var(--line);padding-top:28px;
}
.foot small{color:var(--muted);font-size:13.5px;}
.foot .links{display:flex;gap:22px;font-size:14px;color:#3a3a40;flex-wrap:wrap;}
.tile{
  width:34px;height:34px;border-radius:9px;background:var(--ink);
  display:inline-flex;align-items:center;justify-content:center;
  font-family:"Inter";font-weight:600;
}
/* Real E9 brand mark used as a footer chip. Uses apple-touch-icon.png
   (180x180) downscaled to 34px so it stays sharp on retina. Replaced an
   earlier CSS-rendered tile that relied on the Ǝ glyph (not in Fraunces). */
.tile-img{width:34px;height:34px;border-radius:9px;display:block;}

/* =====================================================
   Article reading layout (live + draft article pages)
   ===================================================== */
.read{max-width:var(--read);margin:0 auto;padding:0 28px;}
.back{display:inline-block;margin:40px 0 22px;font-size:14px;color:var(--purple);font-weight:500;}
.meta{
  font-size:13px;letter-spacing:.5px;text-transform:uppercase;
  color:var(--teal);font-weight:600;margin:0 0 16px;
}
article h1{font-size:42px;margin:0 0 18px;}
.byline{
  display:flex;align-items:center;gap:12px;
  margin:0 0 14px;padding-bottom:30px;border-bottom:1px solid var(--line);
}
.avatar{
  width:44px;height:44px;border-radius:50%;
  background:#E4DECB;border:1px solid var(--line);overflow:hidden;
}
.avatar img{width:100%;height:100%;object-fit:cover;}
.byline .who{font-size:15px;font-weight:500;color:#2b2b31;}
.byline .when{font-size:13.5px;color:var(--muted);}
article p{margin:22px 0;}
article h2{font-size:26px;margin:42px 0 12px;}
article h3{font-size:19px;margin:26px 0 6px;}
article ul{margin:22px 0;padding-left:22px;}
article li{margin:8px 0;}
article blockquote{
  margin:32px 0;padding:6px 0 6px 24px;border-left:3px solid var(--purple);
  font-family:"Fraunces",serif;font-size:21px;line-height:1.45;color:#33333a;
}
.lead{font-size:21px;color:#3c3c44;}

/* Article end-of-page CTA */
.endcta{
  max-width:var(--read);margin:56px auto 0;padding:32px 28px;
  background:var(--ink);border-radius:18px;color:#f4f1ea;text-align:center;
}
.endcta h3{color:#fff;font-size:24px;margin:0 0 8px;}
.endcta p{color:#b9b6c4;font-size:16px;margin:0 0 18px;}

/* Article figure (image placeholder + caption) */
figure{
  margin:32px 0;border:1px dashed #c9c2ac;border-radius:14px;
  padding:18px;text-align:center;background:#fff;
}
figure img{
  max-width:100%;height:auto;display:block;
  margin:0 auto 12px;border-radius:8px;
}
figure figcaption{font-size:14px;color:var(--muted);font-style:italic;}
figure.empty::before{
  content:attr(data-placeholder);display:block;
  color:#a59c82;font-size:13px;margin:18px 0;
}

/* ---- Shared responsive ---- */
@media (max-width:820px){
  article h1{font-size:32px;}

  /* hamburger button */
  .navtoggle-btn{
    display:inline-flex;flex-direction:column;justify-content:center;align-items:center;
    width:38px;height:38px;cursor:pointer;gap:5px;
    border:1px solid var(--line);border-radius:9px;background:transparent;
  }
  .navtoggle-btn span{
    display:block;width:18px;height:2px;background:#3a3a40;border-radius:2px;
    transition:transform .22s ease,opacity .15s ease;
  }
  /* hide the desktop nav by default on mobile */
  .nav-links{
    display:none;
    position:absolute;top:68px;left:0;right:0;
    background:rgba(246,242,230,0.98);
    backdrop-filter:blur(12px);
    flex-direction:column;align-items:stretch;
    gap:0;padding:8px 28px 24px;
    border-bottom:1px solid rgba(0,0,0,0.06);
  }
  .nav-links a{padding:14px 0;border-top:1px solid var(--line);font-size:17px;display:block;}
  .nav-links a:first-child{border-top:none;}
  .nav-links a.cta-link{margin-top:8px;}

  /* toggle open when checkbox is checked */
  .navtoggle-cb:checked ~ .nav-links{display:flex;}
  .navtoggle-cb:checked + .navtoggle-btn span:nth-child(1){transform:translateY(7px) rotate(45deg);}
  .navtoggle-cb:checked + .navtoggle-btn span:nth-child(2){opacity:0;}
  .navtoggle-cb:checked + .navtoggle-btn span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}
}

/* ---- Accessibility ----
   Visible focus styles for keyboard users, a skip-to-content link
   for keyboard and screen-reader users, and respect for the OS
   "reduce motion" preference. */

/* Visible focus ring for keyboard users only (not mouse clicks). */
:focus-visible{
  outline:2px solid var(--purple);
  outline-offset:3px;
  border-radius:3px;
}

/* On the dark footer, switch the ring to white so it stays visible. */
footer :focus-visible{
  outline-color:#fff;
}

/* The hamburger checkbox is invisible; show the ring on the label instead. */
.navtoggle-cb:focus-visible + .navtoggle-btn{
  outline:2px solid var(--purple);
  outline-offset:3px;
}

/* Screen-reader-only utility. Visually hidden, still announced. */
.visually-hidden{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* Skip link — invisible until focused. Lets keyboard users jump past nav. */
.skip-link{
  position:absolute;left:-9999px;top:0;
  background:var(--ink);color:#fff;
  padding:10px 16px;
  border-radius:0 0 8px 0;
  font-size:14px;font-weight:500;
  z-index:100;
}
.skip-link:focus,
.skip-link:focus-visible{
  left:0;outline:none;
}

/* Mark the active nav link for screen-reader users (aria-current="page"). */
.nav-links a[aria-current="page"]{
  color:var(--purple);
  font-weight:500;
}

/* Respect the OS "reduce motion" preference. Disables hover transforms,
   transitions, and the smooth-scroll behaviour. */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    transition:none !important;
    animation:none !important;
  }
  html{scroll-behavior:auto;}
}
