@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 600;
  font-style: normal;
  font-display: block;
  src: url('../fonts/barlow-condensed-latin-600-normal.woff2') format('woff2');
}

:root {
  --bg: #0d0d0c;
  --surface: #171715;
  --surface-2: #201f1c;
  --line: #2e2c28;
  --text: #f1ede4;
  --muted: #a39d91;
  --accent: #f2b632;
  --accent-ink: #1a1405;
  --danger: #e2564a;

  /* the board */
  --frame: #0a0a09;
  --flap-top: #232220;
  --flap-bot: #1c1b19;
  --glyph: #f3efe6;
  --seam: #050505;

  --c-r: #d8382f;
  --c-o: #ef7d22;
  --c-y: #f2c230;
  --c-g: #2f9e55;
  --c-b: #2c6fd6;
  --c-p: #7d4ccf;
  --c-w: #f3efe6;

  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-board-theme='light'] {
  --frame: #d8d3c7;
  --flap-top: #f4f1ea;
  --flap-bot: #ebe7de;
  --glyph: #181816;
  --seam: #b9b3a6;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- flaps ---------- */

.board {
  display: grid;
  grid-gap: var(--gap, 4px);
  --ch: 40px;
  --d: 60ms;
}

.flap {
  position: relative;
  height: var(--ch);
  font-family: var(--display);
  font-weight: 600;
  font-size: calc(var(--ch) * 0.8);
  color: var(--glyph);
  -webkit-perspective: calc(var(--ch) * 4);
  perspective: calc(var(--ch) * 4);
  -webkit-user-select: none;
  user-select: none;
}

.flap .h, .flap .l {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
}

.flap .t {
  top: 0;
  background: var(--flap-top);
  border-radius: calc(var(--ch) * 0.07) calc(var(--ch) * 0.07) 0 0;
  -webkit-transform-origin: 50% 100%;
  transform-origin: 50% 100%;
}

.flap .b {
  bottom: 0;
  background: var(--flap-bot);
  border-radius: 0 0 calc(var(--ch) * 0.07) calc(var(--ch) * 0.07);
  -webkit-transform-origin: 50% 0;
  transform-origin: 50% 0;
}

.flap b {
  display: block;
  height: var(--ch);
  line-height: var(--ch);
  text-align: center;
  font-weight: 600;
}

.flap .b b {
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}

.flap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--seam);
  z-index: 3;
}

.flap .l {
  visibility: hidden;
  z-index: 2;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flap.go0 .l, .flap.go1 .l { visibility: visible; }
.flap.go0 .l.t { -webkit-animation: fallA var(--d) ease-in forwards; animation: fallA var(--d) ease-in forwards; }
.flap.go1 .l.t { -webkit-animation: fallB var(--d) ease-in forwards; animation: fallB var(--d) ease-in forwards; }
.flap.go0 .l.b { -webkit-animation: riseA var(--d) ease-out forwards; animation: riseA var(--d) ease-out forwards; }
.flap.go1 .l.b { -webkit-animation: riseB var(--d) ease-out forwards; animation: riseB var(--d) ease-out forwards; }

@-webkit-keyframes fallA { from { -webkit-transform: rotateX(0); } 50%, to { -webkit-transform: rotateX(-90deg); } }
@-webkit-keyframes fallB { from { -webkit-transform: rotateX(0); } 50%, to { -webkit-transform: rotateX(-90deg); } }
@-webkit-keyframes riseA { from, 50% { -webkit-transform: rotateX(90deg); } to { -webkit-transform: rotateX(0); } }
@-webkit-keyframes riseB { from, 50% { -webkit-transform: rotateX(90deg); } to { -webkit-transform: rotateX(0); } }
@keyframes fallA { from { transform: rotateX(0); } 50%, to { transform: rotateX(-90deg); } }
@keyframes fallB { from { transform: rotateX(0); } 50%, to { transform: rotateX(-90deg); } }
@keyframes riseA { from, 50% { transform: rotateX(90deg); } to { transform: rotateX(0); } }
@keyframes riseB { from, 50% { transform: rotateX(90deg); } to { transform: rotateX(0); } }

.flap [data-c='r'] { background: var(--c-r); }
.flap [data-c='o'] { background: var(--c-o); }
.flap [data-c='y'] { background: var(--c-y); }
.flap [data-c='g'] { background: var(--c-g); }
.flap [data-c='b'] { background: var(--c-b); }
.flap [data-c='p'] { background: var(--c-p); }
.flap [data-c='w'] { background: var(--c-w); }

@media (prefers-reduced-motion: reduce) {
  .flap.go0 .l, .flap.go1 .l { visibility: hidden; }
}

/* ---------- board page ---------- */

.board-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: var(--frame);
  cursor: default;
}

