/* Ertuğrul 1890 — Turkey red (madder) and Japanese indigo (aizome).
   Two dye traditions, one for each end of the story. */

:root {
  --ink:          #0E1A2B;
  --indigo:       #16263E;
  --indigo-mid:   #2A4468;
  --indigo-line:  #3D6293;
  --paper:        #E4E1D7;
  --paper-dim:    #A9A79C;
  --madder:       #A83232;
  --madder-lit:   #CE5340;

  --display: "Instrument Serif", Georgia, serif;
  --body:    "Spectral", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  --measure: 34rem;
  --gutter:  clamp(1.25rem, 5vw, 3.5rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.72;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--madder); color: var(--paper);
  padding: .6rem 1rem; z-index: 20;
}
.skip:focus { left: 1rem; top: 1rem; }

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

.masthead {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid var(--indigo-mid);
}
.masthead__in {
  max-width: 78rem; margin: 0 auto;
  padding: .85rem var(--gutter);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.masthead__mark {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none;
}
.masthead__mark b { color: var(--madder-lit); font-weight: 500; }
.masthead__coords {
  font-family: var(--mono);
  font-size: .62rem; letter-spacing: .14em;
  color: var(--paper-dim);
}

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

.hero {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, var(--ink) 14%, rgba(14,26,43,.86) 34%, rgba(14,26,43,0) 62%);
  pointer-events: none;
}
.hero__in {
  max-width: 78rem; margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter) clamp(3rem, 7vw, 5.5rem);
  position: relative; z-index: 2;
  max-width: min(78rem, 100%);
}
.hero__wrap { max-width: 30rem; }

.hero__eyebrow {
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--madder-lit);
  margin: 0 0 1.5rem;
}
.hero__eyebrow span { color: var(--paper-dim); }

.hero__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 6.5rem);
  line-height: .92;
  letter-spacing: -.015em;
  margin: 0 0 1.4rem;
}
.hero__title em {
  font-style: italic;
  color: var(--madder-lit);
  display: block;
}
.hero__tagline {
  font-size: 1.15rem; line-height: 1.6;
  color: var(--paper);
  opacity: .82;
  margin: 0 0 2rem;
  max-width: 26rem;
}
.hero__rule {
  width: 4.5rem; height: 2px;
  background: var(--madder);
  border: 0; margin: 0;
}

/* chart */

.chart {
  position: absolute;
  z-index: 1;
  right: -14%;
  top: 50%;
  transform: translateY(-50%);
  height: 150%;
  width: auto;
  pointer-events: none;
}
.chart__shoal { fill: var(--indigo-mid); opacity: .5; }
.chart__line, .chart__line--major {
  fill: none;
  stroke: var(--indigo-mid);
  stroke-width: .9;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.4s cubic-bezier(.33,0,.2,1) forwards;
  animation-delay: calc(var(--i) * 95ms);
}
.chart__line--major { stroke: var(--indigo-line); stroke-width: 1.5; }
.chart__sounding {
  fill: var(--indigo-mid);
  font-family: var(--mono);
  font-size: 13px;
  text-anchor: middle;
  opacity: 0; animation: fade 1s ease 1.8s forwards;
}
.chart__halo {
  fill: none; stroke: var(--madder); stroke-width: 1.5;
  opacity: 0; animation: fade 1s ease 2s forwards;
}
.chart__cross {
  stroke: var(--madder-lit); stroke-width: 2.5; stroke-linecap: round;
  opacity: 0; animation: fade 1s ease 2.1s forwards;
}
.chart__label {
  fill: var(--madder-lit);
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  opacity: 0; animation: fade 1s ease 2.3s forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .chart__line, .chart__line--major, .chart__sounding,
  .chart__halo, .chart__cross, .chart__label {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* ------------------------------------------------------------------ index */

.intro {
  max-width: 78rem; margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) var(--gutter) 0;
}
.intro__text {
  max-width: var(--measure);
  font-size: 1.2rem;
  line-height: 1.68;
}
.intro__text p { margin: 0 0 1.2rem; }

.contents {
  max-width: 78rem; margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) clamp(4rem, 9vw, 7rem);
}
.contents__head {
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--madder);
  border-top: 1px solid var(--ink);
  padding-top: .9rem;
  margin: 0 0 .5rem;
}

