/* SDD Accounting & Taxation Services Ltd. — redesign pass
   Concept: THE LEDGER. The practice's artifact is a ruled working paper, so the page is built
   from a margin rail, ruled entries and tabular figures rather than centred cards.

   Deliberate departures from the current site, which is a serif-display-over-sans, centred,
   evenly-stacked layout — the most common template shape there is:
     - grotesque display over a SERIF body (the inverse of the usual pairing)
     - an asymmetric rail + column grid, not a centred container
     - hairline rules carry the structure; whitespace alone does not
     - paper -> ink inversion for the principal's section
     - oxide is reserved for the liability side of a statement, never used decoratively
     - no scroll-reveal animation anywhere; hovers are 120ms colour shifts
*/

:root {
  /* the practice's own palette, taken from the live site and pushed */
  --paper:      #F3EFE6;
  --paper-2:    #FAF8F4;
  --paper-3:    #E8E2D5;
  --ink:        #1C1915;
  --ink-green:  #1E3D34;   /* their deep green */
  --ink-green-2:#16302A;
  --oxide:      #8D5A32;   /* their tan, promoted to a semantic. PAPER GROUND ONLY. */
  --sand:       #C9B79A;   /* the same accent role on the ink-green ground, AA-safe */
  --muted:      #5C5348;
  --rule:       #CFC6B4;
  --rule-ink:   rgba(243,239,230,.22);

  --display: "Archivo", "Archivo Fallback", system-ui, sans-serif;
  --body:    "Source Serif 4", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --rail: clamp(9rem, 14vw, 15rem);
  --gut:  clamp(1.25rem, 4vw, 4rem);
  --maxw: 88rem;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis-weight: none;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; margin: 0;
             line-height: 1.04; text-wrap: balance; }
/* ⛆ The orphan on "…books clean." is handled by text-wrap: balance, NOT by &nbsp;. An nbsp run
   cannot break, so at 320px it was 12px wider than its column and pushed the whole page
   horizontally — a fix for a cosmetic nit creating a real overflow. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
/* at very wide viewports the fixed cap left ~320px dead either side; let the page breathe */
@media (min-width: 100rem) { :root { --maxw: 104rem; --rail: 16rem; } }

/* a real skip link, not a hidden one that never shows */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ink); color: var(--paper); padding: .75rem 1rem; font-family: var(--mono);
  font-size: .8125rem;
}
.skip:focus { left: 0; }

/* ---------- masthead: a letterhead, not a nav bar ---------- */
.masthead { background: var(--ink); color: var(--paper); }
.masthead .wrap {
  display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem);
  padding-block: .875rem;
}
.crest { width: 40px; flex: 0 0 auto; }
.wordmark { display: flex; flex-direction: column; gap: .15rem; margin-right: auto; }
.wordmark b {
  font-family: var(--display); font-weight: 600; font-size: clamp(.95rem, 2.4vw, 1.0625rem);
  letter-spacing: .01em; line-height: 1.1;
}
.wordmark span {
  font-family: var(--mono); font-size: .625rem; letter-spacing: .18em; text-transform: uppercase;
  color: #A9A093;
}
.masthead nav { display: flex; gap: clamp(.9rem, 2.4vw, 1.75rem); align-items: center; }
.masthead nav a {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: #CFC6B4; padding-block: .4rem;
  transition: color .12s ease;
}
.masthead nav a:hover, .masthead nav a:focus-visible { color: var(--paper); }
.masthead nav a.is-call { color: var(--paper); border-bottom: 1px solid var(--oxide); }
/* ⛆ The nav links STAY on mobile — hiding them with no menu to replace them is a navigation
   loss, not a tidy-up. The tagline goes instead; it is the line that wrapped badly. */
@media (max-width: 30rem) {
  .masthead .wrap { gap: .7rem; }
  .wordmark span { display: none; }
  .masthead nav { gap: .85rem; }
  .masthead nav a { font-size: .625rem; letter-spacing: .1em; }
  .crest { width: 32px; }
  /* ⛔ A flex item will not shrink below its content without this, which is what pushed 12px of
     horizontal scroll at 320px. The legal name is long; the masthead carries a shortened form and
     the full one is in the closing table under "Legal name". */
  .wordmark { min-width: 0; }
  .wordmark b { font-size: .8125rem; line-height: 1.15; }
  .wordmark b .ltd { display: none; }
}
@media (max-width: 22.5rem) {
  .masthead .wrap { padding-inline: .9rem; gap: .55rem; }
  .masthead nav { gap: .7rem; }
  .masthead nav a { font-size: .5625rem; letter-spacing: .06em; }
  .wordmark b { font-size: .75rem; }
}

