/* Free Software Isn't Gratis — Dark, Terminal-flavored Theme
 *
 * Built on the revealjs skill's base-styles.css.
 * All font sizes use pt (points) for predictable sizing.
 *
 * Design language: dark, terminal-flavored, for a sharp,
 * story-driven SRE Day talk about open-source sustainability.
 */

/* ===========================================
   FONTS — loaded once, used everywhere via variables
   =========================================== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ===========================================
   CSS VARIABLES
   =========================================== */
:root {
  /* Backgrounds */
  --background-color: #121212;           /* near-black from the Nerdearla wordmark outline, projector-friendly */
  --section-divider-bg: #00A9A5;         /* Nerdearla teal, full-bleed act dividers, ink 6.5:1 */
  --code-bg: #111418;                    /* terminal surface */
  --panel-bg: rgba(255, 255, 255, 0.04); /* subtle panel on dark bg */
  --panel-border: rgba(255, 255, 255, 0.08);

  /* Event brand colors (Nerdearla logo). Fills only, never body text on light. */
  --brand-teal: #00A9A5;                 /* "E" / "L" strokes */
  --brand-red: #FF333E;                  /* "N" / "D" / "R" strokes */
  --highlight: #FFB400;                  /* "A" / "R" yellow, used as a highlighter behind ink text */
  --ink: #111111;                        /* wordmark black */
  --chart-2: #FFB400;                    /* second chart series, next to primary */

  /* Typography */
  --heading-font: "IBM Plex Sans", "Source Sans Pro", Helvetica, sans-serif;
  --body-font: "IBM Plex Sans", "Source Sans Pro", Helvetica, sans-serif;
  --mono-font: "JetBrains Mono", "Courier New", monospace;
  --base-font-size: 24pt;                /* reveal.js base; the only value intentionally not in pt would be a CSS limitation — but 24pt works and keeps the all-pt rule intact */
  --text-size: 18pt;                     /* body text */
  --h1-size: 54pt;
  --h2-size: 38pt;
  --h3-size: 26pt;
  --footnote-size: 12pt;
  --mono-size: 16pt;

  /* Palette */
  --primary-color: #00A9A5;              /* Nerdearla teal, 6.4:1 on #121212 */
  --primary-deep: #00C2BD;              /* hover/deep */
  --secondary-color: #FFB400;            /* Nerdearla yellow as warn, 10.5:1 */
  --critical-color: #FF5A63;             /* lifted Nerdearla red, 6.2:1 */
  --success-color: #2ECC71;              /* terminal green, "you can do this" */
  --text-color: #e0e0e0;                 /* off-white */
  --muted-color: #8a8a8a;                /* captions, secondary, 5.4:1 */
  --line-color: #2E4053;                 /* muted slate */

  /* Layout */
  --slide-padding: 56px;
  --slide-padding-top: 48px;
  --content-gap: 28px;
  --box-radius: 6px;

  /* Spacing scale — used by all components */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  /* Card padding */
  --card-padding: 24px 28px;
  --card-padding-tight: 18px 22px;

  /* Card depth (light mode) */
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-light: 0 2px 8px rgba(26, 26, 26, 0.06);
  --card-shadow-strong: 0 4px 16px rgba(26, 26, 26, 0.10);
}

/* ===========================================
   LIGHT THEME — opt-in via `?theme=light` or `T` key
   Cream/warm palette, terminal feel preserved
   =========================================== */
