/* ========================================
   TEAM 247 DAY GUIDE - DESIGN SYSTEM
   Industrial-editorial. Tradie-grade.
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Archivo:wght@400;500;600;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* Brand colours from PDF */
  --t247-blue: #1B3DA8;
  --t247-blue-light: #E3F2FD;
  --t247-blue-pale: #F0F5FF;
  --t247-black: #0A0A0A;
  --t247-charcoal: #1F1F1F;
  --t247-grey-dark: #4A4A4A;
  --t247-grey: #888888;
  --t247-grey-light: #D4D4D4;
  --t247-grey-pale: #F5F5F5;
  --t247-paper: #FAFAF7;
  --t247-cream: #FFF9E8;
  --t247-white: #FFFFFF;
  
  /* Accent colours for callouts */
  --t247-green: #2E7D32;
  --t247-green-light: #E8F5E9;
  --t247-red: #C62828;
  --t247-red-light: #FFEBEE;
  --t247-amber: #F9A825;
  --t247-amber-light: #FFF8E1;
  
  /* Typography */
  --font-display: 'Archivo Black', sans-serif;
  --font-body: 'Archivo', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-xxl: 6rem;
  
  /* Layout */
  --max-width: 1200px;
  --content-width: 720px;
  --reading-width: 680px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--t247-black);
  background: var(--t247-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ========================================
   HEADER / NAV
   ======================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--t247-black);
  color: var(--t247-white);
  border-bottom: 3px solid var(--t247-blue);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--t247-white);
}

.header-brand-mark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.header-brand-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--t247-grey-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.header-nav a {
  color: var(--t247-white);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.header-nav a:hover {
  background: rgba(255,255,255,0.1);
}

.header-nav a.crumb-link {
  background: var(--t247-blue);
  color: var(--t247-white);
}

.header-nav a.crumb-link:hover {
  background: #2451CC;
}

/* ========================================
   HERO SECTION (home page)
   ======================================== */

.hero {
  background: var(--t247-black);
  color: var(--t247-white);
  padding: 4rem 1.25rem 3rem;
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--t247-blue);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: -10%;
  width: 60%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(27, 61, 168, 0.15) 50%, transparent 100%);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--t247-blue-light);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-eyebrow::before {
  content: '';
  width: 32px;
  height: 2px;
  background: var(--t247-blue);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  max-width: 16ch;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--t247-grey-light);
  max-width: 50ch;
  margin-bottom: 2rem;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--t247-blue);
  color: var(--t247-white);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  font-size: 0.95rem;
}

/* ========================================
   QUICK REFERENCE CARD (home)
   ======================================== */

.section {
  padding: var(--space-xl) 1.25rem;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--t247-blue);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--t247-grey-dark);
  margin-bottom: 2.5rem;
  max-width: 60ch;
}

/* ========================================
   CHAPTER CARDS
   ======================================== */

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.chapter-card {
  background: var(--t247-white);
  border: 2px solid var(--t247-black);
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  color: var(--t247-black);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 220px;
}

.chapter-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--t247-blue);
}

.chapter-card-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--t247-blue);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
}

.chapter-card-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.chapter-card-desc {
  font-size: 0.95rem;
  color: var(--t247-grey-dark);
  line-height: 1.45;
  flex-grow: 1;
}

.chapter-card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--t247-grey);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 0.75rem;
  border-top: 1px solid var(--t247-grey-light);
}

.chapter-card-arrow {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  background: var(--t247-black);
  color: var(--t247-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.2s ease;
}

.chapter-card:hover .chapter-card-arrow {
  background: var(--t247-blue);
}

/* Highlighted card (Quick Reference) */
.chapter-card.featured {
  background: var(--t247-black);
  color: var(--t247-white);
  border-color: var(--t247-black);
  grid-column: 1 / -1;
}

.chapter-card.featured .chapter-card-num {
  color: var(--t247-blue-light);
}

.chapter-card.featured .chapter-card-title {
  font-size: 2rem;
}

.chapter-card.featured .chapter-card-desc {
  color: var(--t247-grey-light);
  font-size: 1.05rem;
}

.chapter-card.featured .chapter-card-meta {
  color: var(--t247-grey);
  border-top-color: var(--t247-grey-dark);
}

.chapter-card.featured .chapter-card-arrow {
  background: var(--t247-blue);
}

.chapter-card.featured:hover {
  box-shadow: 4px 4px 0 0 var(--t247-white);
}

/* ========================================
   PRINCIPLES BAR (home)
   ======================================== */

.principles {
  background: var(--t247-blue);
  color: var(--t247-white);
  padding: var(--space-xl) 1.25rem;
}

.principles-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.principle {
  text-align: left;
}

.principle-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--t247-blue-light);
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.principle-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.principle-text {
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.9;
}

