:root {
  --page-bg: #f4efe6;
  --surface: #fffaf3;
  --header-bg: #ceb07f;
  --ink: #180b05;
  --ink-soft: #5f4c3e;
  --rule: #ddd0ba;
  --frame-rule: rgba(104, 80, 58, 0.16);
  --header-frame: rgba(86, 61, 39, 0.28);
  --link: #73000a;
  --link-dark: #52000a;
  --accent: #c21717;
  --cityline-bg: #f6efe3;
  --cityline-line: #c57b32;
  --cityline-line-soft: rgba(197, 123, 50, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--page-bg);
  color: var(--ink);
  font-family: "Times New Roman", Times, "Liberation Serif", Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--link-dark);
  text-decoration: underline;
}

.site-shell {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  background: var(--header-bg);
  border-top: 1px solid rgba(86, 61, 39, 0.14);
  border-bottom: 3px solid var(--link);
}

.site-header .site-shell {
  padding: 28px 42px 24px;
  border-left: 1px solid var(--header-frame);
  border-right: 1px solid var(--header-frame);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 76%);
}

.site-header h1 {
  margin: 0;
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(34px, 5.8vw, 48px);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.05;
}

.page {
  padding: 34px 42px 70px;
  background: var(--surface);
  border-left: 1px solid var(--frame-rule);
  border-right: 1px solid var(--frame-rule);
  border-bottom: 1px solid var(--frame-rule);
}

.bio {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.bio img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
}

.bio-copy p {
  margin: 0 0 11px;
}

.meta-links {
  margin-top: 16px;
}

.meta-links .bracket + .bracket {
  margin-left: 10px;
}

.bracket::before {
  content: "[ ";
  color: var(--ink-soft);
}

.bracket::after {
  content: " ]";
  color: var(--ink-soft);
}

h2 {
  margin: 34px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
}

.papers {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: paper-count;
}

.paper-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  counter-increment: paper-count;
}

.paper-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.paper-item::before {
  content: counter(paper-count, decimal-leading-zero);
  color: #8a7766;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding-top: 5px;
}

.paper-main {
  min-width: 0;
}

.paper-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.paper-title a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(24, 11, 5, 0.35);
  text-underline-offset: 2px;
}

.paper-title a:hover,
.paper-title a:focus-visible {
  color: var(--link);
  text-decoration-color: currentColor;
}

.paper-authors {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 13.5px;
}

.accent-link {
  color: var(--accent);
  font-weight: 700;
}

.badge {
  display: inline-block;
  margin: 0 8px 4px 0;
  padding: 2px 7px;
  border: 1px solid #efd4d4;
  background: #fdf1f1;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.badge-positive {
  border-color: #cfe7cf;
  background: #eef8ee;
  color: #206a38;
}

.paper-abstract {
  margin-top: 10px;
}

.paper-abstract summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  list-style: none;
}

.paper-abstract summary::-webkit-details-marker {
  display: none;
}

.paper-abstract summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  line-height: 1;
}

.paper-abstract[open] summary {
  color: var(--link);
}

.paper-abstract[open] summary::before {
  content: "-";
}

.paper-abstract p {
  margin: 10px 0 0;
  padding: 11px 13px;
  max-width: 66ch;
  border-left: 3px solid #dec79a;
  background: #fffdf8;
  font-size: 13.5px;
  line-height: 1.62;
}

.paper-action {
  padding-top: 1px;
}

.pdf-button {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--link);
  background: var(--link);
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pdf-button:hover,
.pdf-button:focus-visible {
  background: var(--link-dark);
  border-color: var(--link-dark);
  color: #ffffff;
  text-decoration: none;
}

.site-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}

.cityline {
  margin-top: 54px;
  padding-top: 22px;
  border-top: 1px solid var(--rule, rgba(65, 46, 32, 0.14));
  overflow: hidden;
}

.cityline-art {
  display: block;
  width: 100%;
  height: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08) 54%, rgba(255, 255, 255, 0) 100%);
}

