/* ============================================================
   Trigon Puzzles — site stylesheet
   v1.0  2026-07-26
   Colours sampled from the original logo and book artwork.
   See BRAND-KIT.md for the reasoning behind every value here.
   ============================================================ */

/* ---------- 1. Brand tokens ---------- */
:root {
  --red:        #E93323;
  --blue:       #2F6EBE;
  --yellow:     #F5D000;
  --black:      #000000;
  --maroon:     #8B2E2A;   /* puzzle grid line work */
  --white:      #FFFFFF;
  --grey:       #F4F4F4;
  --grey-line:  #DDDDDD;
  --ink:        #1A1A1A;
  --ink-soft:   #4A4A4A;

  --font-head: "Poppins", "Montserrat", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(0,0,0,.10);
}

/* ---------- 2. Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  /* Deliberately large. A good share of puzzle buyers are older,
     and small grey text loses them. */
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  color: var(--black);
  margin: 0 0 .5em;
  font-weight: 700;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); letter-spacing: -.01em; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }
a { color: var(--red); }
a:hover { color: var(--blue); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }
.small { font-size: .95rem; color: var(--ink-soft); }

/* ---------- 3. The signature triple rule ----------
   Red / yellow / blue, exactly as it appears around every
   puzzle shape in the books. This is the brand in one element. */
.trirule {
  height: 9px;
  border: 0;
  margin: 0;
  background: linear-gradient(
    to bottom,
    var(--red)    0 3px,
    var(--yellow) 3px 6px,
    var(--blue)   6px 9px
  );
}

/* ---------- 4. Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--grey-line);
}
.site-head .bar {
  display: flex; align-items: center; gap: 28px;
  max-width: var(--wrap); margin: 0 auto; padding: 14px 24px;
}

/* ---- The logo lockup, rebuilt live ----
   The original plaque was a flat 345px PNG. This reproduces it in CSS:
   black panel, triple red/yellow/blue outline via stacked shadows, the
   high-resolution mark, and the wordmark as real text. Sharp at any size,
   readable by search engines and screen readers, and recolourable. */
.lockup {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--black);
  padding: 9px 20px 9px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: 0 0 0 3px var(--yellow),
              0 0 0 6px var(--blue),
              0 0 0 9px var(--red);
  margin: 9px;
}
.lockup img { width: 34px; }
.lockup span {
  font-family: var(--font-head);
  font-weight: 700; font-size: 1.3rem;
  color: var(--white); letter-spacing: .01em; white-space: nowrap;
}
.lockup:hover span { color: var(--yellow); }

