/* ==========================================================================
   Bach Architecture — the site's single stylesheet.
   Register: the architecture monograph. One narrow grotesque at one size,
   hierarchy barely a whisper, no divider lines, everything flush-left,
   photography carrying the page. White text on a light neutral grey.
   Tokens up top; every spacing / color decision is a custom property.
   ========================================================================== */

:root {
  /* Color: purely neutral greys, white ink, one orange for words */
  --color-bg: #767676;                 /* body + bands (white on it: 4.5:1) */
  --bg-top: #7a7a7a;                   /* viewport-fixed wash, top */
  --bg-bottom: #717171;                /* viewport-fixed wash, bottom */
  --color-header-bg: #7a7a7a;
  --color-text: #ffffff;
  --color-link: #ffffff;
  --color-accent-mark: #ff9433;        /* active-thumbnail outline, focus ring, map dot */
  --color-accent-text: #ff9433;        /* current / hovered words */
  --panel-bg: #5e5e5e;

  /* Typography: Arial Narrow where installed, otherwise the self-hosted
     metric-compatible Liberation Sans Narrow; one size, two weights */
  --font-body: 'Arial Narrow', 'Liberation Sans Narrow', 'Helvetica Neue Condensed',
               'Nimbus Sans Narrow', 'Roboto Condensed', 'Archivo Narrow', Arial, sans-serif;
  --font-size-body: 15px;
  --line-height-body: 1.55;
  --font-size-h4: 15px;
  --font-size-siteinfo: 15px;
  --caps-tracking: 0.06em;

  /* Spacing scale: exactly three steps.
     S 8px (micro: thumb gaps), M 24px (intra-section), L 64px (between chapters). */
  --s: 8px;
  --m: 24px;
  --l: 64px;

  /* Layout */
  --header-height: 64px;
  --row-width: 80%;
  --row-max-width: 1080px;
  --gutter: 5.5%;
}

/* Liberation Sans Narrow (SIL OFL) — the same metrics as Arial Narrow, so the
   page composes identically whether or not the visitor has Arial Narrow. */
@font-face {
  font-family: 'Liberation Sans Narrow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Liberation Sans Narrow'), local('LiberationSansNarrow-Regular'),
       url('../fonts/liberation-sans-narrow.woff2') format('woff2');
}
@font-face {
  font-family: 'Liberation Sans Narrow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Liberation Sans Narrow Bold'), local('LiberationSansNarrow-Bold'),
       url('../fonts/liberation-sans-narrow-bold.woff2') format('woff2');
}

/* Reset ------------------------------------------------------------------ */

* { margin: 0; padding: 0; border: 0; box-sizing: content-box; }
ol, ul { list-style: none; }
img { max-width: 100%; height: auto; vertical-align: bottom; }
article, aside, footer, header, main, nav, section { display: block; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A very subtle light-to-dark wash, fixed to the viewport so it reads the
   same at any scroll position (pseudo-element: iOS ignores
   background-attachment: fixed) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(var(--bg-top), var(--bg-bottom));
}

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-accent-text); }
p { padding-bottom: 1em; }
p:last-of-type { padding-bottom: 0; }
strong, b { font-weight: 700; }
em, i { font-style: italic; }
hr { border-top: 1px solid var(--color-text); margin-bottom: 1em; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--color-text);
  padding-bottom: 10px;
  line-height: 1em;
  font-weight: 700;
  font-size: var(--font-size-h4);
}

.clearfix::after { content: ""; display: table; clear: both; }

/* Page frame: sticky footer — the © band sits at the viewport bottom even
   on short pages ---------------------------------------------------------- */

#page-container {
  padding-top: var(--header-height);
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#page-container > main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
main > .band-siteinfo { margin-top: auto; }

/* Masthead: tight, wordmark left and nav right on one baseline; hides on
   scroll down and returns on scroll up ----------------------------------- */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background-color: var(--color-header-bg);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
#site-header.is-hidden { transform: translateY(-100%); }

#site-header .container {
  width: var(--row-width);
  max-width: var(--row-max-width);
  margin: auto;
  position: relative;
  display: flex;
  align-items: baseline;
  padding: 26px 0 17px;   /* composes the 64px band around the 21px wordmark */
  box-sizing: border-box;
}

/* The wordmark is the original logo artwork (white-on-transparent PNG)
   used as an alpha mask and filled with the ink — pixel-exact letterforms,
   no font license needed. The <img> stays in the markup for crawlers and
   for browsers without mask support. */
.logo_container { display: block; }
#logo { display: none; }
.logo_container a::before {
  content: "";
  display: block;
  width: 249px;
  height: 22px;
  background-color: var(--color-text);
  -webkit-mask: url('../images/2016/12/logo2.png') no-repeat 0 50% / contain;
  mask: url('../images/2016/12/logo2.png') no-repeat 0 50% / contain;
}
@supports not ((mask: url('')) or (-webkit-mask: url(''))) {
  .logo_container a::before { display: none; }
  #logo { display: block; max-height: 22px; width: auto; }
}

