/* Isoline — a journal about maps, terrain and the shape of places.
 * Fictional publication, built as a Vemvavor demo site (#220).
 *
 * Direction: a survey sheet. Pale sage paper, ink-navy type, map blue for links,
 * elevation violet reserved for one thing only — how far up the page you have
 * climbed. Every plate on the page is drawn procedurally from contour maths; the
 * site fetches nothing.
 */

:root {
  --paper: #e9ede7;
  --paper-raised: #f6f8f3;
  --ink: #12232e;
  --muted: #5d6b6a;
  --rule: #cbd5c8;
  --water: #175e8c;
  --elevation: #5b4b8a;

  --display: "Hoefler Text", "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua",
    Georgia, serif;
  --body: Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --gap: clamp(20px, 5vw, 56px);
  --measure: 63ch;
}

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

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.72 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(91, 75, 138, 0.15);
}

a {
  color: var(--water);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--elevation);
}

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

button,
input {
  font: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 60;
  background: var(--paper-raised);
  padding: 10px 14px;
  border: 1px solid var(--rule);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gap);
}

.narrow {
  max-width: calc(var(--measure) + 2 * var(--gap));
}

/* ── chrome ──────────────────────────────────────────────────────────────── */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 62px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.logo svg {
  display: block;
}

.masthead nav {
  margin-left: auto;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.masthead nav a {
  color: var(--ink);
  text-decoration: none;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 9px 11px;
}

.masthead nav a:hover {
  color: var(--elevation);
}

.masthead nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--elevation);
}

footer.site {
  border-top: 1px solid var(--rule);
  margin-top: 96px;
  padding: 34px 0 64px;
  font: 12px/1.7 var(--mono);
  letter-spacing: 0.05em;
  color: var(--muted);
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 36px;
}

footer.site .right {
  margin-left: auto;
  text-transform: uppercase;
}

/* ── type ────────────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  text-wrap: balance;
  overflow-wrap: break-word;
  margin: 0 0 0.45em;
  letter-spacing: -0.012em;
}

h1 {
  font-size: clamp(33px, 5.4vw, 56px);
  line-height: 1.06;
}

h2 {
  font-size: clamp(23px, 2.6vw, 30px);
  line-height: 1.2;
  margin-top: 1.9em;
}

h3 {
  font-size: 20px;
}

.stamp {
  font: 500 11px/1.6 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.stamp .up {
  color: var(--elevation);
}

.lede {
  font-size: 21px;
  line-height: 1.6;
  color: #2b3a41;
  max-width: var(--measure);
  text-wrap: pretty;
}

.topic {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--elevation);
  border: 1px solid rgba(91, 75, 138, 0.4);
  border-radius: 2px;
  padding: 5px 8px;
  text-decoration: none;
}

a.topic:hover {
  background: rgba(91, 75, 138, 0.1);
  color: var(--elevation);
}

/* ── procedural contour plates ───────────────────────────────────────────── */

.plate {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
}

.plate path {
  fill: none;
  stroke: #9db0a4;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.plate path:nth-child(4n + 1) {
  stroke: #7d9488;
  stroke-width: 1.6;
}

.plate .peak {
  fill: rgba(91, 75, 138, 0.12);
  stroke: var(--elevation);
}

/* ── home ────────────────────────────────────────────────────────────────── */

.flag {
  padding-top: clamp(38px, 7vw, 76px);
  padding-bottom: clamp(22px, 3vw, 34px);
  border-bottom: 1px solid var(--rule);
}

.flag h1 {
  font-size: clamp(52px, 12vw, 132px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 0.92;
  margin-bottom: 18px;
}

.flag .strap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.lead-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-top: clamp(34px, 5vw, 60px);
  padding-bottom: clamp(34px, 5vw, 60px);
  border-bottom: 1px solid var(--rule);
}

.lead-story h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
  margin: 12px 0 14px;
}

.lead-story a.head {
  color: inherit;
  text-decoration: none;
}

.lead-story a.head:hover {
  color: var(--water);
}

/* The index: pieces set as a survey register, not as cards. */
.register {
  list-style: none;
  margin: 0;
  padding: 0;
}

.register li {
  border-bottom: 1px solid var(--rule);
}

