/* ==========================================================================
   CrumbleBear — site styles
   Brand: green #198D53 / bright #30D972 / mint #58FFAC / accent orange #F53A14
   ========================================================================== */

:root {
  --green-900: #0C4E2D;
  --green-700: #126B3E;
  --green: #198D53;
  --green-bright: #30D972;
  --mint: #58FFAC;
  --mint-50: #EAFFF3;
  --orange: #F53A14;
  --orange-50: #FFF0EC;

  --ink: #14201A;
  --body: #43544B;
  --muted: #6B7C72;
  --line: #E1EAE5;
  --bg: #FFFFFF;
  --bg-soft: #F6FAF8;

  --wrap: 1120px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(12, 78, 45, .06), 0 2px 8px rgba(12, 78, 45, .05);
  --shadow-md: 0 4px 12px rgba(12, 78, 45, .08), 0 12px 32px rgba(12, 78, 45, .08);
  --shadow-lg: 0 8px 24px rgba(12, 78, 45, .10), 0 24px 60px rgba(12, 78, 45, .12);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.16, .84, .44, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green); }
button { font: inherit; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); font-weight: 750; letter-spacing: -.03em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 660; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--green-bright); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.section { padding: clamp(64px, 9vw, 108px) 0; }
.section--soft { background: var(--bg-soft); border-block: 1px solid var(--line); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- section heading ---------- */
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--green); margin-bottom: .75rem;
}
.section__head { max-width: 660px; margin-bottom: clamp(32px, 5vw, 52px); }
.section__head p { font-size: 1.06rem; color: var(--muted); margin-bottom: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 620; font-size: .97rem; text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease),
              background-color .18s var(--ease), color .18s var(--ease);
}
.btn--primary { background: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--green-700); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--green-bright); color: var(--green-700); transform: translateY(-2px); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 2px 12px rgba(12, 78, 45, .05); }
.site-header__inner { display: flex; align-items: center; gap: 20px; height: 72px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 34px; height: 34px; }
.brand__name { font-size: 1.16rem; font-weight: 720; letter-spacing: -.02em; color: var(--green); }
.brand__name b { color: var(--orange); font-weight: 720; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: .5rem .8rem; border-radius: 8px; font-size: .95rem; font-weight: 550;
  color: var(--body); text-decoration: none; transition: background-color .15s, color .15s;
}
.nav a:hover { background: var(--mint-50); color: var(--green-700); }
/* Section currently on screen. Deliberately the same treatment as :hover so
   this introduces no new visual language. */
.nav a.is-active { background: var(--mint-50); color: var(--green-700); font-weight: 650; }
.nav .btn { margin-left: 8px; padding: .58rem 1.1rem; }
/* .nav a sets a body-text colour and outranks .btn--primary, so restate it here. */
.nav .btn--primary { color: #fff; }
.nav .btn:hover { background: var(--green-700); color: #fff; }

.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  background: #fff; border-radius: 10px; cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: background-color .2s; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--ink);
  border-radius: 2px; transition: transform .25s var(--ease);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px; box-shadow: var(--shadow-md);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: .8rem .6rem; font-size: 1.02rem; }
  .nav .btn { margin: 8px 0 0; justify-content: center; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(64px, 10vw, 112px) 0 clamp(56px, 8vw, 92px); }
.hero::before {
  content: ""; position: absolute; inset: -40% 50% auto -20%; height: 780px;
  background: radial-gradient(closest-side, rgba(88, 255, 172, .13), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; top: -180px; right: -160px; width: 620px; height: 620px;
  background: radial-gradient(closest-side, rgba(245, 58, 20, .05), transparent 70%);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero h1 { margin-bottom: 1rem; }
.hero h1 .accent {
  background: linear-gradient(180deg, transparent 64%, rgba(88, 255, 172, .34) 64%);
}
.hero__lead { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--muted); max-width: 46ch; margin-bottom: 1.75rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 2rem; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .92rem; color: var(--muted); }
.hero__meta span { display: inline-flex; align-items: center; gap: .45rem; }
.hero__meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green-bright); }

