/* robertwalser.com — shared stylesheet */
:root {
  --paper: #fbfaf6;
  --ink: #1d1d1b;
  --pencil: #6b6a65;
  --rule: #e2e0d8;
  --red: #da291c; /* Swiss red (Pantone 485 C) */
  --measure: 65ch;
}

* { box-sizing: border-box; }

html { font-size: 112.5%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 1.65;
}

a { color: inherit; text-decoration-color: var(--pencil); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--red); }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.site-header .logo img { display: block; width: 52px; height: 52px; mix-blend-mode: multiply; }
.site-header nav ul {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem;
  list-style: none; margin: 0; padding: 0;
}
.site-header nav a { text-decoration: none; color: var(--pencil); }
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.35em; }

/* Main */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}
h1 { font-weight: normal; font-size: 2.2rem; line-height: 1.2; margin: 0 0 0.5rem; }
h2 { font-weight: normal; font-size: 1.5rem; margin: 3rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 0; }
.lede { color: var(--pencil); font-style: italic; margin-top: 0; }

/* Work entries */
.work {
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0;
}
.work-meta { color: var(--pencil); font-size: 0.9rem; margin: 0.25rem 0 1rem; }
.work blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--red);
  font-style: italic;
}
.work cite { display: block; font-style: normal; font-size: 0.85rem; color: var(--pencil); margin-top: 0.25rem; }
.work .timeline.names { grid-template-columns: 10rem 1fr; }
@media (max-width: 30rem) { .timeline.names { grid-template-columns: 1fr; } .timeline.names dd { margin-bottom: 0.6rem; } }
.read-more { font-size: 0.95rem; }

/* Timeline */
.timeline {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.6rem 1rem;
  margin: 0 0 2rem;
}
.timeline dt { color: var(--pencil); font-variant-numeric: oldstyle-nums; }
.timeline dd { margin: 0; }
.timeline.names { grid-template-columns: 10rem 1fr; }
@media (max-width: 30rem) { .timeline.names { grid-template-columns: 1fr; } .timeline.names dd { margin-bottom: 0.6rem; } }
.read-more { font-size: 0.95rem; }

/* Contact form */
.contact-form { display: grid; gap: 0.4rem; margin: 2rem 0; }
.contact-form label { margin-top: 0.8rem; font-size: 0.95rem; }
.contact-form input,
.contact-form textarea {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--pencil); outline-offset: 1px; }
.contact-form button {
  justify-self: start;
  margin-top: 1.2rem;
  font: inherit;
  padding: 0.6rem 1.4rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}
.contact-form button:hover { background: var(--red); }
.hp { position: absolute; left: -9999px; }

/* Works buy links */
.buy-link { font-size: 0.95rem; color: var(--pencil); }
.buy-link a { color: var(--ink); text-decoration-color: var(--red); }

/* Shop */
.disclosure { font-size: 0.9rem; color: var(--pencil); border-left: 2px solid var(--red); padding-left: 1rem; }
.buy { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.btn {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: 0.95rem;
}
.btn:hover { background: var(--red); border-color: var(--red); }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* Homepage */
.hero { position: relative; max-width: 75rem; margin: 0 auto; background: #2b2b29; }
.hero img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: cover; object-position: 75% 30%; }
.hero-text {
  position: absolute; left: 0; bottom: 0; top: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 2rem clamp(1.25rem, 5vw, 4rem);
  width: 55%;
  color: #f4f2ec;
  text-shadow: 0 1px 12px rgba(0,0,0,.6);
}
.hero-text h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); margin: 0; }
.hero-text p { margin: 0.3rem 0 0; letter-spacing: 0.08em; }
.hero-sub { font-style: italic; letter-spacing: 0 !important; max-width: 24ch; margin-top: 1rem !important; font-size: 1.1rem; }
@media (max-width: 40rem) {
  .hero-text { position: static; width: 100%; background: #2b2b29; text-shadow: none; }
}

.home-main { max-width: 60rem; }
.home-main > .intro, .home-main > .start, .home-main > .epigraph { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.epigraph { text-align: center; margin: 1rem auto 2.5rem; font-size: 1.4rem; }
.epigraph p { margin: 0; }
.epigraph .gloss { font-size: 1rem; color: var(--pencil); font-style: italic; margin-top: 0.3rem; }
.epigraph cite { font-style: normal; }
.intro { font-size: 1.1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; margin: 3rem 0; }
.card { display: block; text-decoration: none; color: inherit; }
.card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; display: block; filter: saturate(0.85); transition: filter .3s; }
.card:hover img { filter: saturate(1); }
.card h2 { font-size: 1.3rem; margin: 0.9rem 0 0.2rem; }
.card p { margin: 0; color: var(--pencil); font-size: 0.95rem; }
.card:hover h2 { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 0.2em; }
.start h2 { margin-top: 1rem; }
.photo-credit { font-size: 0.8rem; color: var(--pencil); text-align: center; margin-top: 3rem; }

/* Red accent rule under page titles */
main > h1::after, .start h2::after {
  content: ""; display: block; width: 2.5rem; height: 3px;
  background: var(--red); margin-top: 0.9rem;
}

/* Microscript texture accent */
.micro-band { position: relative; isolation: isolate; padding: 3rem 1.25rem; margin: 0 -1.25rem 2.5rem; }
.micro-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../images/microscript.jpg") center 30% / cover no-repeat;
  opacity: 0.13; filter: grayscale(1);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 72%);
          mask-image: radial-gradient(ellipse at center, #000 35%, transparent 72%);
}
.site-footer { position: relative; }
.site-footer::before {
  content: ""; position: absolute; left: 1.25rem; top: -1px; width: 2.5rem; height: 3px; background: var(--red);
}

/* Page photos */
.page-photo { margin: 2rem 0 2.5rem; }
.page-photo img { width: 100%; height: auto; display: block; }
.page-photo figcaption { font-size: 0.85rem; color: var(--pencil); margin-top: 0.5rem; }

/* Footer */
.site-footer {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--pencil);
  font-size: 0.85rem;
}
