/* "Atlas" Theme — topographic survey sheet.
 *
 * The site's other themes are eras of the web; Blueprint is an engineering
 * drawing. This one is the other document type this work actually produces: a
 * map. Most of the index is spatial — crash locations, brownfield sites, reactor
 * siting, interconnection queues, border crossings — and a survey sheet is how
 * that gets published on paper.
 *
 * Costs nothing to ship: Inter and JetBrains Mono are already in the base font
 * request, and the contour lines and graticule are layered CSS gradients — there
 * is no map image anywhere.
 *
 * Contrast: ink on paper is 11.9:1, and --sea (5.7:1), --relief (5.9:1) and
 * --label (5.4:1) all clear AA at body size. --contour and --graticule draw
 * terrain only and are never used for text.
 *
 * Every rule is scoped under `body.theme-atlas`.
 */

body.theme-atlas {
  --paper:  #F4F1E7; /* survey-sheet stock — the page                  */
  --ink:    #22302A; /* slate green — body text, the whole voice       */
  --sea:    #1F6485; /* water blue — links                             */
  --relief: #93481A; /* terracotta — active states, spot heights       */
  --label:  #55635B; /* secondary text & grid references (5.4:1)       */
  --rule:   rgba(34, 48, 42, 0.22);  /* hairlines, borders             */
  --contour: rgba(150, 122, 82, 0.22); /* terrain lines — never text   */
  --graticule: rgba(34, 48, 42, 0.07); /* the survey grid              */
  --panel:  #FBF9F2; /* panel fills, a shade up from the sheet         */

  color: var(--ink);
  background-color: var(--paper);
  /* Two contour "landforms" over a 96px graticule. All gradients, no asset. */
  background-image:
    repeating-radial-gradient(ellipse 62% 48% at 16% 20%, transparent 0 27px, var(--contour) 27px 28px),
    repeating-radial-gradient(ellipse 52% 64% at 84% 76%, transparent 0 31px, var(--contour) 31px 32px),
    repeating-linear-gradient(to right,  var(--graticule) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(to bottom, var(--graticule) 0 1px, transparent 1px 96px);
  background-attachment: fixed;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  margin: 0;
  padding: 0;
}

body:not(.theme-atlas) .atlas-only { display: none !important; }

/* A link the page is deliberately withholding — a paused demo. Unhide by deleting
   the `hidden` attribute in index.html. Stated explicitly because a theme rule on
   `td.links a` would otherwise out-specify the UA's [hidden] default. */
body.theme-atlas [hidden] { display: none !important; }

body.theme-atlas .container {
  width: 92%;
  max-width: 1120px;
  margin: 32px auto;
  padding: 0 0 40px;
  background: transparent;
  border: none;
}

/* GeoCities furniture belongs to Retro; every other theme hides it. */
body.theme-atlas .ticker,
body.theme-atlas .retro-img,
body.theme-atlas .hit-counter { display: none !important; }

/* ----------------------------------------------------------------- typography */
body.theme-atlas h1,
body.theme-atlas h2,
body.theme-atlas h3 {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
}
body.theme-atlas h1 {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.16;
  margin: 0 0 6px;
}
/* Spot height: the triangle a survey sheet puts beside a named summit. */
body.theme-atlas h2 {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 9px;
}
body.theme-atlas h2::before {
  content: "\25B2";
  color: var(--relief);
  font-size: 0.62em;
}
body.theme-atlas h3 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sea);
  margin: 0 0 12px;
}
body.theme-atlas hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 32px 0;
}
body.theme-atlas code {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(34, 48, 42, 0.06);
  border: 1px solid var(--rule);
  padding: 1px 5px;
}
body.theme-atlas .kicker {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
  margin: 0 0 4px;
}
body.theme-atlas .disclaimer {
  font-size: 0.84rem;
  color: var(--label);
  border-left: 2px solid var(--rule);
  padding-left: 12px;
  margin-top: 16px;
  max-width: none;
}
body.theme-atlas .center { text-align: center; }

