:root {
  --ink: #030405;
  --muted: #808080;
  --paper: #ffffff;
  --font: "General Sans", "Outfit", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Design sheet is 1280 wide; --page never exceeds the viewport. */
  --page-design: 1280;
  --page: min(1280px, 100%);
  --gallery-gap: 12px;
  --gallery-frame-w: 641.67px;
  --gallery-frame-h: 420.89px;
  /* Frame overhang below the photo grid (420.89 - 76.91 - 282). */
  --gallery-frame-below: 61.98px;
  --menu-toggle-size: 44px;
  /* Narrow content + gallery share one width ceiling. */
  --content-max: 641.67px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 11pt;
  font-weight: 400;
  min-height: 100%;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

img {
  max-width: 100%;
  display: block;
}

.canvas {
  position: relative;
  width: var(--page);
  flex: 0 0 auto;
  margin: 0 auto;
  padding-bottom: 40px;
  background: var(--paper);
  container-type: inline-size;
  container-name: page;
  /* One sheet unit: design px → current canvas width. */
  --u: calc(100cqw / 1280);
}

.canvas.is-home {
  min-height: calc((var(--home-extent, 0) + 40) * var(--u));
}

.canvas.is-project {
  padding-bottom: 56px;
}

.site-footer {
  flex-shrink: 0;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  padding: 2px 8px 3px;
  text-align: center;
  background: var(--paper);
}

.site-footer-img {
  display: inline-block;
  width: auto;
  height: 40px;
  max-width: min(100%, 420px);
  margin: 0 auto;
  opacity: 0.9;
}

.site-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 52px calc(180 * var(--u)) 0;
  font-size: 18pt;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.site-header .title-main {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 500;
  text-transform: uppercase;
}

.site-header .title-suffix {
  font-weight: 200;
  font-family: 'Courier New', Courier, monospace;
}

.menu-toggle {
  display: none;
}

.menu {
  position: absolute;
  left: calc(210 * var(--u));
  top: calc(98 * var(--u));
  width: calc(178 * var(--u));
  z-index: 3;
}

.year-block + .year-block {
  margin-top: 2px;
}

.year-btn {
  position: relative;
  display: block;
  width: 100%;
  font-family: "Courier New", Courier, monospace;
  font-size: 12pt;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
  padding: 8px 0 6px;
  color: var(--ink);
}

.year-block.is-open .year-mark,
.year-btn:hover .year-mark,
.year-btn:focus-visible .year-mark {
  opacity: 1;
}

/* While another year is hovered, the current selection arrow drops to half. */
.menu:has(.year-btn:hover) .year-block.is-open:not(:has(.year-btn:hover)) .year-mark,
.menu:has(.year-btn:focus-visible) .year-block.is-open:not(:has(.year-btn:focus-visible)) .year-mark {
  opacity: 0.3;
}

.year-mark {
  /* Box fits selection-arrow.png, whose ink sits inside a padded canvas.
     The drawn arrow stays about 26px wide, tip just left of the year. */
  position: absolute;
  left: calc(-30 * var(--u));
  top: 2px;
  width: calc(30 * var(--u));
  height: calc(28 * var(--u));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.year-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.year-projects {
  display: none;
}

.year-projects > .year-projects-inner {
  min-height: 0;
}

.year-block.is-open .year-projects {
  display: block;
}

.project-link {
  display: block;
  font-family: "Hepta Slab", "Rockwell", "Times New Roman", serif;
  font-size: 10pt;
  font-variant: small-caps;
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
  line-height: 1.45;
  padding: 1px 0 3px;
  color: var(--ink);
  max-width: calc(168 * var(--u));
}

.project-link .name {
  font-weight: 400;
}

.project-link .pipe,
.project-link .trans {
  font-weight: 200;
  font-variant:normal;
}

.project-link .note {
  font-weight: 200;
  font-style: normal;
  font-variant: normal;
  text-transform: lowercase;
}

.project-link.is-current,
.project-link:hover,
.project-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.menu-home {
  margin-bottom: 10px;
}

.menu-home a,
.menu-footer a {
  display: block;
  font-size: 10pt;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 2.1;
}

.menu-footer {
  margin-top: 28px;
}

.menu-home a.is-current,
.menu-footer a.is-current,
.menu-home a:hover,
.menu-footer a:hover,
.menu-home a:focus-visible,
.menu-footer a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.symbols {
  position: absolute;
  inset: 0;
}

.symbol {
  position: absolute;
  padding: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  z-index: 1;
}

.symbol:hover,
.symbol:focus-visible {
  z-index: 4;
  outline: none;
}

.symbol-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: transparent;
  /* White in the icon canvas should not paint over a neighboring icon. */
  mix-blend-mode: multiply;
}

.symbol-circle {
  /* Size set inline from the icon's longer side so the ring stays circular.
     max-width must be cleared: the global img rule would otherwise clamp the ring to the icon. */
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: none;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
}

.symbol:hover .symbol-circle,
.symbol:focus-visible .symbol-circle {
  opacity: 1;
}

/* Year/month grid. Default above the narrow breakpoint; ?new-render=0 uses fixed positions. */
.symbols-grid {
  left: calc(409 * var(--u));
  top: calc(98 * var(--u));
  right: auto;
  bottom: auto;
  width: max-content;
  height: max-content;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.year-row {
  display: grid;
  column-gap: 0;
  height: calc(var(--row-height-n, 0) * var(--u));
  align-items: start;
  justify-content: start;
  overflow: visible;
  grid-template-columns: repeat(var(--slot-count, 1), calc(var(--slot-n, 0) * var(--u)));
}

.symbols-grid .symbol {
  position: relative;
  width: calc(var(--icon-n, 0) * var(--u));
  height: calc(var(--icon-n, 0) * var(--u));
  pointer-events: auto;
}

.symbols-flow {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  inset: auto;
}

.symbols-year {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}

.symbols-flow .symbol {
  position: relative;
  left: auto;
  top: auto;
  width: var(--icon-size);
  height: var(--icon-size);
}

.project-main {
  margin-left: calc(409 * var(--u));
  width: calc(452 * var(--u));
  padding-top: calc(94 * var(--u));
}

.project-body {
  position: relative;
  z-index: 1;
  font-family: "Hepta Slab", "Rockwell", "Times New Roman", serif;
  font-size: 11pt;
  font-weight: 300;
  line-height: 1.35;
  color: var(--muted);
}

.project-body p {
  margin: 0 0 8px;
}

.project-body p:last-child {
  margin-bottom: 0;
}

.project-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-body a:hover,
.project-body a:focus-visible {
  color: var(--ink);
}

.static-page {
  margin-left: calc(409 * var(--u));
  width: calc(452 * var(--u));
  padding-top: calc(94 * var(--u));
}

.static-page h1 {
  display: none;
}

.static-banner {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 28px;
}

.contact-form {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 100%;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-label {
  font-family: "Hepta Slab", "Rockwell", "Times New Roman", serif;
  font-size: 10pt;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.contact-form input:not(.contact-gotcha),
.contact-form textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 0 7px;
  border: 0;
  border-bottom: 1px solid #c8c8c8;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Hepta Slab", "Rockwell", "Times New Roman", serif;
  font-size: 11pt;
  font-weight: 300;
  line-height: 1.35;
  outline: none;
  box-shadow: none;
  appearance: none;
  resize: vertical;
}

.contact-form textarea {
  min-height: 8.5em;
}

.contact-form input:not(.contact-gotcha):focus,
.contact-form textarea:focus {
  border-bottom-color: var(--ink);
}

/* Deploybase honeypot — hidden from people; still in the DOM for bots. */
.contact-form .contact-gotcha {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.contact-submit {
  align-self: flex-start;
  margin-top: 6px;
  padding: 0;
  font-family: var(--font);
  font-size: 10pt;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.contact-submit:hover,
.contact-submit:focus-visible {
  color: var(--muted);
}

.contact-submit:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.55;
  text-decoration: none;
  pointer-events: none;
}

.contact-confirm {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(70px + env(safe-area-inset-top, 0px))
    calc(40px + env(safe-area-inset-right, 0px))
    calc(70px + env(safe-area-inset-bottom, 0px))
    calc(40px + env(safe-area-inset-left, 0px));
  background: rgba(255, 255, 255, 0.86);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.contact-confirm.is-open {
  opacity: 1;
}

.contact-confirm-x {
  position: absolute;
  top: calc(22px + env(safe-area-inset-top, 0px));
  right: calc(28px + env(safe-area-inset-right, 0px));
  font-family: "Outfit", "General Sans", sans-serif;
  font-size: 22pt;
  font-weight: 200;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.contact-confirm-panel {
  max-width: 28rem;
  text-align: center;
}

.contact-confirm-panel p {
  margin: 0 0 22px;
  font-family: "Hepta Slab", "Rockwell", "Times New Roman", serif;
  font-size: 14pt;
  font-weight: 300;
  line-height: 1.4;
  color: var(--ink);
}

.contact-confirm-close {
  font-family: "Hepta Slab", "Rockwell", serif;
  font-size: 10pt;
  font-variant: small-caps;
  font-variant-caps: small-caps;
  letter-spacing: 0.12em;
  color: var(--ink);
  cursor: pointer;
}

body.contact-confirm-open {
  overflow: hidden;
}

/* Desktop gallery: same design px as before, scaled by the sheet unit --u. */
.gallery {
  --gallery-thumb-w: 94.45;
  --gallery-main-w: 377;
  --gallery-row-h: 86;
  --gallery-col-gap: 14;
  position: relative;
  display: grid;
  grid-template-columns: calc(var(--gallery-main-w) * var(--u)) calc(var(--gallery-thumb-w) * var(--u));
  grid-template-rows: repeat(3, calc(var(--gallery-row-h) * var(--u)));
  row-gap: calc(12 * var(--u));
  column-gap: calc(var(--gallery-col-gap) * var(--u));
  margin-top: 28px;
  width: calc((var(--gallery-main-w) + var(--gallery-col-gap) + var(--gallery-thumb-w)) * var(--u));
  padding-bottom: calc(61.98 * var(--u));
  overflow: visible;
}

/* image_grid_horizontal_new.png is 1590×1058 (old 1800×1233 cropped
   68px left, 105px top). Display +8px on width from the prior fit
   (633.67×415.64), aspect locked, center held so strokes sit just
   outside the image cells. */
.gallery-backdrop {
  position: absolute;
  z-index: 0;
  left: calc(-45.46 * var(--u));
  top: calc(-76.91 * var(--u));
  width: calc(641.67 * var(--u));
  height: calc(420.89 * var(--u));
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.gallery-main,
.gallery-thumbs {
  position: relative;
  z-index: 1;
}

.gallery-main {
  grid-column: 1;
  grid-row: 1 / span 3;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-main img,
.gallery-thumbs button img {
  width: 100%;
  height: 100%;
}

.gallery-main img {
  object-fit: contain;
  object-position: center;
}

.gallery-thumbs button img {
  object-fit: cover;
}

.gallery-thumbs {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: grid;
  grid-template-rows: repeat(3, calc(86 * var(--u)));
  gap: calc(12 * var(--u));
}

.gallery-thumbs button {
  overflow: hidden;
  height: calc(86 * var(--u));
}

.gallery-thumbs button:hover img,
.gallery-thumbs button:focus-visible img {
  opacity: 0.86;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(70px + env(safe-area-inset-top, 0px))
    calc(40px + env(safe-area-inset-right, 0px))
    calc(70px + env(safe-area-inset-bottom, 0px))
    calc(40px + env(safe-area-inset-left, 0px));
  background: rgba(255, 255, 255, 0.86);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-x {
  position: absolute;
  top: calc(22px + env(safe-area-inset-top, 0px));
  right: calc(28px + env(safe-area-inset-right, 0px));
  font-family: "Outfit", "General Sans", sans-serif;
  font-size: 22pt;
  font-weight: 200;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.lightbox-image {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: min(960px, 100%);
  max-height: min(
    calc(100dvh - 140px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)),
    100%
  );
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
}

.lightbox-close-label {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  font-family: "Hepta Slab", "Rockwell", serif;
  font-size: 10pt;
  font-variant: small-caps;
  font-variant-caps: small-caps;
  letter-spacing: 0.12em;
  color: var(--ink);
  cursor: pointer;
}

body.lightbox-open,
body.menu-open {
  overflow: hidden;
}

.info {
  position: absolute;
  left: calc(907 * var(--u));
  top: calc(98 * var(--u));
  width: calc(186 * var(--u));
}

.info-symbol {
  width: calc(104 * var(--u));
  height: calc(78 * var(--u));
  margin: 2px 0 18px calc(24 * var(--u));
}

.info-symbol img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
}

.info-frame {
  position: relative;
  padding: 12px 10px 18px 12px;
  min-height: 100px;
}

.info-frame::before,
.info-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.info-frame::before {
  top: 0;
  left: 0;
  width: 32px;
  height: 62px;
  border-top: 0px solid var(--ink);
  border-left: 0px solid var(--ink);
}

.info-frame::after {
  right: 0;
  bottom: 0;
  width: 54px;
  height: 62px;
  border-right: 0px solid var(--ink);
  border-bottom: 0px solid var(--ink);
}

.info-line {
  display: block;
  font-size: 10pt;
  font-weight: 500;
  font-variant: small-caps;
  font-variant-caps: small-caps;
  letter-spacing: 0.08em;
  line-height: 1.55;
  color: var(--ink);
  max-width: calc(170 * var(--u));
  font-family: 'Courier New', Courier, monospace;
}

.info-line + .info-line {
  margin-top: 6px;
}

.info-line.is-muted {
  color: var(--muted);
  font-weight: 400;
  margin-top: 10px;
}

.info-line.is-type {
  margin-top: 4px;
}

.home-hit {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(190 * var(--u));
  height: calc(90 * var(--u));
  z-index: 2;
}

@media (max-width: 960px) {
  .canvas {
    width: 100%;
    min-width: 0;
    min-height: 0 !important;
    padding: 28px 24px 64px;
    container-type: normal;
    --u: 1px;
  }

  .canvas.is-project {
    display: flex;
    flex-direction: column;
  }

  /* Clear the fixed burger so the first symbol row is not covered. */
  .canvas.is-home {
    padding-top: calc(12px + env(safe-area-inset-top, 0px) + var(--menu-toggle-size) + 16px);
  }

  .home-hit {
    display: none;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    z-index: 40;
    width: var(--menu-toggle-size);
    height: var(--menu-toggle-size);
    padding: 6px;
    color: var(--ink);
    background: var(--paper);
    border: 0;
  }

  .menu-toggle-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .site-header {
    order: 1;
    padding: 8px calc(var(--menu-toggle-size) + 16px) 28px;
  }

  .info {
    order: 2;
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 0 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 28px;
  }

  .info-symbol {
    flex: 0 0 auto;
    width: 104px;
    height: 78px;
    margin: 2px 0 0;
  }

  .info-frame {
    flex: 1 1 11rem;
    min-width: min(100%, 11rem);
  }

  .info-line {
    max-width: none;
  }

  .project-main,
  .static-page {
    order: 3;
    margin: 0;
    width: 100%;
    max-width: var(--content-max);
    padding-top: 8px;
  }

  .menu {
    position: fixed;
    inset: 0;
    left: 0;
    top: 0;
    width: auto;
    z-index: 35;
    margin: 0;
    padding:
      calc(72px + env(safe-area-inset-top, 0px))
      24px
      calc(40px + env(safe-area-inset-bottom, 0px));
    background: var(--paper);
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
  }

  .menu.is-open {
    visibility: visible;
    pointer-events: auto;
  }

  .menu .year-mark {
    left: 0;
    width: 30px;
    height: 28px;
  }

  .menu .year-btn {
    padding-left: 34px;
  }

  .menu .project-link {
    max-width: none;
    padding-left: 34px;
  }

  .symbols-flow {
    position: relative;
    width: 100%;
  }

  /* Outer box is the decorative frame; fills the content column up to design size. */
  .gallery {
    width: min(100%, var(--content-max));
    max-width: var(--content-max);
    aspect-ratio: 641.67 / 420.89;
    height: auto;
    margin-top: 28px;
    padding: 0;
    display: grid;
    grid-template-columns: 7.085% 58.752% 2.182% 14.719% 17.262%;
    grid-template-rows: 18.273% 20.433% 2.851% 20.433% 2.851% 20.433% 14.726%;
    column-gap: 0;
    row-gap: 0;
  }

  .gallery-backdrop {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }

  .gallery-main {
    grid-column: 2;
    grid-row: 2 / span 5;
    width: 100%;
    height: 100%;
  }

  .gallery-thumbs {
    grid-column: 4;
    grid-row: 2 / span 5;
    display: grid;
    grid-template-rows: 20.433fr 2.851fr 20.433fr 2.851fr 20.433fr;
    gap: 0;
    height: 100%;
  }

  .gallery-thumbs button {
    height: auto;
    min-height: 0;
  }

  .gallery-thumbs button:nth-child(1) {
    grid-row: 1;
  }

  .gallery-thumbs button:nth-child(2) {
    grid-row: 3;
  }

  .gallery-thumbs button:nth-child(3) {
    grid-row: 5;
  }
}
