/* Layout: a grey baseplate you build on — brick-letter hero, masonry wall of MOCs, a "send yours" brick panel. */
:root {
  --plate: #e7e9ee;        /* light bluish grey baseplate */
  --stud: #d6d9e1;
  --card: #ffffff;
  --ink: #1d2230;
  --muted: #5b6275;
  --red: #d01012;
  --yellow: #f5c518;
  --blue: #0b5cad;
  --green: #237841;
  --line: #c9cdd8;
  --shadow: rgba(20, 26, 44, .18);
  --f-display: "Bowlby One", "Arial Black", Impact, sans-serif;
  --f-body: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --plate: #1a1d26; --stud: #232735; --card: #252a37; --ink: #eef0f5; --muted: #a2a9bb;
    --red: #e8383a; --yellow: #f7cd37; --blue: #3d8be0; --green: #3aa163;
    --line: #363c4d; --shadow: rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --plate: #1a1d26; --stud: #232735; --card: #252a37; --ink: #eef0f5; --muted: #a2a9bb;
  --red: #e8383a; --yellow: #f7cd37; --blue: #3d8be0; --green: #3aa163;
  --line: #363c4d; --shadow: rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--plate);
  background-image: radial-gradient(circle at 50% 50%, var(--stud) 0 7px, transparent 7.5px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 1.2rem/1.6 var(--f-body);
}
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 16px; }
@media (min-width: 700px) { .wrap { padding-inline: 32px; } }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- Hero ---------- */
header.hero { padding-block: 56px 40px; display: grid; gap: 22px; }
.eyebrow {
  font: 500 .95rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.motto { margin: 0; display: flex; flex-wrap: wrap; gap: 10px 18px; font-family: var(--f-display); font-weight: 400; }
.word { display: flex; gap: 6px; }
.brick {
  --c: var(--red);
  position: relative; display: grid; place-items: center;
  width: clamp(46px, 11vw, 104px); height: clamp(52px, 12vw, 112px);
  font-size: clamp(2.2rem, 8.5vw, 5.4rem); line-height: 1; color: #fff;
  background: var(--c); border-radius: 6px;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.25), 0 6px 0 -1px var(--shadow);
  margin-top: 14px;
  animation: drop .55s cubic-bezier(.3,1.5,.5,1) both;
  animation-delay: calc(var(--i) * 60ms);
}
.brick::before, .brick::after {
  content: ""; position: absolute; top: -12px; width: 34%; height: 13px;
  background: var(--c); border-radius: 4px 4px 0 0;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.28), inset 0 -2px 0 rgba(0,0,0,.12);
}
.brick::before { left: 10%; }
.brick::after { right: 10%; }
.brick.y { --c: var(--yellow); color: #2a2100; }
.brick.b { --c: var(--blue); }
.brick.g { --c: var(--green); }
@keyframes drop { from { transform: translateY(-28px); } to { transform: none; } }

.lede { max-width: 52ch; margin: 0; font-size: 1.45rem; color: var(--muted); text-wrap: pretty; }
.lede strong { color: var(--ink); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 1.2rem/1 var(--f-body); text-decoration: none; cursor: pointer;
  padding: 14px 20px; border: 0; border-radius: 6px;
  background: var(--ink); color: var(--plate);
  box-shadow: 0 5px 0 var(--shadow);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--shadow); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--shadow); }
.btn.red { background: var(--red); color: #fff; }
.btn.ghost { background: var(--card); color: var(--ink); }

/* ---------- Filters ---------- */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  padding-block: 12px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--plate) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 1.05rem/1 var(--f-body); cursor: pointer;
  padding: 9px 14px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--plate); border-color: var(--ink); }
