/* =====================================================================
   davegeissberger.com — site styles
   Layout concept: calm editorial pages on a cool "bay fog" paper, with a
   topographic contour motif (terrain = land + climbing) in hero bands.
   ---------------------------------------------------------------------
   TO RE-THEME THE WHOLE SITE: change only the tokens in this first block
   (and the matching dark-mode block below). Fonts are loaded in each
   page's <head> from Google Fonts; swap the family names here too.
   ===================================================================== */
:root {
  --paper:   #f4f6f4;   /* page background */
  --surface: #ffffff;   /* cards, panels */
  --ink:     #17232b;   /* main text */
  --muted:   #52616a;   /* secondary text */
  --line:    #d6dcd8;   /* rules, borders */
  --bay:     #24566b;   /* primary brand color (links, buttons) */
  --bay-ink: #ffffff;   /* text on --bay */
  --gold:    #9a6a1c;   /* accent: California golden hills */
  --band:    #e8eeec;   /* tinted section background */
  --contour: rgba(36, 86, 107, .10);
  --draft:   #b4531f;   /* "DRAFT" markers (remove when content is final) */
  --foot-bg: #17232b;   /* footer background */
  --foot-ink:#eef2f0;   /* footer text */

  --display: "Spectral", Georgia, "Times New Roman", serif;
  --body:    "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --max: 1120px;
  --text: 68ch;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f161b; --surface: #16212a; --ink: #e6ece9; --muted: #9eacb3;
    --line: #2a3943; --bay: #84b8cc; --bay-ink: #0f161b; --gold: #d8a64e;
    --band: #13202a; --contour: rgba(132, 184, 204, .10); --draft: #ec8a55;
    --foot-bg: #0a0f13; --foot-ink: #dfe6e3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f161b; --surface: #16212a; --ink: #e6ece9; --muted: #9eacb3;
  --line: #2a3943; --bay: #84b8cc; --bay-ink: #0f161b; --gold: #d8a64e;
  --band: #13202a; --contour: rgba(132, 184, 204, .10); --draft: #ec8a55;
  --foot-bg: #0a0f13; --foot-ink: #dfe6e3;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.62 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--bay); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.28rem; font-weight: 600; }
p { margin: 0; }
.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.prose { max-width: var(--text); display: grid; gap: 1rem; }
.prose h2 { margin-top: 1.4rem; }
.prose h3 { margin-top: .6rem; }
.prose ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.eyebrow { font: 600 .78rem/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ---------- preview + draft markers (delete for launch) ---------- */
.preview-bar { background: var(--foot-bg); color: var(--foot-ink); font-size: .85rem; }
.preview-bar .wrap { padding-block: .45rem; }
.draft {
  display: inline-block; font: 600 .66rem/1 var(--mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--draft); border: 1px solid var(--draft);
  border-radius: 3px; padding: .22rem .35rem; vertical-align: middle; margin-right: .35rem;
}
.ph { outline: 1.5px dashed var(--draft); outline-offset: 6px; border-radius: 2px; }

/* ---------- header ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .8rem; }
.brand { text-decoration: none; color: var(--ink); display: grid; line-height: 1.1; }
.brand b { font: 600 1.2rem/1.1 var(--display); }
.brand span { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: 1.3rem; align-items: center; font-size: .95rem; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--bay); text-decoration: underline; }
.nav .btn { color: var(--bay-ink); text-decoration: none; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; font-weight: 600; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 0; top: calc(100% + .5rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; display: grid; min-width: 15rem; box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.menu nav a { padding: .55rem .6rem; color: var(--ink); text-decoration: none; border-radius: 4px; }
.menu nav a:hover { background: var(--band); }
@media (max-width: 900px) { .nav { display: none; } .menu { display: block; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; font: 600 .98rem/1 var(--body);
  background: var(--bay); color: var(--bay-ink); border: 1px solid var(--bay);
  padding: .8rem 1.15rem; border-radius: var(--radius); text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--bay); }
.btn.sm { padding: .55rem .85rem; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- sections ---------- */
section { padding-block: clamp(3rem, 7vw, 5.5rem); }
section.tight { padding-block: 2.5rem; }
.band { background: var(--band); }
.section-head { display: grid; gap: .7rem; margin-bottom: 2rem; max-width: 62ch; }
.contour {
  background:
    repeating-radial-gradient(ellipse 70% 55% at 88% 18%, transparent 0 26px, var(--contour) 26px 27px),
    var(--paper);
}

/* ---------- hero ---------- */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-copy { display: grid; gap: 1.3rem; min-width: 0; }
.hero-meta { font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.portrait { background: #0b0f12; border-radius: var(--radius); overflow: hidden; max-width: 380px; justify-self: end; width: 100%; }
.portrait figcaption { color: #cfd6da; background: #0b0f12; font-size: .82rem; padding: .7rem .9rem; }
.page-hero { padding-block: clamp(2.6rem, 6vw, 4.5rem); }
.page-hero .wrap { display: grid; gap: 1rem; }
@media (max-width: 760px) { .hero .wrap { grid-template-columns: 1fr; } .portrait { justify-self: start; max-width: 300px; } }

/* ---------- proof figures ---------- */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-block: 1px solid var(--line); }
.figures div { padding: 1.4rem 1.2rem; display: grid; gap: .3rem; align-content: start; border-left: 1px solid var(--line); }
.figures div:first-child { border-left: 0; padding-left: 0; }
.figures b { font: 500 clamp(1.7rem, 3vw, 2.3rem)/1 var(--mono); color: var(--bay); }
.figures span { font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } .figures div:nth-child(3) { border-left: 0; padding-left: 0; } .figures div { padding-left: 1rem; } }

/* ---------- four answers ---------- */
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.answers > div { background: var(--surface); padding: 1.6rem; display: grid; gap: .6rem; align-content: start; }
.answers h3 { font-size: 1.1rem; }
.answers .not { grid-column: 1 / -1; }
@media (max-width: 760px) { .answers { grid-template-columns: 1fr; } }

/* ---------- cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: .7rem; align-content: start; min-width: 0; }
.card.link { text-decoration: none; color: var(--ink); transition: border-color .15s; }
.card.link:hover { border-color: var(--bay); }
.card .q { font: italic 500 1.12rem/1.35 var(--display); color: var(--muted); }
.card .more { color: var(--bay); font-weight: 600; font-size: .95rem; }
.card img { border-radius: 4px; aspect-ratio: 16/10; object-fit: cover; width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.chips li { border: 1px solid var(--line); background: var(--surface); padding: .4rem .7rem; border-radius: 99px; font-size: .9rem; }
.chips li .mono { color: var(--muted); font-size: .8rem; margin-left: .3rem; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 2.4rem; }
.principles div { display: grid; gap: .4rem; border-top: 2px solid var(--gold); padding-top: .9rem; }
@media (max-width: 700px) { .principles { grid-template-columns: 1fr; } }

/* ---------- stories ---------- */
.story { display: grid; gap: .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.story dl { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .5rem 1rem; margin: 0; }
.story dt { font: 600 .78rem/1.6 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.story dd { margin: 0; }
@media (max-width: 560px) { .story dl { grid-template-columns: 1fr; } .story dd { margin-bottom: .4rem; } }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0; border-top: 1px solid var(--line); max-width: 78ch; }
.faq article { padding-block: 1.3rem; border-bottom: 1px solid var(--line); display: grid; gap: .55rem; }
.faq h3 { font-size: 1.16rem; }

/* ---------- not-right box ---------- */
.notfit { border: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--surface); padding: 1.5rem 1.6rem; border-radius: var(--radius); display: grid; gap: .7rem; max-width: 78ch; }
.notfit ul { margin: 0; padding-left: 1.2rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 .76rem/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--band); }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 1.4rem 1.4rem; position: relative; display: grid; gap: .25rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--bay); }
.timeline .mono { color: var(--muted); font-size: .85rem; }

