:root {
  --gold-start: #ffcc00;
  --gold-end: #ff6f00;
  --teal: #30cfd0;
  --blue: #2a6ded;
  --paper: #f6f7fa;
  --ink: #1a1a1a;
  --stage: #1b1c22;
  --available: #dfe2ec;
  --available-hover: #c7ccdc;
  --selected: #2a6ded;
  --sold-shadow: rgba(0,0,0,0.35);
  --radius: 14px;
  --font-display: 'Space Grotesk', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
}

#top { scroll-margin-top: 76px; }

/* ---------- Nav ---------- */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--gold-start) 0%, var(--gold-end) 100%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: #201a06;
  text-decoration: none;
  letter-spacing: 0.2px;
}
.brand-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.nav-tagline {
  font-size: 0.74rem;
  font-weight: 600;
  color: #4a3a08;
  opacity: 0.85;
  white-space: nowrap;
}
.main-nav nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.main-nav nav a {
  color: #201a06;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.98rem;
  padding: 9px 14px;
  border-radius: 8px;
  transition: background 0.15s;
}
.main-nav nav a:hover,
.main-nav nav a:focus-visible {
  background: rgba(255,255,255,0.45);
}
.main-nav nav a.nav-cta {
  background: #1b1c22;
  color: #fff;
}
.main-nav nav a.nav-cta:hover { background: #33343d; }

/* ---------- Hero ---------- */
.brand-container {
  text-align: center;
  max-width: 560px;
  margin: 16px auto 2px auto;
  padding: 0 20px;
}
.main-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  background: linear-gradient(90deg, var(--teal) 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.site-tagline {
  font-size: 1rem;
  line-height: 1.5;
  color: #4a4d59;
  margin: 0;
}
.stat-strip {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: #201a06;
  background: linear-gradient(90deg, var(--gold-end) 0%, var(--gold-start) 100%);
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  margin: 0 0 18px 0;
}
.grid-stats {
  font-size: 0.85rem;
  color: #8a8d99;
  margin: 8px 0 0 0;
  font-variant-numeric: tabular-nums;
}

/* ---------- Grid stage ---------- */
.grid-stage {
  max-width: 1300px;
  margin: 0 auto 56px auto;
  padding: 12px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.grid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  font-size: 0.85rem;
  color: #4a4d59;
  margin-bottom: 16px;
}
.grid-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
}
.swatch-available { background: var(--available); }
.swatch-selected { background: var(--selected); }
.swatch-pending { background: repeating-linear-gradient(45deg, #ffb300, #ffb300 3px, #ffe082 3px, #ffe082 6px); }

.grid-hint {
  text-align: center;
  font-size: 0.86rem;
  color: #8a8d99;
  margin: 14px 0 0 0;
  max-width: 440px;
}

/* Seamless, edge-to-edge grid like the original million-dollar-pixel sites —
   no gaps between cells (that's what caused the dark grid-line look), and
   every cell sized as a FRACTION of the container width (1fr) rather than a
   fixed px value. That means the whole grid always fits inside the screen
   width exactly, on any device, with zero horizontal scroll — the same way
   a 1000x1000 image scales to fit a browser window. Vertical scroll to see
   the rest of a very tall square grid is fine; horizontal scroll is not. */
#grid {
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(200, 1fr);
  grid-template-rows: repeat(200, 1fr);
  gap: 0;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 1 / 1;
  background: var(--stage);
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  overflow: hidden; /* safety clip only — no rounded corners to cause visible clipping now */
}

.cell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--available);
  cursor: pointer;
}
.cell:hover { filter: brightness(0.93); }
.cell.is-selected { background: var(--selected); }
.cell.is-pending {
  background: repeating-linear-gradient(45deg, #ffb300, #ffb300 3px, #ffe082 3px, #ffe082 6px);
  cursor: not-allowed;
}
.cell.is-sold-wrap {
  display: block;
  width: 100%;
  height: 100%;
  line-height: 0; /* removes the default inline-image gap under the <a> */
}
.cell.is-sold-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* fills the tile fully, cropping the logo to fit rather than squashing it */
}

/* ---------- How it works ---------- */
.page-section {
  max-width: 720px;
  margin: 0 auto 72px auto;
  padding: 0 24px;
}
.page-section h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--ink);
  margin-bottom: 18px;
}
.how-steps {
  padding-left: 20px;
  color: #333;
  line-height: 1.7;
}
.how-steps li { margin-bottom: 12px; }
.fine-print {
  font-size: 0.88rem;
  color: #737788;
  margin-top: 20px;
}

.site-footer {
  text-align: center;
  color: #8a8d99;
  font-size: 0.85rem;
  padding: 24px;
}
.footer-links { margin-top: 6px; }
.footer-links a { color: #8a8d99; margin: 0 2px; }

/* ---------- Selection bar ---------- */
.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  background: #1b1c22;
  color: #fff;
  border-radius: 999px;
  padding: 12px 12px 12px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 200;
}
.selection-bar.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.selection-info { font-size: 0.95rem; white-space: nowrap; }
.selection-actions { display: flex; gap: 8px; }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
}
.btn-primary { background: linear-gradient(90deg, var(--teal), var(--blue)); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost { background: rgba(255,255,255,0.12); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.2); }
.btn-block { width: 100%; margin-top: 18px; border-radius: 10px; padding: 13px; font-size: 1rem; }
#paypalButtonContainer { margin-top: 18px; min-height: 45px; }

/* ---------- Modal ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,15,20,0.55);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal-content {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  padding: 32px 28px 28px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-content h2 {
  font-family: var(--font-display);
  margin: 0 0 6px 0;
  font-size: 1.4rem;
}
.checkout-summary { color: #555; font-size: 0.92rem; margin: 0 0 18px 0; }
.close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #444;
  line-height: 1;
}
#checkoutForm label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 14px 0 6px;
  color: #333;
}
#checkoutForm input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9dbe3;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-body);
}
#checkoutForm input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
.field-hint { font-size: 0.78rem; color: #888; margin: 6px 0 0; }
.checkout-error {
  margin-top: 14px;
  padding: 10px 12px;
  background: #fdecea;
  border: 1px solid #f4c7c3;
  color: #9c2c22;
  border-radius: 8px;
  font-size: 0.85rem;
}

a:focus-visible,
button:focus-visible,
.cell:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .main-title { font-size: 1.8rem; }
  .nav-tagline { display: none; }
}

@media (max-width: 560px) {
  .selection-bar {
    flex-direction: column;
    align-items: stretch;
    width: calc(100% - 32px);
    border-radius: 16px;
    padding: 14px;
  }
  .selection-actions { justify-content: stretch; }
  .selection-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .selection-bar { transition: none; }
}