:root[data-theme="light"] {
  /* Backgrounds: neutral paper, like the white the event logo sits on */
  --background-color: #FAFAF8;
  --section-divider-bg: #00A9A5;         /* Nerdearla teal, full-bleed act dividers, ink 6.5:1 */
  --code-bg: #111418;                    /* KEEP dark: terminal surface is a "card" on paper */
  --panel-bg: #ffffff;
  --panel-border: rgba(17, 17, 17, 0.10);

  /* Accents: text-safe variants of the logo colors, all AA on #FAFAF8 */
  --primary-color: #007673;              /* deep Nerdearla teal (nerdearla.com uses it), 5.2:1 */
  --primary-deep: #005C5A;              /* hover */
  --secondary-color: #7A5600;           /* deep Nerdearla yellow, 6.4:1 */
  --critical-color: #C2121D;            /* deep Nerdearla red, 5.9:1 */
  --success-color: #1E7A3A;             /* deep green, 5.2:1 */

  /* Text */
  --text-color: #111111;                 /* wordmark black, 18.1:1 */
  --muted-color: #595959;               /* captions, secondary, 6.7:1 */
  --line-color: #D9DDE1;                /* cool slate for dividers */

  --chart-2: #00A9A5;                    /* second chart series: bright teal next to deep teal */

  /* Terminal uses the bright bell blue inside the dark code surface */
  --terminal-accent: #00A9A5;

  --card-shadow: 0 1px 3px rgba(17, 17, 17, 0.06), 0 1px 2px rgba(17, 17, 17, 0.04);
  --card-shadow-light: 0 2px 8px rgba(17, 17, 17, 0.08);
  --card-shadow-strong: 0 6px 20px rgba(17, 17, 17, 0.12);
}

/* ===========================================
   BASE STYLES
   =========================================== */

.reveal {
  font-family: var(--body-font);
  font-size: var(--base-font-size);
  color: var(--text-color);              /* unstyled text follows the theme (reveal's default is black) */
}

.reveal strong,
.reveal b { font-weight: 700; }

.reveal-viewport {
  background-color: var(--background-color);
}

.reveal-viewport.is-section-divider .slide-background.present {
  background-color: var(--section-divider-bg) !important;
}

.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
  font-family: var(--heading-font);
  text-transform: none;
  color: var(--text-color);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.reveal h1 { font-size: var(--h1-size); }
.reveal h2 { font-size: var(--h2-size); margin-bottom: 0; }
.reveal h3 { font-size: var(--h3-size); color: var(--primary-color); }

.reveal p,
.reveal li,
.reveal td,
.reveal th,
.reveal blockquote {
  font-size: var(--text-size);
  color: var(--text-color);
  line-height: 1.5;
}

.reveal code,
.reveal pre {
  font-family: var(--mono-font);
  font-size: var(--mono-size);
}

/* ===========================================
   LISTS
   =========================================== */

.reveal ul {
  list-style: none;
  padding-left: 0;
  margin: 15px 0;
}

.reveal ul li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 14px;
}

.reveal ul li::before {
  content: '❯';
  position: absolute;
  left: 0;
  top: 0.05em;
  color: var(--primary-color);
  font-family: var(--mono-font);
  font-weight: 700;
}

.reveal ul ul li::before {
  content: '·';
  color: var(--muted-color);
}

/* ===========================================
   SLIDE LAYOUT
   =========================================== */

.reveal .slides section {
  height: 100%;
  display: flex !important;
  flex-direction: column !important;
  padding: var(--slide-padding-top) var(--slide-padding) var(--slide-padding) var(--slide-padding) !important;
  box-sizing: border-box;
  text-align: left;
}

.reveal .slides section.stack {
  padding: 0 !important;
}

.reveal .slides section > .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--content-gap);
  text-align: left;
}

.reveal .slides section > .footnote {
  position: absolute;
  bottom: 18px;
  left: var(--slide-padding);
  right: var(--slide-padding);
  font-size: var(--footnote-size);
  color: var(--muted-color);
}

/* ===========================================
   SECTION DIVIDERS
   =========================================== */

.reveal .slides section.section-divider {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center;
}

.reveal .slides section.section-divider h1 {
  font-size: 64pt;
  text-align: center;
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 24px;
}

.reveal .slides section.section-divider h1::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-color);
}

.reveal .slides section.section-divider .section-number {
  font-family: var(--mono-font);
  font-size: 18pt;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 18px;
  display: block;
}

.reveal .slides section.section-divider p {
  font-size: 22pt;
  color: var(--muted-color);
  margin-top: 30px;
}

/* ===========================================
   TITLE SLIDE
   =========================================== */

.reveal .slides section#title {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  text-align: left;
  padding: 80px !important;
}

