/*
  Cyanotype look: Prussian-blue ground, white-bordered prints.
  Dark by default, inverts to a pale paper ground in light mode.
  Fonts are system stacks so nothing is fetched from a third party.
*/

:root {
  --ground: #0e2a4d;
  --ground-deep: #091d38;
  --ink: #eaf0f5;
  --ink-soft: #9db6d2;
  --line: #2b4f7e;
  --print: #f3f6f8;
  --accent: #f4b942;
  --accent-ink: #1b1405;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 62ch;
}

@media (prefers-color-scheme: light) {
  :root {
    --ground: #eef2f4;
    --ground-deep: #dde6ec;
    --ink: #0e2a4d;
    --ink-soft: #3f6590;
    --line: #b9c8d6;
    --print: #ffffff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* Header */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
}

.brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
}

.nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.nav .signin {
  padding: 0.45rem 1rem;
  border-radius: 3px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.nav .signin:hover {
  color: var(--accent-ink);
  text-decoration: none;
  filter: brightness(1.08);
}

/* Layout */

main,
.foot {
  max-width: 72rem;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.intro {
  padding: clamp(2.5rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.intro h1 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.lede {
  max-width: var(--measure);
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: 1.1875rem;
}

.block {
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  border-top: 1px solid var(--line);
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.5rem;
}

.block h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
}

.note {
  max-width: var(--measure);
  margin: -0.75rem 0 1.5rem;
  color: var(--ink-soft);
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent);
}

/* Gallery: white-bordered prints */

.gallery {
  columns: 3 17rem;
  column-gap: 1.5rem;
}

.print {
  margin: 0 0 1.75rem;
  break-inside: avoid;
}

.print-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.print img {
  display: block;
  width: 100%;
  height: auto;
  border: 0.5rem solid var(--print);
  background: var(--ground-deep);
}

.print figcaption {
  margin-top: 0.6rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.print .title {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
}

/* One-time "development" of the prints on page load */

@keyframes develop {
  from {
    filter: grayscale(1) sepia(0.5) hue-rotate(170deg) saturate(2.4) brightness(0.55) contrast(1.2);
  }
  to {
    filter: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .print img {
    animation: develop 1.8s ease-out both;
    animation-delay: calc(var(--i, 0) * 90ms);
  }
}

/* Services: a plain list, the lock carries the information */

.services {
  margin: 0;
  padding: 0;
  list-style: none;
}

.service {
  position: relative;
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr auto;
  align-items: baseline;
  gap: 0.25rem 2rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.service:last-child {
  border-bottom: 1px solid var(--line);
}

.service:focus-within,
.service:hover {
  background: var(--ground-deep);
}

.service-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  text-decoration: none;
}

.service-name::after {
  content: "";
  position: absolute;
  inset: 0;
}

.service-name:focus-visible {
  outline-offset: -3px;
}

.service-desc {
  color: var(--ink-soft);
  max-width: var(--measure);
}

.service-access {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  white-space: nowrap;
}

.service-access svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

@media (max-width: 40rem) {
  .service {
    grid-template-columns: 1fr;
  }
}

/* Currently */

.now {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr;
  gap: 0.9rem 2rem;
  margin: 0;
  max-width: 48rem;
}

.now dt {
  color: var(--ink-soft);
}

.now dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1875rem;
}

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.foot p {
  margin: 0;
}

.clock {
  font-variant-numeric: tabular-nums;
}

/* Lightbox */

#lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: clamp(0.75rem, 3vw, 2rem);
  border: 0;
  background: color-mix(in srgb, var(--ground-deep) 96%, transparent);
  color: var(--ink);
}

#lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lb-figure {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
}

.lb-figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 10rem);
  width: auto;
  height: auto;
  border: 0.5rem solid var(--print);
}

.lb-figure figcaption {
  max-width: var(--measure);
  margin-top: 0.9rem;
  text-align: center;
  color: var(--ink-soft);
}

.lb-controls {
  display: flex;
  gap: 1.5rem;
}

.lb-controls button {
  padding: 0.4rem 0.2rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  cursor: pointer;
}

.lb-controls button:hover {
  color: var(--accent);
}
