/* ============================================================
   JG TAX & LEGAL — Shared design system
   Concept: "the ledger and the brief" — ruled tax-workpaper
   structure meeting editorial legal whitespace.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --ink: #0E1B33;
  --paper: #FBFAF6;
  --paper-alt: #F2EFE7;
  --brass: #C17A56;
  --brass-deep: #A55F3D;
  --slate: #5A6373;
  --line: #D9D4C7;
  --line-strong: #C4BDA9;
  --white-card: #FFFFFF;

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 4vw, 4rem);

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --shadow-soft: 0 1px 2px rgba(14,27,51,.05), 0 8px 30px rgba(14,27,51,.06);

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Dark mode ---------- */
[data-theme="dark"] {
  --ink: #ECE7DB;
  --paper: #0B1424;
  --paper-alt: #101D33;
  --brass: #D08A5E;
  --brass-deep: #DD9A6E;
  --slate: #9AA4B6;
  --line: #25324A;
  --line-strong: #33425E;
  --white-card: #111E34;
  --shadow-soft: 0 1px 2px rgba(0,0,0,.3), 0 10px 34px rgba(0,0,0,.4);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 1.125rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s var(--ease), color .4s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--alt { background: var(--paper-alt); }
.section--ink { background: var(--ink); color: var(--paper); }
[data-theme="dark"] .section--ink { background: #060D18; }

/* Home hero brand heading */
.brand-eyebrow {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: .5rem;
}
.hero-sub {
  font-family: var(--mono);
  font-size: .9rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 1.6rem;
}

/* Eyebrow / marginal reference label */
.eyebrow {
  font-family: var(--mono);
  font-size: .95rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.4rem;
}
.eyebrow::before {
  content: "";
  width: 1.8rem;
  height: 1px;
  background: var(--brass);
  display: inline-block;
}
.section--ink .eyebrow { color: var(--brass); }
.eyebrow--lg { font-size: 1.9rem; letter-spacing: .06em; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.01em;
  font-optical-sizing: auto;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
p { color: var(--ink); }
.lead {
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.55;
  color: var(--slate);
  font-weight: 400;
}
.muted { color: var(--slate); }
.prose p + p { margin-top: 1.15rem; }
.prose p { max-width: 64ch; }

/* Heading with marginal rule — the signature device */
.ruled {
  position: relative;
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
}
.ruled::before {
  content: "";
  position: absolute;
  left: 0; top: .35em; bottom: .1em;
  width: 2px;
  background: var(--brass);
}

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink);
  --fg: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding: .85rem 1.6rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--bg);
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn--ghost {
  --bg: transparent;
  --fg: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.section--ink .btn--ghost { --fg: var(--paper); border-color: rgba(255,255,255,.3); }
.section--ink .btn--ghost:hover { background: var(--paper); color: var(--ink); }

/* Text link with underline animation */
.tlink {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--brass);
  padding-bottom: 1px;
  transition: color .2s var(--ease);
}
.tlink:hover { color: var(--brass-deep); }
.tlink .arr { transition: transform .25s var(--ease); display:inline-block; }
.tlink:hover .arr { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 76px;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.brand .logo {
  display: block;
  height: 64px;
  width: auto;
}
.brand .logo-light { display: none; }
[data-theme="dark"] .brand .logo-dark { display: none; }
[data-theme="dark"] .brand .logo-light { display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.4rem);
}
.nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 500;
  position: relative;
  padding: .3rem 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--brass);
  transition: width .3s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 100%; }
.nav a[aria-current="page"] { color: var(--brass-deep); }

.header-actions { display: flex; align-items: center; gap: 1rem; }

