/* bradleake.com
   Palette: white paper, slate ink, one indigo accent (South Carolina indigo).
   Type: Source Serif 4 for headings, Public Sans for text and interface. */

:root {
  --bg: #fcfcfd;
  --surface: #f1f3f7;
  --ink: #1a2030;
  --muted: #566074;
  --rule: #dce0e8;
  --accent: #2b3f96;
  --accent-hover: #1f2f78;
  --accent-ink: #ffffff;
  --accent-soft: #e8ecf8;
  --img-border: #e2e6ee;
  --focus: #2b3f96;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1160px;
  --gutter: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10131c;
    --surface: #181c28;
    --ink: #e7e9f0;
    --muted: #a3aabb;
    --rule: #2a3040;
    --accent: #a9b8ff;
    --accent-hover: #c5cfff;
    --accent-ink: #10131c;
    --accent-soft: #1d2442;
    --img-border: #2a3040;
    --focus: #a9b8ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10131c;
  --surface: #181c28;
  --ink: #e7e9f0;
  --muted: #a3aabb;
  --rule: #2a3040;
  --accent: #a9b8ff;
  --accent-hover: #c5cfff;
  --accent-ink: #10131c;
  --accent-soft: #1d2442;
  --img-border: #2a3040;
  --focus: #a9b8ff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; z-index: 50; border-radius: 4px; }
.skip-link:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 40px; } }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--accent); }
.header-tools { display: flex; align-items: center; gap: 6px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a { display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; font-size: 0.97rem; border-radius: 4px; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.icon-btn {
  appearance: none; background: transparent; border: 1px solid transparent; color: var(--ink);
  width: 40px; height: 40px; border-radius: 6px; display: inline-grid; place-items: center; cursor: pointer; padding: 0;
}
.icon-btn:hover { border-color: var(--rule); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }

@media (max-width: 760px) {
  .js .menu-toggle { display: inline-grid; }
  .js .site-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--bg); border-bottom: 1px solid var(--rule); z-index: 20; }
  .js .site-nav.open { display: block; }
  .js .site-nav ul { flex-direction: column; padding: 8px var(--gutter) 16px; }
  .js .site-nav a { padding: 12px 0; font-size: 1.05rem; border-bottom: 1px solid var(--rule); }
  .js .site-nav li:last-child a { border-bottom: 0; }
  .js .site-nav a[aria-current="page"] { box-shadow: none; }
  .site-header { position: relative; }
  html:not(.js) .header-row { flex-wrap: wrap; padding: 10px 0; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; }
}

main { display: block; }
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--rule); }
@media (min-width: 720px) { .section { padding: 80px 0; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); }
.prose { max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }

