/* 03 — The Board. Split-flap: lamp-black, bone, one brass. */

:root {
  --wall: #101214;
  --panel: #08090b;
  --line: #23262a;
  --bone: #ece3cd;
  --dim: #9b9480;
  --brass: #b08d3e;
  --brass-hi: #d9b86a;
  /* Flap cell geometry. 11 cells must fit a 375px screen. */
  --ch: clamp(38px, 9.2vw, 78px);
  --cw: calc(var(--ch) * 0.72);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--wall);
  /* One lamp over the board; otherwise flat dark. */
  background-image: radial-gradient(120% 80% at 50% 0%, #171a1d 0%, var(--wall) 55%);
  background-repeat: no-repeat;
  color: var(--bone);
  font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

::selection { background: var(--brass); color: #1c1404; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

main {
  max-width: 880px;
  margin-inline: auto;
  padding: clamp(28px, 6vh, 72px) clamp(14px, 4vw, 24px) 24px;
}

/* ---- Brass plaque ------------------------------------------------------- */

.plaque {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(165deg, #d3ad62, #9c7c35 55%, #c19d52);
  color: #332708;
  padding: 12px 26px 12px 16px;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.35),
              0 8px 18px -10px rgba(0, 0, 0, 0.9);
  transform: rotate(-0.5deg); /* hung by hand */
}
.plaque img { display: block; width: 44px; height: auto; }
.plaque-text b {
  display: block;
  font-family: Oswald, "Arial Narrow", "Helvetica Neue", sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: 0.18em;
  /* Engraved, not printed. */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.plaque-text small {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  margin-top: 2px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}
.screw {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d9a0, #6b5419);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}
.screw.tl { top: 5px; left: 5px; }
.screw.tr { top: 5px; right: 5px; }
.screw.bl { bottom: 5px; left: 5px; }
.screw.br { bottom: 5px; right: 5px; }

/* ---- The board ------------------------------------------------------------ */

.board-wrap { position: relative; margin: 36px 0 56px; }

.board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(14px, 4vw, 30px) clamp(8px, 2.5vw, 30px);
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.75), 0 20px 44px -28px #000;
}

.flap-row {
  display: flex;
  justify-content: center;
  gap: clamp(3px, 0.7vw, 6px);
}

.cell {
  position: relative;
  width: var(--cw);
  height: var(--ch);
  perspective: 320px;
  font-family: Oswald, "Arial Narrow", "Helvetica Neue", sans-serif;
  font-weight: 600;
  font-size: calc(var(--ch) * 0.72);
  color: var(--bone);
}
/* Hinge line across the middle. */
.cell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 4;
}

.half, .face {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  background: linear-gradient(#202327, #191c1f);
}
.half.top { top: 0; border-radius: 5px 5px 0 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.half.bot { bottom: 0; border-radius: 0 0 5px 5px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.45); }

.half b, .face b {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--ch);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1; /* Oswald's ascent overflows a line-height box; flex-center instead */
  font-weight: 600;
}
.half.bot b { top: auto; bottom: 0; }

.leaf {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  z-index: 3;
  will-change: transform;
  visibility: hidden; /* only exists mid-flip; otherwise the halves do the talking */
}
.leaf.flip {
  visibility: visible;
  transition: transform var(--t, 140ms) cubic-bezier(0.45, 0, 0.6, 1);
  transform: rotateX(-180deg);
}
.face { inset: 0; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.front { border-radius: 5px 5px 0 0; }
.face.back {
  transform: rotateX(180deg);
  background: linear-gradient(#191c1f, #15181a);
  border-radius: 0 0 5px 5px;
}
.face.back b { top: auto; bottom: 0; }

.board-fallback {
  margin: 0;
  text-align: center;
  font-family: Oswald, "Arial Narrow", "Helvetica Neue", sans-serif;
  font-weight: 600;
  font-size: clamp(2rem, 9vw, 4.4rem);
  letter-spacing: 0.14em;
}

/* ---- Maintenance tag ------------------------------------------------------- */

.tag {
  position: absolute;
  right: 4%;
  bottom: -40px;
  width: 178px;
  margin: 0;
  padding: 12px 14px 12px 26px;
  background: #e6d3a3;
  color: #4a3a14;
  border-radius: 3px;
  transform: rotate(5deg);
  box-shadow: 0 8px 14px -8px #000;
  font-family: Oswald, "Arial Narrow", "Helvetica Neue", sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.6;
}
/* Punched hole, brass eyelet. */
.tag::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  translate: 0 -50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--wall);
  box-shadow: inset 0 0 0 2px #b89a55;
}

/* ---- Copy ---------------------------------------------------------------------- */

.desc {
  max-width: 560px;
  margin: 0 0 30px;
  color: #c9c2ad;
  font-size: 1.05rem;
}

/* ---- Demo: framed platform screenshot + call to action ------------------------- */

.demo { margin: 0; }

.demo-frame {
  position: relative;
  display: block;
  max-width: none; /* full width, aligned with the board (was 560px to match the text column) */
  border-radius: 8px;
  padding: 8px;
  /* A dark monitor bezel around the screenshot; depth from edges, not elevation. */
  background: linear-gradient(#202327, #15171a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px #000,
    0 22px 50px -28px #000;
  text-decoration: none;
  transition: box-shadow 150ms ease;
}
.demo-frame:hover,
.demo-frame:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px #000,
    0 26px 56px -26px #000,
    0 0 0 1px var(--brass);
}
.demo-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* Small brass tag pinned to the frame's top edge. */
.demo-tag {
  position: absolute;
  z-index: 2;
  top: -10px;
  left: 18px;
  font-family: Oswald, "Arial Narrow", "Helvetica Neue", sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #231a05;
  background: linear-gradient(165deg, #d3ad62, #9c7c35);
  padding: 4px 12px;
  border-radius: 3px;
  box-shadow: 0 4px 10px -4px #000, inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.demo-cta { max-width: 560px; margin-top: 24px; }
.demo-cta p { margin: 0 0 16px; color: #c9c2ad; font-size: 1.05rem; }
.demo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0; }

.demo-btn {
  font-family: Oswald, "Arial Narrow", "Helvetica Neue", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--brass);
  color: #231a05;
  border-radius: 4px;
  padding: 12px 24px;
  text-decoration: none;
  white-space: nowrap;
}
.demo-btn:hover { background: var(--brass-hi); }
.demo-note { color: var(--dim); font-size: 0.85rem; }

/* ---- Footer --------------------------------------------------------------------- */

footer {
  max-width: 880px;
  margin-inline: auto;
  padding: 26px clamp(14px, 4vw, 24px) 64px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--dim);
  border-top: 1px solid var(--line);
}
footer p { margin: 0; }

/* ---- Small screens ------------------------------------------------------------------- */

@media (max-width: 560px) {
  /* The board is much shorter here; hang the tag below it instead of across it. */
  .tag { right: 0; bottom: -74px; width: 150px; }
  .board-wrap { margin-bottom: 100px; }
  .demo-frame { padding: 6px; }
  .demo-row { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .leaf.flip { transition: none; }
  * { animation: none !important; }
}