.reveal .slides section#title h1 {
  font-size: 42pt;
  line-height: 1.08;
  margin-bottom: 0;
  letter-spacing: -0.02em;
  font-weight: 700;
  max-width: 1120px;
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
}

.reveal .slides section#title .title-prompt {
  font-family: var(--mono-font);
  color: var(--primary-color);
  font-size: 20pt;
  margin-bottom: 20px;
  display: inline-block;
  position: relative;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.reveal .slides section#title .title-prompt::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 48px;
  height: 2px;
  background: var(--primary-color);
  opacity: 0.85;
}

.reveal .slides section#title .speaker {
  font-size: 24pt;
  color: var(--text-color);
  margin-top: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.reveal .slides section#title .speaker .role {
  color: var(--muted-color);
  font-size: 18pt;
  font-weight: 400;
  display: block;
  margin-top: 6px;
  letter-spacing: 0;
}

.reveal .slides section#title .event {
  font-family: var(--mono-font);
  font-size: 16pt;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-top: 40px;
  font-weight: 500;
}

/* ===========================================
   TEXT SIZE UTILITIES
   =========================================== */

.text-sm { font-size: 14pt !important; }
.text-lg { font-size: 20pt !important; }
.text-xl { font-size: 24pt !important; }
.text-2xl { font-size: 30pt !important; }
.text-3xl { font-size: 38pt !important; }
.text-4xl { font-size: 46pt !important; }
.text-mono { font-family: var(--mono-font) !important; }

.text-muted { color: var(--muted-color) !important; }
.text-center { text-align: center !important; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.1em; }
.font-light { font-weight: 300; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--mono-font); }

.text-primary { color: var(--primary-color) !important; }
.text-warn { color: var(--secondary-color) !important; }
.text-critical { color: var(--critical-color) !important; }
.text-success { color: var(--success-color) !important; }

/* ===========================================
   TERMINAL / CODE BLOCKS
   =========================================== */

.terminal {
  box-sizing: border-box;
  background: var(--code-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--box-radius);
  padding: var(--space-5) var(--space-6);
  font-family: var(--mono-font);
  font-size: var(--mono-size);
  color: var(--text-color);
  margin: var(--space-4) 0;
  text-align: left;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.terminal .prompt {
  color: var(--primary-color);
  margin-right: 8px;
  user-select: none;
}

.terminal .output {
  color: var(--muted-color);
  display: block;
  margin-top: 4px;
}

.terminal .error {
  color: var(--critical-color);
}

.terminal .ok {
  color: var(--success-color);
}

.terminal .warn {
  color: var(--secondary-color);
}

/* ===========================================
   PANELS / CARDS
   =========================================== */

.panel {
  box-sizing: border-box;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--box-radius);
  padding: var(--card-padding);
  margin: var(--space-3) 0;
  box-shadow: var(--card-shadow);
}

.panel.critical {
  border-left: 6px solid var(--critical-color);
}

.panel.warn {
  border-left: 4px solid var(--secondary-color);
}

.panel.success {
  border-left: 4px solid var(--success-color);
}

.panel.primary {
  border-left: 4px solid var(--primary-color);
}

/* ===========================================
   STAT / BIG NUMBER
   =========================================== */

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: var(--space-2) 0;
}

.stat .number {
  font-size: 80pt;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--primary-color);
  font-family: var(--heading-font);
}

.stat .number.critical { color: var(--critical-color); }
.stat .number.warn { color: var(--secondary-color); }
.stat .number.success { color: var(--success-color); }

.stat .label {
  font-size: 18pt;
  color: var(--muted-color);
  margin-top: var(--space-2);
  line-height: 1.4;
}

/* ===========================================
   BLOCKQUOTES
   =========================================== */

.reveal blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: var(--space-6);
  margin: var(--space-5) 0;
  font-style: italic;
  background: none;
  box-shadow: none;
  width: 100%;
  max-width: none;
}

.reveal blockquote cite {
  display: block;
  margin-top: var(--space-3);
  font-style: normal;
  color: var(--muted-color);
  font-size: 14pt;
}

/* ===========================================
   FIGURE / IMAGE
   =========================================== */

.reveal figure {
  margin: 16px 0;
  text-align: center;
}