.hero__art { position: relative; display: flex; justify-content: center; }
.hero__art img { width: min(320px, 78%); filter: drop-shadow(0 24px 48px rgba(12, 78, 45, .16)); }

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .hero__art img { width: min(220px, 55%); }
}

/* ---------- services (expandable grid) ---------- */
.services__grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}
.service-card {
  position: relative; display: flex; flex-direction: column; gap: .55rem;
  text-align: left; width: 100%; padding: 26px 24px 22px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease),
              border-color .22s var(--ease), opacity .22s var(--ease);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(48, 217, 114, .55); }
.service-card__num {
  font-size: .74rem; font-weight: 750; letter-spacing: .1em; color: var(--green-bright);
}
.service-card h3 { margin: 0; font-size: 1.09rem; }
.service-card p { margin: 0; font-size: .93rem; color: var(--muted); }
.service-card__more {
  margin-top: auto; padding-top: .9rem; display: inline-flex; align-items: center; gap: .4rem;
  font-size: .87rem; font-weight: 640; color: var(--green-700);
}
.service-card__more svg { transition: transform .28s var(--ease); }
.service-card[aria-expanded="true"] {
  border-color: var(--green); box-shadow: var(--shadow-md);
  background: var(--mint-50);
}
.service-card[aria-expanded="true"] .service-card__more svg { transform: rotate(180deg); }
.service-card[aria-expanded="true"]::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; width: 16px; height: 16px;
  background: var(--mint-50);
  border-left: 1px solid var(--green); border-top: 1px solid var(--green);
  transform: translateX(-50%) rotate(45deg); border-radius: 3px 0 0 0; z-index: 2;
}
.services__grid.has-open .service-card:not([aria-expanded="true"]) { opacity: .62; }
.services__grid.has-open .service-card:not([aria-expanded="true"]):hover { opacity: 1; }

/* the sliding detail panel */
.service-panel {
  grid-column: 1 / -1;
  display: grid; grid-template-rows: 0fr;
  border-radius: var(--radius-lg);
  transition: grid-template-rows .38s var(--ease);
}
.service-panel[hidden] { display: none; }
.service-panel.is-open { grid-template-rows: 1fr; }
.service-panel__clip { overflow: hidden; }
.service-panel__inner {
  border: 1px solid var(--green); background: var(--mint-50);
  border-radius: var(--radius-lg); padding: clamp(24px, 3.5vw, 36px);
  opacity: 0; transform: translateY(-8px);
  transition: opacity .3s var(--ease) .06s, transform .3s var(--ease) .06s;
}
.service-panel.is-open .service-panel__inner { opacity: 1; transform: none; }
.service-panel__inner { position: relative; }
.service-panel__head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 1.5rem; padding-right: 44px; }
.service-panel__head h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin: 0 0 .4rem; }
.service-panel__head p { margin: 0; max-width: 62ch; color: var(--body); }
.service-panel__close {
  position: absolute; top: 0; right: 0; width: 36px; height: 36px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, transform .15s;
}
.service-panel__close:hover { color: var(--orange); border-color: var(--orange); transform: rotate(90deg); }

.work-label {
  font-size: .74rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green); margin-bottom: .9rem;
}
.work-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.work-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.work-card h4 { font-size: 1rem; margin: 0 0 .45rem; }
.work-card p { font-size: .9rem; color: var(--muted); margin: 0 0 .9rem; }
.work-card__stat {
  display: block; font-size: 1.5rem; font-weight: 760; color: var(--green); letter-spacing: -.02em; line-height: 1.1;
}
.work-card__stat small { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: .2rem; }
.work-card__tag {
  display: inline-block; font-size: .72rem; font-weight: 680; letter-spacing: .04em;
  color: var(--orange); background: var(--orange-50); padding: .25rem .6rem; border-radius: 999px; margin-bottom: .7rem;
}

