/* Bolovsky — one stylesheet, two themes.
 *
 * Both themes define the same token names, so every rule below is written once
 * and a site only chooses a palette. Colours come from the emblem: the navy of
 * the compass rose, the red of the wolf, and the cream of its muzzle.
 */

@font-face {
  font-family: "Lora";
  src: url("../fonts/lora.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("../fonts/lora-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --font-display: "Lora", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 64rem;
  --measure: 36rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --band: clamp(2.75rem, 7vw, 5rem);
  --radius: 10px;
}

[data-theme="night"] {
  color-scheme: dark;
  --bg: #0e1c2e;
  --bg-raised: #14243a;
  --bg-sunken: #0a1524;
  --ink: #f2ede0;
  --ink-muted: #a9b8c9;
  --ink-faint: #7a8ca3;
  --accent: #d9553c;
  --accent-text: #e8775c;
  --line: #1e3350;
  --line-strong: #2c4763;
  --selection: rgba(217, 85, 60, 0.3);
  --watermark: 0.07;
}

[data-theme="parchment"] {
  color-scheme: light;
  --bg: #f4efe4;
  --bg-raised: #ebe3d2;
  --bg-sunken: #e6decc;
  --ink: #13304f;
  --ink-muted: #5a5344;
  --ink-faint: #6b6454;
  --accent: #a8392c;
  --accent-text: #a8392c;
  --line: #ddd2bc;
  --line-strong: #c4b494;
  --selection: rgba(168, 57, 44, 0.22);
  --watermark: 0.09;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  color: var(--accent-text);
  text-decoration-color: var(--accent);
}

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

.wrap {
  width: min(100% - (2 * var(--gutter)), var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.75rem);
  font-size: 0.9375rem;
}

.nav a {
  text-decoration: none;
  color: var(--ink-muted);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
}

.nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.masthead-end {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.5rem);
}

/* The language switcher is two-letter codes rather than flags: a language is
   not a country, and "pt" is shorter than any label that would fit here. */
.langs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: clamp(0.6rem, 2vw, 1rem);
  border-left: 1px solid var(--line);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.langs a {
  color: var(--ink-faint);
  text-decoration: none;
}

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

.langs [aria-current] {
  color: var(--ink);
}

/* ---------- images ---------- */

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

.shot figcaption {
  margin-top: 0.7rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-faint);
}

.shot-hero {
  margin: 2rem 0 2.5rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem 1.25rem;
  margin-top: 1.75rem;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.25rem, 9vw, 6.5rem) clamp(1.5rem, 4vw, 2.5rem);
}

/* The emblem sits behind the top of the hero rather than its middle, so a hero
   that grows an image below the lead does not push it into the body text. */
.hero::after {
  content: "";
  position: absolute;
  top: -8rem;
  right: -8rem;
  width: 34rem;
  height: 34rem;
  background: url("../img/emblem.png") no-repeat center / contain;
  opacity: var(--watermark);
  pointer-events: none;
}

.hero > .wrap {
  position: relative;
}

.hero-tight {
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 3vw, 1.5rem);
}

.kicker,
.overline {
  margin: 0 0 0.9rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.overline {
  color: var(--ink-faint);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.rule {
  width: 3.5rem;
  height: 3px;
  margin: 1.5rem 0 1.5rem;
  border: 0;
  background: var(--accent);
}

.lead {
  max-width: 42rem;
  margin: 0 0 1.25rem;
  font-size: clamp(1.125rem, 1.7vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink);
}

.prose {
  max-width: var(--measure);
  margin: 0 0 1.15rem;
  color: var(--ink-muted);
  line-height: 1.72;
}

.prose-column .prose {
  max-width: var(--measure);
}

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

.band {
  padding-block: var(--band);
  border-top: 1px solid var(--line);
}

.band-quiet {
  background: var(--bg-sunken);
}

.band h2 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.2vw, 2.125rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.band h2 + .lead {
  margin-top: -0.5rem;
  margin-bottom: 2rem;
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.125rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.375rem 1.5rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  transition: border-color 140ms ease, transform 140ms ease;
}

.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.card-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.card-title a {
  text-decoration: none;
}

.card-meta {
  margin: 0.3rem 0 0;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.card-body {
  margin: 0.9rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9688rem;
  line-height: 1.65;
}

.card-link {
  margin: 1.1rem 0 0;
  font-size: 0.875rem;
}

.card-link a {
  color: var(--accent-text);
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

/* ---------- rows and lists ---------- */

.rows,
.ticks,
.links {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.row {
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.row:first-child {
  border-top: 0;
  padding-top: 0;
}

.row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}

.row-head h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.row-meta {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.row-body {
  max-width: var(--measure);
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
}

.ticks li {
  position: relative;
  max-width: var(--measure);
  margin-bottom: 0.7rem;
  padding-left: 1.4rem;
  color: var(--ink-muted);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 2px;
  background: var(--accent);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.5rem;
}

.links li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.links a {
  font-size: 1.0625rem;
}

.link-note {
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* ---------- status strip ---------- */

.status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.status li {
  padding: 1rem 1.125rem;
  border-left: 2px solid var(--accent);
  background: var(--bg-raised);
}

.status h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.status-meta {
  display: block;
  margin: 0.15rem 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.status p {
  margin: 0;
  font-size: 0.9062rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ---------- colophon ---------- */

.colophon {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  font-size: 0.875rem;
  color: var(--ink-faint);
}

.colophon-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.colophon p {
  margin: 0;
}

/* ---------- not found ---------- */

.notfound {
  padding-block: clamp(4rem, 14vw, 9rem);
  text-align: center;
}

.notfound .rule {
  margin-inline: auto;
}

.notfound .lead {
  margin-inline: auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (max-width: 52rem) {
  .hero::after {
    top: -6rem;
    right: -11rem;
    width: 24rem;
    height: 24rem;
    opacity: calc(var(--watermark) * 0.7);
  }
}