.reveal figure img {
  max-width: 100%;
  max-height: 480px;
  border: 1px solid var(--line-color);
  border-radius: var(--box-radius);
  display: block;
  margin: 0 auto;
}

.reveal figure figcaption {
  font-size: 13pt;
  color: var(--muted-color);
  margin-top: 12px;
  font-style: italic;
}

.reveal figure.portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.reveal figure.portrait img {
  max-height: 380px;
  width: auto;
  border: 1px solid var(--line-color);
}

/* ===========================================
   FRAMEWORK STEP
   =========================================== */

.step {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-top: 3px solid var(--primary-color);
  border-radius: var(--box-radius);
  padding: var(--card-padding);
  text-align: left;
  box-shadow: var(--card-shadow);
}

.step .step-number {
  font-family: var(--mono-font);
  font-size: 14pt;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
}

.step h3 {
  margin: 0 0 var(--space-3) 0;
  color: var(--text-color);
  font-size: 24pt;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.step p {
  font-size: 16pt;
  color: var(--muted-color);
  margin: 0;
  line-height: 1.45;
}

/* ===========================================
   TIMELINE
   =========================================== */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}

.timeline .event {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-color);
}

.timeline .event:last-child {
  border-bottom: none;
}

.timeline .event .date {
  font-family: var(--mono-font);
  font-size: 14pt;
  color: var(--primary-color);
  letter-spacing: 0.05em;
}

.timeline .event .what {
  font-size: 18pt;
  color: var(--text-color);
}

/* ===========================================
   DECORATIVE TOP RULE
   =========================================== */

.reveal .slides section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-deep) 100%);
}

.reveal .slides section.section-divider::before {
  background: var(--primary-color);
  height: 4px;
}

/* ===========================================
   CLOSING SLIDE
   =========================================== */

.reveal .slides section#closing {
  text-align: center;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

.reveal .slides section#closing .this-is-fine {
  font-size: 90pt;
  font-weight: 800;
  color: var(--critical-color);
  letter-spacing: -0.03em;
  margin: 0 0 16px 0;
  line-height: 1;
}

.reveal .slides section#closing .subtitle {
  font-size: 26pt;
  color: var(--text-color);
  margin-bottom: 40px;
}

.reveal .slides section#closing .contact {
  font-family: var(--mono-font);
  font-size: 18pt;
  color: var(--primary-color);
  padding-top: 24px;
  border-top: 1px solid var(--line-color);
  margin-top: 32px;
}

/* ===========================================
   PROGRESS BAR ACCENT
   =========================================== */

.reveal .progress {
  background: rgba(255, 255, 255, 0.08);
  height: 4px;
}

.reveal .progress span {
  background: var(--primary-color);
}

/* ===========================================
   CONTROLS
   =========================================== */

.reveal .controls {
  color: var(--primary-color);
}

/* ===========================================
   THEME INDICATOR
   =========================================== */

.theme-indicator {
  position: fixed;
  bottom: 12px;
  right: 14px;
  font-family: var(--mono-font);
  font-size: 10pt;
  letter-spacing: 0.18em;
  color: var(--muted-color);
  z-index: 100;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
}

.theme-indicator::before {
  content: 'theme · ';
  opacity: 0.7;
}

/* ===========================================
   WHOAMI SLIDE
   =========================================== */

.reveal .slides section#whoami .title-prompt {
  margin-bottom: 20px;
}

.whoami-name {
  font-size: 48pt;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-color);
}

.whoami-header {
  display: flex;
  flex-direction: column;
}

.cert-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.cert-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 130px;
}

.cert-badge {
  width: 120px;
  height: 120px;
  background: transparent;
  box-sizing: border-box;
  transition: transform 0.25s ease-out, filter 0.25s ease-out;
  object-fit: contain;
  cursor: pointer;
}

.cert-badge:hover {
  transform: scale(1.1) translateY(-4px);
  filter: drop-shadow(0 8px 16px rgba(69, 190, 239, 0.45));
}

/* Default Theme (Dark Mode) Badge Toggle */
.cert-gcp-light {
  display: none !important;
}
.cert-gcp-dark {
  display: block !important;
}