.board-page .board {
  position: absolute;
}

.chrome {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.3s;
}

.chrome.away { opacity: 0; pointer-events: none; }

.chrome button {
  width: 44px;
  height: 44px;
  margin-left: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: rgba(20, 20, 18, 0.82);
  color: #f1ede4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chrome svg { width: 20px; height: 20px; }

.badge {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 9;
  font: 600 13px/1 var(--display);
  letter-spacing: 0.12em;
  color: rgba(241, 237, 228, 0.55);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
}

[data-board-theme='light'] .badge { color: rgba(24, 24, 22, 0.6); background: rgba(255, 255, 255, 0.5); }

.start {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 7, 0.72);
  border: 0;
  width: 100%;
  cursor: pointer;
  color: var(--text);
}

.start strong { font: 600 40px/1 var(--display); letter-spacing: 0.08em; }
.start span { margin-top: 12px; color: var(--muted); font-size: 15px; }

/* ---------- settings panel ---------- */

.panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100%;
  z-index: 30;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 20px 20px 40px;
  color: var(--text);
}

.panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel h2 { font: 600 28px/1 var(--display); letter-spacing: 0.06em; margin: 0; }

.panel section {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.panel h3 {
  font: 600 15px/1.2 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.row + .row { margin-top: 6px; }

.row label { flex: 1; }

.screen-row { flex-wrap: wrap; }
.screen-row .lock { color: var(--muted); font-size: 13px; margin-left: 8px; }

.sub { margin: 8px 0 4px 30px; }

.panel input[type='text'], .panel input[type='number'], .panel select, .panel textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 16px; /* below 16px iOS zooms the page on focus */
}

.panel textarea { min-height: 84px; resize: vertical; }

.panel input[type='checkbox'] { width: 20px; height: 20px; margin: 0 10px 0 0; vertical-align: middle; }

.panel .inline { display: flex; }
.panel .inline > * + * { margin-left: 8px; }
.panel .inline input { flex: 1; }

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  font-size: 15px;
}

.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.5; cursor: default; }

.picks { margin-top: 8px; }
.picks button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.picks button small { color: var(--muted); display: block; margin-top: 2px; }