.entry {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0 2rem;
  padding: 2.1rem 0;
  border-bottom: 1px solid rgba(14,26,43,.16);
  text-decoration: none;
  transition: background-color .25s ease;
}
.entry:hover { background: rgba(14,26,43,.035); }
.entry:hover .entry__title { color: var(--madder); }

.entry__year {
  font-family: var(--mono);
  font-size: .72rem; letter-spacing: .1em;
  color: var(--madder);
  padding-top: .55rem;
}
.entry__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.6vw, 2.35rem);
  line-height: 1.1;
  margin: 0 0 .5rem;
  transition: color .2s ease;
}
.entry__dek {
  margin: 0;
  max-width: 40rem;
  color: rgba(14,26,43,.74);
  font-size: 1rem;
}

/* ---------------------------------------------------------------- article */

.piece { max-width: 78rem; margin: 0 auto; padding: 0 var(--gutter); }

.piece__head {
  padding: clamp(3rem, 7vw, 5.5rem) 0 0;
  max-width: 46rem;
}
.piece__year {
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--madder);
  margin: 0 0 1.1rem;
}
.piece__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: .98;
  letter-spacing: -.01em;
  margin: 0 0 1.1rem;
}
.piece__dek {
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.55;
  color: rgba(14,26,43,.72);
  margin: 0 0 2.5rem;
  max-width: 36rem;
}
.piece__hr {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 0 0 2.75rem;
  max-width: 46rem;
}

.prose { max-width: var(--measure); padding-bottom: 1rem; }
.prose p { margin: 0 0 1.35rem; }
.prose em { font-style: italic; }
.prose h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1.15;
  margin: 3rem 0 1.1rem;
  color: var(--ink);
}
.prose h2::before {
  content: "";
  display: block;
  width: 2.25rem; height: 2px;
  background: var(--madder);
  margin-bottom: 1.1rem;
}
.prose > p:first-child::first-letter {
  font-family: var(--display);
  float: left;
  font-size: 3.9rem;
  line-height: .82;
  padding: .1rem .5rem 0 0;
  color: var(--madder);
}

.sources {
  max-width: var(--measure);
  margin: 3.5rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(14,26,43,.3);
}
.sources__head {
  font-family: var(--mono);
  font-size: .64rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--madder);
  margin: 0 0 .9rem;
}
.sources ol { margin: 0; padding: 0 0 0 1.1rem; }
.sources li {
  font-size: .88rem;
  line-height: 1.55;
  margin-bottom: .55rem;
  color: rgba(14,26,43,.78);
}
.sources a { color: var(--madder); text-underline-offset: 2px; }

.pager {
  max-width: 78rem; margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) var(--gutter) clamp(4rem, 8vw, 6rem);
  display: flex; justify-content: space-between; gap: 1.5rem;
  border-top: 1px solid rgba(14,26,43,.16);
  margin-top: 3.5rem;
}
.pager__link {
  text-decoration: none;
  max-width: 17rem;
  display: block;
}
.pager__link:last-child { text-align: right; margin-left: auto; }
.pager__dir {
  font-family: var(--mono);
  font-size: .64rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--madder);
  display: block; margin-bottom: .4rem;
}
.pager__name {
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.15;
}
.pager__link:hover .pager__name { color: var(--madder); }

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

.foot {
  background: var(--ink);
  color: var(--paper-dim);
}
.foot__in {
  max-width: 78rem; margin: 0 auto;
  padding: 2.75rem var(--gutter);
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  line-height: 1.9;
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.foot a { color: var(--paper); text-decoration: none; border-bottom: 1px solid var(--indigo-line); }
.foot a:hover { color: var(--madder-lit); }

/* ----------------------------------------------------------------- mobile */

@media (max-width: 46rem) {
  /* On a narrow screen the chart moves below the headline rather than
     hiding behind it, and the scrim flips to vertical. */
  .hero__in { padding-bottom: 13rem; }
  .hero::after {
    background: linear-gradient(180deg, var(--ink) 32%, rgba(14,26,43,0) 78%);
  }
  .chart {
    right: -26%; left: auto;
    top: auto; bottom: -14%;
    transform: none;
    height: 62%;
    opacity: .6;
  }
  .entry { grid-template-columns: 1fr; gap: .5rem; }
  .entry__year { padding-top: 0; }
  .pager { flex-direction: column; }
  .pager__link:last-child { text-align: left; margin-left: 0; }
  .masthead__coords { display: none; }
}