/* Light Theme Active Badge Toggle */
:root[data-theme="light"] .cert-gcp-light {
  display: block !important;
}
:root[data-theme="light"] .cert-gcp-dark {
  display: none !important;
}

.cert-label {
  font-family: var(--mono-font);
  font-size: 14pt;
  color: var(--muted-color);
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.whoami-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 32px;
  margin: 0;
  padding: 16px 20px;
  border-left: 2px solid var(--primary-color);
  background: var(--panel-bg);
  border-radius: 0 4px 4px 0;
}

.whoami-meta-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: baseline;
}

.whoami-meta-label {
  font-family: var(--mono-font);
  font-size: 14pt;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  white-space: nowrap;
}

.whoami-meta-value {
  font-size: 15pt;
  color: var(--text-color);
  line-height: 1.3;
}

.whoami-meta-value em {
  color: var(--primary-color);
  font-style: normal;
  font-weight: 600;
}

.whoami-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-top: 4px;
}

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12pt); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes terminalBlink {
  0%, 50%  { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes accentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(69, 190, 239, 0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(69, 190, 239, 0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20pt); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20pt); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Apply fade-in-up to slide content on enter */
.reveal .slides section .content {
  animation: fadeInUp 0.5s ease-out both;
}

/* Stagger children of content for a quick cascade */
.reveal .slides section .content > * {
  animation: fadeInUp 0.5s ease-out both;
}
.reveal .slides section .content > *:nth-child(1) { animation-delay: 0.05s; }
.reveal .slides section .content > *:nth-child(2) { animation-delay: 0.15s; }
.reveal .slides section .content > *:nth-child(3) { animation-delay: 0.25s; }
.reveal .slides section .content > *:nth-child(4) { animation-delay: 0.35s; }


/* Terminal cursor blink on the ❯ prompt after typing */
.title-prompt .cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--primary-color);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: terminalBlink 1.05s steps(1) infinite;
}

/* Theme indicator: hidden on stage, flashes for 1.5s after pressing T */
.theme-indicator {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
.theme-indicator.show { opacity: 0.8; }

/* Link hover — subtle underline animation */
.reveal a {
  position: relative;
  transition: color 0.2s ease-out;
}
.reveal a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease-out;
}
.reveal a:hover::after {
  transform: scaleX(1);
}

/* Section divider title — small entrance */
.reveal .slides section.section-divider h1 {
  animation: slideInLeft 0.6s ease-out both;
}
.reveal .slides section.section-divider .section-number {
  animation: fadeIn 0.4s ease-out both;
  animation-delay: 0.15s;
}

/* Stat number big-text — count-up effect via CSS variable */
.stat .number {
  display: inline-block;
  animation: fadeInUp 0.6s ease-out both;
}

/* Panel entrance */
.reveal .slides section .panel {
  animation: fadeInUp 0.5s ease-out both;
}

/* QR code frames in the KCD gift and contact slides */
.reveal .slides section img[alt*="QR code"] {
  animation: fadeIn 0.6s ease-out both;
}

/* Reduced motion: respect user preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===========================================
   LIGHT-THEME-SPECIFIC OVERRIDES
   (Things that can't be done with variables alone)
   =========================================== */

:root[data-theme="light"] .reveal .slides section::before {
  /* Same teal gradient in light mode — still a clean hairline */
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-deep) 100%);
}

:root[data-theme="light"] figure.portrait img,
:root[data-theme="light"] .reveal figure img {
  /* Stallman portrait has a dark bg; give it a subtle shadow for separation on cream */
  box-shadow: 0 2px 12px rgba(26, 26, 26, 0.12);
}

:root[data-theme="light"] .terminal {
  /* Terminal surface stays dark — it's a deliberate "island of contrast" on cream */
  background: var(--code-bg);
  border-color: rgba(0, 0, 0, 0.2);
  /* ...so everything inside it uses the dark-theme tokens */
  --text-color: #e0e0e0;
  --muted-color: #9a9a9a;
  --primary-color: #00A9A5;
  --secondary-color: #FFB400;
  --critical-color: #FF5A63;
  --success-color: #2ECC71;
}