/* ========================================
   CHAPTER PAGE - HEADER
   ======================================== */

.chapter-hero {
  background: var(--t247-black);
  color: var(--t247-white);
  padding: 3rem 1.25rem 2.5rem;
  border-bottom: 4px solid var(--t247-blue);
}

.chapter-hero-inner {
  max-width: var(--reading-width);
  margin: 0 auto;
}

.chapter-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--t247-grey-light);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  transition: color 0.15s ease;
}

.chapter-hero-back:hover {
  color: var(--t247-white);
}

.chapter-hero-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--t247-blue-light);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.chapter-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.chapter-hero-tagline {
  font-size: 1.1rem;
  color: var(--t247-grey-light);
  font-style: italic;
}

/* ========================================
   CHAPTER PAGE - CONTENT
   ======================================== */

.chapter-content {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: var(--space-xl) 1.25rem var(--space-xxl);
}

.chapter-content h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin: 3.5rem 0 1rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  border-bottom: 3px solid var(--t247-black);
  padding-bottom: 0.5rem;
}

.chapter-content h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 3rem 0 1rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.chapter-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  line-height: 1.2;
  color: var(--t247-blue);
  letter-spacing: 0.01em;
}

.chapter-content h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

.chapter-content p {
  margin: 1rem 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.chapter-content p:first-of-type {
  font-size: 1.15rem;
  color: var(--t247-charcoal);
}

.chapter-content strong {
  font-weight: 700;
  color: var(--t247-black);
}

.chapter-content em {
  font-style: italic;
  color: var(--t247-charcoal);
}

.chapter-content ul, .chapter-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  padding-left: 0.5rem;
}

.chapter-content li {
  margin: 0.5rem 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

.chapter-content ul li::marker {
  color: var(--t247-blue);
}

.chapter-content blockquote {
  border-left: 4px solid var(--t247-blue);
  background: var(--t247-blue-pale);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--t247-charcoal);
}

.chapter-content img {
  margin: 2rem auto;
  border: 2px solid var(--t247-grey-light);
  border-radius: 4px;
}

.chapter-content hr {
  border: none;
  border-top: 2px solid var(--t247-black);
  margin: 3rem 0;
  width: 60px;
}

.chapter-content code {
  background: var(--t247-grey-pale);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Callout boxes from the PDFs */
.callout {
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  border-left: 5px solid;
}

.callout-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.callout-why {
  background: var(--t247-blue-pale);
  border-left-color: var(--t247-blue);
}

.callout-why .callout-label {
  color: var(--t247-blue);
}

.callout-tip {
  background: var(--t247-amber-light);
  border-left-color: var(--t247-amber);
}

.callout-tip .callout-label {
  color: #B07A00;
}

.callout-safety {
  background: var(--t247-red-light);
  border-left-color: var(--t247-red);
}

.callout-safety .callout-label {
  color: var(--t247-red);
}

.callout-win {
  background: var(--t247-green-light);
  border-left-color: var(--t247-green);
}

.callout-win .callout-label {
  color: var(--t247-green);
}

.callout-principle {
  background: var(--t247-black);
  color: var(--t247-white);
  border-left-color: var(--t247-blue);
  padding: 1.5rem 1.75rem;
}

.callout-principle .callout-label {
  color: var(--t247-blue-light);
}

.callout-ring {
  background: var(--t247-red-light);
  border-left-color: var(--t247-red);
  border: 2px solid var(--t247-red);
  border-left-width: 5px;
}

.callout-ring .callout-label {
  color: var(--t247-red);
}

/* Step blocks */
.step {
  margin: 2rem 0 1.5rem;
  padding-left: 1.5rem;
  border-left: 3px solid var(--t247-blue);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--t247-blue);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.step-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0.25rem 0 0.5rem;
  color: var(--t247-black);
}

.step-detail {
  font-size: 1rem;
  color: var(--t247-grey-dark);
  line-height: 1.6;
}

/* ========================================
   CHAPTER PAGE - FOOTER NAV
   ======================================== */

.chapter-nav {
  background: var(--t247-black);
  color: var(--t247-white);
  padding: 2.5rem 1.25rem;
  border-top: 4px solid var(--t247-blue);
}