/* work card variant: a dashboard preview that links out to the live report */
.work-card--linked {
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
  color: inherit; text-decoration: none;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.work-card--linked:hover,
.work-card--linked:focus-visible {
  transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(48, 217, 114, .55);
}
.work-card__shot {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; object-position: top center;
  background: var(--bg-soft); border-bottom: 1px solid var(--line);
}
.work-card__body { padding: 18px 20px 20px; }
.work-card__link {
  display: inline-flex; align-items: center; gap: .38rem; margin-top: .85rem;
  font-size: .86rem; font-weight: 640; color: var(--green-700);
}
.work-card--linked:hover .work-card__link svg { transform: translate(2px, -2px); }
.work-card__link svg { transition: transform .22s var(--ease); }

/* no-JS fallback: show the detail content inline instead of hiding it */
.service-details[hidden] { display: block; margin-top: 32px; }
.service-details[hidden] > div { padding: 24px 0; border-top: 1px solid var(--line); }
.service-details[hidden] .service-panel__close { display: none; }
html.js .service-details[hidden] { display: none; }

/* ---------- about ---------- */
.about__lead { max-width: 62ch; font-size: 1.08rem; }
.founders { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: clamp(32px, 5vw, 48px); }
.founder {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm);
}
.founder__top { display: flex; align-items: center; gap: 16px; margin-bottom: 1.1rem; }
.founder img {
  width: 84px; height: 84px; flex: none; border-radius: 50%; object-fit: cover;
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--mint);
}
.founder h3 { margin: 0 0 .15rem; }
.founder__role { font-size: .87rem; font-weight: 640; color: var(--green); letter-spacing: .02em; }
.founder p { font-size: .94rem; }
.founder__link { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; font-weight: 620; text-decoration: none; }
.founder__link:hover { text-decoration: underline; }

/* ---------- contact ---------- */
.contact__grid { display: grid; gap: clamp(28px, 5vw, 56px); grid-template-columns: .85fr 1.15fr; align-items: start; }
@media (max-width: 820px) { .contact__grid { grid-template-columns: 1fr; } }

.contact__details { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 14px; }
.contact__details li { display: flex; gap: 12px; align-items: flex-start; }
.contact__details svg { flex: none; margin-top: 3px; color: var(--green); }
.contact__details a { font-weight: 600; text-decoration: none; }
.contact__details a:hover { text-decoration: underline; }
.contact__details small { display: block; color: var(--muted); font-size: .84rem; font-weight: 400; }

.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 3.5vw, 34px); box-shadow: var(--shadow-md); }
.form__row { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }
.field { display: block; margin-bottom: 18px; }
.field label { display: block; font-size: .87rem; font-weight: 640; color: var(--ink); margin-bottom: .4rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: .72rem .85rem; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; background: #fff; border-color: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(48, 217, 114, .18);
}
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--orange); }
.form .btn { width: 100%; justify-content: center; }
.form__note { font-size: .82rem; color: var(--muted); margin: .9rem 0 0; text-align: center; }
.form__status { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 10px; font-size: .92rem; font-weight: 560; }
.form__status[hidden] { display: none; }
.form__status.is-ok { background: var(--mint-50); color: var(--green-900); border: 1px solid var(--green-bright); }
.form__status.is-err { background: var(--orange-50); color: #8C2409; border: 1px solid var(--orange); }
.hp { position: absolute; left: -9999px; opacity: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--green-900); color: rgba(255, 255, 255, .72); padding: 44px 0 34px; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
.site-footer .brand__name { color: #fff; }
.site-footer .brand__name b { color: var(--mint); }
.site-footer a { color: rgba(255, 255, 255, .82); }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 0; font-size: .88rem; }
.site-footer nav { margin-left: auto; display: flex; gap: 20px; font-size: .88rem; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }

/* ---------- motion ---------- */
/* Scoped to html.js so the page is never left invisible when scripts do not run.
   Without the class nothing is hidden in the first place, matching the
   .service-details fallback above. */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
html.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html.js .reveal { opacity: 1; transform: none; }
}