/* ---------------------------------------------------------------------- links */
body.theme-atlas a {
  color: var(--sea);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
body.theme-atlas a:hover { color: var(--relief); }
body.theme-atlas a:visited { color: #6B4A82; }
body.theme-atlas a:focus-visible {
  outline: 2px solid var(--relief);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------- sections */
body.theme-atlas .projects-section {
  border: 1px solid var(--rule) !important;
  background: var(--panel);
  padding: 18px 20px;
  margin-bottom: 26px;
}
body.theme-atlas .projects-section p,
body.theme-atlas .projects-section ul { max-width: 74ch; }

/* ---------------------------------------------------------------------- lists */
body.theme-atlas ul { list-style: none; padding: 0; }
body.theme-atlas ul li {
  padding: 8px 0 8px 18px;
  position: relative;
  line-height: 1.55;
  border-bottom: 1px solid var(--rule);
}
body.theme-atlas ul li:last-child { border-bottom: none; }
body.theme-atlas ul li::before {
  content: "\25CF";                   /* settlement dot */
  position: absolute;
  left: 1px;
  top: 0.42em;
  font-size: 0.5em;
  color: var(--relief);
}
body.theme-atlas ul li i {
  color: var(--label);
  font-style: normal;
  font-size: 0.9em;
}
body.theme-atlas .industry-note {
  display: block;
  margin-top: 6px;
  padding-left: 14px;
  border-left: 2px solid var(--rule);
  font-size: 0.92em;
  color: var(--label);
  line-height: 1.45;
}
body.theme-atlas .note-label { font-weight: 600; color: var(--relief); }

/* ---------------------------------------------------------- identity & socials */
body.theme-atlas .hero { margin-bottom: 30px; }
body.theme-atlas .identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
body.theme-atlas .headshot {
  border: 1px solid var(--rule);
  border-radius: 50%;
  filter: sepia(0.22) saturate(0.9);
}
/* No measure cap on the intro: 72ch wrapped the bio to six lines and broke the
   one-sentence disclaimer across two. The container already caps at 1120px. */
body.theme-atlas .hero-main > p { max-width: none; }
body.theme-atlas .social-links { margin: 14px 0 0; }
body.theme-atlas .social-links a {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  border: 1px solid var(--rule);
  padding: 5px 11px;
  margin-right: 8px;
  display: inline-block;
  text-decoration: none;
  background: var(--panel);
}
body.theme-atlas .social-links a:hover {
  border-color: var(--relief);
  color: var(--relief);
}

/* ----------------------------------------------------------------------- tabs */
body.theme-atlas .tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
body.theme-atlas .tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--label);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 16px;
  cursor: pointer;
  margin-bottom: -2px;
}
body.theme-atlas .tab:hover { color: var(--ink); }
body.theme-atlas .tab[aria-selected="true"] {
  color: var(--relief);
  border-bottom-color: var(--relief);
}
body.theme-atlas .tab:focus-visible {
  outline: 2px solid var(--relief);
  outline-offset: -2px;
}

/* ---------------------------------------------------------- filter bar as a key */
body.theme-atlas .filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
body.theme-atlas .filter-btn {
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--label);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 13px;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
/* Legend swatch — the key's colour chip beside each class of feature. */
body.theme-atlas .filter-btn::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid var(--label);
  background: transparent;
  flex-shrink: 0;
}
body.theme-atlas .filter-btn:hover { color: var(--ink); border-color: var(--sea); }
body.theme-atlas .filter-btn.active {
  color: var(--paper);
  background: var(--sea);
  border-color: var(--sea);
}
body.theme-atlas .filter-btn.active::before {
  background: var(--paper);
  border-color: var(--paper);
}
body.theme-atlas .filter-btn:focus-visible {
  outline: 2px solid var(--relief);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- featured panels */
body.theme-atlas .feat-accordion { display: grid; gap: 12px; }
body.theme-atlas .feat-item {
  border: 1px solid var(--rule);
  background: var(--panel);
}
body.theme-atlas .feat-item[open] { border-color: var(--sea); }
body.theme-atlas .feat-item summary {
  cursor: pointer;
  padding: 14px 16px;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
body.theme-atlas .feat-item summary::-webkit-details-marker { display: none; }
body.theme-atlas .feat-item summary::after {
  content: "+";
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color: var(--sea);
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}
body.theme-atlas .feat-item[open] summary::after { content: "\2212"; }
body.theme-atlas .feat-item summary:focus-visible {
  outline: 2px solid var(--relief);
  outline-offset: -2px;
}
body.theme-atlas .feat-heading { display: block; }
body.theme-atlas .feat-name {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
}
body.theme-atlas .feat-q {
  display: block;
  color: var(--label);
  font-size: 0.9rem;
  margin-top: 4px;
  max-width: 68ch;
}
body.theme-atlas .feat-panel { padding: 0 16px 16px; }
body.theme-atlas .feat-shot { display: block; }
body.theme-atlas .feat-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
body.theme-atlas .feat-links { margin: 12px 0 0; font-size: 0.88rem; }

/* ------------------------------------------------------------ projects listing */
body.theme-atlas table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--rule);
  background: var(--panel);
}
body.theme-atlas th {
  text-align: left;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--label);
  font-weight: 500;
  padding: 9px 12px;
  border-bottom: 2px solid var(--rule);
  background: rgba(34, 48, 42, 0.04);
}
body.theme-atlas td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
body.theme-atlas tr.project-item:hover td { background: rgba(31, 100, 133, 0.07); }
body.theme-atlas .proj-thumb {
  display: inline-block;
  vertical-align: middle;
  width: 72px;
  height: 50px;
  margin-right: 12px;
  border: 1px solid var(--rule);
  overflow: hidden;
  flex-shrink: 0;
}
body.theme-atlas .proj-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Repo-only rows carry no screenshot: draw the initial into the same footprint. */
body.theme-atlas .proj-thumb[data-initial]::before {
  content: attr(data-initial);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color: var(--sea);
  background: rgba(31, 100, 133, 0.09);
}
body.theme-atlas .proj-text { display: inline-block; vertical-align: middle; }
body.theme-atlas .proj-name { display: block; font-weight: 600; color: var(--ink); }
body.theme-atlas .proj-name a { color: var(--ink); text-decoration-color: var(--rule); }
body.theme-atlas .proj-name a:hover { color: var(--sea); }
body.theme-atlas .proj-desc {
  display: block;
  color: var(--label);
  font-size: 0.87rem;
  max-width: 62ch;
  margin-top: 2px;
}
body.theme-atlas td.links { font-size: 0.86rem; white-space: nowrap; }
body.theme-atlas td:nth-child(3) {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--label);
}
body.theme-atlas .blink { color: var(--relief); font-weight: 600; }
body.theme-atlas .table-note {
  font-size: 0.82rem;
  color: var(--label);
  margin-top: 12px;
}