/* Use the regular (lighter) teal for terminal prompts inside the dark code surface */
:root[data-theme="light"] .terminal .prompt {
  color: var(--terminal-accent);
}

/* The 'h1::after' divider on section dividers still uses primary — looks correct in both modes */
:root[data-theme="light"] .reveal blockquote {
  /* Blockquote with deeper teal in light mode for AA */
  border-left: 4px solid var(--primary-color);
}

/* ===========================================
   FOOTNOTE LINK
   =========================================== */

.reveal a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px dotted var(--primary-color);
}

.reveal a:hover {
  color: var(--primary-deep);
  border-bottom-color: var(--primary-deep);
}

/* Reference QR Codes - floating transparently on slide backgrounds */
.ref-qr {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-sizing: border-box !important;
}

/* Hide light theme QR codes by default (dark mode is active) */
.ref-qr.qr-light-theme {
  display: none !important;
}
.ref-qr.qr-dark-theme {
  display: inline-block !important;
}

/* Toggle displays when light theme is active */
:root[data-theme="light"] .ref-qr.qr-light-theme {
  display: inline-block !important;
}
:root[data-theme="light"] .ref-qr.qr-dark-theme {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   Revision 2 additions: logos, evidence screenshots, GitHub comment cards
   --------------------------------------------------------------------------- */

/* Monochrome brand mark that follows the theme: <span class="logo" style="--logo:url(assets/logos/curl.svg)"> */
.logo {
  display: inline-block;
  width: 44px;
  height: 44px;
  background: var(--text-color);
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
  flex-shrink: 0;
}
.logo.sm { width: 28px; height: 28px; }
.logo.lg { width: 64px; height: 64px; }
.logo.primary { background: var(--primary-color); }
.logo.critical { background: var(--critical-color); }
/* curl's official wordmark (curl.se/logo): its navy in light mode, text color on dark */
.logo.curl-brand { background: #093754; }
:root:not([data-theme="light"]) .logo.curl-brand { background: var(--text-color); }

/* Screenshot of a primary source, framed like a browser tab */
.evidence {
  margin: 0;
  border: 1px solid var(--line-color);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel-bg);
}
.reveal .evidence img {
  display: block;
  width: 100%;
  height: auto;
  max-height: var(--evidence-h, 260px);
  object-fit: cover;
  object-position: top;
  margin: 0;
  border: none;
  box-shadow: none;
}
.evidence figcaption {
  font-family: var(--mono-font);
  font-size: 12pt;
  color: var(--muted-color);
  padding: 6px 10px;
  border-top: 1px solid var(--line-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A quoted GitHub / mailing-list / blog comment */
.comment-card {
  box-sizing: border-box;
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--primary-color);
  background: var(--panel-bg);
  border-radius: 4px;
  text-align: left;
}
.comment-card .who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono-font);
  font-size: 14pt;
  color: var(--primary-color);
  font-weight: 600;
  margin: 0 0 6px 0;
}
.reveal .comment-card blockquote,
:root[data-theme="light"] .reveal .comment-card blockquote {
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: none;
  width: auto;
  font-style: italic;
  font-size: 16.5pt;
  line-height: 1.4;
  color: var(--text-color);
  text-align: left;
}
.comment-card .src {
  display: block;
  margin-top: 8px;
  font-family: var(--mono-font);
  font-size: 14pt;
  color: var(--muted-color);
}
.comment-card.critical { border-left-color: var(--critical-color); }
.comment-card.critical .who { color: var(--critical-color); }
.comment-card.warn { border-left-color: var(--secondary-color); }
.comment-card.warn .who { color: var(--secondary-color); }

/* Small receipt line under a stat */
.reveal .receipt,
.reveal p.receipt {
  font-family: var(--mono-font);
  font-size: 14pt;
  color: var(--muted-color);
  margin: 6px 0 0 0;
  line-height: 1.35;
}
.reveal .receipt a { color: var(--primary-color); }