.chapter-nav-inner {
  max-width: var(--reading-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.chapter-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--t247-white);
  text-decoration: none;
  padding: 1.25rem;
  border: 2px solid var(--t247-grey-dark);
  transition: border-color 0.15s ease;
}

.chapter-nav-link:hover {
  border-color: var(--t247-blue);
}

.chapter-nav-link.next {
  text-align: right;
  align-items: flex-end;
}

.chapter-nav-direction {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--t247-grey);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.chapter-nav-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
}

.chapter-nav-disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
  background: var(--t247-charcoal);
  color: var(--t247-grey-light);
  padding: 3rem 1.25rem 2rem;
  text-align: center;
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--t247-white);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--t247-grey);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.footer-mantra {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--t247-blue-light);
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
}

.footer-meta {
  font-size: 0.85rem;
  color: var(--t247-grey);
  border-top: 1px solid var(--t247-grey-dark);
  padding-top: 1.5rem;
}

/* ========================================
   QUICK REFERENCE PAGE
   ======================================== */

.quickref {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-xl) 1.25rem var(--space-xxl);
}

.quickref-section {
  margin-bottom: 3rem;
}

.quickref-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--t247-black);
}

.quickref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}

.quickref-item {
  background: var(--t247-white);
  border-left: 4px solid var(--t247-blue);
  padding: 0.85rem 1.1rem;
}

.quickref-item-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--t247-blue);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.quickref-item-value {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--t247-charcoal);
}

/* ========================================
   MOBILE OPTIMISATIONS
   ======================================== */

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }
  
  .site-header-inner {
    padding: 0.55rem 0.85rem;
  }
  
  .header-brand-mark {
    font-size: 0.95rem;
    white-space: nowrap;
  }
  
  .header-brand-tag {
    display: none;
  }
  
  .header-nav {
    gap: 0.3rem;
  }
  
  .header-nav a {
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
    white-space: nowrap;
  }
  
  .header-nav a.crumb-link {
    padding: 0.35rem 0.65rem;
  }
  
  .hero {
    padding: 2.5rem 1rem 2.5rem;
  }
  
  .section {
    padding: var(--space-lg) 1rem;
  }
  
  .chapter-hero {
    padding: 2rem 1rem;
  }
  
  .chapter-content {
    padding: var(--space-lg) 1rem var(--space-xl);
  }
  
  .chapter-content h1 {
    font-size: 1.7rem;
  }
  
  .chapter-content h2 {
    font-size: 1.4rem;
  }
  
  .chapter-content h3 {
    font-size: 1.1rem;
  }
  
  .lesson-marker h1 {
    font-size: 1.8rem !important;
  }
  
  .chapter-nav-inner {
    grid-template-columns: 1fr;
  }
  
  .principles-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .quickref-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   PRINT
   ======================================== */

@media print {
  .site-header, .chapter-nav, .site-footer {
    display: none;
  }
}

/* =============================================================
   PROGRESS BAR (top of every page)
   ============================================================= */

.progress-bar-wrap {
  background: var(--t247-charcoal);
  border-bottom: 1px solid var(--t247-grey-dark);
  position: sticky;
  top: 49px;
  z-index: 90;
}

.progress-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--t247-blue), #4A77E5);
  width: 0%;
  transition: width 0.6s ease;
  border-radius: 3px;
}

.progress-bar-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--t247-grey-light);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.progress-bar-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--t247-blue-light);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.progress-bar-link:hover {
  color: var(--t247-white);
}

@media (max-width: 720px) {
  .progress-bar-inner {
    padding: 0.5rem 0.85rem;
    gap: 0.6rem;
  }
  .progress-bar-text {
    font-size: 0.7rem;
  }
  .progress-bar-link {
    font-size: 0.7rem;
  }
}

/* =============================================================
   NAME MODAL (one-time on first visit)
   ============================================================= */

.name-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.name-modal {
  background: var(--t247-paper);
  border: 3px solid var(--t247-blue);
  max-width: 480px;
  width: 100%;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
}

.name-modal-brand {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--t247-blue);
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}