/* ----------------------------------------------------------------- accordions */
body.theme-atlas details.accordion-section {
  border: 1px solid var(--rule);
  background: var(--panel);
  margin-bottom: 14px;
}
body.theme-atlas details.accordion-section summary {
  cursor: pointer;
  padding: 12px 16px;
  list-style: none;
}
body.theme-atlas details.accordion-section summary::-webkit-details-marker { display: none; }
body.theme-atlas details.accordion-section summary h2 {
  display: inline-flex;
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-size: 1rem;
}
body.theme-atlas details.accordion-section summary::after {
  content: "+";
  float: right;
  color: var(--sea);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
body.theme-atlas details[open].accordion-section summary::after { content: "\2212"; }
body.theme-atlas details.accordion-section summary:focus-visible {
  outline: 2px solid var(--relief);
  outline-offset: -2px;
}

/* ------------------------------------------------------------------- switcher */
body.theme-atlas #theme-toggle {
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  min-height: 44px;
}
body.theme-atlas #theme-toggle:hover { border-color: var(--relief); color: var(--relief); }
body.theme-atlas #theme-toggle:focus-visible {
  outline: 2px solid var(--relief);
  outline-offset: 2px;
}
body.theme-atlas .theme-menu {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 4px;
  box-shadow: 0 6px 18px rgba(34, 48, 42, 0.16);
}
body.theme-atlas .theme-menu[hidden] { display: none; }
body.theme-atlas .theme-menu-item {
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  text-align: left;
  width: 100%;
  padding: 8px 10px;
  cursor: pointer;
}
body.theme-atlas .theme-menu-item:hover,
body.theme-atlas .theme-menu-item:focus-visible {
  background: rgba(31, 100, 133, 0.12);
  color: var(--sea);
  outline: none;
}

