/* ═══════════════════════════════════════════════════════════════
   Annotation Taxonomy: the family shell
   The header, masthead, section heads, and footer shared with the
   other annotation sites on dilshadur.com (paper on a quiet desk,
   Lora for reading, Inter for interface, hairline rules, one navy
   accent, one warm highlight). The study content keeps its own
   components in index.html and reads its colors from the same tokens.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ink: #15171B;
  --ink-2: #3E4148;
  --ink-3: #5E6169;
  --line: #DCDAD2;
  --line-soft: #E8E6E0;
  --grid: rgba(21, 23, 27, 0.05);
  --accent-ink: #FFFFFF;
  --accent-line: rgba(36, 70, 111, 0.28);
  --warm: #9E4E24;
  --highlight: rgba(214, 140, 72, 0.26);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shell-max: 1240px;
  --gutter: 32px;
}

html[data-theme="dark"] {
  --ink: #ECEDEF;
  --ink-2: #C3C7CE;
  --ink-3: #8F959E;
  --line: #2A2E35;
  --line-soft: #1D2026;
  --grid: rgba(236, 237, 239, 0.045);
  --accent-ink: #0E1013;
  --accent-line: rgba(157, 187, 224, 0.32);
  --warm: #F0B07C;
  --highlight: rgba(240, 176, 124, 0.22);
}

body,
[data-theme="dark"] body {
  background: var(--bg);
}

.wrap {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page {
  max-width: var(--shell-max);
}

.sep {
  color: var(--ink-3);
  opacity: 0.6;
  margin: 0 0.5em;
}

/* Underlines that draw in on hover */
.u,
a.u {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(var(--line), var(--line));
  background-size: 0% 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.45s var(--ease-out), color 0.2s ease;
}

.u:hover {
  color: inherit;
  background-size: 100% 1px, 100% 1px;
}

.u.quiet {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
}

.u.quiet:hover {
  background-size: 100% 1px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.fbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease-fluid);
}

.fbtn:hover {
  color: var(--ink);
  border-color: var(--ink-3);
  background: var(--accent-soft);
}

.fbtn:active {
  transform: translateY(1px);
}

.fbtn--solid,
.fbtn--solid:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.fbtn--solid:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
  border-color: transparent;
}

html[data-theme="dark"] .fbtn--solid:hover {
  background: color-mix(in srgb, var(--accent) 86%, white);
}

.fbtn--ghost {
  border-color: transparent;
  color: var(--ink-2);
}

.fbtn--ghost:hover {
  border-color: var(--line);
}

.fbtn.copied {
  color: var(--accent);
  border-color: var(--accent-line);
}

/* ── Top bar ──────────────────────────────────────────────────── */
.bar {
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  z-index: 2;
}

.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
}

.mark:hover {
  color: var(--ink);
}

.mark__glyph {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.bar__nav {
  display: flex;
  flex: none;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--ink-2);
}

.bar__nav a {
  color: var(--ink-2);
}

.bar__nav a:hover {
  color: var(--ink);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.4s var(--ease-out);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.theme-toggle:active {
  transform: rotate(-20deg);
}

.theme-toggle .i-moon,
html[data-theme="dark"] .theme-toggle .i-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .i-moon {
  display: block;
}

/* ── Masthead ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 64px 0 72px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 70% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
}

.eyebrow {
  margin: 0 0 22px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow .sep {
  margin: 0 0.6em;
}

.hero__title {
  max-width: 19ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 6.2vw, 76px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: var(--ink);
  text-wrap: balance;
}

.hero__title em {
  font-style: italic;
  letter-spacing: -0.03em;
}

.marked {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.marked__word {
  position: relative;
}

.marked__band {
  position: absolute;
  left: -0.12em;
  right: -0.1em;
  top: 0.2em;
  bottom: 0.02em;
  border-radius: 0.08em 0.14em 0.1em 0.06em;
  background: var(--highlight);
  transform-origin: 0 50%;
}

.js .marked__band {
  transform: scaleX(0);
  animation: sweep 1.05s var(--ease-out) 0.8s forwards;
}

@keyframes sweep {
  to {
    transform: scaleX(1);
  }
}

.hero__sub {
  max-width: 36ch;
  margin: 20px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 2.2vw, 25px);
  line-height: 1.35;
  color: var(--ink-2);
  text-wrap: balance;
}

.hero__authors {
  margin: 22px 0 0;
  font-size: 15px;
  color: var(--ink-2);
}

.hero__authors a,
.hero__authors span {
  color: var(--ink-2);
}

.hero__authors a:hover {
  color: var(--ink);
}

.hero__authors > :first-child {
  color: var(--ink);
  font-weight: 500;
}

.hero__lede {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.hero__lede p {
  max-width: 62ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink-2);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

/* entry motion */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.9s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0) * 80ms + 60ms);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Section heads, in the family voice ───────────────────────── */
.section {
  border-top-color: var(--line-soft);
}

