/* ============================================================
   "Will AI take your job?" — custom dashboard styles
   Editorial / Pudding-style. Loaded via _quarto.yml or notebook YAML.
   ============================================================ */

:root {
  /* Deep space blue palette — HAL / 2001 / Interstellar.
     Cool blue-black field, red as the only warm signal. */
  --paper:        #0a0e1a;   /* deep space blue */
  --paper-deep:   #050811;   /* deeper recess */
  --ink:          #d8dde6;   /* cool off-white for body */
  --ink-soft:     #a4abb8;   /* secondary text */
  --ink-quiet:    #6c7480;   /* tertiary / meta */
  --rule:         #1f2532;   /* steel hairlines, blue-tinted */
  --hal-red:      #ff3a1f;   /* alarm red, stays bright on dark */
  --hal-red-deep: #c91f0a;   /* the ? color */
  --hal-amber:    #d4a04a;
  --hal-gold:     #8a6520;
}

/* --- Page background: dark charcoal -------------------- */
html,
body,
.quarto-dashboard-content,
.dashboard-page,
.bslib-page-fill,
.bslib-page-dashboard,
.quarto-dashboard {
  background: var(--paper) !important;
  color: var(--ink);
  font-family: 'Inter Tight', system-ui, sans-serif;
}

/* Override Bootstrap CSS variables that some themes use */
:root, body {
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
}

/* Subtle film-grain overlay — pinned, non-interactive.
   On dark bg we use light noise via 'screen' blend for atmospheric texture. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  opacity: 0.5;
}

/* --- Strip the default card chrome on EVERY row ------------- */
/* The dashboard scrolls as one continuous dark surface, so we kill
   borders, padding, and backgrounds on every card / cell wrapper.
   The hero-row class keeps its specific overrides (min-height etc.)
   but everything below uses the same transparent treatment. */
.card,
.card-body,
.cell-output,
.cell-output-display,
.bslib-card,
.html-fill-item,
.html-fill-container,
.quarto-dashboard .card,
.quarto-dashboard .card-body,
.quarto-dashboard .bslib-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Tighten card padding so plots breathe but don't get isolated.
   Hero row keeps zero padding; data sections get a little. */
.card-body,
.cell-output-display {
  padding: 1rem 0 !important;
}
.hero-row .card,
.hero-row .card-body,
.hero-row .cell-output,
.hero-row .cell-output-display,
.hero-row .bslib-card,
.hero-row .html-fill-item,
.hero-row .html-fill-container {
  padding: 0 !important;
  margin: 0 !important;
}

/* Make sure the hero row can grow to hold both screens */
.hero-row { min-height: 200vh; }

/* --- Section wrapper for Q1-Q4 rows ------------------------- */
/* Each `## Row {.q-section}` becomes one of these. Question-to-question
   separation is created by .q-chapter (border + extra top padding) — not
   by the row itself — so consecutive rows within one question stay tight. */
.q-section {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto !important;
  padding: 1.25rem 4vw !important;
  box-sizing: border-box;
}

/* Chapter intro — the editorial framing above each question's plots.
   Border + heavy top padding = visual question break. */
.q-chapter {
  border-top: 1px solid var(--rule);
  padding-top: 6rem;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
}

.q-eyebrow {
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--hal-red);
  margin-bottom: 1.5rem;
}

.q-question {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 380;
  font-style: italic;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 1.5rem;
  max-width: 28ch;
}

.q-dek {
  font-family: 'Inter Tight', sans-serif;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 65ch;
  margin: 0 0 2rem;
  font-weight: 300;
}

.q-takeaway {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 340;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.6;
  color: var(--ink-soft);
  border-left: 2px solid var(--hal-red);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0 4rem;
  max-width: 60ch;
}
.q-takeaway strong { color: var(--ink); font-weight: 400; }
.q-takeaway em { color: var(--ink); font-style: italic; }

/* Push the last takeaway off the bottom of the page so the dashboard
   doesn't end on a hard edge. */
.q-section:last-of-type {
  padding-bottom: 8rem !important;
}

/* --- Hero block ---------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 2.5rem 4vw 2.5rem;
  z-index: 2;
  /* First viewport: meta bar + headline + scroll cue, exactly 100vh */
  height: auto;
  min-height: 100vh;
  box-sizing: border-box;
}

/* The second beat lives in its own full viewport BELOW the hero */
.hero-second {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 4vw;
  box-sizing: border-box;
}

/* Top meta bar */
.hero .meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
}
.hero .meta .left   { font-weight: 500; }
.hero .meta .center { letter-spacing: 0.22em; }

/* Headline block */
.hero .headline-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4vh 0 2vh;
}

.hero .kicker {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 340;
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
  animation: heroFadeUp 0.9s 0.0s cubic-bezier(.2,.7,.2,1) backwards;
}