#site-nav { margin-left: auto; }
#top-menu {
  line-height: 1;
  display: flex;
  gap: var(--m);
}
#top-menu a {
  color: var(--color-text);
  font-weight: 400;
  font-size: var(--font-size-body);
  line-height: 1;
  display: block;
  transition: color 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
#top-menu a:hover { color: var(--color-accent-text); }
#top-menu li.current-menu-item > a,
#top-menu li.current-menu-ancestor > a { color: var(--color-accent-text); }

/* Content bands ---------------------------------------------------------- */

.band { background-color: transparent; }
.band .row {
  width: var(--row-width);
  max-width: var(--row-max-width);
  margin: auto;
  position: relative;
  padding: var(--l) 0 0;
}

/* Project title: quiet, monograph-scale */
.band-title { padding-top: var(--l); padding-bottom: 0; }
.band.band-title .row { padding: 0; }
.band-title h4 {
  font-size: var(--font-size-h4);
  font-weight: 700;
  letter-spacing: var(--caps-tracking);
  line-height: 1.3;
  padding-bottom: 0;
  margin-bottom: 0;
  text-wrap: balance;
}

/* Columns (1/3 + 2/3 for credits and description, firm chapters, contact) */
.col { float: left; margin-right: var(--gutter); min-height: 1px; }
.col:last-child { margin-right: 0; }
.col-1-2 { width: 47.25%; }
.col-1-3 { width: 29.6667%; }
.col-2-3 { width: 64.833%; }
.col-4-4 { width: 100%; float: none; }

.module { margin-bottom: 2.75%; }
.col-1-3 .module { margin-bottom: 9.27%; }
.col-2-3 .module { margin-bottom: 4.242%; }
.col-1-2 .module { margin-bottom: 5.82%; }

/* Gallery: full-width plate flush-left, contact sheet beneath ------------- */

.band.band-gallery .row { padding-top: var(--m); padding-bottom: 0; }

#ba-wrapper {
  display: flex;
  flex-direction: column;
  height: auto;
}

.ba-preview-wrap {
  order: -1;
  width: 100%;
  height: min(66vh, 720px);
  min-height: 420px;
  /* flush-left to the grid: plate on the left, open field right */
  background-position: 0 50% !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

#ba-thumbs {
  width: 100%;
  margin: var(--m) 0 0;
  display: flex;
  flex-flow: row wrap;
  position: relative;
  align-content: flex-start;
}

.ba-thumb {
  height: 52px;
  width: auto;
  margin: 0 var(--s) var(--s) 0;
  cursor: pointer;
  transition: opacity 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
#ba-thumbs:hover .ba-thumb { opacity: 0.55; }
#ba-thumbs .ba-thumb:hover { opacity: 1; }
.ba-thumb.active {
  outline: 2px solid var(--color-accent-mark);
  outline-offset: 2px;
  opacity: 1;
}

#gallery_loading { display: none; }

/* Info: whitespace instead of rules --------------------------------------- */

.band-info { padding-top: var(--l); }
.band.band-info .row { padding-top: 0; padding-bottom: 0; }

.col-1-3 strong,
.col-1-3 b {
  display: block;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--caps-tracking);
}
.col-1-3 strong + br,
.col-1-3 b + br { display: none; }
.col-1-3 .kicker { font-weight: 700; }
.band-info .col-1-3 p { padding-bottom: var(--m); }
.band-info .col-1-3 hr { display: none; }

.col-2-3 p {
  max-width: 60ch;
  text-wrap: pretty;
}
.col-2-3 strong { letter-spacing: var(--caps-tracking); }

/* Project heading: bold name, then the location on its own regular line */
.project-name { display: block; font-weight: 700; }
.project-location { display: block; font-weight: 400; letter-spacing: var(--caps-tracking); }

/* Press logos in credit columns */
.press-title { margin-top: 30px; max-width: 180px; padding-top: 0; }
.press-logo { margin-bottom: 15px !important; max-width: 115px; text-align: left; margin-left: 0; }
.press-logo img { width: auto; }

/* Prev / next project ----------------------------------------------------- */

.proj-nav { display: block; background-color: transparent; }
.proj-nav .row {
  width: var(--row-width);
  max-width: var(--row-max-width);
  margin: auto;
  padding-top: var(--l);
  display: flex;
  justify-content: space-between;
  gap: var(--m);
}
.proj-nav a {
  text-transform: uppercase;
  letter-spacing: var(--caps-tracking);
}
.proj-nav .pn-next { margin-left: auto; }

/* Work overview: the landing page — a 3 × 3 residential grid, then the
   teaching row ------------------------------------------------------------ */

.band.band-workindex .row { padding-top: var(--l); padding-bottom: 0; }
.wi-cat {
  font-size: var(--font-size-body);
  font-weight: 400;
  letter-spacing: var(--caps-tracking);
  line-height: var(--line-height-body);
  padding: var(--l) 0 var(--m);
  scroll-margin-top: calc(var(--header-height) + var(--m));
}
.wi-cat:first-child { padding-top: 0; }
.wi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--m);
}
.wi-item { display: block; }
.wi-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.wi-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wi-name { display: block; padding-top: var(--s); }
.wi-item:hover .wi-name { color: var(--color-accent-text); }

