/*
 * Chamomile / spatial system
 * A 4px baseline and an 8px modular scale. The common navigation frame
 * remains fixed while reading, photographic and project measures may differ.
 */
:root {
  --unit: .5rem;
  --space-small: var(--unit);
  --space-medium: calc(var(--unit) * 2);
  --space-large: calc(var(--unit) * 4);
  --space-section: calc(var(--unit) * 6);
  --shell-width: 48rem;
  --content-width: 40rem;
  --layout-gutter: calc(var(--unit) * 4);
  --layout-top: calc(var(--unit) * 5);
  --nav-row: calc(var(--unit) * 6);
  --rule: 1px solid var(--border);
}
@media (max-width: 44rem) {
  :root {
    --layout-gutter: calc(var(--unit) * 3);
    --layout-top: calc(var(--unit) * 3);
    --space-section: calc(var(--unit) * 4);
  }
}
@media (max-width: 23rem) {
  :root { --layout-gutter: calc(var(--unit) * 2); }
}

/* An identical frame for every Chamomile room, including the article pages. */
body > .page.layout-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin-inline: auto;
  padding: var(--layout-top) var(--layout-gutter) var(--space-large);
  font-size: 1.25rem;
  line-height: 2rem;
}
.section-projects .layout-shell { --content-width: 48rem; }
.section-gallery .layout-shell,
.section-gallery-curated .layout-shell { --content-width: 60rem; }
.professional-page .layout-shell { --content-width: 54rem; }

.layout-shell > main {
  flex: 1 0 auto;
  min-width: 0;
  width: min(100%, var(--content-width));
  margin-inline: auto;
}
.layout-shell > .site-header,
.layout-shell > footer {
  width: min(100%, var(--shell-width));
  max-width: none;
  margin-inline: auto;
}
.layout-shell > .site-header {
  margin-block: 0 var(--space-large);
  padding-bottom: var(--unit);
  border-bottom: var(--rule);
}
.layout-shell > .site-header::after { display: none; }

/* Equal rails around the mark — its center is the exact page center. */
.layout-shell .wordmark {
  display: grid;
  grid-template-columns: minmax(0, 7.25rem) 1.5rem minmax(0, 7.25rem);
  gap: var(--unit);
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 3rem;
  margin-inline: auto;
  font-size: 1.25rem;
  line-height: 1.5rem;
  letter-spacing: .01em;
}
.layout-shell .wordmark > span:first-child { text-align: end; }
.layout-shell .wordmark > span:last-child { text-align: start; }
.layout-shell .wordmark .gammadion {
  justify-self: center;
  width: 1.125rem;
  height: 1.125rem;
}

/* Eight destinations, eight equal tracks. Both bars use these same rules. */
.layout-shell .room-nav,
.layout-shell > footer > nav {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: var(--nav-row);
  gap: 0;
  width: 100%;
  margin: var(--unit) 0 0;
  padding: 0;
  align-items: stretch;
  justify-items: stretch;
  font: 400 .8125rem/1.25rem var(--font-mono);
  letter-spacing: 0;
}
.layout-shell .room-nav a,
.layout-shell > footer > nav a {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: var(--nav-row);
  padding: 0;
  margin: 0;
  color: var(--forest);
  border: 0;
  border-radius: 0;
  text-align: center;
  text-decoration: none;
  font: inherit;
}
.layout-shell .room-nav a:hover,
.layout-shell > footer > nav a:hover {
  color: var(--ember);
  text-decoration: none;
}
.layout-shell .room-nav a:is([aria-current="page"], .section-parent),
.layout-shell > footer > nav a:is([aria-current="page"], .section-parent) {
  color: var(--ember);
}
.layout-shell .room-nav a:is([aria-current="page"], .section-parent, :hover)::after,
.layout-shell > footer > nav a:is([aria-current="page"], .section-parent, :hover)::after {
  content: "";
  position: absolute;
  bottom: var(--unit);
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--unit) * 3);
  height: 1px;
  background-color: currentColor;
}
.layout-shell .room-nav a:focus-visible,
.layout-shell > footer > nav a:focus-visible {
  outline-offset: -3px;
}

.layout-shell > main > h1,
.layout-shell .article > h1,
.layout-shell main > article > h1 {
  font-size: 3rem;
  line-height: 3.5rem;
  margin: 0 0 var(--space-large);
  letter-spacing: -.025em;
  text-align: center;
  text-wrap: balance;
}
.layout-shell main h2 {
  line-height: 2rem;
  margin-block: var(--space-section) var(--space-medium);
}
.layout-shell main h3 {
  line-height: 1.75rem;
}
.layout-shell .back-link {
  min-height: 1.5rem;
  margin: 0 auto var(--space-medium);
  line-height: 1.5rem;
}
.layout-shell .section-index {
  gap: var(--unit) var(--space-medium);
  padding-block: var(--unit);
  margin: var(--space-medium) 0 var(--space-large);
}
.layout-shell > footer {
  margin-block: var(--space-section) 0;
  padding-top: var(--unit);
  border-top: var(--rule);
}
.layout-shell > footer > nav {
  margin: 0;
}
.footer-utilities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 12rem);
  margin: var(--unit) auto 0;
  font: 400 .75rem/1.25rem var(--font-mono);
}
.footer-utilities a,
.footer-utilities .back-to-top {
  display: grid;
  place-items: center;
  min-height: var(--nav-row);
  margin: 0;
  color: var(--ink-faint);
  text-align: center;
  text-decoration: none;
  font: inherit;
}
.footer-utilities a:hover {
  color: var(--ember);
  text-decoration: underline;
  text-underline-offset: .25rem;
}
@media (max-width: 44rem) {
  body > .page.layout-shell { font-size: 1.1875rem; line-height: 1.75rem; }
  .layout-shell .room-nav, .layout-shell > footer > nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    font-size: .75rem;
  }
  .layout-shell > main > h1,
  .layout-shell .article > h1,
  .layout-shell main > article > h1 {
    font-size: 2.25rem;
    line-height: 2.75rem;
    margin-bottom: var(--space-large);
  }
}

