/* ============================================================
   Cedar Chartered Accountants
   Editorial, restrained design system.
   Display: Fraunces (serif)  ·  Text/UI: Inter (grotesque)
   Ink navy #14233c · Cedar green #2f6b4f · Warm paper neutrals
   ============================================================ */

:root {
  /* Brand */
  --navy:       #14233c;
  --navy-deep:  #0d1a2e;
  --green:      #2f6b4f;
  --green-deep: #244f3b;
  --green-soft: #e7efe9;

  /* Ink & neutrals (warm) */
  --ink:        #1b2330;
  --muted:      #5e6675;
  --faint:      #8a8f9b;

  /* Surfaces */
  --paper:      #fbfaf6;   /* page background  */
  --paper-2:    #f4f1e9;   /* alternating band */
  --card:       #ffffff;
  --line:       #e6e1d6;   /* warm hairline    */
  --line-soft:  #efeadf;

  /* On-dark */
  --on-dark:        rgba(255,255,255,0.86);
  --on-dark-soft:   rgba(255,255,255,0.62);
  --line-dark:      rgba(255,255,255,0.16);
  --green-light:    #8fc7a6;

  /* Shape & depth — tight radii, restrained shadow */
  --radius:    6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(20,35,60,.04), 0 2px 8px rgba(20,35,60,.05);
  --shadow-md: 0 18px 40px -22px rgba(20,35,60,.30);

  --maxw: 1160px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --display: "Schibsted Grotesk", "Inter", system-ui, sans-serif;
  --sans:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; height: auto; }
[hidden] { display: none !important; }
a { color: var(--green-deep); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--green); }

h1, h2, h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  color: var(--navy);
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 .55em;
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(2rem, 3.4vw, 2.85rem); }
h3 { font-size: 1.2rem; letter-spacing: 0; }
p { margin: 0 0 1.25rem; color: var(--muted); }

.container { width: min(var(--maxw), 90%); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--navy); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--sans); font-weight: 600; font-size: .92rem; letter-spacing: .005em;
  padding: .85rem 1.7rem; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent;
  transition: background .2s var(--ease), color .2s, border-color .2s, transform .2s var(--ease), box-shadow .25s var(--ease);
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-deep); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.30); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.55); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Eyebrow (kicker with rule) ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--sans); font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  font-size: 1.02rem; line-height: 1.7; color: var(--green-deep); margin: 0 0 1.1rem;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: currentColor; opacity: .55; flex: none;
}
.eyebrow-dark { color: var(--green-deep); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 250, 246, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-color: var(--line); background: rgba(251, 250, 246, 0.94); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 78px; }
.brand-logo { height: 42px; width: auto; }

.main-nav { display: flex; align-items: center; }
.nav-menu { list-style: none; display: flex; align-items: center; gap: 2rem; margin: 0; padding: 0; }
.nav-menu a {
  font-family: var(--sans); font-weight: 500; font-size: .93rem; color: var(--ink);
  position: relative; padding: .35rem 0;
}
.nav-menu a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--green); transition: width .26s var(--ease);
}
.nav-menu a:not(.nav-cta):hover { color: var(--navy); }
.nav-menu a:not(.nav-cta):hover::after,
.nav-menu a:not(.nav-cta).active::after { width: 100%; }
.nav-menu a:not(.nav-cta).active { color: var(--navy); }
.nav-cta {
  background: var(--navy); color: #fff !important; padding: .6rem 1.25rem !important; border-radius: var(--radius);
  font-weight: 600 !important; transition: background .2s;
}
.nav-cta:hover, .nav-cta.active { background: var(--green); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px;
  background: none; border: 0; cursor: pointer; padding: 10px;
}
.nav-toggle span { height: 2px; width: 100%; background: var(--ink); border-radius: 3px; transition: transform .3s, opacity .3s; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  min-height: clamp(620px, 78vh, 820px);
  display: grid; align-items: center;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(rgba(13,26,46,0.65), rgba(13,26,46,0.65)),
    url("../img/forest-hero.webp") center/cover no-repeat;
  filter: saturate(0.92) contrast(0.98);
}
.hero-inner {
  position: relative; z-index: 1;
  padding: clamp(4.5rem, 11vw, 7.5rem) 0;
  max-width: 730px;
}
.hero .eyebrow { color: var(--green-light); }
.hero-title {
  color: #fff; font-weight: 500;
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 1.04; letter-spacing: -0.02em; margin-bottom: 1.1rem;
}
.hero-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--on-dark);
  max-width: 600px; margin-bottom: 2.2rem; line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 2.8rem; }
