:root{
    --ink:#1A1410;
    --brick:#B8432F;
    --brick-dark:#8F3120;
    --mortar:#E8DDD0;
    --limewash:#F4ECE2;
    --mortar-grey:#6B5B4D;
    --gold:#C99A45;
    --white:#FFFCF8;
    --radius:2px;
    --max-w:1240px;
    --ease:cubic-bezier(.16,.84,.32,1);
    --ease-soft:cubic-bezier(.4,0,.2,1);
  }
  *{margin:0;padding:0;box-sizing:border-box;}
  html{scroll-behavior:smooth;}
  body{
    background:var(--limewash);
    color:var(--ink);
    font-family:'Public Sans',sans-serif;
    -webkit-font-smoothing:antialiased;
    overflow-x:hidden;
  }
  ::selection{background:var(--brick);color:var(--white);}
  a{color:inherit;text-decoration:none;}
  img{max-width:100%;display:block;}

  .wrap{max-width:var(--max-w);margin:0 auto;padding:0 32px;}

  @media (prefers-reduced-motion: reduce){
    *{animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important;}
  }

  /* ---------- focus ---------- */
  a:focus-visible, button:focus-visible{
    outline:2px solid var(--brick);
    outline-offset:3px;
  }

  /* ---------- scroll reveal ---------- */
  /* Content is visible by default. Only when script.js successfully runs
     does <html> get the .js-ready class — at that point these elements
     hide themselves and wait to be revealed on scroll. This means if JS
     fails to load or run for any reason, nothing stays invisible. */
  .js-ready .reveal{
    opacity:0;
    transform:translateY(28px);
    transition:opacity .8s var(--ease), transform .8s var(--ease);
  }
  .js-ready .reveal.in-view{
    opacity:1;
    transform:translateY(0);
  }
  .js-ready .reveal-stagger > *{
    opacity:0;
    transform:translateY(22px);
    transition:opacity .6s var(--ease), transform .6s var(--ease);
  }
  .js-ready .reveal-stagger.in-view > *{
    opacity:1;
    transform:translateY(0);
  }
  .reveal-stagger.in-view > *:nth-child(1){transition-delay:.02s;}
  .reveal-stagger.in-view > *:nth-child(2){transition-delay:.09s;}
  .reveal-stagger.in-view > *:nth-child(3){transition-delay:.16s;}
  .reveal-stagger.in-view > *:nth-child(4){transition-delay:.23s;}
  .reveal-stagger.in-view > *:nth-child(5){transition-delay:.30s;}
  .reveal-stagger.in-view > *:nth-child(6){transition-delay:.37s;}

  /* ---------- header ---------- */
  header{
    position:fixed; top:0; left:0; right:0; z-index:100;
    background:rgba(244,236,226,0.92);
    backdrop-filter:blur(8px);
    border-bottom:1px solid rgba(26,20,16,0.08);
  }
  .nav{
    display:flex; align-items:center; justify-content:space-between;
    padding:18px 32px; max-width:var(--max-w); margin:0 auto;
  }
  .logo{
    font-family:'Fraunces',serif;
    font-weight:700;
    font-size:1.5rem;
    letter-spacing:-0.01em;
    display:flex; align-items:center; gap:10px;
  }
  .logo .mark{
    width:14px;height:18px;background:var(--brick);
    display:inline-block;
    position:relative;
  }
  .logo .mark::after{
    content:'';position:absolute;left:0;top:50%;width:100%;height:2px;
    background:var(--limewash);transform:translateY(-1px);
  }
  nav.links{display:flex; gap:36px; font-size:0.92rem; font-weight:600;}
  nav.links a{
    position:relative; padding:4px 0; color:var(--ink);
    transition:color .3s var(--ease-soft);
  }
  nav.links a::after{
    content:'';position:absolute;left:0;bottom:0;width:0;height:2px;background:var(--brick);
    transition:width .4s var(--ease);
  }
  nav.links a:hover::after{width:100%;}
  .nav-cta{
    background:var(--ink); color:var(--white);
    padding:10px 22px; font-size:0.85rem; font-weight:600;
    border-radius:var(--radius);
    transition:background .3s var(--ease-soft), transform .3s var(--ease);
  }
  .nav-cta:hover{background:var(--brick); transform:translateY(-2px);}
  .menu-btn{display:none;background:none;border:none;cursor:pointer;padding:8px;}
  .menu-btn span{display:block;width:24px;height:2px;background:var(--ink);margin:5px 0;}

  @media (max-width:880px){
    nav.links{
      position:fixed; top:64px; left:0; right:0; bottom:0; height:calc(100vh - 64px);
      background:var(--limewash); flex-direction:column; padding:40px 32px;
      gap:24px; font-size:1.1rem; transform:translateX(100%);
      transition:transform .3s ease; overflow-y:auto; z-index:99;
      opacity:0; visibility:hidden;
    }
    nav.links.open{transform:translateX(0); opacity:1; visibility:visible;}
    .menu-btn{display:block;}
    .nav-cta{display:none;}
    nav.links .nav-cta-mobile{
      display:block; background:var(--brick); color:var(--white);
      padding:14px 22px; text-align:center; border-radius:var(--radius);
    }
  }

  /* ---------- hero ---------- */
  .hero{
    min-height:100vh;
    display:flex; flex-direction:column; justify-content:center;
    padding:140px 0 80px;
    position:relative;
  }
  .hero-eyebrow{
    font-family:'JetBrains Mono',monospace;
    font-size:0.78rem; letter-spacing:0.12em; text-transform:uppercase;
    color:var(--brick); font-weight:500;
    display:flex; align-items:center; gap:10px;
    margin-bottom:28px;
  }
  .hero-eyebrow::before{
    content:''; width:28px; height:1px; background:var(--brick);
  }
  .hero h1{
    font-family:'Fraunces',serif;
    font-size:clamp(2.8rem, 7vw, 6rem);
    font-weight:600;
    line-height:0.98;
    letter-spacing:-0.02em;
    max-width:980px;
  }
  .hero h1 .brick-word{
    display:inline-block;
    opacity:0;
    transform:translateY(0.6em) rotate(-1.5deg) scale(0.97);
    animation:settle 0.85s var(--ease) forwards;
  }
  @keyframes settle{
    60%{opacity:1;}
    100%{opacity:1; transform:translateY(0) rotate(0) scale(1);}
  }
  .hero h1 .accent{
    font-style:italic; color:var(--brick); font-weight:500;
  }
  .hero p.lede{
    font-size:1.2rem; line-height:1.6; color:var(--mortar-grey);
    max-width:560px; margin:32px 0 44px;
    opacity:0;
    animation:fadeUp 0.9s var(--ease) forwards;
    animation-delay:.55s;
  }
  .hero-ctas{
    display:flex; gap:18px; flex-wrap:wrap;
    opacity:0;
    animation:fadeUp 0.9s var(--ease) forwards;
    animation-delay:.7s;
  }
  @keyframes fadeUp{
    from{opacity:0; transform:translateY(16px);}
    to{opacity:1; transform:translateY(0);}
  }
  .btn{
    display:inline-flex; align-items:center; gap:10px;
    padding:15px 30px; font-weight:600; font-size:0.95rem;
    border-radius:var(--radius); transition:background .35s var(--ease-soft), transform .35s var(--ease), box-shadow .35s var(--ease), color .35s var(--ease-soft);
    border:1.5px solid transparent;
  }
  .btn-primary{background:var(--brick); color:var(--white);}
  .btn-primary:hover{background:var(--brick-dark); transform:translateY(-3px); box-shadow:0 14px 28px -10px rgba(184,67,47,0.45);}
  .btn-ghost{border-color:var(--ink); color:var(--ink);}
  .btn-ghost:hover{background:var(--ink); color:var(--white); transform:translateY(-3px);}

  .hero-stats{
    display:flex; gap:56px; margin-top:80px; flex-wrap:wrap;
  }
  .stat{font-family:'JetBrains Mono',monospace;}
  .stat .num{font-size:1.9rem; font-weight:500; color:var(--ink);}
  .stat .label{font-size:0.75rem; color:var(--mortar-grey); text-transform:uppercase; letter-spacing:0.08em; margin-top:2px;}

  /* hero brick texture accent — bricks lay themselves in, one by one */
  .hero-texture{
    position:absolute; right:0; top:0; bottom:0; width:38%;
    display:flex; flex-direction:column; justify-content:center;
    gap:6px; opacity:0.9; pointer-events:none;
    mask-image:linear-gradient(to left, black 40%, transparent 95%);
  }
  @media (max-width:980px){ .hero-texture{display:none;} }
  .brick-row{display:flex; gap:6px;}
  .brick-row:nth-child(even){padding-left:32px;}
  .tx-brick{
    height:34px; flex:1; max-width:120px;
    background:linear-gradient(160deg, var(--brick) 0%, var(--brick-dark) 100%);
    border-radius:1px;
    opacity:0;
    transform:translateX(46px) scaleX(0.4);
    transform-origin:left center;
    animation:lay-brick 0.6s var(--ease) forwards;
  }
  @keyframes lay-brick{
    0%{opacity:0; transform:translateX(46px) scaleX(0.4);}
    65%{opacity:1;}
    100%{opacity:0.85; transform:translateX(0) scaleX(1);}
  }
  .brick-row:nth-child(3n) .tx-brick{background:linear-gradient(160deg,#cf9a4f, #B8432F);}

  /* ---------- section shell ---------- */
  section{padding:120px 0;}
  .section-head{max-width:680px; margin-bottom:64px;}
  .eyebrow{
    font-family:'JetBrains Mono',monospace; font-size:0.75rem;
    text-transform:uppercase; letter-spacing:0.12em; color:var(--brick);
    font-weight:500; margin-bottom:16px; display:block;
  }
  h2{
    font-family:'Fraunces',serif; font-size:clamp(2rem,4vw,3rem);
    font-weight:600; letter-spacing:-0.01em; line-height:1.05;
  }
  .section-sub{color:var(--mortar-grey); font-size:1.1rem; line-height:1.6; margin-top:20px;}

  /* ---------- about ---------- */
  .about{background:var(--white);}
  .about-grid{display:grid; grid-template-columns:1.1fr 0.9fr; gap:80px; align-items:start;}
  @media (max-width:880px){.about-grid{grid-template-columns:1fr; gap:48px;}}
  .about-body p{font-size:1.05rem; line-height:1.75; color:#3a3128; margin-bottom:20px;}
  .pillars{display:flex; flex-direction:column; gap:0;}
  .pillar{
    padding:28px 0; border-top:1px solid rgba(26,20,16,0.12);
  }
  .pillar:last-child{border-bottom:1px solid rgba(26,20,16,0.12);}
  .pillar h3{
    font-family:'Fraunces',serif; font-size:1.3rem; font-weight:600; margin-bottom:8px;
  }
  .pillar p{color:var(--mortar-grey); font-size:0.96rem; line-height:1.6;}

  /* ---------- services: the brick wall ---------- */
  .services{background:var(--ink); color:var(--limewash); position:relative; overflow:hidden;}
  .services .eyebrow{color:var(--gold);}
  .services h2{color:var(--white);}
  .services .section-sub{color:#b8a99a;}

  .wall{
    display:flex; flex-direction:column; gap:8px; margin-top:8px;
  }
  .wall-row{display:flex; gap:8px;}
  .wall-row.offset{padding-left:38px;}
  .brick-tile{
    background:#241a14;
    border:1px solid rgba(232,221,208,0.08);
    border-radius:1px;
    padding:22px 24px;
    flex:1;
    min-width:0;
    cursor:default;
    transition:transform .45s var(--ease), background .4s var(--ease-soft), box-shadow .45s var(--ease);
    position:relative;
  }
  .js-ready .brick-tile{
    opacity:0;
    transform:translateY(0) scaleX(0.85);
    transform-origin:left center;
  }
  .js-ready .wall.in-view .brick-tile{
    animation:lay-tile 0.7s var(--ease) forwards;
  }
  @keyframes lay-tile{
    0%{opacity:0; transform:translateX(-24px) scaleX(0.85);}
    65%{opacity:1;}
    100%{opacity:1; transform:translateX(0) scaleX(1);}
  }
  .brick-tile:hover{
    background:var(--brick);
    transform:translateY(-6px);
    box-shadow:0 16px 32px -12px rgba(184,67,47,0.5);
  }
  .brick-tile:hover .b-code{color:rgba(255,255,255,0.6);}
  .brick-tile .b-code{
    font-family:'JetBrains Mono',monospace; font-size:0.7rem;
    color:var(--mortar-grey); display:block; margin-bottom:10px;
    transition:color .35s var(--ease-soft);
  }
  .brick-tile h4{
    font-family:'Fraunces',serif; font-size:1.08rem; font-weight:600;
    line-height:1.25; margin-bottom:6px;
  }
  .brick-tile p{font-size:0.85rem; color:#9c8d7e; line-height:1.45; transition:color .35s var(--ease-soft);}
  .brick-tile:hover p{color:rgba(255,255,255,0.85);}

  /* row sizing to mimic running-bond variety */
  .wall-row .brick-tile.w-lg{flex:1.6;}
  .wall-row .brick-tile.w-sm{flex:0.8;}

  /* per-row stagger so the wall builds left-to-right, row by row */
  .wall-row:nth-child(1) .brick-tile:nth-child(1){animation-delay:.05s;}
  .wall-row:nth-child(1) .brick-tile:nth-child(2){animation-delay:.15s;}
  .wall-row:nth-child(1) .brick-tile:nth-child(3){animation-delay:.25s;}
  .wall-row:nth-child(2) .brick-tile:nth-child(1){animation-delay:.35s;}
  .wall-row:nth-child(2) .brick-tile:nth-child(2){animation-delay:.45s;}
  .wall-row:nth-child(2) .brick-tile:nth-child(3){animation-delay:.55s;}
  .wall-row:nth-child(3) .brick-tile:nth-child(1){animation-delay:.65s;}
  .wall-row:nth-child(3) .brick-tile:nth-child(2){animation-delay:.75s;}
  .wall-row:nth-child(3) .brick-tile:nth-child(3){animation-delay:.85s;}
  .wall-row:nth-child(4) .brick-tile:nth-child(1){animation-delay:.95s;}
  .wall-row:nth-child(4) .brick-tile:nth-child(2){animation-delay:1.05s;}

  @media (max-width:880px){
    .wall-row{flex-direction:column;}
    .wall-row.offset{padding-left:0;}
    .wall-row .brick-tile.w-lg, .wall-row .brick-tile.w-sm{flex:1;}
  }

  /* ---------- global reach ---------- */
  .reach{background:var(--mortar); position:relative;}
  .reach-grid{display:grid; grid-template-columns:1fr 1fr; gap:64px; align-items:center;}
  @media (max-width:880px){.reach-grid{grid-template-columns:1fr;}}
  .reach-map{
    aspect-ratio:4/3; background:var(--white); border-radius:var(--radius);
    position:relative; overflow:hidden; border:1px solid rgba(26,20,16,0.08);
  }
  .reach-map svg{width:100%; height:100%;}
  .reach-map #liveMap{width:100%; height:100%;}
  .pin{
    position:absolute; width:10px; height:10px; border-radius:50%;
    background:var(--brick); box-shadow:0 0 0 4px rgba(184,67,47,0.18);
  }
  .pin::after{
    content:attr(data-label);
    position:absolute; top:16px; left:50%; transform:translateX(-50%);
    font-family:'JetBrains Mono',monospace; font-size:0.68rem;
    white-space:nowrap; color:var(--ink); font-weight:500;
  }
  .reach-stats{display:grid; grid-template-columns:repeat(3,1fr); gap:24px; margin-top:40px;}
  .reach-stat{border-top:2px solid var(--brick); padding-top:16px;}
  .reach-stat .num{font-family:'JetBrains Mono',monospace; font-size:2.4rem; font-weight:500; color:var(--ink);}
  .reach-stat .label{font-size:0.82rem; color:var(--mortar-grey); margin-top:4px;}

  /* Leaflet live map pin styling */
  .glow-pin{background:transparent;}
  .glow-pin .dot{
    display:block; width:12px; height:12px; border-radius:50%;
    background:var(--brick); border:2px solid #fff;
    box-shadow:0 0 8px rgba(184,67,47,0.9), 0 0 20px rgba(184,67,47,0.45);
    transform:translate(-50%,-50%);
    animation:pulse 2.6s infinite ease-in-out;
  }
  @keyframes pulse{
    0%{box-shadow:0 0 6px rgba(184,67,47,0.9), 0 0 14px rgba(184,67,47,0.35); transform:scale(0.96);}
    50%{box-shadow:0 0 22px rgba(184,67,47,0.95), 0 0 42px rgba(184,67,47,0.25); transform:scale(1.08);}
    100%{box-shadow:0 0 6px rgba(184,67,47,0.9), 0 0 14px rgba(184,67,47,0.35); transform:scale(0.96);}
  }

  /* ---------- CTA band ---------- */
  .cta-band{
    background:var(--brick); color:var(--white); text-align:left;
    position:relative; overflow:hidden;
  }
  .cta-band .wrap{display:flex; justify-content:space-between; align-items:center; gap:40px; flex-wrap:wrap;}
  .cta-band h2{color:var(--white); max-width:560px;}
  .cta-band .btn-primary{background:var(--ink);}
  .cta-band .btn-primary:hover{background:#000;}

  /* ---------- footer ---------- */
  footer{background:var(--ink); color:#b8a99a; padding:80px 0 32px;}
  .footer-grid{
    display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:48px;
    padding-bottom:56px; border-bottom:1px solid rgba(232,221,208,0.12);
  }
  @media (max-width:780px){.footer-grid{grid-template-columns:1fr; gap:36px;}}
  .footer-brand .logo{color:var(--white);}
  .footer-brand p{margin-top:18px; max-width:320px; line-height:1.6; font-size:0.92rem;}
  .footer-col h5{
    font-family:'JetBrains Mono',monospace; font-size:0.75rem; letter-spacing:0.1em;
    text-transform:uppercase; color:var(--gold); margin-bottom:18px;
  }
  .footer-col a, .footer-col p{
    display:block; font-size:0.92rem; margin-bottom:12px; color:#cdc0b3;
    transition:color .2s;
  }
  .footer-col a:hover{color:var(--white);}
  .footer-bottom{
    display:flex; justify-content:space-between; align-items:center;
    padding-top:28px; font-size:0.82rem; flex-wrap:wrap; gap:12px;
  }
  .social-row{display:flex; gap:18px;}
  .social-row a{
    width:36px;height:36px; border:1px solid rgba(232,221,208,0.2); border-radius:50%;
    display:flex; align-items:center; justify-content:center; transition:all .2s;
  }
  .social-row a:hover{background:var(--brick); border-color:var(--brick);}
  .social-row svg{width:16px;height:16px;}