:root {
  --bg: #dd9341;
  --panel: #ffffff;
  --ink: #111111;
  --line: #000000;
  --soft-line: #cfcfcf;
  --image-mat: #ffffff;
  --orange: #dd9341;
  --orange-dark: #ad6c1c;
  --orange-light: #ebb066;
  --green: #6ea931;
  --green-dark: #588b24;
  --green-light: #88be4a;
  --shadow: rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Comfortaa", sans-serif;
}

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

a:visited,
a:hover {
  color: var(--orange-dark);
}

img {
  display: block;
  max-width: 100%;
}

.site-shell {
  width: min(1260px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
}

.site-frame {
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow);
}

.site-frame {
  padding: 18px 20px 20px;
}

.site-header {
  padding: 0 0 16px;
  margin-bottom: 18px;
}

.home-header {
  border-bottom: 0;
  margin-bottom: 12px;
}

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

.site-title,
.page-title,
.section-heading h2,
.thumb-card-title {
  font-weight: 700;
}

.site-title {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.site-title a {
  color: var(--ink);
}

.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.letter-pill,
.random-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 1.18rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.22), 0 1px 0 rgba(255,255,255,0.18);
  transition: background 120ms ease, color 120ms ease, text-shadow 120ms ease;
}

.letter-pill-green,
.random-link {
  background: linear-gradient(180deg, var(--green-light) 0%, var(--green) 55%, var(--green-dark) 100%);
}

.letter-pill-orange {
  background: linear-gradient(180deg, var(--orange-light) 0%, var(--orange) 55%, var(--orange-dark) 100%);
}

.letter-pill:visited,
.letter-pill:active,
.random-link:visited,
.random-link:active {
  color: #ffffff;
}

.letter-pill:hover,
.random-link:hover,
.letter-pill:visited:hover,
.random-link:visited:hover {
  color: #cfcfcf;
  text-shadow: none;
}

.site-main {
  margin-top: 0;
}

.page-header {
  padding: 0 4px 14px;
}

.page-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.3vw, 1.9rem);
}

.hero {
  overflow: hidden;
}

.hero-figure {
  margin: 0;
  padding: 20px;
}

.hero-image {
  width: 100%;
  aspect-ratio: 1200 / 450;
  object-fit: cover;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--image-mat);
}

.hero-fallback {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(110, 169, 49, 0.24), transparent 35%),
    radial-gradient(circle at bottom right, rgba(221, 147, 65, 0.28), transparent 40%),
    #fffdf8;
  border-bottom: 1px solid var(--soft-line);
}

.hero-fallback p {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  text-align: center;
}

.hero-copy,
.section-heading,
.entry-caption,
.provenance {
  padding: 18px 20px;
}

.home-random {
  margin: 18px 0 0;
}

.home-random a,
.home-random a:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(180deg, var(--green-light) 0%, var(--green) 55%, var(--green-dark) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 6px rgba(0,0,0,0.18);
  text-shadow: 0 1px 0 rgba(0,0,0,0.18);
}

.section-heading {
  border-bottom: 1px solid var(--soft-line);
}

.letter-heading {
  padding-top: 10px;
  padding-bottom: 10px;
}

.letter-heading .meta {
  margin: 0;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.meta {
  color: #3d3d3d;
  font-size: 0.9rem;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 240px));
  justify-content: space-between;
  gap: 24px 20px;
  padding: 20px;
}

.thumb-grid-home {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.thumb-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--ink);
}

.thumb-card:hover,
.thumb-card:visited {
  color: var(--ink);
}

.thumb-card-image {
  width: 100%;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 14px;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--image-mat);
}

.thumb-card-title {
  font-size: 1.1rem;
}

.thumb-caption {
  margin: 0;
  color: #333333;
  font-size: 0.95rem;
}

.about-copy {
  padding: 18px 20px;
}

.about-copy p {
  margin: 0 0 16px;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.entry-panel {
  padding: 8px 0 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.entry-shell {
  display: grid;
  grid-template-columns: minmax(32px, 48px) minmax(0, 1080px) minmax(32px, 48px);
  gap: 16px;
  align-items: start;
  justify-content: center;
}

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

.entry-figure {
  margin: 0;
}

.entry-image {
  width: 100%;
  aspect-ratio: 1200 / 896;
  object-fit: cover;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--image-mat);
}

.entry-word {
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.entry-caption p {
  margin: 0;
  font-size: 1.05rem;
}

.entry-caption {
  padding: 0 0 14px;
}

.provenance {
  padding: 10px 0 10px;
  text-align: right;
}

.entry-nav {
  display: flex;
  align-self: stretch;
}

.caret-link,
.caret-link:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  padding: 12px 0;
  color: #000000;
  font-size: 4rem;
  line-height: 1;
}

.caret-link.is-empty {
  visibility: hidden;
}

.mini-strip-wrap {
  overflow-x: auto;
  padding-bottom: 2px;
}

.mini-strip {
  display: flex;
  gap: 10px;
  min-width: max-content;
}

.mini-thumb {
  display: block;
  border-radius: 12px;
}

.mini-thumb img {
  width: 96px;
  height: 96px;
  padding: 6px;
  border-radius: 12px;
  border: 2px solid var(--line);
  object-fit: cover;
  background: var(--image-mat);
}

.mini-thumb.is-current img {
  border-color: var(--green);
}

.site-footer {
  border-top: 1px solid var(--soft-line);
  margin-top: 18px;
  padding: 14px 4px 0;
}

.site-footer .meta {
  margin: 0;
}

@media (max-width: 980px) {
  .site-shell {
    width: min(100vw - 24px, 1320px);
  }

  .entry-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .entry-main {
    order: 1;
  }

  .entry-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: calc(100vw - 18px);
    margin-top: 12px;
  }

  .site-frame {
    padding: 14px;
  }

  .thumb-grid,
  .hero-figure,
  .hero-copy,
  .section-heading {
    padding: 14px;
  }

  .site-header {
    padding-bottom: 14px;
    margin-bottom: 14px;
  }

  .thumb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
  }

  .thumb-caption {
    display: none;
  }

  .hero-image {
    aspect-ratio: 4 / 3;
    object-position: center center;
  }
}