.name-modal-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.name-modal-text {
  color: var(--t247-grey-dark);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.name-modal-input {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  border: 2px solid var(--t247-black);
  background: var(--t247-white);
  color: var(--t247-black);
  margin-bottom: 1rem;
  transition: border-color 0.15s ease;
}

.name-modal-input:focus {
  outline: none;
  border-color: var(--t247-blue);
  box-shadow: 0 0 0 3px rgba(27, 61, 168, 0.15);
}

.name-modal-btn {
  width: 100%;
  padding: 1rem;
  background: var(--t247-black);
  color: var(--t247-white);
  border: none;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s ease;
}

.name-modal-btn:hover {
  background: var(--t247-blue);
}

/* =============================================================
   QUIZ ENGINE STYLES
   ============================================================= */

.quiz-intro {
  background: var(--t247-black);
  color: var(--t247-white);
  padding: 2rem 1.75rem;
  margin: 3rem 0 2rem;
  position: relative;
}

.quiz-intro-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--t247-blue-light);
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

.quiz-intro-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.quiz-intro-text {
  font-size: 1rem;
  color: var(--t247-grey-light);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.quiz-intro-meta {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--t247-grey-light);
}

.quiz-already-passed {
  background: var(--t247-green-light);
  border-left: 4px solid var(--t247-green);
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
  color: var(--t247-charcoal);
}

.quiz-already-passed strong {
  color: var(--t247-green);
  display: block;
  margin-bottom: 0.25rem;
}

.quiz-already-passed p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.quiz-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.quiz-question {
  background: var(--t247-white);
  border: 2px solid var(--t247-grey-light);
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.quiz-question.quiz-correct {
  border-color: var(--t247-green);
  background: var(--t247-green-light);
}

.quiz-question.quiz-wrong {
  border-color: var(--t247-red);
  background: var(--t247-red-light);
}

.quiz-question.quiz-unanswered {
  border-color: var(--t247-amber);
  background: var(--t247-amber-light);
}

.quiz-question-header {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.quiz-question-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--t247-blue);
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--t247-blue-pale);
  padding: 0.3rem 0.6rem;
  flex-shrink: 0;
}

.quiz-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--t247-grey-light);
  background: var(--t247-paper);
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 4px;
}

.quiz-option:hover {
  border-color: var(--t247-blue);
  background: var(--t247-blue-pale);
}

.quiz-option input[type="radio"] {
  margin-top: 0.15rem;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--t247-blue);
}

.quiz-option-letter {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--t247-blue);
  flex-shrink: 0;
}

.quiz-option-text {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--t247-black);
}

.quiz-option.selected-correct {
  background: var(--t247-green-light);
  border-color: var(--t247-green);
  border-width: 2px;
}

.quiz-option.selected-correct .quiz-option-letter {
  color: var(--t247-green);
}

.quiz-option.selected-wrong {
  background: var(--t247-red-light);
  border-color: var(--t247-red);
  border-width: 2px;
}

.quiz-option.selected-wrong .quiz-option-letter {
  color: var(--t247-red);
}

.quiz-option.is-correct-answer {
  border-color: var(--t247-green);
  background: var(--t247-green-light);
  border-width: 2px;
}

.quiz-option.is-correct-answer .quiz-option-letter::after {
  content: ' ← Right answer';
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--t247-green);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.quiz-explanation {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--t247-paper);
  border-left: 3px solid var(--t247-blue);
  font-size: 0.9rem;
}

.quiz-explanation strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--t247-blue);
}

.quiz-explanation p {
  margin: 0;
  color: var(--t247-charcoal);
  line-height: 1.5;
}

.quiz-submit-area {
  background: var(--t247-paper);
  padding: 1.75rem;
  border: 2px solid var(--t247-black);
  margin-top: 1rem;
}

.quiz-reflection {
  margin-bottom: 1.5rem;
}

.quiz-reflection-label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--t247-black);
  line-height: 1.4;
}

.quiz-reflection-input {
  width: 100%;
  padding: 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 2px solid var(--t247-grey-light);
  background: var(--t247-white);
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.15s ease;
}

.quiz-reflection-input:focus {
  outline: none;
  border-color: var(--t247-blue);
  box-shadow: 0 0 0 3px rgba(27, 61, 168, 0.1);
}

.quiz-submit-btn {
  width: 100%;
  padding: 1.1rem;
  background: var(--t247-blue);
  color: var(--t247-white);
  border: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s ease;
}

.quiz-submit-btn:hover {
  background: #2451CC;
}

.quiz-submit-btn:disabled {
  background: var(--t247-grey);
  cursor: not-allowed;
}

.quiz-result {
  margin-top: 1.5rem;
  padding: 2rem 1.75rem;
  border-radius: 0;
  text-align: center;
  border: 3px solid;
}