/* Title slide logo row; .only-dark / .only-light swap images with the theme */
.reveal img.only-light { display: none; }
:root[data-theme="light"] .reveal img.only-light { display: inline-block; }
:root[data-theme="light"] .reveal img.only-dark { display: none; }
.title-logos {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-top: 40px;
}
.title-logos img {
  height: 104px;
  width: auto;
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}
.title-logos .divider {
  width: 1px;
  height: 56px;
  background: var(--line-color);
}
.title-logos .employer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22pt;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-color);
}

/* whoami: community / organizer logos (white tiles so they read on both themes) */
.cert-item { width: 118px; }
.cert-badge { width: 104px; height: 104px; }
.community-logos {
  display: flex;
  align-items: center;
  gap: 14px;
}
.community-logos figure {
  margin: 0;
  height: 100px;
  width: 112px;
  padding: 4px;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.community-logos figure.wide { width: 250px; }
.reveal .community-logos img {
  max-height: 100%;
  max-width: 100%;
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

/* Colored stat cards (e.g. "The humans behind the controller") */
.stat-card {
  box-sizing: border-box;
  margin: 0;
  padding: 18px 20px;
  border-radius: var(--box-radius);
  border: 1px solid var(--panel-border);
  border-top: 5px solid var(--card-color);
  background: color-mix(in srgb, var(--card-color) 10%, var(--panel-bg));
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.stat-card .number {
  font-size: 44pt;
  font-weight: 800;
  line-height: 1;
  color: var(--card-color);
}
.reveal .stat-card .label {
  font-size: 15pt;
  line-height: 1.3;
  color: var(--text-color);
}
.stat-card.primary { --card-color: var(--primary-color); }
.stat-card.critical { --card-color: var(--critical-color); }
.stat-card.warn { --card-color: var(--secondary-color); }
.stat-card.success { --card-color: var(--success-color); }

/* Sources footer (revision 2): one line of links pinned to the slide bottom */
.reveal .slides section > .footnote {
  bottom: 14px;
  right: 150px; /* clear the nav arrows and theme badge */
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line-color);
  font-family: var(--mono-font);
  font-size: 11pt;
  line-height: 1.4;
  color: var(--muted-color);
}
.reveal .slides section > .footnote a {
  color: var(--muted-color);
  border-bottom: 1px dotted var(--muted-color);
}
.reveal .slides section:has(> .footnote) {
  padding-bottom: 64px !important;
}

/* Highlighted quote: tinted card, strong left rule, full-contrast text */
.quote-card {
  box-sizing: border-box;
  margin: 0;
  padding: 22px 28px;
  border-radius: var(--box-radius);
  border: 1px solid var(--panel-border);
  border-left: 6px solid var(--card-color, var(--primary-color));
  background: color-mix(in srgb, var(--card-color, var(--primary-color)) 9%, var(--panel-bg));
  text-align: left;
}
.quote-card.critical { --card-color: var(--critical-color); }
.quote-card.warn { --card-color: var(--secondary-color); }
.reveal .quote-card .quote {
  margin: 0;
  font-size: 22pt;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text-color);
}
.reveal .quote-card .who {
  margin: 12px 0 0 0;
  font-family: var(--mono-font);
  font-size: 14pt;
  font-weight: 600;
  color: var(--card-color, var(--primary-color));
}
.reveal .slides section.section-divider > .footnote {
  font-size: 11pt;
  text-align: left;
  max-width: none;
  margin: 0;
  letter-spacing: 0;
}

/* ---------------------------------------------------------------------------
   Event branding (Nerdearla México 2026 palette)
   --------------------------------------------------------------------------- */

/* Act dividers: full-bleed Nerdearla teal, ink type in both themes */
.reveal .slides section[id^="divider-"] {
  --text-color: var(--ink);
  --muted-color: var(--ink);
  --primary-color: var(--ink);
}
.reveal .slides section[id^="divider-"]::before { background: var(--ink); }
.reveal .slides section[id^="divider-"] h1 { font-size: 80pt; }
.reveal .slides section[id^="divider-"] p { font-size: 24pt; opacity: 0.85; }

/* Signature: a Nerdearla yellow highlighter stroke behind one key phrase per slide */
.hl {
  color: var(--ink) !important;
  background: linear-gradient(transparent 58%, var(--highlight) 58%, var(--highlight) 92%, transparent 92%);
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
:root:not([data-theme="light"]) .hl {
  /* On near-black the yellow works as text color: 10.5:1 */
  color: var(--highlight) !important;
  background: none;
}

/* Plain stat rows: a number and a line, no box. For slides with one hero element. */
.stat-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 2px solid var(--card-color, var(--line-color));
  text-align: left;
}
.stat-row .number {
  font-size: 34pt;
  font-weight: 800;
  line-height: 1;
  color: var(--card-color, var(--text-color));
}
.reveal .stat-row .label {
  font-size: 16pt;
  line-height: 1.35;
  color: var(--text-color);
}
.stat-row.primary { --card-color: var(--primary-color); }
.stat-row.critical { --card-color: var(--critical-color); }
.stat-row.warn { --card-color: var(--secondary-color); }

/* CVE-by-year stacked bars (#case-ingress-timeline) */
.reveal figure.cve-chart { margin: 0; text-align: left; }
.reveal .cve-chart .cve-title { margin: 0 0 8px 0; font-size: 16pt; font-weight: 600; }
.cve-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 180px;
  border-bottom: 1px solid var(--line-color);
}
.cve-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.cve-stack { display: flex; flex-direction: column-reverse; gap: 2px; width: 100%; max-width: 54px; }
.cve-stack span { display: block; }
.cve-stack span:last-child { border-radius: 4px 4px 0 0 !important; }
.cve-total { font-family: var(--mono-font); font-size: 14pt; font-weight: 700; margin-bottom: 4px; color: var(--text-color); }
.cve-year { position: relative; top: 26px; margin-top: -22px; font-family: var(--mono-font); font-size: 14pt; color: var(--muted-color); }
.reveal .cve-chart .cve-legend { margin: 30px 0 0 0; font-size: 14pt; color: var(--muted-color); display: flex; align-items: center; gap: 8px; }
.cve-legend span { display: inline-block; width: 14px; height: 14px; border-radius: 2px; margin-left: 10px; }
.cve-legend span:first-child { margin-left: 0; }