.hero-badges {
  list-style: none; display: flex; flex-wrap: wrap; align-items: center;
  gap: .35rem 1.4rem; margin: 0; padding: 1.6rem 0 0; border-top: 1px solid var(--line-dark);
}
.hero-badges li {
  font-family: var(--sans); font-weight: 500; font-size: .9rem; color: var(--on-dark);
  display: inline-flex; align-items: center; gap: .6rem;
}
.hero-badges li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-light); flex: none;
}

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 8.5vw, 7rem) 0; }
.section-head { max-width: 640px; margin: 0 0 clamp(2.4rem, 5vw, 3.4rem); }
.section-head h2 { margin-bottom: .35em; }
.section-sub { color: var(--muted); font-size: 1.08rem; margin: 0; line-height: 1.7; white-space: nowrap; }

/* ---------- Services ---------- */
.services { background: var(--paper-2); }
.service-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.4rem;
}
.service-card {
  position: relative; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 2.4rem 2rem 2.6rem;
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--green);
  box-shadow: var(--shadow-md);
}
.service-icon {
  width: 88px; height: 88px; display: grid; place-items: center;
  border-radius: var(--radius); background: var(--green-soft);
  color: var(--green-deep); margin-bottom: 1.6rem;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.service-icon svg { width: 52px; height: 52px; }
.service-card:hover .service-icon { background: var(--green); color: #fff; }
.service-card h3 { margin-bottom: .5rem; font-size: 1.18rem; color: var(--navy); }
.service-card p { color: var(--muted); font-size: .98rem; margin: 0; line-height: 1.66; }

/* Draw-on-hover stroke animation (replaces the original Motion pathLength effect) */
.service-icon svg path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.service-card:hover .service-icon svg path { animation: icon-draw .65s var(--ease) both; }
.service-icon svg path:nth-child(2) { animation-delay: .08s; }
.service-icon svg path:nth-child(3) { animation-delay: .16s; }
.service-icon svg path:nth-child(4) { animation-delay: .24s; }
@keyframes icon-draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .service-card:hover .service-icon svg path { animation: none; }
}

/* Industries We Work With — sits beneath the services grid.
   Intro/outro copy spans the full container width to minimise wrapping. */
.industries { margin-top: clamp(3rem, 6vw, 4.5rem); }
.industries-head { max-width: none; margin: 0 0 clamp(1.8rem, 4vw, 2.6rem); }
.industries-head h2 { margin-bottom: .5rem; }
.industries-lead { color: var(--muted); font-size: 1.08rem; margin: 0; line-height: 1.7; }
.industries-outro {
  color: var(--muted); font-size: 1.06rem; line-height: 1.8;
  max-width: none; margin: clamp(2rem, 4vw, 2.8rem) 0 0;
}

/* ---------- Fixed Fee ---------- */
.fixed-fee {
  background: var(--navy-deep); color: #fff;
  position: relative;
}
.fixed-fee-inner {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem); align-items: center;
}
.fixed-fee .eyebrow { color: var(--green-light); }
.fixed-fee-title {
  color: #fff; font-weight: 500; font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.1; letter-spacing: -0.015em; margin-bottom: 1.4rem;
}
.fixed-fee-copy p:not(.eyebrow) { color: var(--on-dark); max-width: 60ch; font-size: 1.02rem; }
.fixed-fee-tag {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line-dark);
  font-family: var(--display); font-weight: 500; font-size: 1.1rem; letter-spacing: -0.01em; color: #fff;
  display: inline-flex; align-items: center; gap: .7rem;
}
.fixed-fee-tag .leaf { color: var(--green-light); font-size: 1.1rem; }
.fixed-fee-visual { display: grid; place-items: center; }
.ff-illustration { width: min(330px, 84%); height: auto; filter: drop-shadow(0 22px 40px rgba(0,0,0,0.38)); }

