/* The chart is a staff chart on paper: black ink and milsymbol's friendly blue. Below it, a plain portfolio. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
:root { --ink: #1b1b1b; --muted: #5a5a57; --rule: #d9d6cd; --paper: #f6f5f1; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font: 16px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif; }
main:focus { outline: none; }
a { color: inherit; }
img, video, svg { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.drawing { display: block; line-height: 0; }
.drawing svg { width: 100%; height: auto; }
.loading, .unavailable { max-width: 40rem; margin: 20vh auto; padding: 0 1.25rem; }
.unavailable button { padding: .5rem 1rem; border: 1px solid currentColor; background: none; }

.masthead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem 1.25rem; padding: 1.5rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid var(--ink); }
.masthead h1 { margin: 0; font-size: 2rem; line-height: 1.1; }
.headline { margin: .3rem 0 0; font-size: 1.125rem; }
.avatar { display: block; width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--ink); }
/* Without an avatar, the name takes its column. */
.masthead > div:first-child { grid-column: 1 / 3; }
.links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; overflow-wrap: anywhere; }
.page { padding: 0 clamp(1rem, 3vw, 2.5rem) 4rem; }

/* Order of battle */
.orbat { border-bottom: 1px solid var(--ink); }
.orbat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1rem 0 .5rem; }
.orbat-head h2 { margin: 0; font-size: 1rem; }
.orbat-head p { margin: 0; font-size: .875rem; color: var(--muted); }
.unit { display: inline-flex; max-width: 100%; flex-direction: column; align-items: center; gap: 4px; padding: 2px 4px; text-decoration: none; font-size: .75rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.unit span { min-width: 0; max-width: 100%; }
.unit .drawing { width: 44px; }
.unit-root .drawing { width: 56px; }
.unit-root span { font-weight: 700; font-size: .875rem; }
.unit:hover span { text-decoration: underline; }
.unit[aria-current] span { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
/* The root, a bus line, a row of top-level units, and subprojects stacked under their parent. */
.orbat-chart { display: flex; flex-direction: column; align-items: center; padding: 1rem 0 2rem; }
.orbat-chart ul { list-style: none; margin: 0; padding: 0; }
.orbat-units { position: relative; display: flex; width: 100%; padding-top: 20px !important; }
.orbat-units::before { content: ""; position: absolute; top: 0; left: 50%; height: 20px; border-left: 1px solid var(--ink); }
.orbat-units > li { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 20px 4px 0; }
.orbat-units > li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 1px solid var(--ink); }
.orbat-units > li:first-child::before { left: 50%; }
.orbat-units > li:last-child::before { right: 50%; }
.orbat-units > li:only-child::before { display: none; }
.orbat-units > li::after { content: ""; position: absolute; top: 0; left: 50%; height: 20px; border-left: 1px solid var(--ink); }
.orbat-units li ul { display: flex; width: 100%; flex-direction: column; align-items: center; }
.orbat-units li li { position: relative; display: flex; max-width: 100%; flex-direction: column; align-items: center; padding-top: 18px; }
.orbat-units li li::before { content: ""; position: absolute; top: 0; left: 50%; height: 18px; border-left: 1px solid var(--ink); }

/* Portfolio display below the chart */
/* The homepage stays at a reading width; selected projects use the desktop width. */
.display { max-width: 67rem; margin: 0 auto; padding-top: 1.5rem; }
.display:has(.project) { max-width: none; }
.display h2:focus { outline: none; }
.intro h2 { margin: 0 0 .5rem; font-size: 1.125rem; }
.intro p { margin: 0; }
.projects { margin-top: 2rem; }
.projects > h2 { margin: 0 0 .5rem; font-size: 1.125rem; }
.rows, .rows ul { list-style: none; margin: 0; padding: 0; }
.rows ul { margin-left: 30px; padding-left: 1rem; border-left: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 1rem; align-items: start; padding: .9rem 0; border-top: 1px solid var(--rule); }
.row .drawing { width: 44px; }
.row h3, .row h4 { margin: 0; font-size: 1.0625rem; }
.row h3 a, .row h4 a { text-decoration: none; }
.row h3 a:hover, .row h4 a:hover { text-decoration: underline; }
.row p { margin: .2rem 0 0; }
.row-meta { font-size: .8125rem; color: var(--muted); }

.project { overflow-wrap: anywhere; }
.project-layout { display: grid; gap: 1.5rem; }
.project-sidebar { min-width: 0; }
.project-body { min-width: 0; display: grid; gap: 2rem; align-content: start; align-items: start; }
.project-body:empty { display: none; }
.back { margin: 0 0 1rem; font-size: .875rem; }
.project-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 1rem; align-items: start; }
.project-head h2 { margin: 0; font-size: 2rem; line-height: 1.1; }
.lead { margin: .5rem 0 0; font-size: 1rem; line-height: 1.5; }
.project-symbol { width: 64px; }
.facts { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: .3rem .75rem; margin: 1.25rem 0 0; font-size: .875rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.project-sidebar > .links { margin-top: 1.25rem; font-size: .875rem; }
.project figure { margin: 0 0 1rem; }
.project figure img, .project figure video { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.project figcaption { margin-top: .4rem; font-size: .8125rem; color: var(--muted); }
.section-children { grid-column: 1 / -1; padding-top: 1rem; border-top: 1px solid var(--rule); }
.section-children > h3 { margin: 0 0 .75rem; font-size: 1.125rem; }
.story { max-width: 72ch; line-height: 1.6; }
.story h3 { margin: 1.5rem 0 .4rem; font-size: 1.125rem; }
.story h4 { margin: 1.5rem 0 .4rem; font-size: 1.0625rem; }
.story h5, .story h6 { margin: 1.25rem 0 .4rem; font-size: .9375rem; }
.story > :first-child { margin-top: 0; }
.story p { margin: .5rem 0 1rem; }
.story pre { overflow-x: auto; }
.project-media { min-width: 0; }
.project-media > :last-child { margin-bottom: 0; }
.project .rows .row { border-top: 0; padding: .5rem 0; }

@media (min-width: 1100px) {
  .project-layout { grid-template-columns: clamp(14rem, 17vw, 18rem) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
  .project-sidebar { padding-right: 1.5rem; border-right: 1px solid var(--rule); }
  .project-head { display: block; }
  .project-symbol { width: 56px; margin-bottom: 1rem; }
  .project-head h2 { font-size: 1.5rem; line-height: 1.2; }
  .project-body:has(.project-notes):has(.project-media) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}

/* Narrow screens: the chart turns into an indented tree with the same connectors turned sideways. */
@media (max-width: 760px) {
  .orbat-chart { align-items: stretch; overflow: visible; }
  .orbat-units { display: block; min-width: 0; padding: 4px 0 0 !important; }
  .orbat-units::before { display: none; }
  .unit { flex-direction: row; gap: .75rem; text-align: left; font-size: .875rem; }
  .unit .drawing { width: 38px; flex-shrink: 0; }
  .unit-root .drawing { width: 46px; }
  .orbat-units > li, .orbat-units li li { display: block; padding: 4px 0 0 26px; }
  .orbat-units > li::before, .orbat-units li li::before { left: 10px; right: auto; top: 0; bottom: 0; height: auto; width: 0; border-top: 0; border-left: 1px solid var(--ink); display: block; }
  .orbat-units > li:first-child::before, .orbat-units > li:only-child::before { left: 10px; display: block; }
  .orbat-units > li:last-child::before, .orbat-units li li:last-child::before { right: auto; bottom: auto; height: 26px; }
  .orbat-units > li::after, .orbat-units li li::after { content: ""; position: absolute; top: 26px; left: 10px; width: 12px; height: 0; border-top: 1px solid var(--ink); border-left: 0; }
  .orbat-units li ul { display: block; }
  .masthead { padding-block: 1.25rem; }
  .masthead { grid-template-columns: auto minmax(0, 1fr); column-gap: 1rem; }
  .masthead h1 { font-size: 1.625rem; }
  .headline { font-size: 1rem; }
  .avatar { width: 52px; height: 52px; }
  .masthead .links { grid-column: 1 / -1; }
  .project-head { grid-template-columns: 48px minmax(0, 1fr); gap: 1rem; }
  .project-head h2 { font-size: 1.5rem; }
  .project-symbol { width: 48px; }
  .rows ul { margin-left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
