/* lloydgerry.com — single stylesheet, no build step.
   Tokens first, then shell, then blocks. System faces only: zero external
   requests, so the CSP needs no font exceptions and there is no FOUT. */
/* ============================================================
   Tokens — light is the base; dark redefines tokens only.
   ============================================================ */
:root {
  --paper:   #f2f2f6;
  --paper-2: #fbfbfd;
  --paper-3: #e9e9f0;
  --ink:     #15161f;
  --ink-2:   #4c4e5c;
  --ink-3:   #83869a;
  --rule:    #dcdce4;
  --accent:  #2e36b0;
  --accent-tint: #e2e3f6;
  --on-accent: #fbfbfd;
  --shadow: 0 1px 1px rgb(21 22 31 / 4%), 0 10px 30px -18px rgb(21 22 31 / 22%);

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --s-1:  clamp(0.72rem, 0.7rem + 0.08vw, 0.78rem);
  --s0:   clamp(0.95rem, 0.92rem + 0.14vw, 1.03rem);
  --s1:   clamp(1.13rem, 1.07rem + 0.28vw, 1.3rem);
  --s2:   clamp(1.45rem, 1.32rem + 0.62vw, 1.85rem);
  --s3:   clamp(1.95rem, 1.6rem + 1.6vw, 2.95rem);
  --s4:   clamp(2.5rem, 1.75rem + 3.4vw, 4.65rem);

  --gutter: clamp(1.15rem, 4vw, 3.25rem);
  --rail: 8.5rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:   #0f1014;
    --paper-2: #171923;
    --paper-3: #1e202b;
    --ink:     #e9e9f0;
    --ink-2:   #a9abbc;
    --ink-3:   #787b8e;
    --rule:    #292b38;
    --accent:  #98a0ff;
    --accent-tint: #1c1f3a;
    --on-accent: #101223;
    --shadow: 0 1px 1px rgb(0 0 0 / 40%), 0 10px 30px -18px rgb(0 0 0 / 80%);
  }
}

:root[data-theme="dark"] {
  --paper:   #0f1014;
  --paper-2: #171923;
  --paper-3: #1e202b;
  --ink:     #e9e9f0;
  --ink-2:   #a9abbc;
  --ink-3:   #787b8e;
  --rule:    #292b38;
  --accent:  #98a0ff;
  --accent-tint: #1c1f3a;
  --on-accent: #101223;
  --shadow: 0 1px 1px rgb(0 0 0 / 40%), 0 10px 30px -18px rgb(0 0 0 / 80%);
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--s0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.021em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--s4); }
h2 { font-size: var(--s3); }
h3 { font-size: var(--s1); letter-spacing: -0.012em; line-height: 1.25; }

p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }

a { color: var(--accent); text-underline-offset: 0.19em; text-decoration-thickness: 1px; }

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

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--paper-2); padding: .7rem 1.1rem; }

/* ============================================================
   Ledger shell — narrow mono rail, wide prose column
   ============================================================ */