.hero .headline {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-weight: 400;             /* Major Mono is single-weight */
  text-transform: lowercase;    /* Major Mono only has lowercase glyphs */
  line-height: 1.05;            /* monospace needs more vertical air */
  letter-spacing: 0;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;                  /* slightly more gap since lines have less weight contrast */
  max-width: 1400px;
  margin: 0 auto;
}

/* Each line gets its own scale — building rhythm.
   With no weight or italic available, size + tracking + color do the work. */
.hero .headline .line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0 0.18em;
  white-space: nowrap;
}
.hero .headline .line-1 { font-size: clamp(1.8rem, 3.5vw, 3.2rem);  letter-spacing: 0.15em; color: var(--ink-quiet); }
.hero .headline .line-2 {
  font-family: 'Major Mono Display', 'Courier New', monospace;  /* AI keeps the original alien font */
  font-size: clamp(3rem, 7vw, 6rem);
  letter-spacing: 0.05em;
  color: var(--ink);
}
.hero .headline .line-3 { font-size: clamp(2rem,   4vw,   3.6rem);  letter-spacing: 0.18em; color: var(--ink-soft); }
.hero .headline .line-4 { font-size: clamp(4rem,   12vw,  11rem);   letter-spacing: 0;       color: var(--ink); }
.hero .headline .line-5 {
  font-size: clamp(3rem, 9vw, 8rem);
  letter-spacing: 0;
  color: var(--hal-red);
  filter: drop-shadow(0 0 0.2em rgba(255, 58, 31, 0.45));
  margin-top: 0.1em;
  margin-bottom: 1.5em;
}

/* Stagger the reveal — each line a beat after the previous */
.hero .headline .line-1 { animation: heroFadeUp 0.9s 0.2s cubic-bezier(.2,.7,.2,1) backwards; }
.hero .headline .line-2 { animation: heroFadeUp 0.9s 0.5s cubic-bezier(.2,.7,.2,1) backwards; }
.hero .headline .line-3 { animation: heroFadeUp 0.9s 0.8s cubic-bezier(.2,.7,.2,1) backwards; }
.hero .headline .line-4 { animation: heroFadeUp 1.1s 1.2s cubic-bezier(.2,.7,.2,1) backwards; }
.hero .headline .line-5 { animation: heroFadeUp 1.1s 1.7s cubic-bezier(.2,.7,.2,1) backwards; }

.hero .job-word {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.hero .job-word .letter { display: inline-block; }

.hero .hal-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.6em;       /* matches the height of Major Mono's rounded letterforms */
  height: 0.6em;
  margin: 0 0.04em;
  position: relative;
  top: 0.04em;        /* nudge down so it sits on the baseline like a real letter */
}

.hero .hal-eye {
  width: 100%;
  height: 100%;
  display: block;
  filter:
    drop-shadow(0 0 0.3em rgba(255, 58, 31, 0.55))
    drop-shadow(0 0 0.6em rgba(255, 58, 31, 0.25))
    drop-shadow(0 0.04em 0.08em rgba(0, 0, 0, 0.6));
  animation: halPulse 4.2s ease-in-out infinite;
}

@keyframes halPulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 0.3em rgba(255, 58, 31, 0.55))
      drop-shadow(0 0 0.6em rgba(255, 58, 31, 0.25))
      drop-shadow(0 0.04em 0.08em rgba(0, 0, 0, 0.6));
  }
  50% {
    filter:
      drop-shadow(0 0 0.5em rgba(255, 58, 31, 0.75))
      drop-shadow(0 0 1em   rgba(255, 58, 31, 0.4))
      drop-shadow(0 0.04em 0.08em rgba(0, 0, 0, 0.6));
  }
}

.hero .hal-core {
  transform-origin: center;
  animation: halCore 4.2s ease-in-out infinite;
}
@keyframes halCore {
  0%, 100% { opacity: 0.95; }
  50%      { opacity: 1; }
}

/* Punctuation */
.hero .bang {
  font-family: 'Major Mono Display', 'Courier New', monospace;
  font-weight: 400;
  color: var(--hal-red);
  margin-left: 0.04em;
  letter-spacing: 0;
  filter: drop-shadow(0 0 0.15em rgba(255, 58, 31, 0.4));
}

/* Below-the-fold soft voice + scroll cue */
.hero .below {
  text-align: center;
  padding-bottom: 1rem;
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: heroFadeUp 1.4s 2.2s cubic-bezier(.2,.7,.2,1) backwards;
}

.hero .scroll-cue {
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.hero .scroll-cue .line {
  display: inline-block;
  width: 1px;
  height: 56px;
  background: var(--ink-soft);
  animation: lineDrop 2.4s ease-in-out infinite;
  transform-origin: top;
}
@keyframes lineDrop {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(56px); opacity: 0; }
}