/* About / Bio / Contact --------------------------------------------------- */

.firm-img {
  width: 100%;
  height: auto;
  display: block;
}
#bio .firm-img { max-width: 75%; }
#bio .row { padding-top: var(--l); }

.map-wrap { position: relative; }
.map-embed {
  width: 100%;
  height: 440px;
  /* hairline in the map's own linework color */
  border: 1px solid color-mix(in srgb, var(--color-text) 28%, transparent);
  box-sizing: border-box;
}
.map-embed .maplibregl-ctrl-group { border-radius: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); background: var(--panel-bg); }
.map-embed .maplibregl-ctrl button span { filter: invert(1); }
.map-embed .maplibregl-ctrl-attrib { font-size: 11px; }
.map-embed .maplibregl-ctrl-attrib.maplibregl-compact { background: transparent; }
.map-embed .maplibregl-ctrl-attrib-button { background-color: transparent; opacity: 0.55; filter: invert(1); }
.map-embed .maplibregl-ctrl-attrib.maplibregl-compact-show { background: rgba(0, 0, 0, 0.35); }
.map-embed .maplibregl-ctrl-attrib,
.map-embed .maplibregl-ctrl-attrib a { color: rgba(255, 255, 255, 0.7); }

/* Site info: © / address / phone+email spread left-middle-right on wide
   screens, a flush-left stack below — the three groups never wrap
   mid-group --------------------------------------------------------------- */

.band-siteinfo .nb { white-space: nowrap; }
.band.band-siteinfo .row {
  margin-top: var(--l);
  padding-top: 0;
  /* window symmetry: matches the masthead's top offset */
  padding-bottom: var(--m);
}
.band-siteinfo p {
  font-size: var(--font-size-siteinfo);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s) var(--m);
  text-align: left;
}
.band-siteinfo .si-left,
.band-siteinfo .si-mid,
.band-siteinfo .si-right { flex-shrink: 0; }
.band-siteinfo .si-sep { display: none; }
.band-siteinfo .si-dot { display: inline; }

/* Interaction polish ------------------------------------------------------ */

.press-logo a { transition: opacity 160ms cubic-bezier(0.22, 1, 0.36, 1); }

:is(a, button):focus-visible {
  outline: 2px solid var(--color-accent-mark);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  #site-header { transition: none; }
  #site-header.is-hidden { transform: none; }
}

/* Responsive -------------------------------------------------------------- */

/* Middle widths: the footer's single line no longer fits — each group
   becomes a column of two stacked lines (still spread left / middle /
   right), shedding the one-line punctuation with the split */
@media all and (max-width: 1349px) {
  .band-siteinfo .si-left .nb,
  .band-siteinfo .si-mid .nb,
  .band-siteinfo .si-right .nb { display: block; }
  .band-siteinfo .p1 { display: none; }
}

@media screen and (max-width: 1024px) {
  .ba-thumb { height: 44px; }
}

/* Below 980px the nav sits as a flush-left row under the wordmark */
@media all and (max-width: 980px) {
  :root { --header-height: 74px; }
  #site-header .container {
    flex-wrap: wrap;
    row-gap: var(--s);
    padding: 16px 0 15px;
  }
  .logo_container { flex-basis: 100%; }
  #site-nav { margin-left: 0; }
  #top-menu { flex-wrap: wrap; }

  .col, .col-1-2, .col-1-3, .col-2-3 { width: 100%; float: none; margin-right: 0; }
  .band-title { padding-top: var(--m); }
  .band-info { padding-top: var(--l); }
}

/* Small screens: the footer is a single flush-left column, one line per
   group, punctuation restored */
@media all and (max-width: 750px) {
  .band-siteinfo p {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s);
  }
  .band-siteinfo .si-left .nb,
  .band-siteinfo .si-mid .nb,
  .band-siteinfo .si-right .nb { display: inline; }
  .band-siteinfo .p1 { display: inline; }
}

@media screen and (max-width: 736px) {
  .ba-preview-wrap {
    height: 44vh;
    min-height: 260px;
  }
  #ba-thumbs { margin-top: var(--s); }
  .ba-thumb { height: 30px; }
  .band-title { padding-top: var(--m); }
  /* Phones keep the desktop three-column composition. The grid breaks out of
     the row's gutter and runs edge to edge, so three columns stay as wide as
     the screen allows. -12.5% is the row's 10%-of-parent gutter expressed
     against the row's own 80% width: if --row-width moves, this moves with it. */
  .wi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--m) var(--s);
    margin-inline: -12.5%;
  }
}

/* © and address stack deliberately */
@media all and (max-width: 480px) {
  .band-siteinfo .si-left .nb,
  .band-siteinfo .si-mid .nb,
  .band-siteinfo .si-right .nb { display: block; }
  .band-siteinfo .p1 { display: none; }
}
