/*
Theme Name: CanInsight
Theme URI: https://caninsightca.com
Author: CanInsight
Author URI: https://caninsightca.com
Description: A clean, Canadian-spirited, insights-driven social-gaming theme for CanInsight. Auto-generates all site pages on activation, featuring a bright maple-red & true-north palette, graph-paper textures, data-style accents and an editorial dashboard aesthetic.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: caninsight
*/

/* =========================================================
   DESIGN TOKENS — TRUE NORTH / INSIGHTS
   ========================================================= */
:root {
  --paper: #f6f4ef;        /* warm paper white */
  --paper-2: #ffffff;
  --paper-tint: #fbeceb;   /* faint maple tint */
  --slate-tint: #eef2f6;   /* faint data slate */

  --ink: #16202b;          /* deep charcoal-navy text */
  --ink-soft: #46535f;
  --ink-faint: #7c8893;

  --maple: #d81e2c;        /* Canadian red */
  --maple-deep: #a8121e;
  --maple-bright: #f23b46;

  --north: #11405e;        /* true-north slate blue (insight/trust) */
  --north-bright: #1f6f9e;
  --teal: #128f86;         /* data accent */
  --amber: #e6a417;        /* highlight accent */

  --line: #e3ddd2;         /* hairlines on paper */
  --line-strong: #d4ccbe;
  --grid: rgba(17, 64, 94, 0.05);

  --surface: #ffffff;
  --border: #e6e0d5;

  --grad-maple: linear-gradient(120deg, #f23b46 0%, #d81e2c 55%, #a8121e 100%);
  --grad-north: linear-gradient(120deg, #1f6f9e 0%, #11405e 100%);

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 14px 40px -22px rgba(17, 32, 43, 0.45);
  --shadow-lift: 0 26px 60px -28px rgba(17, 32, 43, 0.55);
  --shadow-maple: 0 18px 40px -16px rgba(216, 30, 44, 0.4);

  --font-display: "Archivo", "Archivo Expanded", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1180px;
}

/* =========================================================
   BASE + GRAPH-PAPER TEXTURE
   ========================================================= */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 38px 38px;
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--maple); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--maple-deep); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  color: var(--ink);
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 92px 0; position: relative; }
.narrow { max-width: 880px; }

/* alternating section coloring across the site */
.section:nth-of-type(even) { background: var(--slate-tint); }
.section:nth-of-type(odd)  { background: transparent; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--north-bright);
  margin-bottom: 18px;
}
.eyebrow::before { content: "//"; color: var(--maple); }

.grad-text { color: var(--maple); }

/* maple-leaf + sparkline divider */
.laurel-rule {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 0 auto 20px; color: var(--maple); max-width: 280px;
}
.laurel-rule::before, .laurel-rule::after {
  content: ""; height: 2px; flex: 1; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--line-strong));
}
.laurel-rule::after { background: linear-gradient(90deg, var(--line-strong), transparent); }
.laurel-rule svg { width: 24px; height: 24px; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
  padding: 14px 30px; border-radius: var(--radius-s);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, background .22s ease;
  text-transform: none;
}
.btn-primary { background: var(--grad-maple); color: #fff; box-shadow: var(--shadow-maple); border-color: var(--maple-deep); }
.btn-primary:hover { transform: translateY(-3px); color: #fff; box-shadow: 0 22px 48px -14px rgba(216,30,44,.55); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { transform: translateY(-3px); color: var(--north); border-color: var(--north-bright); }
.btn-blood { background: var(--grad-north); color: #fff; border-color: var(--north); }
.btn-blood:hover { transform: translateY(-3px); color: #fff; }

/* =========================================================
   HEADER / NAV
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(246, 244, 239, 0.88);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--maple) 0 22%, transparent 22% 78%, var(--maple) 78% 100%);
  opacity: .9;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 800; font-size: 22px;
  letter-spacing: -0.02em; color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--grad-maple); border-radius: 12px;
  box-shadow: var(--shadow-maple);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand span b { color: var(--maple); }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  font-family: var(--font-body); color: var(--ink-soft); font-weight: 600; font-size: 15px;
  padding: 9px 16px; border-radius: var(--radius-s); transition: all .2s ease;
}
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--maple); background: var(--paper-tint); }
.nav-cta { margin-left: 10px; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .3s; }

/* =========================================================
   HERO
   ========================================================= */
.hero { padding: 104px 0 88px; position: relative; overflow: hidden; background: var(--paper-2); }
.hero::before {
  content: ""; position: absolute; top: -120px; right: -80px; width: 460px; height: 460px; z-index: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(216,30,44,.10), transparent 62%);
}
/* faint data sparkline backdrop */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='160'%3E%3Cpolyline points='0,120 120,90 240,108 360,60 480,84 600,40 720,70 840,30 960,66 1080,24 1200,52' fill='none' stroke='%2311405e' stroke-width='2' opacity='0.18'/%3E%3Cpolyline points='0,140 120,128 240,134 360,110 480,124 600,96 720,116 840,88 960,112 1080,80 1200,104' fill='none' stroke='%23d81e2c' stroke-width='2' opacity='0.16'/%3E%3C/svg%3E");
  background-size: cover; background-position: bottom;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); margin-bottom: 22px; }
.hero p.lead { color: var(--ink-soft); font-size: 18px; max-width: 560px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { position: relative; display: grid; place-items: center; }
.hero-card {
  position: relative; width: 100%; max-width: 420px; padding: 30px;
  border-radius: var(--radius-l); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.hero-card::before {
  content: ""; position: absolute; top: 0; left: 30px; right: 30px; height: 4px; border-radius: 0 0 4px 4px;
  background: var(--grad-maple);
}
.hero-card .chip {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--teal); background: rgba(18,143,134,.08); border: 1px solid rgba(18,143,134,.25);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero-card h3 { font-size: 22px; margin-bottom: 6px; }
.hero-card p { color: var(--ink-soft); font-size: 15px; }
.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 8px; }
.hero-stat { text-align: center; padding: 16px 8px; border-radius: var(--radius-s); background: var(--slate-tint); border: 1px solid var(--line); }
.hero-stat b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--maple); }
.hero-stat small { font-family: var(--font-mono); color: var(--ink-faint); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* =========================================================
   SECTION HEADERS
   ========================================================= */
.section-head { text-align: center; max-width: 740px; margin: 0 auto 54px; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 48px); }
.section-head p { color: var(--ink-soft); font-size: 18px; }