/* Large centred version, for the footer or a splash */
.lockup-lg { padding: 16px 34px 16px 24px; }
.lockup-lg img { width: 62px; }
.lockup-lg span { font-size: 2.1rem; }
.site-head nav { margin-left: auto; display: flex; gap: 26px; flex-wrap: wrap; }
.site-head nav a {
  font-family: var(--font-head);
  font-weight: 600; font-size: 1rem;
  color: var(--black); text-decoration: none;
}
.site-head nav a:hover { color: var(--red); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700; font-size: 1.05rem;
  padding: 15px 30px;
  border-radius: 999px;
  text-decoration: none;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-primary { background: var(--red);  color: var(--white); }
.btn-primary:hover { color: var(--white); }

.btn-secondary {
  background: var(--white); color: var(--black);
  border-color: var(--blue);
}
.btn-secondary:hover { color: var(--blue); }

/* The plaque button — the logo treatment turned into a control.
   Black panel, triple outline. Use sparingly, for the main action. */
.btn-plaque {
  background: var(--black); color: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 0 0 3px var(--yellow),
              0 0 0 6px var(--blue),
              0 0 0 9px var(--red);
  margin: 9px;
}
.btn-plaque:hover { color: var(--yellow); }

/* ---------- 6. Sections ---------- */
section { padding: 76px 0; }
section.tint { background: var(--grey); }
section.dark { background: var(--black); color: var(--white); }
section.dark h2 { color: var(--white); }
section.dark .lead { color: #C9C9C9; }

/* ---------- 7. Hero ----------
   The mark sits at the top and the words wrap around it. Bright, white
   background, colour doing the work. */
.hero { padding: 52px 0 60px; text-align: center; }
.hero .mark { width: 190px; margin: 0 auto 26px; }
.hero h1 { max-width: 15ch; margin-left: auto; margin-right: auto; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero .lead { max-width: 640px; margin: 0 auto 10px; }
.hero .actions {
  display: flex; gap: 16px; flex-wrap: wrap;
  justify-content: center; margin-top: 34px;
}
.hero .reassure { margin-top: 18px; font-size: .95rem; color: var(--ink-soft); }

/* Confetti of small marks behind the hero — subtle, not busy */
.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero .fleck {
  position: absolute; opacity: .10; pointer-events: none;
  width: 120px; z-index: 0;
}
.hero .fleck:nth-of-type(1) { top: 8%;  left: -30px; transform: rotate(-18deg); }
.hero .fleck:nth-of-type(2) { top: 55%; right: -34px; transform: rotate(24deg); width: 165px; }
.hero .fleck:nth-of-type(3) { bottom: -20px; left: 12%; transform: rotate(9deg); width: 90px; }

/* ---------- 7a2. The mark crossing the page ----------
   A thin strip between two sections. Every 40 seconds the tribar tumbles
   in from the left, steadies in the middle, and leaves on the right —
   and every fourth pass it bursts instead. Often enough to be noticed,
   rare enough not to nag. */
.flypast {
  height: 110px;
  overflow: hidden;
  pointer-events: none;
  margin: 0;
}
.flypast img { width: 100%; height: 110px; display: block; }

@media (max-width: 700px) { .flypast, .flypast img { height: 78px; } }

/* ---------- 7b. Split feature rows ---------- */
.split {
  display: grid; gap: 52px; align-items: center;
  grid-template-columns: 1fr 1fr;
}
.split.flip > :first-child { order: 2; }
.split figure { margin: 0; }
.split img { border-radius: var(--radius); }
/* the walking-man scene is wide and thin — let it break out of its column */
.split figure.wide { margin-right: -6vw; }
.split figure.wide img { border-radius: 0; width: 100%; }

/* ---------- 7c. Big stat strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px; text-align: center; margin-top: 12px;
}
.stat .n {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1;
  display: block;
}
.stat:nth-child(1) .n { color: var(--red); }
.stat:nth-child(2) .n { color: var(--blue); }
.stat:nth-child(3) .n { color: #C9A800; }
.stat:nth-child(4) .n { color: var(--black); }
.stat p { margin: 8px 0 0; font-size: .98rem; color: var(--ink-soft); }
section.dark .stat p { color: #B5B5B5; }
section.dark .stat:nth-child(3) .n { color: var(--yellow); }
section.dark .stat:nth-child(4) .n { color: var(--white); }

/* ---------- 7d. Comparison chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 26px 0 0; padding: 0; list-style: none; }
.chips li {
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  padding: 9px 20px; border-radius: 999px;
  border: 2px solid var(--grey-line); background: var(--white);
}
.chips li:nth-child(4n+1) { border-color: var(--red); }
.chips li:nth-child(4n+2) { border-color: var(--blue); }
.chips li:nth-child(4n+3) { border-color: #D9BC00; }

/* ---------- 7e. Cover strip ---------- */
.covers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.covers img {
  border-radius: 8px; box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.covers img:hover { transform: translateY(-4px); }

/* ---------- 8. Cards ---------- */
.cards { display: grid; gap: 26px; grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 28px;
}
.card h3 { margin-top: 0; }
/* Each card gets one of the three brand colours as a top edge */
.card:nth-child(3n+1) { border-top: 5px solid var(--red); }
.card:nth-child(3n+2) { border-top: 5px solid var(--yellow); }
.card:nth-child(3n+3) { border-top: 5px solid var(--blue); }

/* ---------- 9. Legend panel ----------
   The yellow box from the puzzle pages, reused as a callout. */
.legend {
  background: var(--yellow);
  border: 2px solid var(--black);
  border-radius: 6px;
  padding: 18px 22px;
  font-weight: 600;
  color: var(--black);
}

/* ---------- 10. Pull quote (Dax's rule) ---------- */
.quote {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.35;
  max-width: 760px; margin: 0 auto;
  padding-left: 26px;
  border-left: 6px solid var(--red);
  text-align: left;
}
.quote cite { display: block; font-size: 1rem; font-style: normal;
              font-weight: 400; margin-top: 14px; color: var(--ink-soft); }
section.dark .quote cite { color: #B5B5B5; }

/* ---------- 10b. Video ----------
   Self-hosted, so the visitor never leaves the site. preload="none" means
   nothing downloads until they press play, so the page stays fast on a phone
   and we don't burn bandwidth on people who never watch. */
.videowrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--yellow), 0 0 0 6px var(--blue), 0 0 0 9px var(--red);
  margin: 9px 9px 30px;
  background: #000;
  line-height: 0;
}
.videowrap video {
  width: 100%; height: auto; display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}

/* ---------- 10c. Numbered steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 62px;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem;
  color: var(--white); background: var(--blue);
  border-radius: 50%;
}
.steps li:nth-child(3n+1)::before { background: var(--red); }
.steps li:nth-child(3n+2)::before { background: var(--black); }
.steps li h3 { margin: 0 0 .3em; }

/* ---------- 11. Email capture ---------- */
.signup { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.signup input {
  font-family: var(--font-body); font-size: 1.05rem;
  padding: 15px 18px; min-width: 300px;
  border: 2px solid var(--grey-line); border-radius: 999px;
}
.signup input:focus { outline: none; border-color: var(--blue); }

/* ---------- 11b. Prices, catalogue, misc ---------- */
.price {
  font-family: var(--font-head); font-weight: 700;
  font-size: 2.1rem; line-height: 1; color: var(--black);
  margin: 0 0 .5em;
}

.catalogue {
  display: grid; gap: 22px;
  grid-template-columns: repeat(6, 1fr);
}
.catalogue a { text-decoration: none; color: var(--ink); display: block; }
.catalogue img {
  border-radius: 8px; box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.catalogue a:hover img { transform: translateY(-4px); }
.catalogue .cap {
  font-family: var(--font-head); font-weight: 600;
  font-size: .95rem; text-align: center; margin: 10px 0 0;
}

/* stacked sign-up, for inside cards */
.signup.stacked { flex-direction: column; align-items: stretch; }
.signup.stacked input { min-width: 0; width: 100%; }
.signup.stacked button { width: 100%; }

.form-msg { margin-top: 12px; }

/* skip link — invisible until tabbed to */
.skip {
  position: absolute; left: -9999px;
  background: var(--black); color: var(--white);
  padding: 12px 18px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip:focus { left: 0; top: 0; color: var(--white); }

.langs { margin: 10px 0 0; }
.langs a { margin-right: 10px; }

/* buttons that aren't live yet */
[aria-disabled="true"] {
  opacity: .55; cursor: default; pointer-events: none;
}

section ul { padding-left: 1.2em; }
section li { margin-bottom: .5em; }

/* ---------- 12. Footer ---------- */
.site-foot { background: var(--black); color: #B5B5B5; padding: 52px 0 34px; }
.site-foot a { color: var(--white); text-decoration: none; }
.site-foot a:hover { color: var(--yellow); }
.site-foot .cols { display: grid; gap: 34px; grid-template-columns: repeat(4, 1fr); }
.site-foot h4 { font-family: var(--font-head); color: var(--white);
                margin: 0 0 12px; font-size: 1rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 8px; }
.site-foot .base { margin-top: 38px; padding-top: 22px;
                   border-top: 1px solid #333; font-size: .9rem; }

/* ---------- 13. Responsive ---------- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 30px; }
  .split.flip > :first-child { order: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .covers { grid-template-columns: repeat(3, 1fr); }
  .catalogue { grid-template-columns: repeat(3, 1fr); }
  .cards[style*="1fr 1fr"] { grid-template-columns: 1fr !important; }
  .hero .fleck { display: none; }
  .cards { grid-template-columns: 1fr; }
  .site-foot .cols { grid-template-columns: repeat(2, 1fr); }
  .site-head nav { gap: 18px; }
  .site-head .logo img { width: 150px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  section { padding: 54px 0; }
  .signup input { min-width: 100%; }
}