/* ---------------------------------------------------------------- case studies */
body.theme-atlas .cs-kicker { margin: 8px 0 4px; }
body.theme-atlas .cs-tagline {
  font-size: 1.08rem;
  color: var(--label);
  max-width: 62ch;
  margin: 4px 0 18px;
}
body.theme-atlas .cs-question {
  font-size: 1.1rem;
  color: var(--ink);
  border-left: 3px solid var(--relief);
  padding-left: 14px;
  max-width: 64ch;
}
/* Map key: the sheet's marginal table of what each symbol means. */
body.theme-atlas .cs-glance {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 14px 16px;
  margin: 0 0 22px;
}
body.theme-atlas .cs-glance > div { display: contents; }
body.theme-atlas .cs-glance dt {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--label);
  margin: 0;
}
body.theme-atlas .cs-glance dd { margin: 0; color: var(--ink); font-size: 0.92rem; }
body.theme-atlas .cs-shots { margin: 26px 0; }
body.theme-atlas .cs-shots-title { font-size: 1.05rem; }
body.theme-atlas .cs-shots-note { color: var(--label); font-size: 0.85rem; }
body.theme-atlas .cs-shot-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
body.theme-atlas .cs-shot { margin: 0 0 22px; }
body.theme-atlas .cs-shot figcaption {
  color: var(--label);
  font-size: 0.86rem;
  margin-top: 8px;
  max-width: 70ch;
}
body.theme-atlas .shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
body.theme-atlas .shot-frame.desktop { flex: 1 1 460px; }
body.theme-atlas .shot-frame.mobile  { width: 208px; flex: 0 0 auto; }
body.theme-atlas .cs-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  margin-top: 26px;
}
body.theme-atlas .cs-nav-link {
  text-decoration: none;
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 10px 14px;
  flex: 1 1 240px;
}
body.theme-atlas .cs-nav-link:hover { border-color: var(--relief); }
body.theme-atlas .cs-nav-next { text-align: right; }
body.theme-atlas .cs-nav-dir {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--label);
}
body.theme-atlas .cs-nav-title { display: block; color: var(--ink); margin-top: 3px; }
body.theme-atlas .cs-related { color: var(--label); font-size: 0.9rem; }

/* --------------------------------------------------------------------- footer */
body.theme-atlas .site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 40px;
  padding-top: 18px;
}
body.theme-atlas .footer-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.76rem;
  color: var(--label);
}
body.theme-atlas .footer-links a { margin-right: 14px; }
body.theme-atlas .footer-thanks { color: var(--label); font-size: 0.86rem; }
body.theme-atlas .colophon { color: var(--label); font-size: 0.8rem; }

/* --------------------------------------------------------- tablet and phone */
@media screen and (max-width: 1024px) {
  body.theme-atlas .shot-frame.desktop { flex-basis: 100%; }
}

@media screen and (max-width: 768px) {
  body.theme-atlas { font-size: 15px; }
  body.theme-atlas .container { width: 94%; margin: 20px auto; }
  body.theme-atlas h1 { font-size: 1.62rem; }
  body.theme-atlas .identity { gap: 12px; }
  body.theme-atlas .footer-meta { flex-direction: column; }
  body.theme-atlas .cs-nav-next { text-align: left; }
  /* Map key collapses to one column so long values stop being squeezed. */
  body.theme-atlas .cs-glance { grid-template-columns: 1fr; gap: 2px 0; }
  body.theme-atlas .cs-glance dd { margin-bottom: 10px; }
  /* The table becomes a stack of cards: a 3-column grid cannot hold a thumbnail,
     a description and a link list inside 360px without truncating something. */
  body.theme-atlas table,
  body.theme-atlas tbody,
  body.theme-atlas tr,
  body.theme-atlas td { display: block; width: 100%; }
  body.theme-atlas thead { display: none; }
  body.theme-atlas tr.project-item {
    border: 1px solid var(--rule);
    margin-bottom: 12px;
    padding: 12px;
  }
  body.theme-atlas td { border-bottom: none; padding: 3px 0; }
  body.theme-atlas td.links { white-space: normal; }
  body.theme-atlas .proj-desc { max-width: none; }
}

@media screen and (max-width: 560px) {
  body.theme-atlas .shot-frame.mobile { width: 100%; }
  body.theme-atlas .social-links a { margin-bottom: 8px; }
}

/* Contours are viewport-anchored, so `fixed` is doing visible work on a big
   screen. It is also the expensive case: iOS Safari repaints a fixed background
   on every scroll frame, and this site's open Core Web Vitals item is INP. Drop
   it on phones and wherever motion is unwelcome; the pattern still reads. */
@media screen and (max-width: 768px), (prefers-reduced-motion: reduce) {
  body.theme-atlas { background-attachment: scroll; }
}
