:root {
  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #6b6b70;
  --accent: #c2410c;
  --code-bg: #14141a;
  --code-fg: #e7e5e4;
  --rule: #e6e3dc;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 18px/1.75 Georgia, "Iowan Old Style", "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

header {
  text-align: center;
  padding: 7rem 1.5rem 3rem;
}

header h1 {
  margin: 0;
  font: 700 clamp(3rem, 10vw, 5.5rem) / 1 -apple-system, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.04em;
}

header h1 span { color: var(--accent); }

header p {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font: 1.1rem -apple-system, "Helvetica Neue", Arial, sans-serif;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin: 2rem auto 0;
  max-width: 40rem;
  font: 0.85rem -apple-system, "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--accent); }

main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

section { padding-top: 3rem; }

h2 {
  margin: 0 0 1rem;
  font: 700 1.6rem -apple-system, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.02em;
}

h2::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-bottom: 1rem;
  background: var(--accent);
}

p { margin: 0 0 1.25rem; }

.lead { font-size: 1.2rem; }

code {
  font: 0.85em ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--rule);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

pre {
  margin: 1.5rem 0;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code { background: none; padding: 0; font-size: inherit; }

ul { padding-left: 1.2rem; margin: 0 0 1.25rem; }
li { margin-bottom: 0.4rem; }

figure { margin: 2rem 0; text-align: center; }

figure img {
  width: 100%;
  height: auto;
}

.source-figure {
  margin-top: 2rem;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #f1f1f1;
  box-shadow: 0 18px 48px rgb(29 29 31 / 12%);
}

.source-figure a {
  position: relative;
  display: block;
  overflow: hidden;
  background: #d7d9dc;
}

.source-figure a::after {
  content: "OPEN FULL IMAGE ↗";
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 6px;
  background: rgb(20 20 26 / 88%);
  color: #fff;
  font: 600 0.68rem -apple-system, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.source-figure a:hover::after,
.source-figure a:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.source-figure a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.source-figure img {
  display: block;
  width: 100%;
  max-height: min(72vh, 38rem);
  object-fit: cover;
  object-position: top;
  transition: filter 160ms ease;
}

.source-figure a:hover img {
  filter: brightness(0.9);
}

.source-figure figcaption {
  padding: 0.85rem 1rem;
  color: var(--muted);
  font: 600 0.68rem -apple-system, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.1em;
  text-align: left;
}

.source-figure figcaption span { padding: 0 0.35rem; }
.source-figure figcaption code { letter-spacing: 0; }

footer {
  padding: 2rem 1.5rem 4rem;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  font: 0.85rem -apple-system, "Helvetica Neue", Arial, sans-serif;
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  header { padding-top: 4rem; }
  .source-figure img { max-height: 60vh; }
}
