/* ===========================================================
   RSD Chartered Accountants — Stylesheet
   Type: Fraunces (display) / IBM Plex Sans (body) / IBM Plex Mono (figures)
   Palette: Ink Navy #0F2A3D · Deep Teal #1C6E7D · Bright Teal #2FA8B3
            Ice #F4F7F8 · Ink text #1B2B33
=========================================================== */

:root {
  --navy: #0F2A3D;
  --navy-soft: #16394F;
  --teal-deep: #1C6E7D;
  --teal-bright: #2FA8B3;
  --ice: #F4F7F8;
  --ice-2: #E9EFF1;
  --ink: #1B2B33;
  --ink-soft: #4C5F68;
  --white: #FFFFFF;
  --line: rgba(15, 42, 61, 0.14);
  --line-light: rgba(255, 255, 255, 0.22);

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;

  --container: 1180px;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 500; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.1em; color: var(--ink-soft); }
a { color: var(--teal-deep); text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 6vw;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1em;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--teal-deep);
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85em 1.7em;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--teal-bright); color: var(--navy); }
.btn-primary:hover { background: var(--white); transform: translateY(-2px); }
.btn-outline { background: transparent; border-color: var(--line-light); color: var(--white); }
.btn-outline:hover { background: var(--line-light); transform: translateY(-2px); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: var(--teal-deep); transform: translateY(-2px); }

/* ---------- Ledger rule (signature divider) ---------- */
.ledger-rule {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 0;
}
.ledger-rule.on-dark { border-top: 1px dashed var(--line-light); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 6vw;
  max-width: var(--container);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
}
.brand img { height: 34px; width: auto; }
.brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--teal-deep);
  font-weight: 500;
  text-transform: uppercase;
}
.nav-links { display: flex; align-items: center; gap: 2.2em; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--teal-bright);
  transition: right 0.3s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { right: 0; }
.nav-links a.active { color: var(--teal-deep); }
.nav-cta { display: flex; align-items: center; gap: 1.5em; }
.nav-cta .btn span.short { display: none; }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  background: var(--navy);
  color: var(--white);
  position: relative;
  overflow: hidden;
  padding: 100px 0 80px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(47,168,179,0.16), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(47,168,179,0.10), transparent 40%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4vw;
  align-items: center;
  position: relative;
}
.hero h1 { color: var(--white); }
.hero p.lead { color: rgba(255,255,255,0.72); font-size: 1.15rem; max-width: 46ch; }
.hero-ctas { display: flex; gap: 1em; margin-top: 1.8em; flex-wrap: wrap; }

.hero-figure { display: flex; align-items: center; justify-content: center; }
.hero-figure svg { width: 100%; max-width: 420px; height: auto; }