/* Home hero */
.hero { padding: 56px 0 64px; }
@media (min-width: 720px) { .hero { padding: 96px 0 72px; } }
.hero + .section, .contact-band { border-top: 1px solid var(--rule); }
.hero-grid { display: grid; gap: 48px; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 72px; align-items: start; } }
.hero h1 { font-size: clamp(3rem, 1.6rem + 6vw, 5.5rem); line-height: 1; letter-spacing: -0.03em; }
.hero .lead { font-family: var(--serif); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); line-height: 1.35; margin: 24px 0 28px; max-width: 34ch; color: var(--ink); }
.hero .prose { color: var(--muted); }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Career line */
.career { margin: 0; padding: 0; list-style: none; position: relative; }
.career-title { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--muted); margin: 0 0 18px; letter-spacing: 0; }
.career li { position: relative; padding: 0 0 22px 26px; }
.career li::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: -8px; width: 2px; background: var(--rule); }
.career li:last-child::before { display: none; }
.career li::after { content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.career li:first-child::after { background: var(--accent); }
.career .years { display: block; font-size: 0.88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.career .role { display: block; font-weight: 600; line-height: 1.35; margin-top: 2px; }
.career .org { display: block; color: var(--muted); font-size: 0.95rem; line-height: 1.4; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 18px;
  border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: 600 0.98rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .meta { font-weight: 400; opacity: 0.8; font-size: 0.88rem; }

/* Areas index */
.areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 56px; }
@media (min-width: 820px) { .areas { grid-template-columns: 1fr 1fr; } }
.areas li { border-top: 1px solid var(--rule); position: relative; }
.areas a.area-link { display: block; padding: 22px 0 24px; text-decoration: none; color: var(--ink); }
.areas .area-title { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; line-height: 1.25; display: block; }
.areas a.area-link:hover .area-title { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.areas .area-short { display: block; color: var(--muted); margin-top: 6px; max-width: 52ch; }
.areas .area-count { display: block; margin-top: 10px; font-size: 0.9rem; color: var(--accent); font-weight: 600; }

/* Work cards */
.cards { display: grid; gap: 48px 40px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { position: relative; display: flex; flex-direction: column; }
.card .thumb { border: 1px solid var(--img-border); border-radius: 6px; overflow: hidden; background: var(--surface); aspect-ratio: 16 / 10; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.card h3 { margin-top: 20px; font-size: 1.35rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card:hover h3 a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }
.card:hover .thumb { border-color: var(--accent); }
.card .summary { margin: 10px 0 14px; color: var(--muted); }
.card .card-area { font-size: 0.9rem; color: var(--muted); margin: 14px 0 0; }
.card.wide { grid-column: 1 / -1; }
@media (min-width: 960px) {
  .card.wide { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 0 48px; align-items: center; }
  .card.wide .thumb { grid-row: 1 / span 5; }
  .card.wide h3 { margin-top: 0; font-size: 1.75rem; }
}

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 0.82rem; line-height: 1; padding: 6px 9px; border-radius: 4px; background: var(--surface); color: var(--ink); }
.data-flag { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); margin-top: 12px; }
.data-flag::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--muted); flex: none; }
.data-flag.public::before { background: var(--accent); }
.page-head .data-flag { font-size: 0.95rem; margin-top: 20px; align-items: baseline; }

.empty { padding: 28px; background: var(--surface); border-radius: 6px; color: var(--muted); max-width: 68ch; }

/* Page heads */
.page-head { padding: 56px 0 40px; }
@media (min-width: 720px) { .page-head { padding: 80px 0 48px; } }
.crumbs { font-size: 0.92rem; color: var(--muted); margin: 0 0 18px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.page-head .lead { font-family: var(--serif); font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); line-height: 1.45; margin: 20px 0 0; max-width: 46ch; }
.page-head .prose { margin-top: 24px; }

/* Product page */
.product-hero { margin: 0 0 8px; }
.product-hero a { display: block; border: 1px solid var(--img-border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.product-hero a:hover { border-color: var(--accent); }
.product-hero img { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.product-body { display: grid; gap: 48px; padding: 56px 0 24px; }
@media (min-width: 960px) { .product-body { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 72px; } }
.product-body h2 { font-size: 1.45rem; margin: 0 0 14px; }
.product-body .block + .block { margin-top: 44px; }
.features { margin: 0; padding: 0; list-style: none; }
.features li { position: relative; padding: 10px 0 10px 22px; border-top: 1px solid var(--rule); }
.features li:last-child { border-bottom: 1px solid var(--rule); }
.features li::before { content: ""; position: absolute; left: 2px; top: 1.15em; width: 8px; height: 2px; background: var(--accent); }
.aside-block + .aside-block { margin-top: 36px; }
.aside-block h2 { font-family: var(--sans); font-size: 0.98rem; font-weight: 600; letter-spacing: 0; margin: 0 0 10px; }
.data-note { background: var(--accent-soft); border-radius: 6px; padding: 18px 20px; }
.data-note p { margin: 0; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li + li { margin-top: 10px; }
.file-list a { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; color: var(--ink); }
.file-list a:hover { border-color: var(--accent); color: var(--accent); }
.file-list .size { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.area-links { list-style: none; margin: 0; padding: 0; }
.area-links li + li { margin-top: 6px; }

.gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.gallery a { display: block; border: 1px solid var(--img-border); border-radius: 6px; overflow: hidden; background: var(--surface); aspect-ratio: 16 / 10; }
.gallery a:hover { border-color: var(--accent); }
.gallery img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }

/* Lightbox */
dialog.lightbox { border: 0; padding: 0; margin: auto; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: transparent; color: #fff; }
dialog.lightbox::backdrop { background: rgba(12, 14, 22, 0.97); }
.lb-inner { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 16px 24px; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; min-height: 0; }
.lb-figure img { max-width: min(100%, 1600px); max-height: calc(100vh - 150px); width: auto; height: auto; border-radius: 4px; background: #fff; }
.lb-figure figcaption { margin-top: 12px; font-size: 0.92rem; color: #d9dcea; text-align: center; max-width: 70ch; }
.lb-btn { position: absolute; appearance: none; border: 1px solid rgba(255,255,255,0.25); background: rgba(20,24,36,0.7); color: #fff; width: 44px; height: 44px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.lb-btn:hover { border-color: #fff; }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 22px; left: 16px; font-size: 0.9rem; color: #d9dcea; margin: 0; }
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; } .lb-inner { padding-bottom: 72px; } }
body.lb-open { overflow: hidden; }

/* Published work */
.pub-group + .pub-group { margin-top: 64px; }
.pub-group > h2 { margin-bottom: 4px; }
.pub-group > .muted { margin: 0 0 20px; }
.pub-item { border-top: 1px solid var(--rule); padding: 24px 0; display: grid; gap: 8px; }
@media (min-width: 820px) { .pub-item { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 40px; } }
.pub-item h3 { font-size: 1.2rem; line-height: 1.3; }
.pub-item p { margin: 0; }
.pub-item .ext { font-size: 0.9rem; color: var(--muted); display: block; margin-top: 6px; font-family: var(--sans); font-weight: 400; word-break: break-all; }
.pub-item details { margin-top: 14px; }
.pub-item summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.sublinks { list-style: none; margin: 10px 0 0; padding: 0; columns: 2 220px; column-gap: 24px; }
.sublinks li { padding: 4px 0; break-inside: avoid; font-size: 0.95rem; }
.placeholder { display: inline-block; font-size: 0.85rem; font-weight: 600; padding: 4px 8px; border-radius: 4px; border: 1px dashed var(--muted); color: var(--muted); margin-bottom: 8px; }

/* About */
.about-grid { display: grid; gap: 48px; }
@media (min-width: 960px) { .about-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 72px; } }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 10px 0; border-top: 1px solid var(--rule); }
.plain-list li:last-child { border-bottom: 1px solid var(--rule); }
.plain-list .sub { display: block; color: var(--muted); font-size: 0.95rem; }

/* Contact band and footer */
.contact-band .wrap { display: grid; gap: 20px; }
@media (min-width: 820px) { .contact-band .wrap { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: center; gap: 72px; } }
.contact-band p { margin: 0; max-width: 56ch; }
.site-footer { border-top: 1px solid var(--rule); padding: 48px 0 56px; font-size: 0.95rem; color: var(--muted); }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); gap: 48px; } }
.site-footer h2 { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--ink); margin: 0 0 10px; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .name { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--ink); margin: 0 0 6px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer, .actions, .contact-band, .menu-toggle, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