.cityline-bg {
  fill: var(--cityline-bg, #fff7ec);
}

.cityline-art path,
.cityline-art circle,
.cityline-art rect {
  vector-effect: non-scaling-stroke;
}

.ym-terrain path {
  fill: none;
  stroke: var(--cityline-line-soft, rgba(197, 123, 50, 0.34));
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-front,
.ym-tower,
.ym-wall-front {
  fill: var(--cityline-bg, #fff7ec);
  stroke: var(--cityline-line, #c57b32);
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-side,
.ym-wall-side {
  fill: #f6edde;
  stroke: var(--cityline-line, #c57b32);
  stroke-width: 1.94;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-roof,
.ym-roof-side,
.ym-cap {
  fill: #ce8764;
  stroke: #b56d52;
  stroke-width: 1.72;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-back-row .ym-front,
.ym-back-row .ym-side {
  fill: #fbf4ea;
}

.ym-back-row .ym-roof,
.ym-back-row .ym-roof-side {
  fill: #d69878;
  stroke: #ba7a60;
}

.ym-roof-tiles path {
  fill: none;
  stroke: rgba(167, 100, 74, 0.56);
  stroke-width: 0.86;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-ledger,
.ym-opening-line,
.ym-door-line,
.ym-stairs path,
.ym-retaining path,
.ym-trees path,
.ym-bushes path,
.ym-bush-tall path {
  fill: none;
  stroke: var(--cityline-line, #c57b32);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-stone path,
.ym-windmill-stone path {
  fill: none;
  stroke: rgba(197, 123, 50, 0.42);
  stroke-width: 0.88;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-ledger {
  stroke-width: 1.76;
}

.ym-opening-fill {
  fill: #fdf7ef;
  stroke: var(--cityline-line, #c57b32);
  stroke-width: 1.38;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-opening-line {
  stroke-width: 1.16;
}

.ym-door-leaf {
  fill: #be8352;
  stroke: #8f5b34;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-door-line {
  stroke: #7c4f2a;
  stroke-width: 1.02;
}

.ym-windmill {
  opacity: 0.93;
}

.ym-sails path,
.ym-fantail path,
.ym-fantail circle {
  fill: none;
  stroke: var(--cityline-line, #c57b32);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ym-hub {
  fill: var(--cityline-bg, #fff7ec);
  stroke: var(--cityline-line, #c57b32);
  stroke-width: 1.82;
}

.ym-stairs path {
  stroke: rgba(173, 110, 54, 0.86);
  stroke-width: 1.66;
}

.ym-stairs .ym-stair-edge {
  stroke-width: 1.82;
}

.ym-retaining path {
  stroke: rgba(197, 123, 50, 0.72);
  stroke-width: 1.56;
}

.ym-trees path {
  stroke-width: 1.8;
}

.ym-bushes path {
  stroke-width: 1.56;
}

.ym-bush-tall path {
  stroke-width: 1.48;
}

.ym-flower {
  fill: rgba(214, 132, 90, 0.96);
  stroke: none;
}

.ym-flower-alt {
  fill: rgba(198, 103, 122, 0.88);
  stroke: none;
}

@media (max-width: 720px) {
  .cityline {
    margin-top: 40px;
    padding-top: 18px;
  }

  .cityline-art {
    width: 100%;
  }

  .ym-roof-tiles,
  .ym-windmill-stone {
    display: none;
  }

  .ym-stone path {
    stroke-width: 0.8;
  }

  .ym-bush-tall path:nth-child(even) {
    display: none;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 32px, 960px);
  }

  .site-header .site-shell {
    padding: 20px 20px 18px;
    border-left: none;
    border-right: none;
  }

  .page {
    padding: 24px 20px 46px;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .bio {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .bio img {
    width: 160px;
  }

  .paper-item {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  .paper-action {
    grid-column: 2;
    padding-top: 0;
  }
}

@media (max-width: 420px) {
  .cityline-art {
    width: 100%;
  }
}
