/* ============================================================
   JM Accountants & Advisors — jmadvisory.com.au
   Hand-written stylesheet. No framework, no build step.
   ============================================================ */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../assets/fonts/public-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Spline Sans Mono";
  src: url("../assets/fonts/spline-sans-mono.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #24262b;
  --ink-soft: #5c5f66;
  --accent: #2e75c5;
  --accent-deep: #1e5799;
  --accent-soft: #8fb4e0;      /* accent for dark band text */
  --paper: #ffffff;
  --paper-tint: #f3f5f8;
  --band: #1f2430;
  --band-ink: #e9ebef;
  --band-soft: #9aa0ac;
  --line: #e2e5ea;
  --line-dark: rgba(233, 235, 239, 0.14);

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --s1: 4px;  --s2: 8px;  --s3: 16px; --s4: 24px;
  --s5: 32px; --s6: 48px; --s7: 72px; --s8: 112px;

  --radius: 4px;
  --measure: 62ch;
  --header-h: 84px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "kern";
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 500; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 40px);
  padding-right: clamp(20px, 4vw, 40px);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: var(--s2) var(--s3);
  z-index: 100;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Type utilities ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 var(--s3);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: var(--s3);
}

.section-title {
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.lede {
  color: var(--ink-soft);
  max-width: var(--measure);
  margin-top: var(--s3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 160ms ease;
}
.btn:hover { background: var(--accent-deep); color: #fff; }

.link-quiet {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  transition: color 160ms ease, border-color 160ms ease;
}
.link-quiet:hover { color: var(--accent-deep); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { width: 200px; height: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(var(--s3), 2.5vw, var(--s5));
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav a:not(.btn) {
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}
.site-nav a:not(.btn):hover { color: var(--accent-deep); }
.site-nav a.is-active { color: var(--accent-deep); border-bottom-color: var(--accent); }

.nav-pill {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(var(--s7), 12vh, 150px) 0 clamp(var(--s7), 11vh, 140px);
  background: var(--paper);
}
.hero-arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 880px; }
.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.1rem);
  line-height: 1.07;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s4);
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 38em;
  margin-bottom: var(--s6);
}

/* ---------- Sections ---------- */
.section { padding: var(--s8) 0; }
.section--tint { background: var(--paper-tint); }
.section-head { margin-bottom: var(--s6); }

/* ---------- Services: ledger-ruled grid ---------- */
.ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ledger-cell {
  background: var(--paper);
  padding: var(--s5) var(--s5) var(--s5) 0;
  padding-left: var(--s5);
}
.ledger-cell .num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: var(--s3);
  transition: color 160ms ease;
}
.ledger-cell h3 {
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: var(--s2);
  transition: color 160ms ease;
}
.ledger-cell p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.ledger-cell:hover h3 { color: var(--accent-deep); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--s6) var(--s7);
  align-items: start;
}
.about-copy { max-width: var(--measure); }
.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.facts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line);
}
.facts .k {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.facts .v {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--ink);
  text-align: right;
}

/* ---------- Associations strip ---------- */
.assoc { padding: var(--s6) 0; border-top: 1px solid var(--line); }
.assoc .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}
.assoc-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.assoc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--s5);
  flex-wrap: wrap;
}
.assoc-list li { display: flex; align-items: center; }
.assoc-list li.badge-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
  white-space: nowrap;
}
.assoc-list img { height: 52px; width: auto; }

/* ---------- Contact (dark band — signature) ---------- */
.contact {
  background: var(--band);
  color: var(--band-ink);
  padding: var(--s8) 0;
}
.contact .eyebrow { color: var(--band-soft); }
.contact-title {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--band-ink);
  max-width: 18em;
  margin-bottom: var(--s4);
}
.contact-title em { font-style: italic; color: var(--accent-soft); }
.contact-copy {
  color: var(--band-soft);
  max-width: 46em;
  margin-bottom: var(--s6);
}
.contact-email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.375rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--band-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 6px;
  transition: color 160ms ease, border-color 160ms ease;
}
.contact-email:hover { color: var(--accent-soft); }
.contact-aside {
  margin-top: var(--s6);
  padding-top: var(--s4);
  border-top: 1px solid var(--line-dark);
  font-size: 0.9375rem;
  color: var(--band-soft);
}
.contact-aside a { color: var(--band-ink); }
.contact-aside a:hover { color: var(--accent-soft); }

/* ---------- Footer (continues dark band) ---------- */
.site-footer {
  background: var(--band);
  color: var(--band-soft);
  border-top: 1px solid var(--line-dark);
  padding: var(--s6) 0;
  font-size: 0.875rem;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  color: var(--band-ink);
}
.footer-nav { display: flex; gap: var(--s4); flex-wrap: wrap; }
.footer-nav a { color: var(--band-soft); text-decoration: none; }
.footer-nav a:hover { color: var(--band-ink); }
.footer-legal {
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--line-dark);
  font-size: 0.8125rem;
  color: var(--band-soft);
}

/* ---------- Simple inner pages (portal, 404) ---------- */
.page-simple {
  min-height: 55vh;
  display: flex;
  align-items: center;
  padding: var(--s8) 0;
}
.page-simple .inner { max-width: 620px; }
.page-simple h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: var(--s4);
}
.page-simple p { color: var(--ink-soft); }
.page-simple .actions { margin-top: var(--s5); display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .fx {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 640ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  html.js .fx.is-in { opacity: 1; transform: none; }
  html.js .fx-d1 { transition-delay: 90ms; }
  html.js .fx-d2 { transition-delay: 180ms; }
  html.js .fx-d3 { transition-delay: 270ms; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .facts { max-width: 480px; }
}

@media (max-width: 760px) {
  :root { --header-h: 0px; }
  .section { padding: var(--s7) 0; }
  .hero { padding: var(--s7) 0; }

  .site-header { position: static; backdrop-filter: none; background: var(--paper); }
  .site-header .wrap {
    flex-direction: column;
    align-items: center;
    padding-top: var(--s4);
    padding-bottom: var(--s4);
    gap: var(--s3);
  }
  .brand img { width: 180px; }
  .site-nav { justify-content: center; }

  section[id] { scroll-margin-top: var(--s4); }
  .assoc .wrap { justify-content: center; }
  .assoc-label { width: 100%; text-align: center; }
  .assoc-list { justify-content: center; }
  .footer-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .ledger { grid-template-columns: 1fr; }
  .ledger-cell { padding: var(--s4); }
}