.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink);
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.theme-toggle:hover { background: var(--paper-alt); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

.nav-cta { display: inline-flex; }
/* nav CTA inherits .btn colours, not .nav a colours */
.nav a.nav-cta { color: var(--paper); padding: .85rem 1.6rem; }
.nav a.nav-cta::after { display: none; }
.nav a.nav-cta:hover { color: var(--paper); }

/* Mobile nav */
.menu-btn {
  display: none;
  width: 42px; height: 42px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  cursor: pointer;
  color: var(--ink);
}
.menu-btn span {
  display:block; width: 18px; height: 1.5px; background: currentColor;
  margin: 4px auto; transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.menu-open .menu-btn span:nth-child(1){ transform: translateY(5.5px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2){ opacity: 0; }
.menu-open .menu-btn span:nth-child(3){ transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
}
.hero h1 { margin-bottom: 1.5rem; font-size: clamp(1.9rem, 4.3vw, 3rem); }
.hero h1 em { font-style: italic; color: var(--brass-deep); }
.hero .lead { margin-bottom: 2.2rem; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Hero aside — the "schedule" panel */
.hero-panel {
  border: 1px solid var(--line-strong);
  background: var(--white-card);
  box-shadow: var(--shadow-soft);
  padding: 1.6rem 1.7rem;
}
.hero-panel h2 {
  font-family: var(--mono);
  font-size: .9rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
  margin-bottom: 1rem;
}
.schedule-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .58rem 0;
  border-top: 1px solid var(--line);
}
.schedule-row:first-of-type { border-top: none; padding-top: 0; }
.schedule-row .no {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--brass);
  min-width: 2.2ch;
}
.schedule-row .nm { font-family: var(--serif); font-size: 1.02rem; }

/* ---------- Intro / two-column statements ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 320px) 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.split .label {
  font-family: var(--mono);
  font-size: .95rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brass-deep);
  position: sticky;
  top: 110px;
}
.split .label--lg { font-size: 1.9rem; letter-spacing: .06em; line-height: 1.1; }

/* ---------- Practice preview / schedule list ---------- */
.areas-list { border-top: 1px solid var(--line-strong); }
.area-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2.2rem) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: padding-left .3s var(--ease), background .3s var(--ease);
}
.area-item:hover { padding-left: .8rem; }
.area-item .a-no {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--brass);
  padding-top: .5rem;
}
.area-item .a-body h3 { margin-bottom: .5rem; }
.area-item .a-body p { color: var(--slate); max-width: 60ch; font-size: .98rem; }
.area-item .a-go {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--line-strong);
  transition: color .3s var(--ease), transform .3s var(--ease);
}
.area-item:hover .a-go { color: var(--brass); transform: translateX(4px); }

/* ---------- Feature columns (why us / who we work with) ---------- */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.col-card {
  border-top: 2px solid var(--ink);
  padding-top: 1.4rem;
}
.col-card .ci {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--brass);
  margin-bottom: .9rem;
  letter-spacing: .1em;
}
.col-card h3 { margin-bottom: .65rem; font-size: 1.3rem; }
.col-card p { color: var(--slate); font-size: .98rem; }
.section--ink .col-card { border-top-color: var(--brass); }
.section--ink .col-card p { color: rgba(236,231,219,.78); }

/* ---------- Process / how we work ---------- */
.steps { display: grid; gap: 0; }
.step {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.4rem, 3vw, 2rem) 0;
  border-top: 1px solid var(--line);
}
.step:first-child { border-top: none; }
.step .s-no {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--brass);
  line-height: 1;
}
.step h3 { margin-bottom: .5rem; }
.step p { color: var(--slate); max-width: 62ch; }

/* ---------- Team preview ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}
.person {
  text-decoration: none;
  color: var(--ink);
  display: block;
  group: person;
}
.person .ph {
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  margin-bottom: 1.2rem;
}
.person .ph img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  filter: grayscale(18%);
  transition: transform .6s var(--ease), filter .5s var(--ease);
}
.person:hover .ph img { transform: scale(1.04); filter: grayscale(0%); }
.person .role {
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: .4rem;
}
.person h3 { font-size: 1.6rem; margin-bottom: .4rem; }
.person .pmeta { color: var(--slate); font-size: .98rem; margin-bottom: .8rem; }

/* ---------- Profile hero ---------- */
.profile-hero {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
.profile-hero .ph-img {
  border: 1px solid var(--line-strong);
  background: var(--paper-alt);
  overflow: hidden;
  aspect-ratio: 4/5;
  max-width: 440px;
}
.profile-hero .ph-img img { width:100%; height:100%; object-fit: cover; object-position: top center; }
.profile-hero .role {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1rem;
}
.profile-hero h1 { margin-bottom: 1.2rem; }
.profile-hero .contact-line {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--slate);
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}
.profile-hero .contact-line a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--brass); }