/* Keep the photographic gallery's wider measure and its original image ratios. */
.section-gallery-curated .work-section,
.section-gallery-curated .archive-links,
.section-gallery-curated .gallery-intro {
  max-width: 100%;
}
.section-gallery-curated .work-section {
  margin-bottom: var(--space-section);
}
.section-gallery-curated .work-section h2 {
  margin: 0 0 var(--space-medium);
}
.section-gallery-curated .gallery-intro {
  gap: var(--space-medium);
  margin-bottom: var(--space-large);
  padding-bottom: var(--space-medium);
}
.section-gallery-curated :is(.work-wide, .work-pair, .work-mixed) {
  margin-bottom: var(--space-section);
}
.section-gallery-curated :is(.work-pair, .work-mixed) { gap: var(--space-large); }
.section-gallery-curated .work figcaption { margin-top: var(--unit); }
.section-gallery-curated .work-pair { max-width: 48rem; }
.section-gallery-curated .work-pair .work:nth-child(2) { margin-top: var(--space-large); }
.section-gallery-curated .work-inset { max-width: 48rem; }
.section-gallery-curated .work-pair-last { max-width: 44rem; }
.section-gallery-curated .archive-links h2 { margin: 0 0 var(--space-medium); }
@media (max-width: 620px) {
  .section-gallery-curated .work-pair .work:nth-child(2) { margin-top: 0; }
}

/* The project directory keeps its original colored blocks. */
.section-projects .project-index {
  margin: var(--space-medium) 0 var(--space-large);
}
.section-projects .project-index a {
  min-height: 7rem;
  padding: var(--space-medium);
  gap: var(--unit);
}
.section-projects .project-index + h2 {
  padding-top: var(--space-medium);
  margin-top: var(--space-section);
}
@media (max-width: 420px) {
  .section-projects .project-index a { min-height: 6rem; }
}
.section-listen .track-list li {
  padding-block: var(--space-medium);
  column-gap: var(--space-medium);
}
.section-listen .track-list h2 { margin: 0 0 .25rem; line-height: 1.5rem; }

/* Entrance: the eight rows, photo and rotated wordmark share one height. */
.field-home {
  --home-row: 3rem;
  --home-composition-height: calc(var(--home-row) * 8);
  --home-strip: 5.5rem;
}
.field-home .home {
  grid-template-columns: minmax(0, 28rem);
  place-content: center;
  gap: var(--space-large);
  padding: var(--space-large) var(--layout-gutter);
}
.field-home .home-composition {
  grid-template-columns: minmax(0, 1fr) var(--home-strip) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  height: var(--home-composition-height);
  align-items: center;
  justify-items: center;
}
.field-home .home-wordmark {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--home-row) minmax(0, 1fr);
  inline-size: var(--home-composition-height);
  gap: var(--unit);
  font-size: 1.75rem;
  line-height: 2rem;
}
.field-home .home-wordmark > span:first-child { text-align: end; }
.field-home .home-wordmark > span:last-child { text-align: start; }
.field-home .daisy-switch {
  width: var(--home-row);
  height: var(--home-row);
  justify-self: center;
  transform: rotate(180deg);
}
.field-home .home-photo {
  width: var(--home-strip);
  height: var(--home-composition-height);
}
.field-home .home-nav {
  width: 100%;
  max-width: 7rem;
}
.field-home .home-nav-list {
  display: grid;
  grid-template-rows: repeat(8, var(--home-row));
  gap: 0;
  align-items: stretch;
}
.field-home .home-nav a {
  display: grid;
  place-items: center;
  justify-content: center;
  height: var(--home-row);
  width: 100%;
  min-width: 0;
  min-inline-size: 0;
  min-block-size: var(--home-row);
  padding: 0;
  border-radius: 0;
  font: 400 .9375rem/1.25rem var(--font-mono);
  letter-spacing: .025em;
}
.field-home .home-nav a:hover {
  background: transparent;
  color: var(--home-accent);
}
.field-home .home-greeting::before {
  width: 3rem;
  margin-bottom: var(--space-medium);
}
.field-home .home-line {
  font-size: 1.375rem;
  line-height: 1.75rem;
}
@media (max-width: 44rem) {
  .field-home { --home-row: 2.75rem; --home-strip: 4.5rem; }
  .field-home .home-wordmark { font-size: 1.375rem; line-height: 1.75rem; }
  .field-home .home-nav a { font-size: .8125rem; line-height: 1.25rem; }
  .field-home .home-line { font-size: 1.1875rem; line-height: 1.75rem; }
}