/* ---------- About ---------- */
/* Tighter gap below the trust logos; top padding stays as .section sets it. */
.about { padding-bottom: 50px; }
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: start; }
.about-text p { color: var(--muted); font-size: 1.06rem; line-height: 1.8; }
.about-text p:first-of-type {
  font-family: var(--display); font-weight: 400; font-size: clamp(1.25rem, 1.9vw, 1.5rem);
  line-height: 1.45; color: var(--navy); margin-bottom: 1.4rem;
}
.about-aside {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 2rem 2.1rem; box-shadow: var(--shadow-sm);
}
.trust-logos {
  margin: clamp(2.6rem, 5vw, 4rem) 0 0; padding-top: clamp(2.2rem, 4vw, 3rem);
  border-top: 1px solid var(--line); text-align: center;
}
.trust-caption {
  font-family: var(--sans); font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; font-size: .72rem; color: var(--green-deep);
  margin: 0 0 1.8rem;
}
.trust-logos-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center; justify-items: center;
  gap: 1.8rem 2rem; max-width: 840px; margin: 0 auto;
}
.trust-logo { width: auto; max-width: 100%; display: block; }
.trust-ca   { height: 180px; }
.trust-tax  { height: 198px; }
.trust-xero { height: 134px; }
.value-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.3rem; }
.value-list li { display: flex; gap: .95rem; align-items: flex-start; }
.value-icon {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 11px; background: var(--green-soft); color: var(--green-deep);
}
.value-icon svg { width: 23px; height: 23px; }
.value-body { display: flex; flex-direction: column; }
.value-list strong { font-family: var(--display); font-weight: 600; color: var(--navy); font-size: 1.05rem; margin-bottom: .2rem; }
.value-list .value-body span { color: var(--muted); font-size: .95rem; line-height: 1.6; }

/* ---------- Founder ---------- */
.founder { background: var(--paper-2); }
.founder-inner {
  display: grid; grid-template-columns: 330px 1fr;
  column-gap: clamp(2.5rem, 6vw, 4.5rem); align-items: start;
}
/* Name/role sit top-right; the photo drops to row 2 so its frame top lines
   up with the first paragraph of the bio. */
.founder-head        { grid-column: 2; grid-row: 1; }
.founder-photo       { grid-column: 1; grid-row: 2; position: relative; width: 320px; max-width: 100%; }
.founder-body        { grid-column: 2; grid-row: 2; }
.founder-photo img {
  border-radius: var(--radius-lg); position: relative; z-index: 1;
  box-shadow: var(--shadow-md);
}
.founder-mark {
  position: absolute; inset: 18px -18px -18px auto; width: 100%; height: 100%;
  border: 1px solid var(--green); border-radius: var(--radius-lg); z-index: 0;
}
.founder-head h2 { margin-bottom: .15rem; }
.founder-role { font-family: var(--sans); font-weight: 500; color: var(--green-deep); font-size: .98rem; margin: 0; }
.founder-body p { color: var(--muted); font-size: 1.02rem; line-height: 1.8; }
.founder-body p:first-child { margin-top: 0; }
.founder-personal {
  font-size: 1.02rem; border-left: 2px solid var(--green);
  padding-left: 1.2rem; color: var(--ink);
}