.hint { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 8px 0 0; }
.ok { color: #6fcf8f; }
.err { color: var(--danger); }

.qr { background: #fff; padding: 10px; border-radius: 10px; width: 164px; margin: 12px 0; }
.qr svg, .qr img { display: block; width: 144px; height: 144px; }

.link-box {
  word-break: break-all;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---------- site pages ---------- */

.site { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

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

.logo {
  font: 600 30px/1 var(--display);
  letter-spacing: 0.16em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo i {
  display: inline-block;
  width: 14px;
  height: 20px;
  margin-right: 10px;
  border-radius: 2px;
  background: linear-gradient(var(--accent) 0 47%, var(--bg) 47% 53%, var(--accent) 53%);
}

.nav nav a { color: var(--muted); text-decoration: none; margin-left: 24px; font-size: 15px; }
.nav nav a.btn { color: var(--accent-ink); }

.hero { padding: 24px 0 24px; text-align: center; }

.hero h1 {
  font: 600 clamp(40px, 5.6vw, 72px)/0.95 var(--display);
  letter-spacing: 0.02em;
  margin: 0 auto;
  max-width: 20ch;
  text-transform: uppercase;
}

.hero p.lede {
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 40em;
  margin: 16px auto 22px;
}

.cta { display: flex; justify-content: center; flex-wrap: wrap; }
.cta .btn { margin: 0 6px 10px; padding: 14px 22px; font-size: 17px; }

.stage {
  margin: 22px auto 10px;
  padding: clamp(10px, 2.4vw, 26px);
  background: var(--frame);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  max-width: 1040px;
  position: relative;
}

.stage .board { margin: 0 auto; }

.stage-cap {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  max-width: 1040px;
  margin: 10px auto 0;
}

.stage-cap button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; }

.band { padding: 72px 0; border-top: 1px solid var(--line); }

.band h2 {
  font: 600 clamp(32px, 5vw, 52px)/1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 12px;
}

.band > .site > p { color: var(--muted); font-size: 18px; line-height: 1.55; max-width: 40em; margin: 0 0 36px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}

.card h3 { font: 600 24px/1.1 var(--display); letter-spacing: 0.04em; margin: 0 0 8px; text-transform: uppercase; }
.card p { color: var(--muted); line-height: 1.55; margin: 0; font-size: 15.5px; }
.card .tile { display: inline-block; width: 12px; height: 16px; border-radius: 2px; margin-bottom: 14px; }

.steps { counter-reset: s; }
.steps .card h3::before {
  counter-increment: s;
  content: counter(s);
  display: inline-block;
  width: 30px;
  height: 38px;
  line-height: 38px;
  text-align: center;
  margin-right: 12px;
  border-radius: 4px;
  background: var(--flap-top);
  color: var(--accent);
  font-size: 26px;
  vertical-align: middle;
}

.price {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-gap: 16px;
  max-width: 820px;
}

.price .card { padding: 28px; }
.price .card.pro { border-color: var(--accent); }
.price .amount { font: 600 56px/1 var(--display); margin: 10px 0 2px; }
.price .amount small { font-size: 20px; color: var(--muted); letter-spacing: 0.04em; }
.price ul { list-style: none; padding: 0; margin: 18px 0 24px; line-height: 1.5; }
.price li { padding: 7px 0 7px 26px; position: relative; color: var(--text); border-top: 1px solid var(--line); font-size: 15.5px; }
.price li::before { content: ''; position: absolute; left: 2px; top: 13px; width: 9px; height: 12px; border-radius: 2px; background: var(--accent); }
.price .card:not(.pro) li::before { background: var(--muted); }
.price .btn { width: 100%; text-align: center; padding: 14px; font-size: 17px; }

.faq { max-width: 760px; }
.faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-size: 18px; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); line-height: 1.6; margin: 12px 0 0; }

footer.foot {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
footer.foot a { color: var(--muted); margin-right: 18px; }

.page { max-width: 720px; padding-bottom: 80px; }
.page h1 { font: 600 52px/1 var(--display); text-transform: uppercase; margin: 24px 0 20px; }
.page h2 { font: 600 26px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; margin: 32px 0 8px; }
.page p, .page li { line-height: 1.65; color: #d6d1c6; }

.keybox {
  font: 600 clamp(26px, 6vw, 40px)/1.2 var(--display);
  letter-spacing: 0.08em;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 14px;
  text-align: center;
  margin: 20px 0;
  word-break: break-all;
}

.send-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 18px;
  text-transform: uppercase;
}

.swatches { display: flex; flex-wrap: wrap; margin: 10px 0 18px; }
.swatches button {
  width: 34px;
  height: 44px;
  border-radius: 5px;
  border: 1px solid var(--line);
  margin: 0 8px 8px 0;
  cursor: pointer;
}

.preview-frame { background: var(--frame); border-radius: 10px; padding: 10px; margin: 0 0 18px; }

@media (max-width: 640px) {
  .nav nav a:not(.btn) { display: none; }
  .band { padding: 52px 0; }
  .stage-cap { flex-direction: column; }
}
