/* pnw.ad: shared by every page. Colours, type, the theme, the top bar, buttons and the footer. */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-soft-variable-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-soft-italic-variable-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --fir: #10262a;
  --evergreen: #1f5a4a;
  --sound: #2f5f86;
  --salmon: #f08a5d;
  --wheat: #d9a945;
  --snow: #fbf7ef;
  --paper: #f4efe4;
  --forest-night: #0d1b1e;

  --bg: var(--paper);
  --bg-2: #ebe3d3;
  --ink: var(--fir);
  --ink-2: #3c5257;
  --rule: rgba(16, 38, 42, 0.16);
  --accent: #a5482a; /* salmon, deepened to read on paper */
  --card: #fbf7ef;
  --focus: #2f5f86;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: var(--forest-night);
  --bg-2: #13262a;
  --ink: #ede6d6;
  --ink-2: #b5c0bb;
  --rule: rgba(237, 230, 214, 0.16);
  --accent: #f4a27c;
  --card: #122428;
  --focus: #9cc3e4;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--forest-night);
    --bg-2: #13262a;
    --ink: #ede6d6;
    --ink-2: #b5c0bb;
    --rule: rgba(237, 230, 214, 0.16);
    --accent: #f4a27c;
    --card: #122428;
    --focus: #9cc3e4;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
  text-wrap: pretty;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--snow);
  color: var(--fir);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.skip:focus {
  top: 12px;
}

/* a fine film grain over everything */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 40;
  pointer-events: none;
  background: url("../img/grain.png") repeat;
  background-size: 160px 160px;
  opacity: 0.09;
  mix-blend-mode: overlay;
}
:root[data-theme="dark"] .grain {
  opacity: 0.12;
}

/* ---------- top bar ---------- */
.bar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--gutter);
  color: var(--ink);
}
.bar.on-art {
  color: var(--snow);
}
.wordmark {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 23px;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wordmark svg {
  width: 26px;
  height: 26px;
}
.wordmark .dot {
  color: var(--salmon);
}
.on-art .wordmark {
  text-shadow: 0 1px 12px rgba(4, 12, 16, 0.45);
}

.theme-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.on-art .theme-switch {
  border-color: rgba(251, 247, 239, 0.28);
  background: rgba(8, 20, 26, 0.42);
}
.theme-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: 600 12.5px/1 var(--sans);
  letter-spacing: 0.02em;
  padding: 8px 11px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 32px;
}
.theme-switch button[aria-checked="true"] {
  background: var(--snow);
  color: var(--fir);
}
:root[data-theme="dark"] .bar:not(.on-art) .theme-switch button[aria-checked="true"] {
  background: var(--ink);
  color: var(--forest-night);
}

/* ---------- buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  font: 650 15.5px/1.1 var(--sans);
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.button:hover {
  transform: translateY(-1px);
}
.button.primary {
  background: var(--salmon);
  color: var(--fir);
}
.button.primary:hover {
  background: #f39a72;
}
.button.ghost {
  color: var(--snow);
  border-color: rgba(251, 247, 239, 0.55);
  background: rgba(8, 20, 26, 0.18);
}
.button.ghost:hover {
  border-color: var(--snow);
}
.button.quiet {
  color: var(--ink);
  border-color: var(--rule);
  background: transparent;
}

/* small caps labels */
.label {
  font: 650 12px/1.3 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- footer ---------- */
.foot {
  position: relative;
  padding: 56px var(--gutter) 40px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 15px;
}
.foot-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px 32px;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}
.foot a {
  color: var(--ink);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.foot .mark {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 19px;
}

/* sections that rise into view (only when motion is welcome) */
@media (prefers-reduced-motion: no-preference) {
  .js .rise {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .js .rise.in {
    opacity: 1;
    transform: none;
  }
}

.maps-link {
  white-space: nowrap;
}
.maps-link::after {
  content: " ↗";
  font-size: 0.8em;
}