.quiz-result-pass {
  background: var(--t247-green-light);
  border-color: var(--t247-green);
}

.quiz-result-fail {
  background: var(--t247-red-light);
  border-color: var(--t247-red);
}

.quiz-result-incomplete {
  background: var(--t247-amber-light);
  border-color: var(--t247-amber);
  text-align: left;
}

.quiz-result-icon {
  font-family: var(--font-display);
  font-size: 3rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.quiz-result-pass .quiz-result-icon {
  color: var(--t247-green);
}

.quiz-result-fail .quiz-result-icon {
  color: var(--t247-red);
}

.quiz-result h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0.5rem 0;
  letter-spacing: -0.01em;
}

.quiz-result p {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0.5rem 0;
  color: var(--t247-charcoal);
}

.quiz-result-reflection {
  background: rgba(255,255,255,0.6);
  padding: 1rem;
  margin: 1rem 0;
  font-style: italic;
  font-size: 0.9rem;
  text-align: left;
}

.quiz-result-reflection strong {
  font-style: normal;
  display: block;
  margin-bottom: 0.3rem;
}

.quiz-result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.quiz-result-btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  background: var(--t247-white);
  color: var(--t247-black);
  border: 2px solid var(--t247-black);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-result-btn:hover {
  background: var(--t247-black);
  color: var(--t247-white);
}

.quiz-result-btn.primary {
  background: var(--t247-blue);
  color: var(--t247-white);
  border-color: var(--t247-blue);
}

.quiz-result-btn.primary:hover {
  background: #2451CC;
  border-color: #2451CC;
}

.quiz-submit-status {
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* =============================================================
   BADGE POPUP (slides in from right when earned)
   ============================================================= */

.badge-popup {
  position: fixed;
  top: 100px;
  right: 1rem;
  background: var(--t247-black);
  color: var(--t247-white);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 5px solid var(--t247-blue);
  box-shadow: 0 6px 30px rgba(0,0,0,0.4);
  z-index: 1000;
  max-width: 360px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.badge-popup.show {
  transform: translateX(0);
}

.badge-popup-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.badge-popup-content {
  flex: 1;
}

.badge-popup-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--t247-blue-light);
  letter-spacing: 0.15em;
  margin-bottom: 0.2rem;
}

.badge-popup-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.badge-popup-desc {
  font-size: 0.85rem;
  color: var(--t247-grey-light);
  line-height: 1.3;
}

@media (max-width: 720px) {
  .badge-popup {
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
  }
}

/* =============================================================
   BADGES PAGE
   ============================================================= */

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.badge {
  background: var(--t247-white);
  border: 2px solid var(--t247-grey-light);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.2s ease;
}

.badge-earned {
  border-color: var(--t247-blue);
  background: var(--t247-blue-pale);
}

.badge-locked {
  opacity: 0.5;
  filter: grayscale(0.7);
}

.badge-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.badge-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  letter-spacing: 0.02em;
}

.badge-desc {
  font-size: 0.8rem;
  color: var(--t247-grey-dark);
  line-height: 1.3;
}

/* =============================================================
   CHAPTER CARD STATUS BADGES (on home page)
   ============================================================= */

.chapter-card-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.6rem;
  display: inline-block;
  border-radius: 3px;
  margin-top: 0.5rem;
}

.chapter-card-status.passed {
  background: var(--t247-green-light);
  color: var(--t247-green);
  border: 1px solid var(--t247-green);
}

.chapter-card-status.attempted {
  background: var(--t247-amber-light);
  color: #B07A00;
  border: 1px solid var(--t247-amber);
}

.chapter-card-status.reading {
  background: var(--t247-blue-pale);
  color: var(--t247-blue);
  border: 1px solid var(--t247-blue);
}

.chapter-card-status.not-started {
  background: var(--t247-grey-pale);
  color: var(--t247-grey);
  border: 1px solid var(--t247-grey-light);
}

/* =============================================================
   MY PROGRESS PAGE
   ============================================================= */

.progress-page {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-xl) 1.25rem var(--space-xxl);
}

.progress-greeting {
  background: var(--t247-black);
  color: var(--t247-white);
  padding: 2rem 1.75rem;
  margin-bottom: 2.5rem;
}

.progress-greeting-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--t247-blue-light);
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

.progress-greeting-name {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.progress-greeting-stats {
  font-size: 1.05rem;
  color: var(--t247-grey-light);
}

.progress-section {
  margin-bottom: 2.5rem;
}

.progress-section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--t247-black);
}