/* ---------- the ledger grid: rail + column ---------- */
.ledger { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
@media (max-width: 60rem) { .ledger { grid-template-columns: 1fr; } }

.rail {
  border-right: 1px solid var(--rule);
  padding: 2.25rem 1.5rem 2.25rem 0;
  font-family: var(--mono); font-size: .6875rem; line-height: 1.7;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.rail .n { display: block; color: var(--ink); font-size: 1.5rem; letter-spacing: 0; line-height: 1; }
.rail p { margin: .6rem 0 0; }
@media (max-width: 60rem) {
  .rail { border-right: 0; border-bottom: 1px solid var(--rule); padding: 1.25rem 0 1rem; }
  .rail .n { display: inline-block; margin-right: .6rem; font-size: 1.125rem; }
  .rail p { display: inline; }
}
/* the rail is now a structural cell only: it carries the hairline and, under 60rem,
   the section divider. Without the padding an empty one is the rule and nothing else. */
.rail:empty { padding: 0; }

.col { padding: 2.25rem 0 2.25rem clamp(1.25rem, 3vw, 2.75rem); min-width: 0; }
@media (max-width: 60rem) { .col { padding-left: 0; padding-top: 1.5rem; } }

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--rule); }
.hero .col { padding-block: clamp(2.5rem, 7vw, 5rem); }
@media (min-width: 64rem) {
  .hero .col { display: grid; grid-template-columns: 1.15fr .85fr; column-gap: clamp(2rem,4vw,4rem); align-items: end; }
  .hero .kicker { grid-column: 1 / -1; }
  .hero h1 { grid-column: 1; margin-bottom: 0; }
  .hero .lede { grid-column: 2; margin-top: 0; padding-bottom: .4rem; }
  .hero .actions { grid-column: 1 / -1; }
}
.kicker {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--oxide); margin: 0 0 1.25rem;
}
.hero h1 {
  font-size: clamp(2.5rem, 6.6vw, 5.25rem);
  line-height: .96; letter-spacing: -.035em; font-weight: 700;
  max-width: 13ch;
}
.hero h1 em {
  font-style: normal; display: block; color: var(--ink-green);
}
.lede {
  font-size: clamp(1.0625rem, 1.9vw, 1.3125rem); line-height: 1.5; max-width: 46ch;
  margin: 1.5rem 0 0; color: #332E27;
}
.lede-flush { margin-top: 0; max-width: 84ch; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; padding: .9rem 1.4rem; border: 1px solid var(--ink);
  transition: background .12s ease, color .12s ease;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover, .btn-ink:focus-visible { background: var(--ink-green); border-color: var(--ink-green); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover, .btn-line:focus-visible { background: var(--ink); color: var(--paper); }

/* ---------- the accounts table: the seven services as ledger entries ---------- */
.accounts { border-collapse: collapse; width: 100%; margin-top: .5rem; }
.accounts caption {
  text-align: left; font-family: var(--mono); font-size: .6875rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); padding-bottom: .9rem;
}
.accounts tr { border-top: 1px solid var(--rule); }
.accounts tr:last-child { border-bottom: 1px solid var(--rule); }
.accounts td { padding: 1rem .75rem 1rem 0; vertical-align: baseline; }
.accounts td.num {
  font-family: var(--mono); font-size: .75rem; color: var(--oxide); width: 3.5rem;
  font-variant-numeric: tabular-nums;
}
.accounts td.name {
  font-family: var(--display); font-weight: 600; font-size: clamp(1rem, 2vw, 1.1875rem);
  letter-spacing: -.01em; width: 34%;
}
.accounts td.what { color: var(--muted); font-size: .9375rem; }
.accounts td.name { padding-right: 2rem; }
.accounts tr:hover td.name { color: var(--ink-green); }
.accounts tr { transition: background .12s ease; }
.accounts tr:hover { background: var(--paper-2); }
@media (max-width: 46rem) {
  .accounts td { display: block; padding: 0; }
  .accounts tr { padding-block: 1rem; display: block; }
  .accounts td.num { width: auto; margin-bottom: .2rem; }
  .accounts td.name { width: auto; margin-bottom: .25rem; }
}

/* ---------- entries: the detailed work ---------- */
.entries { border-top: 1px solid var(--rule); margin-top: 2rem; }
.entry {
  display: grid; grid-template-columns: 3.5rem minmax(0,1fr);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
}
.entry > .idx {
  font-family: var(--mono); font-size: .75rem; color: var(--oxide); padding-top: .35rem;
  font-variant-numeric: tabular-nums;
}
.entry h3 { font-size: clamp(1.25rem, 2.6vw, 1.625rem); letter-spacing: -.02em; }
.entry p { margin: .6rem 0 0; max-width: 68ch; color: #332E27; }
.entry ul {
  margin: .9rem 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: .4rem .5rem;
}
.entry li {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--rule); padding: .35rem .6rem; color: var(--muted);
}
/* oxide marks the liability side of a statement — the things that go wrong — and nothing else */
.entry.is-risk > .idx { color: var(--oxide); }
.entry.is-risk h3::after {
  content: ""; display: inline-block; width: .5rem; height: .5rem; margin-left: .55rem;
  background: var(--oxide); vertical-align: middle;
}
@media (max-width: 40rem) {
  .entry { grid-template-columns: 1fr; }
  .entry > .idx { padding-top: 0; margin-bottom: .4rem; }
}

/* ---------- the principal: paper inverts to ink ---------- */
.principal { background: var(--ink-green); color: var(--paper); }
.principal .ledger { border: 0; }
.principal .rail { border-right-color: var(--rule-ink); color: #A8BDB5; }
.principal .rail .n { color: var(--paper); }
@media (max-width: 60rem) { .principal .rail { border-bottom-color: var(--rule-ink); } }
.principal h2 { font-size: clamp(1.875rem, 4.6vw, 3rem); letter-spacing: -.03em; }
.principal p { max-width: 66ch; color: #DCE5E1; }
/* ⛔ NOT var(--oxide) here. Oxide on paper is 5.03:1 and passes; oxide on this deep green is
   2.05:1 and fails AA outright. The accent keeps its warm role on the dark ground with a sand
   tint instead, measured at 6.05:1. */
.principal .name {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--sand); margin: 0 0 .9rem;
}
.principal .seal { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 2.25rem; align-items: flex-start; }
.principal .seal img { width: 92px; border: 1px solid var(--rule-ink); }
.solas {
  margin: 0; padding: 0; list-style: none;
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase;
  color: #8FA69D; line-height: 2;
}
.creds { margin-top: 2.5rem; border-top: 1px solid var(--rule-ink); padding-top: 1.25rem; }
.creds h3 {
  font-family: var(--mono); font-weight: 400; font-size: .6875rem; letter-spacing: .18em;
  text-transform: uppercase; color: #8FA69D; margin-bottom: .75rem;
}
.creds ul { margin: 0; padding: 0; list-style: none; }
.creds li {
  border-top: 1px solid var(--rule-ink); padding: .7rem 0; font-size: .9375rem; color: #DCE5E1;
}
.creds li:first-child { border-top: 0; }

/* ---------- the statement: contact as a closing balance ---------- */
.statement .col { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.statement h2 { font-size: clamp(1.875rem, 4.4vw, 3.5rem); letter-spacing: -.03em; max-width: 22ch; }
.statement .say { margin: 1.25rem 0 2rem; max-width: 46ch; color: #332E27; }
.facts { border-collapse: collapse; width: 100%; max-width: 40rem; }
.facts tr { border-top: 1px solid var(--rule); }
.facts tr:last-child { border-bottom: 1px solid var(--rule); }
.facts th {
  text-align: left; font-family: var(--mono); font-weight: 400; font-size: .6875rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  padding: .95rem 1rem .95rem 0; width: 7.5rem; vertical-align: baseline;
}
.facts td { padding: .95rem 0; vertical-align: baseline; }
.facts a { text-decoration: none; border-bottom: 1px solid var(--oxide); }
.facts a:hover { color: var(--oxide); }
.facts .tnum { font-family: var(--mono); font-variant-numeric: tabular-nums; }

footer.foot { border-top: 1px solid var(--rule); background: var(--paper-3); }
footer.foot .wrap {
  display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between;
  padding-block: 1.5rem;
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
footer.foot a { text-decoration: none; }
footer.foot a:hover { color: var(--ink); }

/* ---------- wide-width composition: neither band leaves a dead right half ---------- */
@media (min-width: 64rem) {
  /* 04 — prose carries the left, the seal and credentials hold the right */
  .principal .col {
    display: grid; grid-template-columns: 1.1fr .9fr;
    column-gap: clamp(2rem, 5vw, 4.5rem);
  }
  .principal .name { grid-column: 1 / -1; }
  /* ⛔ NOT 1 / -1. Spanning the grid put the headline's descenders on the crest in the right
     column — measured 0px gap at 1440 and -1px at 1024. It stays in column 1. */
  .principal h2 { grid-column: 1; }
  .principal .aside { margin-top: .35rem; }
  .principal .prose { grid-column: 1; }
  .principal .aside { grid-column: 2; }
  .principal .seal { margin-top: 0; }
  .principal .creds { margin-top: 2rem; }

  /* 05 — the closing balance sits beside its statement, not under it */
  .statement .col {
    display: grid; grid-template-columns: 1fr 1fr;
    column-gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
  }
  .statement .facts { grid-column: 2; grid-row: 1 / span 3; max-width: none; }
  .statement h2, .statement .say { grid-column: 1; }
}