/* ledger-line draw animation */
.ledger-draw path, .ledger-draw line, .ledger-draw circle {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 2.6s var(--ease) forwards;
}
.ledger-draw .d2 { animation-delay: 0.25s; }
.ledger-draw .d3 { animation-delay: 0.5s; }
.ledger-draw .d4 { animation-delay: 0.75s; }
.ledger-draw .fade { opacity: 0; animation: fadeIn 1s ease forwards; animation-delay: 1.4s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

/* Stat strip under hero */
.stat-strip {
  background: var(--navy-soft);
  border-top: 1px solid var(--line-light);
}
.stat-strip .container {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5em;
  padding-top: 28px;
  padding-bottom: 28px;
}
.stat {
  color: var(--white);
}
.stat .num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--teal-bright);
  display: block;
}
.stat .label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-head { max-width: 640px; margin-bottom: 3em; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.bg-ice { background: var(--ice); }
.bg-navy { background: var(--navy); color: var(--white); }
.bg-navy h2, .bg-navy h3 { color: var(--white); }
.bg-navy p { color: rgba(255,255,255,0.7); }

/* ---------- Service cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.2em 1.8em;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(15,42,61,0.10);
  border-color: transparent;
}
.card .icon {
  width: 46px; height: 46px;
  color: var(--teal-deep);
  margin-bottom: 1.1em;
}
.card h3 { margin-bottom: 0.5em; font-size: 1.2rem; }
.card p { margin-bottom: 1em; font-size: 0.96rem; }
.card a.card-link { font-family: var(--font-mono); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal-deep); }
.card a.card-link::after { content: " \2192"; transition: margin 0.3s var(--ease); }
.card a.card-link:hover::after { margin-left: 4px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Image frame ---------- */
.img-frame { border-radius: var(--radius); overflow: hidden; position: relative; }
.img-frame img { transition: transform 0.6s var(--ease); }
.img-frame:hover img { transform: scale(1.04); }

/* ---------- Founder / stat blocks ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 1em; }
.pillar {
  border-left: 3px solid var(--teal-bright);
  padding: 1.1em 1.4em;
  background: var(--ice);
}
.pillar .num { font-family: var(--font-mono); color: var(--teal-deep); font-size: 1.4rem; display: block; margin-bottom: 0.2em; }
.pillar .label { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(120deg, var(--teal-deep), var(--navy));
  color: var(--white);
  text-align: center;
  padding: 90px 0;
}
.cta-banner h2 { color: var(--white); }
.cta-banner p { color: rgba(255,255,255,0.75); max-width: 50ch; margin-left: auto; margin-right: auto; }

/* ---------- Services list page ---------- */
.service-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5em 4em; }
.service-item { border-bottom: 1px dashed var(--line); padding-bottom: 1.6em; }
.service-item h3 { display: flex; align-items: center; gap: 0.6em; font-size: 1.1rem; }
.service-item .icon { width: 26px; height: 26px; color: var(--teal-deep); flex-shrink: 0; }
.service-item p { font-size: 0.95rem; margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 4vw; }
.info-line { display: flex; gap: 1em; align-items: flex-start; margin-bottom: 1.6em; }
.info-line .icon { width: 22px; height: 22px; color: var(--teal-bright); flex-shrink: 0; margin-top: 3px; }
.info-line strong { display: block; color: var(--white); font-size: 0.95rem; }
.info-line span { color: rgba(255,255,255,0.65); font-size: 0.9rem; }

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.4em;
  box-shadow: 0 30px 60px rgba(15,42,61,0.14);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--navy); margin-bottom: 0.4em; }
input, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.85em 1em;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.2em;
  background: var(--ice);
  color: var(--ink);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--teal-bright);
  box-shadow: 0 0 0 3px rgba(47,168,179,0.16);
}
textarea { resize: vertical; min-height: 130px; }

.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-frame iframe { width: 100%; height: 340px; border: 0; display: block; filter: grayscale(0.25); }
.map-frame--full { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.map-frame--full iframe { height: 460px; }
@media (max-width: 767px) {
  .map-frame--full iframe { height: 320px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.65); padding: 70px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3em; margin-bottom: 3em; }
.footer-brand .brand { color: var(--white); }
.footer-brand p { color: rgba(255,255,255,0.55); max-width: 34ch; margin-top: 1em; }
.footer-col h4 { color: var(--white); font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1.2em; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.8em; }
.footer-col a { color: rgba(255,255,255,0.65); font-size: 0.92rem; }
.footer-col a:hover { color: var(--teal-bright); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px dashed var(--line-light);
  font-size: 0.82rem; flex-wrap: wrap; gap: 1em;
}

.dev-credit {
  display: flex; align-items: center; gap: 0.6em;
  margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-light);
  font-size: 0.74rem; color: rgba(255,255,255,0.38);
}
.dev-credit img { height: 18px !important; width: auto !important; max-width: 60px !important; opacity: 0.75; }
.dev-credit a { color: rgba(255,255,255,0.5); }
.dev-credit a:hover { color: var(--teal-bright); }

/* ---------- Responsive (Divi-style breakpoints: tablet <=980, phone <=767) ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; text-align: left; }
  .hero-figure { order: -1; max-width: 280px; margin-bottom: 1em; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .service-list { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  body { font-size: 16px; }
  section { padding: 64px 0; }
  .nav-links { display: none; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius);
    background: none; cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 18px; height: 2px; background: var(--navy); position: relative; transition: all 0.3s ease;
  }
  .nav-toggle span::before { position: absolute; top: -6px; }
  .nav-toggle span::after { position: absolute; top: 6px; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white); padding: 1.5em 6vw; border-bottom: 1px solid var(--line); gap: 1.2em;
  }
  .nav-cta .btn span.long { display: none; }
  .nav-cta .btn span.short { display: inline; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2.2em; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 70px 0 50px; }
  .stat-strip .container { gap: 1.4em; justify-content: space-between; }
}