.hero-second .soft-voice {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-weight: 400;
  text-transform: lowercase;
  font-size: clamp(1.4rem, 3.5vw, 2.8rem);
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  max-width: 32ch;
  margin: 0 auto;
  text-align: center;
}
.hero-second .soft-voice .em {
  color: var(--hal-red);
  letter-spacing: 0.12em;
}

/* Footer meta sits at the bottom of the second viewport */
.hero-second .footer-meta {
  position: absolute;
  bottom: 2rem;
  left: 4vw;
  right: 4vw;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hide Quarto's auto-generated navbar — the headline lives in the hero. */
.quarto-dashboard .navbar,
.quarto-dashboard nav.navbar,
body.quarto-dashboard > .navbar,
.quarto-dashboard #quarto-header,
.navbar.navbar-expand-lg {
  display: none !important;
}

/* Reclaim the space the navbar used to occupy */
.quarto-dashboard,
.quarto-dashboard .dashboard-page,
.quarto-dashboard .bslib-page-fill,
.quarto-dashboard .bslib-page-dashboard {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Force Space Mono everywhere except the hero */
body *:not(.hero *):not(.hero-second *) {
  font-family: 'Space Mono', 'Courier New', monospace !important;
}

/* Mobile */
@media (max-width: 700px) {
  .hero .meta, .hero-second .footer-meta {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
  }
  .hero .meta .center { display: none; }
  .hero .headline    { gap: 0 0.12em; }
  .hero-second .soft-voice { font-size: 1.6rem; }
  .q-section { padding: 5rem 6vw 4rem; }
}

/* Remove ALL italics */
body * {
  font-style: normal !important;
}
/* --- Ending: final cinematic screen -------------------------- */

.ending {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 2.5rem 4vw 2.5rem;
  box-sizing: border-box;
  background: transparent !important;
}

.ending-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
}

.ending-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.ending-headline {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-weight: 400;
  text-transform: lowercase;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4em;
  max-width: 1400px;
  margin: 0 auto;
}

.ending-headline .line {
  display: block;
  white-space: nowrap;
  font-family: 'Space Mono', 'Courier New', monospace;
  letter-spacing: 0.12em;
}

.ending-headline .line-1 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--ink-quiet);
}

.ending-headline .line-2,
.ending-headline .line-3 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--ink-soft);
}

.ending-headline .nb {
  font-family: 'Major Mono Display', 'Courier New', monospace;
  font-size: 1.15em;
  margin-left: 0.3em;
  letter-spacing: 0.05em;
}

.ending-headline .red {
  color: var(--hal-red);
  filter: drop-shadow(0 0 0.15em rgba(255,58,31,0.35));
}

.ending .below {
  text-align: center;
  margin-top: 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ending .scroll-cue {
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.ending .scroll-cue .scroll-line {
  display: inline-block;
  width: 1px;
  height: 40px;
  background: var(--ink-soft);
  animation: endingLineDrop 2.4s ease-in-out infinite;
  transform-origin: top;
}

@keyframes endingLineDrop {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(40px); opacity: 0; }
}

.ending-second {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 4vw;
  box-sizing: border-box;
  background: transparent !important;
}

.ending-second .soft-voice {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-weight: 400;
  text-transform: lowercase;
  font-size: clamp(1.4rem, 3.5vw, 2.8rem);
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  max-width: 34ch;
  margin: 0 auto;
  text-align: center;
}

.ending-second .soft-voice .em,
.ending-second .soft-voice .query {
  color: var(--hal-red);
}

.ending-headline .ai {
  text-transform: uppercase;
}
/* Réduire les espaces entre les éléments */
.cell {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.cell-output {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.quarto-figure {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}
p {
  margin-bottom: 0.5rem !important;
}

.columns.q-section {
  min-height: unset !important;
  height: auto !important;
  flex: 0 0 auto !important;
}
.columns.q-section > .card {
  min-height: unset !important;
  height: auto !important;
}
.columns.q-section > .card > .card-body {
  min-height: unset !important;
  height: auto !important;
  flex: 0 0 auto !important;
}

/*-- scss:rules --*/
.cell-output-display {
  min-height: unset !important;
  height: auto !important;
}
.bslib-gap-item {
  gap: 0 !important;
}
.bslib-grid {
  gap: 0 !important;
  row-gap: 0 !important;
}

.bslib-grid.html-fill-container {
  grid-template-rows: unset !important;
  grid-auto-rows: auto !important;
}

.html-fill-item.html-fill-container.bslib-grid {
  grid-template-rows: unset !important;
  grid-auto-rows: auto !important;
}

.q-section.html-fill-item.html-fill-container.bslib-grid {
  grid-template-rows: unset !important;
  grid-auto-rows: auto !important;
}