.sec-eyebrow {
  display: none;
}

.sec-title {
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.sec-title em {
  font-style: italic;
}

.sec-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-3);
}

/* the citation block sits on paper, like the siblings' BibTeX */
.cite-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}

/* ── Footer ───────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--ink-3);
}

.foot__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 32px;
}

.foot p {
  margin: 0;
}

.foot a {
  color: var(--ink-3);
}

.foot a:hover {
  color: var(--ink);
}

.foot__inner a {
  white-space: nowrap;
}

@media (max-width: 700px) {
  :root {
    --gutter: 18px;
  }

  .bar__inner {
    height: 56px;
  }

  .bar__nav {
    gap: 16px;
  }

  .bar__nav a:not(.bar__ext) {
    display: none;
  }

  .hero {
    padding: 44px 0 52px;
  }

  .hero__title {
    font-size: clamp(34px, 10vw, 48px);
    line-height: 1.07;
  }

  .hero__lede {
    margin-top: 30px;
    padding-top: 26px;
  }

  .hero__lede p {
    font-size: 16px;
  }

  .hero__actions .fbtn {
    flex: 1 1 auto;
  }

  .hero__actions .fbtn--ghost {
    border-color: var(--line);
  }

  .foot__inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .marked__band {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ── Family: the way home and the sibling sites ───────────────────
   Shared by every annotation site on dilshadur.com. Keep identical. */
.bar__start {
  display: flex;
  align-items: center;
  min-width: 0;
}

.home {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  outline-offset: 3px;
  transition: transform 0.4s var(--ease-out), box-shadow 0.2s;
}

.home img {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 999px;
}

.home:hover {
  transform: translateX(-2px);
  box-shadow: 0 0 0 1px var(--line);
}

.bar__div {
  flex: none;
  width: 1px;
  height: 18px;
  margin: 0 14px;
  background: var(--line);
}

.bar__start .mark {
  min-width: 0;
}

.bar__start .mark span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family + .foot__inner {
  justify-content: space-between;
}

.family {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 14px 40px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.family__home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.family__home img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
}

.family__home span {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease-out);
}

.family__home:hover span {
  background-size: 100% 1px;
}

.family__set {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.family__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.family__set a,
.family__set [aria-current] {
  font-size: 13.5px;
  white-space: nowrap;
}

.family__set [aria-current] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.family__set [aria-current]::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--warm);
}

@media (max-width: 760px) {
  .family {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .family__set {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: start;
    gap: 10px 16px;
  }

  .family__label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .bar__div {
    margin: 0 10px;
  }
}

/* content columns line up with the header and masthead */
.section {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.bar__start + .bar__nav {
  flex: none;
}

@media (max-width: 600px) {
  .bar__start + .bar__nav .bar__ext {
    display: none;
  }
}

@media (max-width: 700px) {
  .eyebrow__far,
  .foot__sep {
    display: none;
  }

  .foot__inner p a {
    display: block;
    width: fit-content;
  }

  .foot__inner p a + a {
    margin-top: 6px;
  }
}