.count { font: 400 .95rem/1 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Gallery (masonry) ---------- */
.wall { columns: 1; column-gap: 18px; padding-bottom: 56px; }
@media (min-width: 560px) { .wall { columns: 2; } }
@media (min-width: 900px) { .wall { columns: 3; } }
@media (min-width: 1180px) { .wall { columns: 4; } }
.moc {
  break-inside: avoid; margin: 0 0 18px; display: block; width: 100%;
  background: var(--card); border: 0; padding: 0; text-align: left; color: inherit; font: inherit;
  border-radius: 8px; overflow: hidden; cursor: zoom-in;
  box-shadow: 0 4px 0 var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.moc:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 9px 0 var(--shadow); }
.moc img { display: block; width: 100%; height: auto; background: var(--stud); }
.moc .meta { display: grid; gap: 4px; padding: 12px 14px 14px; }
.moc h3 { margin: 0; font: 700 1.25rem/1.25 var(--f-body); text-wrap: balance; }
.moc .by { display: flex; justify-content: space-between; gap: 8px; font: 400 .9rem/1.35 var(--f-mono); color: var(--muted); }
.moc .by span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { flex: none; padding: 2px 6px; border-radius: 3px; color: #fff; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.tag.diorama { background: var(--green); }
.tag.space { background: var(--blue); }
.tag.technic { background: var(--red); }
.tag.sculpture { background: var(--yellow); color: #2a2100; }
.tag.mech { background: var(--muted); }
.tag.architecture { background: var(--ink); color: var(--plate); }

/* ---------- Send yours ---------- */
.send { padding-block: 24px 64px; }
.panel {
  position: relative; display: grid; gap: 28px; padding: 32px 22px;
  background: var(--yellow); color: #2a2100; border-radius: 10px;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.12), 0 8px 0 var(--shadow);
}
@media (min-width: 860px) { .panel { grid-template-columns: 1.1fr 1fr; padding: 44px; align-items: center; } }
.panel::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: -14px; height: 15px;
  background: radial-gradient(circle at 50% 100%, var(--yellow) 0 15px, transparent 15.5px) 0 0 / 48px 15px repeat-x;
}
.panel h2 { margin: 0 0 10px; font: 400 clamp(2.4rem, 6vw, 3.8rem)/1 var(--f-display); text-wrap: balance; }
.panel p { margin: 0; max-width: 46ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 5px;
  background: #2a2100; color: #f5c518; font: 700 1.1rem/1 var(--f-mono);
}
.mailbox { display: grid; gap: 12px; margin-top: 22px; }
.addr {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 10px 10px 16px; border-radius: 6px; background: #fff8d6; border: 2px solid #2a2100;
}
.addr code { flex: 1 1 200px; min-width: 0; font: 500 1.3rem/1.3 var(--f-mono); user-select: all; overflow-wrap: anywhere; color: #2a2100; }
.addr .btn { padding: 10px 14px; font-size: 1.05rem; background: #2a2100; color: #f5c518; box-shadow: none; }
.panel .btn.red { justify-self: start; }
.note { font-size: 1rem; opacity: .8; }

/* ---------- Footer / credits ---------- */
footer { border-top: 1px solid var(--line); background: var(--card); padding-block: 36px; }
footer h2 { margin: 0 0 6px; font: 700 1.25rem/1.3 var(--f-body); }
footer p { margin: 0 0 16px; color: var(--muted); font-size: 1.1rem; max-width: 70ch; }
.credits { columns: 1; column-gap: 28px; margin: 0; padding: 0; list-style: none; font: 400 .92rem/1.5 var(--f-mono); color: var(--muted); }
@media (min-width: 700px) { .credits { columns: 2; } }
@media (min-width: 1050px) { .credits { columns: 3; } }
.credits li { break-inside: avoid; margin-bottom: 6px; }
.credits a { color: var(--ink); }

/* ---------- Lightbox ---------- */
dialog.lb {
  width: min(1100px, 100% - 24px); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 10px;
  background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
dialog.lb::backdrop { background: rgba(10, 12, 20, .78); }
.lb figure { margin: 0; display: grid; }
.lb img { width: 100%; max-height: 74vh; object-fit: contain; background: #0f1118; }
.lb figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.lb figcaption div { min-width: 0; }
.lb h3 { margin: 0; font: 400 1.75rem/1.2 var(--f-display); }
.lb small { font: 400 .95rem/1.4 var(--f-mono); color: var(--muted); }
.lb .nav { display: flex; gap: 8px; }
.lb .nav button { width: 42px; height: 42px; border-radius: 6px; border: 1px solid var(--line); background: var(--plate); color: var(--ink); font: 700 1.1rem/1 var(--f-body); cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .brick { animation: none; }
  .moc, .btn { transition: none; }
}

[hidden] { display: none !important; }
.moc { text-decoration: none; }
