:root {
  --bg: #15120e;
  --surface: #1f1a14;
  --surface-2: #2a231b;
  --line: #3b3226;
  --text: #ece3d3;
  --muted: #b3a690;
  --accent: #d6a84c;
  --accent-ink: #1a1408;
  --shadow: 0 10px 30px rgb(0 0 0 / .35);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5efe3;
    --surface: #fffaf0;
    --surface-2: #efe5d2;
    --line: #dccdb2;
    --text: #2a2218;
    --muted: #6b5d48;
    --accent: #9a6b14;
    --accent-ink: #fffaf0;
    --shadow: 0 8px 24px rgb(80 60 20 / .15);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
code { font-size: .9em; background: var(--surface-2); padding: .05em .35em; border-radius: 4px; overflow-wrap: anywhere; }

main, .masthead, .footer { max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

.masthead { padding-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 1.5rem/1 var(--serif); letter-spacing: .02em; color: var(--text); text-decoration: none;
}

h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0 0 .3em; }
h2 { font-size: 1.6rem; margin: 1.4em 0 .4em; }

.hero { padding: 48px 0 32px; max-width: 760px; }
.hero p { color: var(--muted); font-size: 1.15rem; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; padding-bottom: 56px; }
@media (max-width: 680px) { .grid { grid-template-columns: 1fr; gap: 20px; } }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  color: var(--text); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card-body { padding: 16px 20px 20px; }
.card h2 { margin: 0; font-size: 1.9rem; }
.card p { margin: .3em 0 0; color: var(--muted); }
.period { color: var(--accent) !important; font-weight: 600; font-size: .95rem; letter-spacing: .02em; }

.crumbs { padding: 18px 0 0; font-size: .95rem; }
.crumbs a::before { content: "\2190  "; }

.mod-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; align-items: start; padding: 20px 0 32px; }
@media (max-width: 820px) { .mod-head { grid-template-columns: 1fr; gap: 20px; } }
.cover { border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.mod-intro p { margin: .5em 0; }
.meta { color: var(--muted); font-size: .9rem; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 10px; }
.button {
  display: inline-flex; flex-direction: column; padding: 12px 22px; border-radius: 8px; border: 1px solid var(--accent);
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: 1.05rem; line-height: 1.25;
}
.button span { font-weight: 400; font-size: .8rem; opacity: .85; }
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button:hover { filter: brightness(1.1); }
@media (max-width: 480px) { .button { flex: 1 1 100%; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery a { border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .2s ease; }
.gallery a:hover img { transform: scale(1.03); }

.columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; padding: 8px 0 56px; }
@media (max-width: 820px) { .columns { grid-template-columns: 1fr; gap: 0; } }
.text p { margin: .4em 0 .9em; }
.install {
  align-self: start; margin-top: 2.2em; padding: 4px 22px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; font-size: .95rem;
}
.install h2 { font-size: 1.4rem; margin-top: .8em; }
.install ol { padding-left: 1.2em; }
.install li { margin-bottom: .6em; }
.install dl { margin: .4em 0 0; }
.install dt { font-weight: 600; }
.install dd { margin: 0 0 .3em; }

.lightbox {
  padding: 0; border: 0; background: transparent; color: #fff;
  width: 100vw; height: 100vh; max-width: none; max-height: none; overflow: hidden;
}
.lightbox::backdrop { background: rgb(0 0 0 / .95); }
.lightbox .track {
  display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.lightbox .track::-webkit-scrollbar { display: none; }
.lightbox .slide {
  flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 48px 72px; scroll-snap-align: center; scroll-snap-stop: always;
}
.lightbox .slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 6px; }
.lightbox button {
  position: fixed; background: rgb(0 0 0 / .45); border: 0; color: #fff; cursor: pointer; line-height: 1;
  border-radius: 50%; width: 48px; height: 48px; font-size: 2rem; display: grid; place-items: center;
}
.lightbox button:hover { background: rgb(0 0 0 / .75); }
.lightbox button:disabled { opacity: .25; cursor: default; }
.lightbox .prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .close { top: 12px; right: 14px; }
.lightbox .counter { position: fixed; top: 22px; left: 0; right: 0; text-align: center; font-size: .95rem; opacity: .8; pointer-events: none; }
@media (max-width: 680px) {
  .lightbox .slide { padding: 56px 8px; }
  .lightbox .nav { top: auto; bottom: 14px; transform: none; }
}

.footer { max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

.masthead { padding-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 1.5rem/1 var(--serif); letter-spacing: .02em; color: var(--text); text-decoration: none;
}

h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0 0 .3em; }
h2 { font-size: 1.6rem; margin: 1.4em 0 .4em; }

.hero { padding: 48px 0 32px; max-width: 760px; }
.hero p { color: var(--muted); font-size: 1.15rem; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; padding-bottom: 56px; }
@media (max-width: 680px) { .grid { grid-template-columns: 1fr; gap: 20px; } }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  color: var(--text); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card-body { padding: 16px 20px 20px; }
.card h2 { margin: 0; font-size: 1.9rem; }
.card p { margin: .3em 0 0; color: var(--muted); }
.period { color: var(--accent) !important; font-weight: 600; font-size: .95rem; letter-spacing: .02em; }

.crumbs { padding: 18px 0 0; font-size: .95rem; }
.crumbs a::before { content: "\2190  "; }

.mod-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; align-items: start; padding: 20px 0 32px; }
@media (max-width: 820px) { .mod-head { grid-template-columns: 1fr; gap: 20px; } }
.cover { border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.mod-intro p { margin: .5em 0; }
.meta { color: var(--muted); font-size: .9rem; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 10px; }
.button {
  display: inline-flex; flex-direction: column; padding: 12px 22px; border-radius: 8px; border: 1px solid var(--accent);
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: 1.05rem; line-height: 1.25;
}
.button span { font-weight: 400; font-size: .8rem; opacity: .85; }
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button:hover { filter: brightness(1.1); }
@media (max-width: 480px) { .button { flex: 1 1 100%; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery a { border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .2s ease; }
.gallery a:hover img { transform: scale(1.03); }

.columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; padding: 8px 0 56px; }
@media (max-width: 820px) { .columns { grid-template-columns: 1fr; gap: 0; } }
.text p { margin: .4em 0 .9em; }
.install {
  align-self: start; margin-top: 2.2em; padding: 4px 22px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; font-size: .95rem;
}
.install h2 { font-size: 1.4rem; margin-top: .8em; }
.install ol { padding-left: 1.2em; }
.install li { margin-bottom: .6em; }
.install dl { margin: .4em 0 0; }
.install dt { font-weight: 600; }
.install dd { margin: 0 0 .3em; }

.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox::backdrop { background: rgb(0 0 0 / .85); }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 6px; cursor: pointer; }
.lightbox .close {
  position: fixed; top: 10px; right: 16px; background: none; border: 0; color: #fff; font-size: 2.4rem; cursor: pointer;
}

.footer { border-top: 1px solid var(--line); padding-top: 20px; padding-bottom: 32px; color: var(--muted); font-size: .85rem; }
