/* Kastrevundo — rail-scale */

:root {
  --bg: #f6f1e7;
  --bg-alt: #ece4d6;
  --bg-dark: #1a2340;
  --ink: #12182b;
  --muted: #6b6858;
  --on-dark: #f6f1e7;
  --accent: #e2a93b;
  --accent-2: #b4472f;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --step: 80px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
}

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

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--accent-2); }
a:focus-visible,
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

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

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

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
}

/* service rail column */
.rail {
  grid-column: 1 / span 2;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail-num {
  color: var(--accent-2);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.rail-ticks {
  display: block;
  margin-top: 14px;
  height: 24px;
  background-image: repeating-linear-gradient(to right, var(--accent) 0 2px, transparent 2px 14px);
  background-repeat: repeat-x;
  background-size: 14px 24px;
  background-position: left top;
}

.rail-scale {
  display: block;
  margin-top: 18px;
}
.rail-scale span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
  margin-bottom: 12px;
}
.rail-scale span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 2px;
  height: 24px;
  background: var(--accent);
}
.rail-scale span:nth-child(even)::before { background: var(--accent-2); height: 12px; }

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

.site-header {
  border-bottom: 1px solid rgba(18, 24, 43, 0.16);
  padding: 20px 0;
}

.site-header .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
}

.brand {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
}
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}
.site-nav a {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); }

h1 {
  font-size: clamp(2.15rem, 5.2vw, 3.6rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.3;
  margin: 0 0 18px;
}

h3 {
  font-size: 1.06rem;
  line-height: 1.4;
  margin: 28px 0 10px;
}

p { margin: 0 0 20px; }

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

.caption {
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 10px 0 0;
}
.caption b { color: var(--accent-2); font-weight: 400; letter-spacing: 0.14em; }

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

.band { padding: var(--step) 0; }
.band-alt { background: var(--bg-alt); }
.band-dark { background: var(--bg-dark); color: var(--on-dark); }
.band-dark h2, .band-dark h3 { color: var(--on-dark); }
.band-dark a { color: var(--on-dark); }
.band-dark .caption { color: #c9c2ad; }
.band-dark .rail { color: #c9c2ad; }
.band-dark .rail-scale span { color: #c9c2ad; }

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

.hero-body { grid-column: 3 / span 6; }
.col-text { grid-column: 3 / span 7; }
.col-wide { grid-column: 3 / span 9; }

.rail-inline { display: none; }

/* separators */
.ticks {
  grid-column: 3 / span 9;
  height: 24px;
  margin-bottom: 34px;
  background-image: repeating-linear-gradient(to right, var(--accent) 0 2px, transparent 2px 16px);
  background-size: 16px 24px;
  background-repeat: repeat-x;
}
.band-dark .ticks { background-image: repeating-linear-gradient(to right, var(--accent) 0 2px, transparent 2px 16px); }

.stroke {
  width: 2px;
  height: 24px;
  background: var(--accent-2);
  margin: 30px 0;
}

/* lists */
ul.checklist, ul.plain {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
ul.checklist li, ul.plain li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 12px;
}
ul.checklist li::before, ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 10px;
  height: 2px;
  background: var(--accent);
}
.cols-2 {
  grid-column: 3 / span 9;
  columns: 2;
  column-gap: 48px;
}
.cols-2 li { break-inside: avoid; }

ol.steps {
  grid-column: 3 / span 7;
  margin: 0 0 20px;
  padding-left: 22px;
}
ol.steps li { margin-bottom: 12px; padding-left: 6px; }
ol.steps li::marker { color: var(--accent-2); font-family: var(--serif); }

dl.terms { grid-column: 3 / span 9; margin: 0; }
dl.terms dt {
  font-family: var(--serif);
  font-size: 1.06rem;
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid rgba(18, 24, 43, 0.18);
}
dl.terms dd { margin: 8px 0 0; }
.band-dark dl.terms dt { border-top-color: rgba(246, 241, 231, 0.3); }

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

.figure-main {
  margin: 0;
  grid-column: 4 / span 9;
}
.figure-main img { width: 100%; }

.figure-main-caption {
  grid-column: 1 / span 3;
  align-self: end;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding-bottom: 4px;
}
.figure-main-caption b { display: block; color: var(--accent-2); font-weight: 400; letter-spacing: 0.16em; margin-bottom: 6px; }

.figure-detail { margin: 0; grid-column: 3 / span 4; }
.figure-detail img { width: 100%; }
.detail-text { grid-column: 8 / span 5; }

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

.about-rail { position: sticky; top: 28px; }

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

.site-footer {
  background: var(--bg-alt);
  padding: 40px 0 32px;
  border-top: 2px solid var(--accent);
}
.patchbay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}
.patchbay .f-name { font-family: var(--serif); font-size: 19px; letter-spacing: 0.06em; }
.patchbay nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0;
  padding: 0;
}
.patchbay nav a { font-size: 13px; letter-spacing: 0.07em; text-transform: uppercase; }
.patchbay .f-mail { font-size: 14px; }
.footer-rule {
  height: 24px;
  margin-top: 26px;
  border-top: 1px solid rgba(18, 24, 43, 0.2);
  background-image: repeating-linear-gradient(to right, var(--accent-2) 0 2px, transparent 2px 18px);
  background-size: 18px 12px;
  background-repeat: repeat-x;
  background-position: left top;
}
.footer-note {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 6px 0 0;
}

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

@media (max-width: 1000px) {
  .hero-body, .col-text, .col-wide, .ticks, .cols-2, ol.steps, dl.terms { grid-column: 2 / span 11; }
  .figure-main { grid-column: 2 / span 11; }
  .figure-main-caption { grid-column: 2 / span 11; align-self: start; padding-top: 10px; }
  .figure-detail { grid-column: 2 / span 5; }
  .detail-text { grid-column: 7 / span 6; }
  .rail { grid-column: 1 / span 1; }
}

@media (max-width: 720px) {
  :root { --step: 48px; }
  body { font-size: 16px; line-height: 1.75; }
  .grid { display: block; }
  .rail { display: none; }
  .rail-inline {
    display: block;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
    padding-left: 16px;
    position: relative;
  }
  .rail-inline::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 2px;
    height: 14px;
    background: var(--accent);
  }
  .rail-inline b { color: var(--accent-2); font-weight: 400; }
  .ticks { margin-bottom: 24px; }
  .cols-2 { columns: 1; }
  .figure-main, .figure-detail, .detail-text, .figure-main-caption { width: 100%; }
  .figure-detail { margin-bottom: 24px; }
  .figure-main-caption { padding-top: 10px; }
  .patchbay { flex-direction: column; align-items: flex-start; }
  .site-header .inner { flex-direction: column; align-items: flex-start; }
  .site-nav ul { gap: 6px 16px; }
}
