:root {
  --bg: #faf7f2;
  --ink: #1d1a17;
  --muted: #6c645a;
  --line: #e5ddd0;
  --accent: #2f6b4f;
  --accent-hover: #24563f;
  --accent-ink: #fffaf3;
  --code-bg: #1a1714;
  --code-ink: #efe6d6;
  --code-muted: #9c8f7e;
  --menu-bg: #fffcf7;
  --shot-shadow: 0 1px 2px rgb(60 35 15 / 0.08), 0 28px 64px -28px rgb(60 35 15 / 0.45);
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

/* Project accents */

.melodom {
  --accent: #a6501d;
  --accent-hover: #8c4317;
  --accent-ink: #fffaf3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131110;
    --ink: #f2eadb;
    --muted: #a0968a;
    --line: #2b2622;
    --accent: #6dbd8c;
    --accent-hover: #8bcca4;
    --accent-ink: #0b1710;
    --code-bg: #1c1916;
    --menu-bg: #1c1916;
    --shot-shadow: 0 0 0 1px rgb(255 255 255 / 0.07), 0 28px 64px -28px rgb(0 0 0 / 0.9);
  }

  .melodom {
    --accent: #e08447;
    --accent-hover: #eb9862;
    --accent-ink: #1b0f06;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
a.arrow { text-decoration: none; }
a.arrow::after { content: " →"; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; margin: 0; text-wrap: balance; }
p, figcaption { text-wrap: pretty; }

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
.wrap.wide { max-width: 1264px; }

.hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header */

.top { display: flex; align-items: center; justify-content: space-between; height: 76px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-size: 18px; font-weight: 650; letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }

nav { display: flex; gap: 28px; }
nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav a:hover { color: var(--ink); }

/* Hero */

.hero { text-align: center; padding-top: 88px; }
.hero-icon { margin: 0 auto 36px; filter: drop-shadow(0 10px 18px rgb(120 50 10 / 0.25)); }
.hero h1 { font-size: clamp(42px, 6.4vw, 76px); letter-spacing: -0.035em; line-height: 1.04; }
.lead { max-width: 640px; margin: 24px auto 0; font-size: 20px; line-height: 1.55; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 36px 0 0; }

.button {
  display: inline-flex; align-items: center; height: 46px; padding: 0 22px;
  border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  font-size: 16px; font-weight: 600; text-decoration: none;
}
.button:hover { background: var(--accent-hover); color: var(--accent-ink); }
.button.ghost { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.button.ghost:hover { box-shadow: inset 0 0 0 1px var(--muted); color: var(--ink); }

.meta { margin: 22px 0 0; font-size: 14px; color: var(--muted); }

/* Screenshots */

.shot { margin-top: 80px; }
.shot img, .gallery img { border-radius: 12px; box-shadow: var(--shot-shadow); }
figure { margin: 0; }
figcaption { margin-top: 16px; font-size: 14px; color: var(--muted); }
.shot figcaption { text-align: center; }
figcaption b { color: var(--ink); font-weight: 600; }

/* Features */

.features { padding-top: 136px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 40px; }
.grid article { border-top: 1px solid var(--line); padding-top: 20px; }
.grid h3 { font-size: 18px; margin-bottom: 8px; }
.grid p { margin: 0; color: var(--muted); font-size: 16px; }
.more { margin: 40px 0 0; font-size: 16px; }

/* Gallery */

.gallery img { aspect-ratio: 16 / 10; object-fit: cover; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 56px 40px; padding-top: 136px; }

/* Split sections */

.split {
  display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center;
  padding-top: 136px;
}
.split > * { min-width: 0; }
.split h2 { font-size: clamp(30px, 3.4vw, 40px); letter-spacing: -0.03em; margin-bottom: 20px; }
.split p { margin: 0 0 16px; color: var(--muted); }

pre {
  margin: 0; padding: 24px 28px; overflow-x: auto;
  background: var(--code-bg); color: var(--code-ink); border-radius: 12px;
  font: 14px/1.75 var(--mono);
}
pre .c { color: var(--code-muted); }

kbd {
  display: inline-block; min-width: 1.6em; padding: 0 6px; margin: 0 1px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  font: 13px/1.6 var(--sans); color: var(--ink); text-align: center;
}

.combo { white-space: nowrap; }

.links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 16px; }

/* Status */

.status { padding-top: 136px; }
.status p {
  max-width: 760px; margin: 0 auto; text-align: center;
  font-size: 18px; color: var(--muted);
}
.status strong { color: var(--ink); font-weight: 600; }

/* Footer */

footer { margin-top: 136px; padding-bottom: 56px; font-size: 14px; color: var(--muted); }
.foot { display: flex; align-items: center; justify-content: space-between; padding-top: 32px; margin-bottom: 20px; border-top: 1px solid var(--line); }
.foot .brand { font-size: 16px; gap: 8px; }
footer p { margin: 0 0 8px; max-width: 760px; }
footer .fine { font-size: 12px; }

/* Home */

.intro { padding-top: 104px; }
.intro h1 { max-width: 11em; font-size: clamp(42px, 6vw, 72px); letter-spacing: -0.035em; line-height: 1.04; }
.intro .lead { margin: 28px 0 0; }

.projects { padding-top: 120px; }

.label {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}

.project {
  display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center;
  margin-top: 20px; padding-top: 56px; border-top: 1px solid var(--line);
}
.project + .project { margin-top: 104px; }
.project > * { min-width: 0; }
.project p { margin: 12px 0 0; color: var(--muted); }

.project-title { display: flex; align-items: center; gap: 14px; font-size: 32px; letter-spacing: -0.03em; }
.project-title a { display: inline-flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.project-title a:hover { color: var(--accent); }
.project .tagline { margin-top: 20px; font-size: 21px; font-weight: 600; line-height: 1.35; letter-spacing: -0.015em; color: var(--ink); }
.project .meta { margin-top: 18px; }
.project .actions { justify-content: flex-start; margin-top: 28px; }
.project .note { margin-top: 16px; font-size: 14px; }
.project p code { font: 0.9em var(--mono); color: var(--ink); }
.project-shot-link { display: block; }
.project-shot { border-radius: 12px; box-shadow: var(--shot-shadow); }

/* Download menu */

.download { position: relative; }
.download summary { list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none; }
.download summary::-webkit-details-marker { display: none; }
.download .chevron { margin-left: 10px; vertical-align: middle; }
.download[open] .chevron { transform: rotate(180deg); }

.download-menu {
  position: absolute; z-index: 10; top: calc(100% + 8px); left: 0; width: 340px; padding: 8px;
  background: var(--menu-bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shot-shadow);
}
.download-menu ul { margin: 0; padding: 0; list-style: none; }
.download-menu a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none;
}
.download-menu a:hover { background: var(--line); color: var(--ink); }
.download-menu small { font-size: 13px; font-weight: 400; color: var(--muted); }
.project .download-menu p { margin: 6px 12px 4px; font-size: 13px; line-height: 1.5; }

/* Small screens */

@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .split, .project { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 20px; }
  .top { height: 64px; }
  nav { gap: 18px; }
  nav a { font-size: 14px; }
  .hero { padding-top: 48px; }
  .hero-icon { width: 72px; height: 72px; margin-bottom: 28px; }
  .lead { font-size: 18px; }
  .shot { margin-top: 56px; }
  .shot img, .gallery img { border-radius: 8px; }
  .features, .gallery, .split, .status { padding-top: 88px; }
  .grid, .gallery { grid-template-columns: 1fr; gap: 32px; }
  pre { padding: 18px 20px; font-size: 12px; }
  .intro { padding-top: 48px; }
  .projects { padding-top: 80px; }
  .project { padding-top: 40px; }
  .project + .project { margin-top: 72px; }
  .project-title { font-size: 28px; }
  .project-title img { width: 40px; height: 40px; }
  .project .tagline { font-size: 19px; }
  .project-shot { border-radius: 8px; }
  footer { margin-top: 88px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 16px; }
}