.wrap {
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { border-top: 1px solid var(--rule); }

.ledger {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-block: clamp(3.25rem, 7vw, 6rem);
  align-items: start;
}

.rail {
  font-family: var(--mono);
  font-size: var(--s-1);
  line-height: 1.5;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  gap: .45rem;
  position: sticky;
  top: 4.5rem;
}
.rail b { display: block; color: var(--accent); font-weight: 500; letter-spacing: .04em; }
.rail span { display: block; }

.col { display: flex; flex-direction: column; gap: clamp(1.4rem, 3vw, 2.1rem); }

.measure { max-width: 60ch; }

@media (max-width: 54rem) {
  .ledger { grid-template-columns: 1fr; gap: 1.1rem; }
  .rail { position: static; flex-direction: row; flex-wrap: wrap; gap: .35rem 1rem; }
}

.lede { font-size: var(--s1); line-height: 1.5; color: var(--ink-2); }

/* Placeholder copy still waiting on the résumé. */
.ph {
  font-family: var(--mono);
  font-size: .88em;
  font-style: normal;
  color: var(--ink-2);
  background: var(--accent-tint);
  border-bottom: 1px dashed var(--accent);
  padding: 0 .25em;
}

/* ============================================================
   Header
   ============================================================ */
.top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--paper) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.top-in {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 3.6rem;
  max-width: 74rem; margin-inline: auto; padding-inline: var(--gutter);
}
.mark {
  font-family: var(--mono); font-size: var(--s-1); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink); text-decoration: none;
  margin-right: auto; display: flex; align-items: center; gap: .6rem;
}
.mark::before {
  content: ""; width: .62rem; height: .62rem; background: var(--accent);
  /* Two filled quarters — the fractional mark. */
  clip-path: polygon(0 0, 50% 0, 50% 50%, 100% 50%, 100% 100%, 50% 100%, 50% 50%, 0 50%);
}
.top nav { display: flex; gap: 1.35rem; }
.top nav a {
  font-family: var(--mono); font-size: var(--s-1); color: var(--ink-2);
  text-decoration: none; letter-spacing: .01em;
}
.top nav a:hover { color: var(--accent); }
@media (max-width: 46rem) { .top nav { display: none; } }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block; font-family: var(--sans); font-size: var(--s0);
  font-weight: 500; line-height: 1.15; padding: .82em 1.4em;
  background: var(--accent); color: var(--on-accent);
  border: 1px solid var(--accent); border-radius: 2px;
  text-decoration: none; cursor: pointer;
  transition: filter 130ms ease, transform 130ms ease;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.small { padding: .55em 1em; font-size: var(--s-1); font-family: var(--mono); }

.row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(2.5rem, 5vw, 4rem); }
.hero h1 { max-width: 21ch; }
.kicker {
  font-family: var(--mono); font-size: var(--s-1); letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.4rem;
}

.status {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: var(--s-1); color: var(--ink-3);
}
.pip {
  width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint); flex: none;
}

/* ============================================================
   The week grid — the page's central motif
   ============================================================ */
.week { display: flex; flex-direction: column; gap: .6rem; }

.week-days {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem;
  font-family: var(--mono); font-size: .68rem; color: var(--ink-3);
  letter-spacing: .06em;
}

.week-blocks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  grid-auto-flow: column;
  gap: .3rem;
}

.blk {
  width: clamp(1.35rem, 4.4vw, 2.15rem);
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  background: transparent;
  transition: background-color 260ms ease, border-color 260ms ease;
}
.blk.on { background: var(--accent); border-color: var(--accent); }

.week-read {
  font-family: var(--mono); font-size: var(--s-1); color: var(--ink-2);
  display: flex; flex-direction: column; gap: .3rem;
  border-top: 1px solid var(--rule); padding-top: .55rem;
}
.week-row { display: flex; justify-content: space-between; gap: 1rem; }
.week-read b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ============================================================
   Cards / services
   ============================================================ */
/* Four across on one line. auto-fit can't be used here: the ledger's prose column
   is narrower than the page, so it wrapped these to 2×2. */
.trio { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
@media (max-width: 64rem) { .trio { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 32rem) { .trio { grid-template-columns: 1fr; } }
.svc { background: var(--paper-2); padding: clamp(1.15rem, 2.2vw, 1.55rem); display: flex; flex-direction: column; gap: .7rem; }
.svc-no { font-family: var(--mono); font-size: var(--s-1); color: var(--accent); letter-spacing: .06em; }
.svc p { color: var(--ink-2); }
.ticks { display: flex; flex-direction: column; gap: .45rem; margin-top: auto; padding-top: .5rem; }
.ticks li {
  font-family: var(--mono); font-size: var(--s-1); color: var(--ink-2);
  padding-left: 1.15rem; position: relative; line-height: 1.45;
}
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .48em;
  width: .5rem; height: 1px; background: var(--accent);
}

/* ============================================================
   Engagements — tier picker drives the week grid
   ============================================================ */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; }