/* ---------- Contact ---------- */
.contact { background: var(--navy-deep); color: #fff; }
.contact-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
.contact .eyebrow { color: var(--green-light); }
.contact-intro h2 { color: #fff; font-weight: 500; }
.contact-intro p { color: var(--on-dark); margin-bottom: 1.6rem; }
.contact-points { list-style: none; margin: 1.8rem 0 0; padding: 1.6rem 0 0; border-top: 1px solid var(--line-dark); display: grid; gap: 1.15rem; }
.contact-points li { display: flex; align-items: center; gap: .95rem; color: var(--on-dark); font-size: 1rem; }
.contact-ico {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(255,255,255,0.07);
  border: 1px solid var(--line-dark); color: var(--green-light);
}
.contact-ico svg { width: 21px; height: 21px; }
.contact-value { line-height: 1.5; }
.contact-points address { font-style: normal; margin: 0; }
.contact-points a { color: #fff; }
.contact-points a:hover { color: var(--green-light); }

/* Visually hidden but available to screen readers */
.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;
}

.contact-form {
  background: var(--card); border-radius: var(--radius-lg); padding: clamp(1.8rem, 3vw, 2.6rem);
  box-shadow: var(--shadow-md); display: grid; gap: 1.1rem;
}
.field { display: grid; gap: .4rem; }
.field label { font-family: var(--sans); font-weight: 600; font-size: .88rem; color: var(--ink); letter-spacing: .005em; }
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.14);
}
.field textarea { resize: vertical; min-height: 130px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form-note { color: var(--muted); font-size: .88rem; text-align: center; margin: 0; }
.contact-form .btn-primary { margin-top: .3rem; }

/* Acknowledgement panel shown in place of the form after a successful send */
.form-success {
  background: var(--card); border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3rem); box-shadow: var(--shadow-md);
  text-align: center; align-self: center;
}
.form-success-icon {
  display: inline-grid; place-items: center; width: 66px; height: 66px;
  border-radius: 50%; background: var(--green-soft); color: var(--green-deep);
  margin-bottom: 1.3rem;
}
.form-success-icon svg { width: 34px; height: 34px; }
.form-success-title { color: var(--navy); margin-bottom: .6rem; }
.form-success-text { color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--on-dark); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: center; padding: 3rem 0; }
.footer-brand a { display: inline-block; line-height: 0; transition: opacity .2s ease; }
.footer-brand a:hover { opacity: .8; }
.footer-brand img { height: 40px; width: auto; margin-bottom: .8rem; filter: brightness(0) invert(1); opacity: .92; }
.footer-brand p { font-family: var(--display); font-weight: 500; color: rgba(255,255,255,0.9); margin: 0; font-size: 1rem; letter-spacing: -0.01em; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.footer-nav a { color: var(--on-dark-soft); font-size: .92rem; transition: color .2s ease; }
.footer-nav a:hover { color: var(--green-light); }
.footer-legal { border-top: 1px solid var(--line-dark); }
.footer-legal p {
  margin: 0; padding: 1.1rem 0 0; text-align: left;
  font-size: .82rem; color: rgba(255,255,255,0.5); line-height: 1.6;
}
.footer-bottom { border-top: 0; }
.footer-bottom-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem; padding: 1.4rem 0;
}
.footer-copy { text-align: left; font-size: .85rem; color: rgba(255,255,255,0.5); margin: 0; }
.footer-credit { font-size: .78rem; color: rgba(255,255,255,0.45); margin: 0; }
.footer-credit a { color: rgba(255,255,255,0.7); text-decoration: underline; text-underline-offset: 2px; transition: color .2s ease; }
.footer-credit a:hover { color: var(--green-light); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .section-sub { white-space: normal; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .founder-inner, .fixed-fee-inner, .contact-inner { grid-template-columns: 1fr; }
  .fixed-fee-visual { order: -1; }
  .founder-mark { inset: 14px -14px -14px auto; }
  .founder-head, .founder-photo, .founder-body { grid-column: 1; grid-row: auto; }
  .founder-head { margin-bottom: 1.6rem; }
  .founder-photo { margin-bottom: 1.8rem; }
}

@media (max-width: 760px) {
  /* Lighter hero image for small screens (~100 KiB vs ~233 KiB) */
  .hero-bg {
    background-image:
      linear-gradient(rgba(13,26,46,0.65), rgba(13,26,46,0.65)),
      url("../img/forest-hero-mobile.webp");
  }
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; inset: 78px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); padding: .5rem 5%; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-120%); transition: transform .35s var(--ease); pointer-events: none;
  }
  .nav-menu.open { transform: translateY(0); pointer-events: auto; }
  .nav-menu li { border-bottom: 1px solid var(--line-soft); }
  .nav-menu li:last-child { border-bottom: 0; }
  .nav-menu a { display: block; padding: 1rem .2rem; }
  .nav-menu a:not(.nav-cta)::after { display: none; }
  .nav-cta { display: inline-block; margin: .8rem 0; text-align: center; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 520px) {
  .service-grid { grid-template-columns: 1fr; }
  .service-card { padding: 2rem 1.6rem 2.2rem; }
  .hero-actions .btn { flex: 1 1 auto; }
  .trust-logos-row { grid-template-columns: 1fr; gap: 2.2rem; max-width: 220px; }
  .trust-ca { height: 112px; }
  .trust-tax { height: 96px; }
  .trust-xero { height: 100px; }
  /* Keep the founder photo + its offset frame inside the viewport (no h-scroll) */
  .founder-photo { width: min(320px, 82%); }
  .founder-mark { inset: 12px -12px -12px auto; }
  /* Stack the footer cleanly */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1.4rem; padding: 2.4rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
}
