:root {
  --paper: #f3ead8;
  --paper-deep: #e8dcc3;
  --surface: rgba(255, 250, 240, 0.86);
  --stamp-paper: #fffaf0;
  --ink: #2a2118;
  --muted: #6b5d48;
  --line: #d9cbb0;
  --accent: #9c3d2a;
  --postmark: rgba(40, 32, 26, 0.55);
  --stamp-filter: none;
  --shadow: rgba(60, 40, 20, 0.28);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #18150f;
    --paper-deep: #100e0a;
    --surface: rgba(32, 28, 21, 0.86);
    --stamp-paper: #ece2cf;
    --ink: #f1e8d6;
    --muted: #b4a68d;
    --line: #3b3428;
    --accent: #e0846a;
    --postmark: rgba(30, 24, 18, 0.6);
    --stamp-filter: brightness(0.82) saturate(0.9);
    --shadow: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, transparent 40%, var(--paper-deep) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.6 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.defs {
  position: absolute;
}

/* Perforated stamp edge: solid content box plus a row of holes around the padding */
.perf {
  display: inline-block;
  position: relative;
  padding: 7px;
  background: var(--stamp-paper);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(circle 3.2px, #0000 96%, #000) -5px -5px / 10px 10px round;
  mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(circle 3.2px, #0000 96%, #000) -5px -5px / 10px 10px round;
}

.perf img {
  display: block;
  width: 100%;
  height: auto;
  filter: var(--stamp-filter);
}

/* Parallax album */
.album {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.track {
  position: absolute;
  inset: 0 0 auto;
  will-change: transform;
}

.track .perf {
  position: absolute;
  transform: rotate(var(--tilt));
}

.track.far {
  opacity: 0.5;
  filter: blur(1px) saturate(0.85);
}

.track.mid {
  opacity: 0.78;
  filter: drop-shadow(0 4px 6px var(--shadow));
}

.track.near {
  opacity: 1;
  filter: drop-shadow(0 10px 14px var(--shadow));
}

.pm {
  position: absolute;
  top: 8%;
  right: -28%;
  width: 78%;
  overflow: visible;
  fill: none;
  stroke: var(--postmark);
  stroke-width: 2.4;
  transform: rotate(-14deg);
}

.pm text {
  fill: var(--postmark);
  stroke: none;
  font: 700 11px Inter, sans-serif;
  letter-spacing: 0.08em;
}

.pm .pm-arc {
  font-size: 8.5px;
  letter-spacing: 0.18em;
}

/* Calm reading area in the middle, stamps show more at the edges */
.veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 55% 70% at 50% 45%, color-mix(in srgb, var(--paper) 70%, transparent) 0%, transparent 100%);
}

.hero,
main,
footer {
  position: relative;
  z-index: 1;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  max-width: 1040px;
  min-height: 86vh;
  margin: 0 auto;
  padding: 72px 24px 48px;
}

.hero-text {
  text-shadow: 0 0 18px var(--paper), 0 0 6px var(--paper);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font: 700 clamp(64px, 11vw, 128px) / 0.95 Fraunces, Georgia, serif;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 34ch;
  margin: 20px 0 0;
  color: var(--muted);
  font: 400 clamp(18px, 2.2vw, 21px) / 1.55 Fraunces, Georgia, serif;
}

.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.cta {
  display: inline-block;
  padding: 12px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.cta:hover,
.cta:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.cta.quiet {
  border-color: transparent;
}

.cta.quiet:hover,
.cta.quiet:focus-visible {
  border-color: var(--ink);
  background: none;
  color: var(--ink);
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 0;
}

.feature-stamp {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 18px 24px var(--shadow));
  transform: rotate(-4deg);
  transition: transform 0.3s;
}

.feature-stamp:hover {
  transform: rotate(-1deg) scale(1.03);
}

.feature-stamp:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
}

.feature-stamp .perf {
  padding: 10px;
}

.feature-stamp img {
  width: auto;
  max-width: 240px;
  height: auto;
  max-height: 240px;
}

.feature-stamp.flip {
  animation: flip 0.6s ease;
}

@keyframes flip {
  from {
    opacity: 0;
    transform: rotate(-12deg) translateY(16px) scale(0.94);
  }
}

.feature figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.feature-title {
  margin-top: 4px;
  font: 600 20px/1.3 Fraunces, Georgia, serif;
}

.feature-year {
  color: var(--muted);
  font-size: 14px;
}

/* Panels */
main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.panel {
  margin-bottom: 40px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px -30px var(--shadow);
}

h2 {
  margin: 0;
  font: 600 32px/1.2 Fraunces, Georgia, serif;
  letter-spacing: -0.01em;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}

.section-head a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.section-head a:hover {
  text-decoration: underline;
}

.section-lead {
  max-width: 60ch;
  margin: 10px 0 0;
  color: var(--muted);
}

/* App cards, edged like stamps */
.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.apps li {
  filter: drop-shadow(0 6px 10px var(--shadow));
  transition: transform 0.2s, filter 0.2s;
}

.apps li:hover,
.apps li:focus-within {
  transform: translateY(-4px) rotate(-0.6deg);
  filter: drop-shadow(0 14px 18px var(--shadow));
}

.apps a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 10px 10px 22px;
  background: var(--stamp-paper);
  color: #2a2118;
  text-decoration: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(circle 3.6px, #0000 96%, #000) -6px -6px / 12px 12px round;
  mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(circle 3.6px, #0000 96%, #000) -6px -6px / 12px 12px round;
}

.apps a:focus-visible {
  outline: none;
}

.apps li:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.band {
  display: flex;
  justify-content: space-between;
  margin: 0 0 6px;
  padding: 9px 14px;
  background: var(--band);
  color: #fff8ea;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.apps h3 {
  margin: 4px 14px 0;
  font: 600 22px/1.25 Fraunces, Georgia, serif;
}

.apps p {
  margin: 0 14px;
  color: #6b5d48;
}

.host {
  margin: auto 14px 0;
  padding-top: 10px;
  color: #9c3d2a;
  font-size: 14px;
  font-weight: 600;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 32px 24px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.gallery li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.gallery .perf {
  filter: drop-shadow(0 6px 10px var(--shadow));
  transition: transform 0.25s;
}

.gallery li:nth-child(odd) .perf {
  transform: rotate(-2deg);
}

.gallery li:nth-child(even) .perf {
  transform: rotate(1.5deg);
}

.gallery li:hover .perf {
  transform: rotate(0) scale(1.05);
}

.gallery img {
  width: auto;
  max-width: 170px;
  max-height: 170px;
}

.cap {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.cap strong {
  font: 600 16px/1.3 Fraunces, Georgia, serif;
}

.cap span {
  color: var(--muted);
}

/* Post lists, on the home page and the blog index */
.posts {
  display: grid;
  gap: 4px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.posts a {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 4px 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.posts li:first-child a {
  border-top: 0;
}

.posts time {
  grid-row: span 2;
  padding-top: 4px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.posts h3 {
  margin: 0;
  font: 600 21px/1.3 Fraunces, Georgia, serif;
}

.posts a:hover h3,
.posts a:focus-visible h3 {
  color: var(--accent);
}

.posts p {
  margin: 0;
  color: var(--muted);
}

/* Blog pages */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.topbar a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.topbar a:hover {
  color: var(--accent);
}

.topbar .brand {
  color: var(--ink);
  font: 700 24px/1 Fraunces, Georgia, serif;
}

.post {
  max-width: 760px;
  padding-top: 40px;
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.post-head h1 {
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.postmark {
  flex: none;
  width: 124px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  transform: rotate(-10deg);
  opacity: 0.85;
}

.postmark text {
  fill: var(--accent);
  stroke: none;
  font-family: Inter, sans-serif;
  font-weight: 700;
}

.postmark .ring {
  font-size: 9px;
  letter-spacing: 0.2em;
}

.postmark .day {
  font-size: 13px;
  letter-spacing: 0.06em;
}

.postmark .year {
  font-size: 17px;
}

.cover {
  margin: 32px 0 0;
}

.cover img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border: 10px solid var(--stamp-paper);
  box-shadow: 0 18px 40px -20px var(--shadow);
}

.prose {
  margin-top: 32px;
  font: 400 19px/1.75 Fraunces, Georgia, serif;
}

.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin: 1.6em 0 0.4em;
  font: 600 24px/1.3 Fraunces, Georgia, serif;
}

.prose h5,
.prose h6 {
  color: var(--muted);
  font-size: 15px;
  font-family: Inter, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.1em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.prose blockquote p {
  margin: 0;
}

.prose img {
  max-width: 100%;
  height: auto;
  border: 8px solid var(--stamp-paper);
  box-shadow: 0 12px 28px -16px var(--shadow);
}

.prose a {
  color: var(--accent);
}

.post-foot {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.post-foot a {
  color: var(--accent);
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
}

footer {
  padding: 8px 24px 40px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: 0;
    padding: 56px 16px 40px;
  }

  main {
    padding: 0 16px 32px;
  }

  .panel {
    padding: 24px 18px;
  }

  .feature-stamp img {
    max-width: 200px;
    max-height: 200px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }

  .gallery img {
    max-width: 100%;
  }

  .posts a {
    grid-template-columns: 1fr;
  }

  .posts time {
    grid-row: auto;
  }

  .topbar {
    padding: 20px 16px 0;
  }

  .post {
    padding-top: 28px;
  }

  .postmark {
    width: 92px;
  }

  .prose {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .feature-stamp.flip {
    animation: none;
  }
}