/* ---------- photos ---------- */
.photo { border-radius: var(--radius); overflow: hidden; background: var(--band); }
.photo img { width: 100%; object-fit: cover; }
.photo figcaption { font-size: .82rem; color: var(--muted); padding: .55rem .2rem 0; background: var(--paper); }
.wide-photo img { aspect-ratio: 21/8; }
@media (max-width: 640px) { .wide-photo img { aspect-ratio: 16/9; } }
.photo-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }

/* ---------- testimonial ---------- */
.testimonial { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.testimonial blockquote { margin: 0; font: 500 1.15rem/1.5 var(--display); }
.testimonial .who { font-size: .9rem; color: var(--muted); }
.reply { border-left: 3px solid var(--bay); padding-left: 1rem; display: grid; gap: .3rem; }
.reply b { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--bay); }

/* ---------- CTA band ---------- */
.cta { background: var(--bay); color: var(--bay-ink); }
.cta .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem; }
.cta h2 { color: var(--bay-ink); }
.cta p { opacity: .9; max-width: 56ch; }
.cta .btn { background: var(--bay-ink); color: var(--bay); border-color: var(--bay-ink); }

/* ---------- forms ---------- */
form.contact { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
form.contact label { display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; }
form.contact input, form.contact select, form.contact textarea {
  font: 400 1rem/1.4 var(--body); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 4px; padding: .7rem .75rem; width: 100%;
}
.form-note { font-size: .9rem; color: var(--muted); }

/* ---------- article ---------- */
.article-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .9rem; color: var(--muted); }
.callout { background: var(--band); border-radius: var(--radius); padding: 1.2rem 1.4rem; display: grid; gap: .5rem; }