.progress-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-chapter-row {
  background: var(--t247-white);
  border-left: 4px solid var(--t247-grey-light);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
}

.progress-chapter-row.passed {
  border-left-color: var(--t247-green);
}

.progress-chapter-row.attempted {
  border-left-color: var(--t247-amber);
}

.progress-chapter-info-title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.progress-chapter-info-meta {
  font-size: 0.85rem;
  color: var(--t247-grey-dark);
}

.progress-chapter-score {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--t247-charcoal);
}

.progress-chapter-action a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--t247-blue);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.progress-chapter-action a:hover {
  color: var(--t247-black);
}

.progress-reflection-block {
  background: var(--t247-blue-pale);
  border-left: 3px solid var(--t247-blue);
  padding: 1rem 1.25rem;
  margin: 0.5rem 0;
}

.progress-reflection-block strong {
  display: block;
  font-size: 0.85rem;
  color: var(--t247-blue);
  margin-bottom: 0.3rem;
}

.progress-reflection-block p {
  margin: 0;
  font-style: italic;
  color: var(--t247-charcoal);
  font-size: 0.95rem;
}

.progress-empty {
  background: var(--t247-grey-pale);
  padding: 1.5rem;
  text-align: center;
  color: var(--t247-grey-dark);
  font-style: italic;
}

@media (max-width: 720px) {
  .progress-chapter-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .progress-greeting-name {
    font-size: 1.85rem;
  }
}

/* =============================================================
   CERTIFICATION PAGE
   ============================================================= */

.cert-locked, .cert-ready, .cert-passed {
  text-align: center;
  padding: 3rem 1.5rem;
  margin: 2rem 0;
}

.cert-locked {
  background: var(--t247-grey-pale);
  border: 2px dashed var(--t247-grey);
}

.cert-ready {
  background: var(--t247-blue-pale);
  border: 3px solid var(--t247-blue);
}

.cert-passed {
  background: linear-gradient(135deg, var(--t247-black) 0%, var(--t247-blue) 100%);
  color: var(--t247-white);
  border: 4px solid var(--t247-blue);
  padding: 3rem 2rem;
}

.cert-passed h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.cert-passed-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--t247-blue-light);
  margin: 1rem 0;
}

.cert-passed-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--t247-grey-light);
  letter-spacing: 0.1em;
  margin-top: 1rem;
}

/* Chapter quiz section divider - clean separator instead of the old blue box */
.chapter-quiz-divider {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 4rem 0 0.5rem;
  padding-bottom: 0.5rem;
  text-align: center;
  color: var(--t247-grey-dark);
  letter-spacing: 0.05em;
  border-bottom: 2px dashed var(--t247-grey-light);
}

/* =============================================================
   TOMMY VIDEO EMBEDS (Vimeo)
   ============================================================= */

.tommy-video,
.owner-video {
  background: var(--t247-black);
  color: var(--t247-white);
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 5px solid var(--t247-blue);
  border-radius: 4px;
}

.tommy-video-header,
.owner-video-header {
  margin-bottom: 1rem;
}

.tommy-video-label,
.owner-video-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--t247-blue-light);
  letter-spacing: 0.2em;
  margin-bottom: 0.4rem;
}

.tommy-video-title,
.owner-video-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--t247-white);
}

.tommy-video-wrapper,
.owner-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  background: var(--t247-charcoal);
  margin: 0.5rem 0 1rem;
  border-radius: 4px;
}

.tommy-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tommy-video-caption,
.owner-video-caption {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--t247-grey-light);
  font-style: italic;
  line-height: 1.4;
}

/* Escape hatch under each video. Added 4 Aug 2026 while the Vimeo embeds were
   returning 401 (embed privacy locked on the account) — without it the boys
   just saw a black box. Harmless once embeds are working again. */
.tommy-video-fallback {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--t247-grey-light);
  line-height: 1.4;
}
.tommy-video-fallback a {
  color: var(--t247-yellow, #f2b90d);
  font-weight: 700;
  text-decoration: underline;
}

@media (max-width: 720px) {
  .tommy-video {
    padding: 1rem;
    margin: 1.5rem 0;
  }
  .tommy-video-title {
    font-size: 1.1rem;
  }
}

/* Engine fix: keep the header inside the viewport on narrow phones */
@media (max-width: 480px) {
  .site-header-inner { flex-wrap: wrap; row-gap: 0.2rem; }
  .header-nav { flex-wrap: wrap; max-width: 100%; }
}