/* =========================================================
   FEATURE CARDS — insight tiles
   ========================================================= */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  position: relative; padding: 34px 30px; border-radius: var(--radius-l);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s;
}
.feature-card::after {
  content: ""; position: absolute; right: -10px; bottom: -10px; width: 110px; height: 70px; opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='70'%3E%3Cpolyline points='0,60 22,44 44,52 66,24 88,36 110,8' fill='none' stroke='%23d81e2c' stroke-width='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lift); border-color: var(--maple-bright); }
.feature-ico {
  width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 22px;
}
.feature-ico svg { width: 28px; height: 28px; color: #fff; }
.ico-mint { background: var(--grad-maple); }
.ico-warm { background: var(--grad-north); }
.ico-violet { background: linear-gradient(120deg, var(--teal), var(--north-bright)); }
.feature-card h3 { font-size: 21px; }
.feature-card p { color: var(--ink-soft); font-size: 15.5px; margin: 0; }

/* =========================================================
   GAMES SHOWCASE
   ========================================================= */
.game-row { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; margin-bottom: 66px; }
.game-row:last-child { margin-bottom: 0; }
.game-row.reverse .game-media { order: 2; }
.game-media {
  position: relative; border-radius: var(--radius-l); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-card); background: var(--surface);
}
.game-media img { width: 100%; aspect-ratio: 417/277; object-fit: cover; display: block; }
.game-row.reverse .game-media img { aspect-ratio: 412/288; }
.game-info h3 { font-size: clamp(26px, 3vw, 38px); }
.game-info p { color: var(--ink-soft); font-size: 16px; }
.game-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--north-bright); margin-bottom: 14px;
}

/* =========================================================
   HOW IT WORKS
   ========================================================= */
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.step { padding: 32px 28px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); position: relative; }
.step-num {
  font-family: var(--font-mono); font-weight: 600; font-size: 16px;
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--paper-tint); color: var(--maple); border: 1px solid rgba(216,30,44,.25); margin-bottom: 18px;
}
.step h3 { font-size: 19px; margin-bottom: 6px; }
.step p { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* =========================================================
   HALL OF FAME — leaderboard table
   ========================================================= */
.hof { border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); }
.hof table { width: 100%; border-collapse: collapse; }
.hof th, .hof td { padding: 18px 22px; text-align: left; font-size: 15px; }
.hof thead th {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em;
  font-size: 12px; color: var(--ink-faint); background: var(--slate-tint); border-bottom: 1px solid var(--border);
}
.hof tbody tr { border-bottom: 1px solid var(--line); transition: background .2s; }
.hof tbody tr:last-child { border-bottom: 0; }
.hof tbody tr:hover { background: var(--paper-tint); }
.hof .rank { font-size: 20px; }
.hof .score { font-family: var(--font-mono); font-weight: 600; color: var(--north); }
.hof .activity { color: var(--ink-faint); }