/* ---------- breadcrumb ---------- */
.crumbs { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem; }
.crumbs a { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--foot-bg); color: var(--foot-ink); font-size: .92rem; }
.site-footer .wrap { padding-block: 3rem 2rem; display: grid; gap: 2rem; }
.site-footer a { color: var(--foot-ink); }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.foot-grid h4 { font: 600 .76rem/1.3 var(--body); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 .7rem; opacity: .7; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.legal { border-top: 1px solid rgba(255,255,255,.15); padding-top: 1.2rem; opacity: .75; font-size: .82rem; display: grid; gap: .4rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- v2 additions ---------- */
.band .callout { background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 821px) { .band .photo-row { position: sticky; top: 6rem; } }

/* ---------- transactions table ---------- */
.tx-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tx-table thead th { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--hh, 64px)); z-index: 2; background: var(--band); border-bottom: 1px solid var(--line); }
.tx-table thead th:first-child { border-top-left-radius: var(--radius); }
.tx-table thead th:last-child { border-top-right-radius: var(--radius); }
.tx-table td { vertical-align: middle; border-bottom: 1px solid var(--line); }
.tx-table tbody tr:last-child td { border-bottom: 0; }
.tx-photo { width: 176px; }
.tx-photo img { width: 160px; height: 104px; object-fit: cover; border-radius: 4px; background: var(--band); }
.tx-table td.num, .tx-table th.num { text-align: right; white-space: nowrap; }
.tx-table td:last-child { white-space: nowrap; }
@media (max-width: 640px) {
  .tx-table th, .tx-table td { padding: .55rem .5rem; font-size: .85rem; }
  .tx-photo { width: 84px; }
  .tx-photo img { width: 76px; height: 54px; }
  .tx-table th { font-size: .66rem; letter-spacing: .04em; }
}

/* ---------- v5: real photos ---------- */
.portrait { background: transparent; }
.photo-stack { display: grid; gap: 1rem; align-content: start; }
.photo-stack .photo:last-child { max-width: 75%; justify-self: end; }
@media (min-width: 821px) { .band .photo-stack { position: sticky; top: 6rem; } }

/* ---------- v6: tighter vertical rhythm (removes dead space) ---------- */
section { padding-block: clamp(2rem, 4vw, 3.25rem); }
section.tight { padding-block: clamp(1.25rem, 2.5vw, 1.75rem); }
.page-hero { padding-block: clamp(1.5rem, 3.5vw, 2.5rem); }
.hero { padding-block: clamp(2rem, 4vw, 3rem); }
/* two neighboring sections on the same background share one gap instead of two */
section:not(.band):not(.cta) + section:not(.band):not(.cta) { padding-top: 0; }
.band + .band { padding-top: 0; }
.section-head { margin-bottom: 1.5rem; }
.faq article:last-child { border-bottom: 0; }