/* Full-width pull quote with a critical rule (#cost-companies) */
.reveal blockquote.statement,
:root[data-theme="light"] .reveal blockquote.statement {
  margin: 0;
  padding: 4px 0 4px 28px;
  border-left: 6px solid var(--critical-color);
  font-style: normal;
  width: 100%;
  box-sizing: border-box;
}
.reveal blockquote.statement p {
  margin: 0;
  font-size: var(--statement-size, 26pt);
  line-height: 1.35;
  font-weight: 500;
  color: var(--text-color);
}
.reveal blockquote.statement.warn,
:root[data-theme="light"] .reveal blockquote.statement.warn { border-left-color: var(--secondary-color); }
.reveal blockquote.statement.warn cite { color: var(--secondary-color); }
.reveal blockquote.statement cite {
  display: block;
  margin-top: 14px;
  font-family: var(--mono-font);
  font-size: 14pt;
  font-weight: 600;
  color: var(--critical-color);
}

/* Three practices with a real tool screenshot each (#reframe) */
.solutions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  width: 100%;
  align-items: start;
}
.solution { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.reveal .solution .solution-label {
  margin: 0;
  font-family: var(--mono-font);
  font-size: 16pt;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.reveal ul.solution-steps { margin: 4px 0 0 0; }
.reveal ul.solution-steps li { font-size: 15pt; line-height: 1.35; margin-bottom: 8px; padding-left: 22px; }

/* Contribution ladder (#framework): four rising rungs */
.ladder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
}
.ladder .step { padding: 18px 20px; }
.ladder .step h3 { font-size: 22pt; }
.ladder .step p { font-size: 15pt; color: var(--text-color); }
.reveal .ladder .rung-proof {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-color);
  font-size: 14pt;
  color: var(--muted-color);
}

/* Roadmap: fill the slide instead of floating mid-height */
#roadmap .step { padding: 22px 18px; }
#roadmap .step h3 { font-size: 28pt; }
#roadmap .step p { font-size: 17pt; }
