:root {
  --night: #1d1b3a;
  --night-2: #2a2552;
  --night-3: #3a3370;
  --cream: #fff6e8;
  --cream-2: #f6e7cf;
  --ink: #2b2330;
  --ink-soft: #5a4d5e;
  --red: #c92f37;
  --red-dark: #9e2229;
  --gold: #f2b53a;
  --green: #2f7d4f;
  --snow: #f4f2ff;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(10, 8, 30, .35);
  --wrap: 1080px;
  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night) radial-gradient(ellipse at top, var(--night-3), var(--night) 60%) no-repeat;
  color: var(--snow);
  font: 17px/1.6 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
a:hover { color: #ffd27a; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); margin: .2em 0 .3em; }
h2 { font-size: clamp(1.45rem, 4vw, 2rem); margin: 1.6em 0 .5em; }
h3 { font-size: 1.2rem; margin: 1.2em 0 .3em; }
p, ul, ol { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--cream); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* Header */
.site-header { background: rgba(20, 18, 44, .85); border-bottom: 3px solid var(--red); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; margin-right: auto; }
.brand img { width: 120px; height: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--display); font-weight: 500; }
.nav a { color: var(--snow); text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--gold); color: #fff; }

/* Buttons */
.btn {
  display: inline-block; font-family: var(--display); font-weight: 600; font-size: 1.05rem;
  text-decoration: none; border-radius: 999px; padding: 12px 24px;
  background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-dark);
}
.btn:hover { background: #dc3c44; color: #fff; }
.btn.small { padding: 7px 16px; font-size: .95rem; }
.btn.ghost { background: transparent; color: var(--snow); box-shadow: inset 0 0 0 2px var(--cream-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.btn.ghost.on-light { color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.ghost.on-light:hover { background: rgba(0, 0, 0, .05); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1em 0 1.4em; }

/* Breadcrumbs */
.crumbs { font-size: .9rem; margin: 16px 0 0; color: #cfc8ee; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: #8f87c2; }
.crumbs a { color: #cfc8ee; }

/* Hero */
.hero { padding: 28px 0 8px; text-align: center; }
.hero .logo { width: min(440px, 86%); margin: 0 auto; }
.hero .lead { font-size: 1.15rem; max-width: 640px; margin: 0 auto; color: #e9e5ff; }
.hero .btn-row { justify-content: center; }

/* Cards and content */
main { padding-bottom: 40px; }
.card { background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 22px 22px 8px; box-shadow: var(--shadow); margin: 18px 0; }
.card a { color: var(--red-dark); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.prose { max-width: 760px; }
.updated { color: #cfc8ee; font-size: .95rem; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid .card { margin: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 46px; margin-bottom: 14px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--red); color: #fff; font-family: var(--display); font-weight: 600; display: grid; place-items: center;
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1em; }
table { width: 100%; border-collapse: collapse; background: var(--cream); color: var(--ink); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e8d6b8; vertical-align: top; }
th { background: var(--cream-2); font-family: var(--display); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Codes */
.code { font: 700 1.15rem/1 ui-monospace, Consolas, monospace; letter-spacing: .04em; background: #fff; border: 2px dashed var(--red); color: var(--red-dark); padding: 6px 10px; border-radius: 8px; display: inline-block; }
.status { display: inline-block; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.status.on { background: #d9f2e2; color: var(--green); }
.status.off { background: #eee; color: #777; }

/* Gallery */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin: 0 0 1em; }
.gallery figure { margin: 0; background: var(--night-2); border-radius: 14px; overflow: hidden; }
.gallery figcaption { padding: 8px 12px 12px; font-size: .95rem; color: #e1dcff; }

/* Footer */
.site-footer { background: #15132e; border-top: 3px solid var(--green); padding: 28px 0; font-size: .95rem; color: #cfc8ee; }
.site-footer .cols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font-size: 1.1rem; margin: 0 0 .4em; color: var(--snow); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.site-footer a { color: #e9e5ff; }
.fine { margin-top: 18px; font-size: .85rem; color: #9d95cc; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand img { width: 96px; }
  .nav { width: 100%; justify-content: space-between; font-size: .95rem; }
  .header-play { display: none; }
  .card { padding: 18px 16px 4px; }
  th, td { padding: 8px; }
}