/* =========================================================
   TRUST / COMPLIANCE BADGES
   ========================================================= */
.trust { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; margin-top: 60px; }
.trust a, .trust .badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 12px; padding: 14px 22px; min-height: 64px;
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
  transition: transform .22s ease, box-shadow .22s ease;
}
.trust a:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.trust img { height: 34px; width: auto; }
.badge-18 { font-family: var(--font-display); font-weight: 800; color: #d8453a; background: #fff; border: 3px solid #d8453a; border-radius: 50%; width: 58px; height: 58px; display:grid; place-items:center; font-size: 18px; }

/* =========================================================
   STATIC / LEGAL PAGES
   ========================================================= */
.page-hero { padding: 76px 0 0; background: var(--paper-2); }
.page-hero h1 { font-size: clamp(36px, 5vw, 58px); }
.prose { max-width: 880px; }
.prose h2 { font-size: clamp(26px, 3vw, 36px); margin-top: 1.6em; color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 20px; margin-top: 1.4em; color: var(--north); }
.prose h4 { font-size: 17px; margin-top: 1.2em; color: var(--ink); }
.prose p { color: var(--ink-soft); }
.prose ul { color: var(--ink-soft); padding-left: 22px; }
.prose ul li { margin-bottom: 8px; }
.prose ul li::marker { color: var(--maple); }
.prose a { font-weight: 600; }
.prose .lead { color: var(--ink); font-size: 19px; }

/* legal/page sections shouldn't alternate tint distractingly */
.page-hero.section, .section.page-content { background: var(--paper-2); }

/* =========================================================
   FORMS
   ========================================================= */
.form-wrap { max-width: 880px; }
.spv-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 34px; }
.spv-form .full { grid-column: 1 / -1; }
.spv-form label { font-family: var(--font-mono); display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--north); margin-bottom: 8px; text-transform: uppercase; }
.spv-form input, .spv-form textarea {
  width: 100%; padding: 15px 17px; font-family: var(--font-body); font-size: 16px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong, #d8d0c2); border-radius: var(--radius-s);
  transition: border-color .2s, box-shadow .2s;
}
.spv-form input::placeholder, .spv-form textarea::placeholder { color: var(--ink-faint); }
.spv-form input:focus, .spv-form textarea:focus { outline: none; border-color: var(--maple); box-shadow: 0 0 0 3px rgba(216,30,44,.15); }
.spv-form textarea { min-height: 170px; resize: vertical; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

/* =========================================================
   GAME PLAY PAGES
   ========================================================= */
.game-stage { text-align: center; padding: 76px 0 56px; background: var(--paper-2); }
.game-stage h1 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 34px; }
.game-frame { position: relative; max-width: 1080px; margin: 0 auto; border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lift); background: #0a1622; }
.game-frame iframe { display: block; width: 100%; aspect-ratio: 1080/500; border: 0; }
.game-back { margin-top: 30px; }

/* =========================================================
   FOOTER
   ========================================================= */
.disclaimer-band { background: var(--north); color: #d7e3ec; padding: 48px 0; }
.disclaimer-band h4 { font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #fff; margin-bottom: 10px; }
.disclaimer-band p { color: #b4c6d3; font-size: 14px; max-width: 1000px; margin: 0; }

.site-footer { padding: 26px 0; background: #0d3147; border-top: 1px solid rgba(255,255,255,.08); }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-nav a { color: #c7d6e1; font-size: 14px; font-weight: 600; }
.footer-nav a:hover { color: #fff; }
.footer-copy { font-family: var(--font-mono); color: #7e98a8; font-size: 13px; }

/* =========================================================
   REVEAL ANIMATION
   ========================================================= */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .game-row { grid-template-columns: 1fr; gap: 28px; }
  .game-row.reverse .game-media { order: 0; }
  .spv-form { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
}
@media (max-width: 720px) {
  .main-nav { position: fixed; inset: 80px 0 auto 0; flex-direction: column; align-items: stretch;
    background: rgba(246,244,239,.98); backdrop-filter: blur(12px); padding: 18px 24px 26px;
    border-bottom: 1px solid var(--line); transform: translateY(-130%); transition: transform .35s ease; gap: 4px; }
  .main-nav.open { transform: none; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a { padding: 12px 14px; }
  .nav-cta { margin: 8px 0 0; }
  .nav-toggle { display: block; }
  .hof { overflow-x: auto; }
  .hof table { min-width: 520px; }
}