/* Representative matters */
.matters { display: grid; gap: 0; }
.matter {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}
.matter:first-child { border-top: none; }
.matter .m-mark {
  color: transparent;
  position: relative;
  width: 14px;
  display: inline-block;
}
.matter .m-mark::before {
  content: "";
  position: absolute;
  left: 0; top: .7rem;
  width: 8px; height: 2px;
  background: var(--brass); border-radius: 1px;
}
.matter p { color: var(--slate); }

/* Focus tags */
.tags { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.tag {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .06em;
  padding: .45rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--slate);
}

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line-strong); }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: .4rem 0;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic {
  flex: none;
  width: 22px; height: 22px;
  position: relative;
}
.faq summary .ic::before, .faq summary .ic::after {
  content:""; position:absolute; background: var(--brass);
  left: 50%; top: 50%;
}
.faq summary .ic::before { width: 14px; height: 1.5px; transform: translate(-50%,-50%); }
.faq summary .ic::after { width: 1.5px; height: 14px; transform: translate(-50%,-50%); transition: transform .3s var(--ease); }
.faq details[open] summary .ic::after { transform: translate(-50%,-50%) scaleY(0); }
.faq .ans { padding: 0 0 1.3rem; color: var(--slate); max-width: 70ch; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact-info dl { display: grid; gap: 1.4rem; margin-top: 1.8rem; }
.contact-info dt {
  font-family: var(--mono);
  font-size: .85rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: .3rem;
}
.contact-info dd { font-size: 1.05rem; }
.contact-info dd a { color: inherit; text-decoration: none; }
.contact-info dd a:hover { color: var(--brass-deep); }

.form-field { margin-bottom: 1.25rem; }
.form-field label {
  display: block;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: .5rem;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white-card);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: .8rem .9rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form-field textarea { resize: vertical; min-height: 130px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 22%, transparent);
}
.form-note { font-size: .85rem; color: var(--slate); margin-top: .5rem; }
.form-msg {
  margin-top: 1rem;
  font-size: .92rem;
  color: var(--brass-deep);
  font-family: var(--mono);
  min-height: 1.2em;
}

/* ---------- Referral callout ---------- */
.referral {
  border: 1px solid var(--brass);
  background: color-mix(in srgb, var(--brass) 7%, var(--paper));
  padding: clamp(1.6rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}
[data-theme="dark"] .referral { background: color-mix(in srgb, var(--brass) 12%, var(--paper)); }
.referral h3 { margin-bottom: .5rem; }
.referral p { color: var(--slate); max-width: 58ch; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
}
[data-theme="dark"] .site-footer { background: #060D18; border-top: 1px solid var(--line); }
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-top .fcol h4 {
  font-family: var(--mono);
  font-size: .9rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(251,250,246,.92);
  font-weight: 500;
  margin-bottom: 1.1rem;
}
.footer-top a { color: rgba(251,250,246,.82); text-decoration: none; display: block; padding: .3rem 0; transition: color .2s var(--ease); }
.footer-top a:hover { color: #fff; }
.footer-top .fblurb { color: rgba(251,250,246,.7); max-width: 38ch; margin-top: 1rem; font-size: .95rem; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.8rem;
  font-size: .82rem;
  color: rgba(251,250,246,.55);
  font-family: var(--mono);
  letter-spacing: .03em;
}
.footer-disclosure { color: rgba(251,250,246,.8); }

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

/* ---------- Page intro band ---------- */
.page-head { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem,4vw,3rem); border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: 1.2rem; max-width: 18ch; }
.page-head .lead { max-width: 60ch; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .profile-hero, .contact-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split .label { position: static; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .hero-panel { order: -1; }
}
@media (max-width: 760px) {
  .nav, .nav-cta { display: none; }
  .menu-btn { display: block; }
  .nav.open {
    display: flex;
    position: fixed;
    inset: 76px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1rem var(--gutter) 1.5rem;
  }
  .nav.open a { width: 100%; padding: .9rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav.open .nav-cta { display: inline-flex; margin-top: 1rem; }
  .area-item { grid-template-columns: 1fr; }
  .area-item .a-go { display: none; }
  .footer-top { grid-template-columns: 1fr; }
  .referral { grid-template-columns: 1fr; }
}