.register a {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 8px 22px;
  align-items: baseline;
  padding: 22px 0;
  text-decoration: none;
  color: inherit;
}

.register a:hover .title {
  color: var(--water);
}

.register .no {
  font: 500 12px/1.7 var(--mono);
  letter-spacing: 0.1em;
  color: var(--muted);
}

.register .title {
  font-family: var(--display);
  font-size: clamp(21px, 2.4vw, 27px);
  line-height: 1.2;
  font-weight: 600;
}

.register .sub {
  color: var(--muted);
  font-size: 16px;
  margin-top: 4px;
  max-width: 62ch;
}

.register .right {
  text-align: right;
  white-space: nowrap;
}

.section {
  padding-top: clamp(40px, 6vw, 72px);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 26px);
}

.section-head a {
  margin-left: auto;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

/* ── article ─────────────────────────────────────────────────────────────── */

.article {
  padding-top: clamp(34px, 5vw, 64px);
}

.article header {
  max-width: var(--measure);
}

.article h1 {
  margin: 14px 0 18px;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 26px 0 34px;
}

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

.prose p {
  margin: 0 0 1.35em;
  text-wrap: pretty;
}

.prose > p:first-of-type::first-letter {
  font-family: var(--display);
  float: left;
  font-size: 3.35em;
  line-height: 0.82;
  padding: 0.06em 0.1em 0 0;
  color: var(--elevation);
}

.prose h2 {
  border-top: 1px solid var(--rule);
  padding-top: 1.1em;
}

.prose blockquote {
  margin: 2em 0;
  padding: 0 0 0 22px;
  border-left: 2px solid var(--elevation);
  font-size: 21px;
  line-height: 1.55;
  color: #2b3a41;
}

.prose figure {
  margin: 2.4em 0;
}

.prose figcaption {
  font: 500 11px/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 10px;
}

.prose ul {
  padding-left: 1.15em;
}

.prose li {
  margin-bottom: 0.5em;
}

.endnote {
  max-width: var(--measure);
  margin-top: 56px;
  padding-top: 26px;
  border-top: 2px solid var(--ink);
}

.signup {
  max-width: var(--measure);
  margin: 44px 0 0;
  padding: 26px;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
}

.signup form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

input[type="email"],
input[type="search"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
  font-size: 16px;
}

input:focus-visible {
  background: #fff;
}

/* The UA default placeholder grey misses 4.5:1 on this paper. */
input::placeholder {
  color: #566361;
  opacity: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: var(--elevation);
  border-color: var(--elevation);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.btn.ghost:hover {
  color: #fff;
}

.said {
  margin-top: 12px;
  color: var(--elevation);
  font: 500 12px/1.6 var(--mono);
  letter-spacing: 0.08em;
}

.said:empty {
  display: none;
}

/* ── the signature: a contour spine that fills as you climb the page ─────── */

.spine {
  position: fixed;
  left: max(12px, calc((100vw - 1080px) / 2 - 66px));
  top: 96px;
  width: 52px;
  z-index: 5;
  pointer-events: none;
}

.spine svg {
  display: block;
  width: 52px;
  height: 260px;
}

.spine .base path {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1.4;
}

.spine .fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 260px;
  clip-path: inset(calc(100% - var(--climb, 0%)) 0 0 0);
}

.spine .fill path {
  fill: none;
  stroke: var(--elevation);
  stroke-width: 1.6;
}

.spine .read {
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-top: 10px;
  font-variant-numeric: tabular-nums;
}

/* Mobile: a hairline gauge along the top instead of the rail. */
.gauge {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--elevation);
  transform-origin: 0 50%;
  transform: scaleX(var(--climb-x, 0));
  z-index: 40;
  display: none;
}

@media (max-width: 1180px) {
  .spine {
    display: none;
  }

  .gauge {
    display: block;
  }
}

/* ── search ──────────────────────────────────────────────────────────────── */

.searchbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 26px 0 8px;
  max-width: var(--measure);
}

.no-results {
  padding: 34px 0;
  color: var(--muted);
  max-width: 52ch;
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
  }

  .lead-story {
    grid-template-columns: minmax(0, 1fr);
  }

  .register a {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .register .right {
    grid-column: 2;
    text-align: left;
  }
}

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