/* Kastrevundop — rail-scale */

:root {
  --bg: #f6f1e7;
  --bg-alt: #ece4d6;
  --bg-dark: #1a2340;
  --text: #12182b;
  --muted: #6b6858;
  --accent: #e2a93b;
  --accent2: #b4472f;
  --step: 80px;
  --gap: 24px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
}

/* ---------- grid ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gap);
  row-gap: 0;
  align-items: start;
}

.rail {
  grid-column: 1 / span 2;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  padding-top: 10px;
}

.rail .num {
  color: var(--accent2);
  display: block;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.rail .scale {
  display: block;
  margin-top: 14px;
  height: 120px;
  width: 26px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--muted) 0 1px,
    transparent 1px 12px
  );
  opacity: 0.55;
}

.rail .scale.tall { height: 220px; }

.col-text { grid-column: 3 / span 7; }
.col-wide { grid-column: 3 / span 9; }
.col-full { grid-column: 1 / -1; }

/* ---------- header / nav ---------- */

.site-head {
  border-bottom: 1px solid rgba(18, 24, 43, 0.14);
  background: var(--bg);
}

.site-head .grid {
  padding-top: 20px;
  padding-bottom: 20px;
  align-items: center;
  row-gap: 12px;
}

.brand {
  grid-column: 1 / span 3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand span {
  display: block;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent2);
  line-height: 1.4;
}

.site-nav {
  grid-column: 4 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: flex-end;
  font-size: 14px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible { border-bottom-color: var(--accent); }

.site-nav a[aria-current="page"] { border-bottom-color: var(--accent2); }

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent2); }

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

/* ---------- typography ---------- */

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  color: var(--text);
}

h1 {
  font-size: 54px;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
}

h2 {
  font-size: 27px;
  line-height: 1.25;
  margin: 0 0 16px;
}

h3 {
  font-size: 19px;
  line-height: 1.35;
  margin: 26px 0 8px;
}

p { margin: 0 0 18px; }

.lead {
  font-size: 19px;
  line-height: 1.72;
  color: var(--text);
}

.caption {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ---------- sections ---------- */

section { padding: var(--step) 0; }

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

.hero { padding: calc(var(--step) + 24px) 0 var(--step); }

.hero h1 { max-width: 15ch; }

.hero .col-text { grid-column: 3 / span 7; }

.ticks {
  height: 24px;
  width: 100%;
  max-width: 260px;
  margin: 26px 0 0;
  background-image: repeating-linear-gradient(
    to right,
    var(--accent2) 0 1px,
    transparent 1px 14px
  );
}

.ticks.short { max-width: 140px; margin: 22px 0; }

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

.figure-main {
  margin: 0;
  padding: 0 0 var(--step);
}

.figure-main .imgcol {
  grid-column: 4 / span 9;
}

.figure-main img,
.figure-detail img {
  display: block;
  width: 100%;
  height: auto;
}

.figure-main figcaption {
  grid-column: 1 / span 3;
  padding-top: 6px;
  padding-right: 12px;
}

/* ---------- dark band ---------- */

.band-dark {
  background: var(--bg-dark);
  color: var(--bg);
}

.band-dark h2,
.band-dark h3 { color: var(--bg); }

.band-dark .rail { color: rgba(246, 241, 231, 0.65); }
.band-dark .rail .num { color: var(--accent); }
.band-dark .rail .scale {
  background-image: repeating-linear-gradient(to bottom, rgba(246, 241, 231, 0.6) 0 1px, transparent 1px 12px);
}
.band-dark .caption { color: rgba(246, 241, 231, 0.7); }
.band-dark a { color: var(--bg); text-decoration-color: var(--accent); }
.band-dark .ticks {
  background-image: repeating-linear-gradient(to right, var(--accent) 0 1px, transparent 1px 14px);
}

.figure-detail {
  grid-column: 3 / span 4;
  margin: 0;
}

.band-dark .textcol {
  grid-column: 8 / span 5;
}

.figure-detail figcaption { padding-top: 10px; }

/* ---------- lists ---------- */

.list-two {
  grid-column: 3 / span 9;
  columns: 2;
  column-gap: 48px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.list-two li,
.list-plain li {
  break-inside: avoid;
  position: relative;
  padding-left: 22px;
  margin-bottom: 12px;
}

.list-two li::before,
.list-plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 10px;
  height: 1px;
  background: var(--accent);
}

.list-plain {
  margin: 8px 0 18px;
  padding: 0;
  list-style: none;
}

dl.defs { margin: 0; }
dl.defs dt {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  margin-top: 22px;
}
dl.defs dd { margin: 4px 0 0; }

/* ---------- about layout ---------- */

.page-head { padding: calc(var(--step) - 16px) 0 24px; }
.page-head h1 { font-size: 42px; }

.prose { grid-column: 3 / span 7; }

.prose .ticks { max-width: 120px; margin: 30px 0; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid rgba(18, 24, 43, 0.16);
  padding: 30px 0 40px;
  background: var(--bg);
}

.patchbay {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px 28px;
}

.patchbay .fname {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.patchbay nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 14px;
}

.patchbay .femail { font-size: 14px; }

.foot-rule {
  height: 1px;
  background: rgba(18, 24, 43, 0.16);
  margin: 20px 0 12px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  h1 { font-size: 40px; }
  .page-head h1 { font-size: 33px; }
  h2 { font-size: 24px; }

  .grid { column-gap: 16px; }

  .col-text,
  .col-wide,
  .prose,
  .hero .col-text,
  .figure-main .imgcol,
  .figure-main figcaption,
  .figure-detail,
  .band-dark .textcol,
  .list-two {
    grid-column: 1 / -1;
  }

  .rail {
    grid-column: 1 / -1;
    padding-top: 0;
    margin-bottom: 14px;
  }

  .rail .num { display: inline; margin-right: 10px; }
  .rail .label { display: inline; }
  .rail .scale { display: none; }

  .list-two { columns: 1; }

  .figure-main figcaption { padding-top: 10px; }
}

@media (max-width: 700px) {
  :root { --step: 48px; }

  body { font-size: 16px; line-height: 1.75; }
  h1 { font-size: 32px; }
  .page-head h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .lead { font-size: 17px; }

  .site-head .grid { row-gap: 10px; }
  .brand { grid-column: 1 / -1; }
  .site-nav { grid-column: 1 / -1; justify-content: flex-start; gap: 6px 18px; }

  .patchbay { flex-direction: column; align-items: flex-start; }
}