.tier {
  text-align: left; cursor: pointer; font: inherit;
  background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 2px;
  padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: .3rem;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.tier:hover { border-color: var(--accent); }
.tier[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); box-shadow: var(--shadow); }
.tier-n { font-family: var(--mono); font-size: var(--s-1); color: var(--accent); letter-spacing: .05em; }
.tier-h { font-family: var(--serif); font-size: var(--s1); letter-spacing: -.01em; }
.tier-m { font-family: var(--mono); font-size: var(--s-1); color: var(--ink-3); }

.panel {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--rule); background: var(--paper-2);
  padding: clamp(1.35rem, 3.5vw, 2.1rem); align-items: start;
}
@media (max-width: 48rem) { .panel { grid-template-columns: 1fr; } }
.panel-body { display: flex; flex-direction: column; gap: .8rem; }
.panel-body p { color: var(--ink-2); }
.panel-note {
  font-family: var(--mono); font-size: var(--s-1); color: var(--ink-3);
  border-top: 1px solid var(--rule); padding-top: .7rem;
}

/* ============================================================
   Work
   ============================================================ */
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr)); gap: clamp(1.5rem, 3.5vw, 2.5rem); }
.case { display: flex; flex-direction: column; gap: .6rem; border-top: 1px solid var(--ink); padding-top: 1rem; }
.case-tag { font-family: var(--mono); font-size: var(--s-1); color: var(--ink-3); letter-spacing: .04em; }
.case p:last-child { color: var(--ink-2); }

.pull { margin: 0; background: var(--accent-tint); padding: clamp(1.5rem, 4vw, 2.4rem); border-left: 2px solid var(--accent); }
.pull p { font-family: var(--serif); font-size: var(--s2); line-height: 1.32; }
.pull figcaption { font-family: var(--mono); font-size: var(--s-1); color: var(--ink-2); margin-top: 1.1rem; }

/* ============================================================
   About / FAQ / contact
   ============================================================ */
.about { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 52rem) { .about { grid-template-columns: 1fr; } .portrait { max-width: 13rem; } }
.portrait {
  aspect-ratio: 4/5; border: 1px dashed var(--rule); background: var(--paper-2);
  display: grid; place-items: center; font-family: var(--mono); font-size: var(--s-1); color: var(--ink-3);
}
.about-copy { display: flex; flex-direction: column; gap: .9rem; }
.about-copy p { color: var(--ink-2); max-width: 60ch; }
.about-links { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; font-family: var(--mono); font-size: var(--s-1); margin-top: .4rem; }

.faq { display: flex; flex-direction: column; }
.faq > div { border-top: 1px solid var(--rule); padding-block: 1.35rem; display: grid; grid-template-columns: minmax(0, 22ch) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.5rem); }
.faq > div:first-child { border-top: 0; padding-top: 0; }
.faq dt { font-family: var(--serif); font-size: var(--s1); line-height: 1.25; letter-spacing: -.01em; }
.faq dd { color: var(--ink-2); max-width: 58ch; }
@media (max-width: 48rem) { .faq > div { grid-template-columns: 1fr; gap: .5rem; } }

.close { padding-block: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--rule); }
.close h2 { max-width: 24ch; }
.fine { font-family: var(--mono); font-size: var(--s-1); color: var(--ink-3); }

.foot {
  border-top: 1px solid var(--rule); padding-block: 1.6rem;
  font-family: var(--mono); font-size: var(--s-1); color: var(--ink-3);
}
.foot-in { display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; justify-content: space-between; max-width: 74rem; margin-inline: auto; padding-inline: var(--gutter); }
.foot ul { display: flex; gap: 1.35rem; }

/* ============================================================
   Utilities — these exist so index.html carries no inline
   style attributes, which lets the CSP stay at style-src 'self'.
   ============================================================ */
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.7rem; }
.muted { color: var(--ink-2); }
/* The two hero paragraphs read as one thought, so they sit closer together
   than the surrounding hero-copy gap. */
.hero-lede { display: flex; flex-direction: column; gap: .9rem; }
.about-h { font-size: var(--s2); }
.ledger-flush { padding-block: 0; }
