/* Captain Copilot series site: shared styles for the landing page and every episode page. */

:root {
  --ink: #111111;
  --muted: #444444;
  --paper: #fffdf7;
  --soft: #f5f5f7;
  --line: #dedee7;
  --yellow: #ffd23f;
  --blue: #185abd;
  --green: #107c41;
  --outlook: #0f6cbd;
  --powerpoint: #c43e1c;
  --teams: #5b5fc7;
  --teal: #038387;
  --gradient: linear-gradient(135deg,#2d7cff 0%,#2ec4b6 35%,#c6ff3d 55%,#ff9f1c 75%,#ff2e88 90%,#7b2cbf 100%);
  --shadow: 0 24px 70px rgba(17,17,17,.12);
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid #5b5fc7;
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 10;
  transform: translateY(-140%);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  background: #ffffff;
  font-weight: 700;
}

.skip-link:focus { transform: translateY(0); }

.page {
  overflow: hidden;
}

.section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  place-items: center;
  min-height: min(760px, 100vh);
  padding: 112px 0 54px;
  background:
    radial-gradient(circle at 50% 0%, rgba(45,124,255,.09), transparent 34rem),
    linear-gradient(#ffffff 0%, #ffffff 58%, var(--paper) 100%);
}

.hero-inner {
  width: min(930px, 100%);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255,255,255,.8);
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

h1, h2, h3 {
  margin: 0;
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -.035em;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(2.5rem, 6vw, 5.35rem);
  line-height: .92;
  font-weight: 800;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
  font-weight: 800;
}

h3 {
  font-size: 1.12rem;
  line-height: 1.15;
  font-weight: 800;
}

.lead {
  max-width: 680px;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.24rem);
}

.lead:has(+ .byline) { margin-bottom: 14px; }

.byline {
  max-width: 680px;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 600;
}

.prompt-frame {
  position: relative;
  margin: 0 auto;
  border-radius: 28px;
  padding: 3px;
  background: var(--gradient);
  box-shadow: var(--shadow);
}

.prompt-frame::before {
  content: "✦";
  position: absolute;
  right: 26px;
  top: -22px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 1.25rem;
}

.prompt-box {
  min-height: 172px;
  border-radius: 25px;
  padding: clamp(24px, 5vw, 44px);
  background: rgba(255,255,255,.97);
  text-align: left;
}

.prompt-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.prompt-label::before {
  content: "";
  width: 28px;
  height: 28px;
  background: url("../art/copilot-logo.png") center / contain no-repeat;
}

.typed-text {
  min-height: 3.4em;
  margin: 0;
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(1.45rem, 4.2vw, 3.4rem);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.typed-text::after {
  content: "";
  display: inline-block;
  width: .08em;
  height: .9em;
  margin-left: .08em;
  transform: translateY(.12em);
  background: var(--teams);
  animation: blink 900ms steps(2, start) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.typed-text.is-complete::after {
  display: none;
}

.copilot-avatar {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.response-text[data-animate-reply] {
  min-height: 6em;
}

.response-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  margin: 22px auto 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(18px, 3vw, 24px);
  background: #ffffff;
  box-shadow: 0 20px 55px rgba(17,17,17,.08);
  text-align: left;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}

.response-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.avatar {
  width: 56px;
  height: 56px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  object-fit: contain;
  box-shadow: 4px 4px 0 var(--yellow);
}

.response-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 750;
}

.response-text {
  margin: 0;
  color: #202020;
  font-size: clamp(1rem, 1.8vw, 1.14rem);
}

.copilot-chat {
  position: relative;
  border: 5px solid transparent;
  border-radius: 28px;
  background: linear-gradient(#fff, #fff) padding-box, var(--gradient) border-box;
  box-shadow: 0 0 0 3px var(--ink), 8px 12px 0 3px var(--ink);
  text-align: left;
}

.chat-skyline {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  width: min(65%, 400px);
  transform: translateX(-50%);
  pointer-events: none;
}

.chat-london {
  display: block;
  width: 100%;
  height: auto;
  animation: london-shunt 12s linear 3s infinite;
}

@keyframes london-shunt {
  0%, 66%, 87%, 100% { transform: translateX(0); }
  69% { transform: translateX(-18px) rotate(-.3deg); }
  71%, 82% { transform: translateX(-16px); }
  85% { transform: translateX(3px); }
}

.london-wheel {
  transform-origin: 760px 250px;
  animation: london-turn 36s linear infinite;
}

.london-minute, .london-hour, .london-wheel {
  transform-box: view-box;
}

.london-minute, .london-hour {
  transform-origin: 385px 170px;
  animation: london-turn 24s linear infinite;
}

.london-hour {
  animation-duration: 288s;
}

@keyframes london-turn {
  to { transform: rotate(360deg); }
}

.london-windows rect {
  animation: london-lights 17s steps(1, end) infinite;
}

.london-windows rect:nth-child(2n) { animation-delay: -5s; }
.london-windows rect:nth-child(3n) { animation-delay: -11s; animation-duration: 23s; }
.london-windows rect:nth-child(4n) { animation-delay: -14s; animation-duration: 29s; }

@keyframes london-lights {
  0%, 38%, 72%, 100% { fill: #FFD23F; }
  22%, 58% { fill: #34394D; }
}

.chat-pigeon {
  position: absolute;
  right: calc(100% - 8px);
  bottom: -8px;
  width: clamp(42px, 13vw, 64px);
  height: auto;
  overflow: visible;
  transform-origin: 50% 92%;
  animation: pigeon-push 12s linear 3s infinite;
}

.pigeon-frown {
  opacity: 0;
  animation: pigeon-cross 12s linear 3s infinite;
}

@keyframes pigeon-push {
  0%, 66%, 90%, 100% { transform: translate(0, 0) rotate(0); }
  69% { transform: translate(-6px, -4px) rotate(-8deg); }
  72%, 78% { transform: translate(-3px, 0) rotate(-4deg); }
  81% { transform: translate(-5px, 0) rotate(-10deg); }
  85% { transform: translate(-3px, 0) rotate(-12deg); }
  87% { transform: translate(0, 0) rotate(3deg); }
}

@keyframes pigeon-cross {
  0%, 74%, 92%, 100% { opacity: 0; }
  76%, 89% { opacity: 1; }
}

.pigeon-shock {
  opacity: 0;
  animation: pigeon-shock 12s linear 3s infinite;
}

@keyframes pigeon-shock {
  0%, 67%, 75%, 100% { opacity: 0; }
  69%, 73% { opacity: 1; }
}

.pigeon-foot {
  transform-box: view-box;
  transform-origin: 100px 132px;
  animation: pigeon-foot-push 12s linear 3s infinite;
}

@keyframes pigeon-foot-push {
  0%, 78%, 90%, 100% { transform: rotate(0) scaleY(1); }
  81% { transform: rotate(-55deg) scaleY(1.5); }
  85% { transform: rotate(-85deg) scaleY(5); }
  87% { transform: rotate(-55deg) scaleY(1.8); }
}

.hero.chat-hero {
  min-height: 0;
  padding: 185px 0 32px;
}

@media (prefers-reduced-motion: reduce) {
  .chat-london, .chat-pigeon, .pigeon-frown, .pigeon-shock, .pigeon-foot,
  .london-wheel, .london-minute, .london-hour, .london-windows rect { animation: none; }
}

.chat-hero .hero-inner {
  width: min(1120px, calc(100% - 40px));
}

.chat-hero .copilot-chat {
  width: 80%;
  margin: 0 auto;
}

.chat-page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 740px) {
  .chat-hero .hero-inner {
    width: min(100% - 28px, 1120px);
  }

}

@media (max-width: 640px) {
  .chat-hero .copilot-chat {
    width: 100%;
  }

  .hero.chat-hero {
    padding-top: 155px;
  }

  .chat-skyline {
    width: 75%;
    max-width: 240px;
  }
}

.chat-messages {
  padding: clamp(18px, 3vw, 24px);
}

.chat-user {
  width: fit-content;
  max-width: 85%;
  margin-left: auto;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 18px;
  background: #eef0f8;
}

.chat-user .typed-text {
  min-height: 1.5em;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
}

.copilot-chat .response-card {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  margin-top: 20px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  visibility: hidden;
  transform: none;
  transition: opacity .55s ease;
}

.copilot-chat .response-card.is-visible {
  visibility: visible;
}

.copilot-chat .copilot-avatar {
  width: 32px;
  height: 32px;
}

.copilot-chat .response-text {
  line-height: 1.65;
}

.copilot-chat .response-text[data-animate-reply] {
  min-height: 6.6em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.chat-more[hidden] {
  display: none;
}

.chat-reply-area.is-reserved,
.chat-user.is-reserved {
  display: grid;
}

.is-reserved > * {
  grid-area: 1 / 1;
  min-width: 0;
}

.chat-size {
  visibility: hidden;
  pointer-events: none;
}

.chat-user .chat-size::after {
  display: none;
}

.chat-reply-copy .response-text {
  min-height: 0;
}

.chat-reply-copy .response-text[data-animate-reply] {
  min-height: 0;
}

.chat-reply-copy .response-text + .response-text {
  margin-top: 12px;
}

.button {
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0 18px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--ink);
}

.button.primary:hover,
.button.primary:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 var(--ink);
}

main > section {
  padding: 74px 0;
}

.section-head {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin-bottom: 30px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

#episodes .section-head {
  max-width: none;
}

.section-head p,
.card p,
.step p,
.quiet-card p,
footer p {
  margin: 0;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  border-color: transparent;
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px #2d7cff;
}

.answer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(20px, 4vw, 34px);
  background: var(--soft);
}

.answer-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.mini-captain {
  width: min(116px, 18vw);
  min-width: 78px;
  align-self: end;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(17,17,17,.05);
}

.tile {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

.tile.word { background: var(--blue); }
.tile.excel { background: var(--green); }
.tile.outlook { background: var(--outlook); }
.tile.powerpoint { background: var(--powerpoint); }
.tile.teams { background: var(--teams); }
.tile.copilot { background: var(--gradient); }

.example {
  margin: auto 0 0;
  border-radius: 16px;
  padding: 12px;
  background: var(--paper);
  color: #262626;
  font-family: Consolas, "Courier New", monospace;
  font-size: .84rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.setup-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 6px 6px 0 rgba(17,17,17,.08);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--yellow);
  font-weight: 900;
}

.step.is-video-active {
  background: #fff6cc;
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
  box-shadow: 6px 6px 0 var(--ink);
}

.step.is-video-active .step-number {
  color: #fff;
  background: var(--ink);
}

.step-download {
  text-decoration: none;
}

.step-download:hover h3,
.step-download:focus-visible h3 {
  text-decoration: underline;
}

.step-download:focus-visible {
  outline: 3px solid #5b5fc7;
  outline-offset: 4px;
}

.install-guide {
  margin: 38px 0 0;
}

.install-guide figcaption {
  text-align: center;
  margin-bottom: 20px;
}

.install-guide video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #1d1d29;
  border: 2px solid var(--ink);
  border-radius: 16px;
}

.install-player {
  position: relative;
  width: 80%;
  margin: 0 auto;
}

.install-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  padding: 12px;
  background: var(--yellow);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 5px 5px 0 var(--ink);
  font: inherit;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
}

.install-play[hidden] { display: none; }
.install-play svg { width: 42px; height: 42px; }
.install-play:hover { background: #ffe374; }
.install-play:focus-visible { outline: 4px solid #fff; outline-offset: 5px; }

@media (max-width: 640px) {
  .install-player { width: 100%; }
  .install-play { width: 88px; height: 88px; }
}

.install-progress {
  text-align: center;
  font-weight: 700;
  min-height: 1.5em;
  margin: 14px 0;
}

.install-error {
  border-left: 4px solid #b42318;
  padding: 12px 16px;
}

.install-transcript {
  max-width: 860px;
  margin: 18px auto 0;
  line-height: 1.6;
}

.install-transcript summary {
  cursor: pointer;
  font-weight: 700;
}

.install-transcript li {
  margin-bottom: 12px;
}

.quiet-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 20px;
  align-items: stretch;
}

.quiet-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(22px, 4vw, 32px);
  background: #ffffff;
}

.quiet-card.accent {
  background: linear-gradient(135deg, rgba(45,124,255,.08), rgba(46,196,182,.08), rgba(255,46,136,.07));
}

.facts {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.facts li {
  display: flex;
  gap: 10px;
}

.facts li::before {
  content: "✓";
  color: #107c41;
  font-weight: 900;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  padding: 20px 24px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-list p {
  margin: 16px 0 0;
}

footer {
  border-top: 0;
  padding: 34px 0 48px;
}

footer::before {
  content: "";
  display: block;
  height: 10px;
  border-block: 3px solid var(--ink);
  background: var(--gradient);
  margin-top: -34px;
  margin-bottom: 34px;
}

.footer-inner {
  display: grid;
  gap: 12px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  font-size: .9rem;
}

.analytics-choice {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 100;
  width: min(420px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: .9rem;
  text-align: left;
}

.analytics-choice[hidden] { display: none; }
.analytics-choice p { margin: 0; }
.analytics-choice .actions { margin-top: 12px; gap: 10px; }
.analytics-choice .button { padding: 0 12px; min-height: 44px; }

.chat-hero .analytics-choice {
  position: static;
  width: min(420px, 80%);
  margin: 22px 10% 0 auto;
}

@media (min-width: 1360px) {
  .chat-hero .analytics-choice {
    position: fixed;
    width: min(240px, calc((100vw - 896px) / 2 - 64px));
    margin: 0;
  }

  .chat-hero .analytics-choice .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .chat-hero .analytics-choice {
    width: 100%;
    margin: 22px 0 0;
  }
}

.analytics-settings {
  justify-self: start;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.avatar.is-popping {
  animation: pop 600ms cubic-bezier(.2,.9,.25,1.3) both;
}

.mini-captain.is-popping {
  animation: pop 480ms cubic-bezier(.2,.9,.25,1.3) both;
}

@keyframes pop {
  0% { transform: scale(.6) rotate(-8deg); }
  60% { transform: scale(1.08) rotate(3deg); }
  100% { transform: none; }
}

/* Sparkle badge: an occasional twinkle, and a full spin on hover */
.prompt-frame::before {
  animation: twinkle 7s ease-in-out 4s infinite;
}

.prompt-frame:hover::before {
  animation: spin 700ms cubic-bezier(.2,.9,.25,1.2);
}

@keyframes twinkle {
  0%, 86%, 100% { transform: none; }
  90% { transform: rotate(18deg) scale(1.14); }
  94% { transform: rotate(-8deg) scale(.96); }
  97% { transform: rotate(3deg); }
}

@keyframes spin {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(200deg) scale(1.18); }
  to { transform: rotate(360deg) scale(1); }
}

/* Captain idles in the response card: a small head tilt every few seconds */
.avatar.is-idle {
  transform-origin: 50% 90%;
  animation: tilt 6.5s ease-in-out 1.5s infinite;
}

@keyframes tilt {
  0%, 84%, 100% { transform: none; }
  88% { transform: rotate(-9deg); }
  92% { transform: rotate(6deg); }
  95% { transform: rotate(-2deg); }
}

.mini-captain {
  transition: transform .25s ease;
}

.answer-panel:hover .mini-captain:not(.is-popping) {
  transform: translateY(-4px) rotate(-3deg);
}

/* Sparkle burst from the download button */
.spark {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  color: var(--c, var(--yellow));
  font-size: var(--s, 18px);
  line-height: 1;
  text-shadow: 0 0 1px var(--ink);
  animation: burst 750ms cubic-bezier(.15,.8,.3,1) forwards;
}

@keyframes burst {
  from { transform: translate(-50%, -50%) scale(.4) rotate(0deg); opacity: 1; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(160deg); opacity: 0; }
}

/* Step numbers stamp in when scrolled into view */
.stamp-ready .step-number {
  opacity: 0;
  transform: scale(1.8) rotate(-14deg);
}

.stamp-ready .step.is-in .step-number {
  animation: stamp 420ms cubic-bezier(.3,1.4,.5,1) var(--delay, 0ms) forwards;
}

@keyframes stamp {
  0% { opacity: 0; transform: scale(1.8) rotate(-14deg); }
  70% { opacity: 1; transform: scale(.92) rotate(4deg); }
  100% { opacity: 1; transform: rotate(-4deg); }
}

/* Admiral Analogue peeking over the footer line */
footer {
  position: relative;
}

.admiral-peek {
  position: absolute;
  right: max(20px, calc((100% - 1120px) / 2 + 20px));
  bottom: 100%;
  width: 84px;
  height: 54px;
  overflow: hidden;
}

.admiral-peek img {
  display: block;
  width: 84px;
  height: auto;
  transform: translateY(var(--peek, 100%));
  transition: transform .45s cubic-bezier(.3,1.3,.5,1);
}

.admiral-peek.is-up img {
  --peek: 6px;
}

.admiral-peek.is-ducking img {
  --peek: 100%;
  transition-duration: .18s;
  transition-timing-function: ease-in;
}

.admiral-bubble {
  position: absolute;
  right: calc(max(20px, calc((100% - 1120px) / 2 + 20px)) + 92px);
  bottom: calc(100% + 14px);
  border: 2px solid var(--ink);
  border-radius: 14px 14px 4px 14px;
  padding: 6px 12px;
  background: #ffffff;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

.admiral-bubble.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1080px) {
  .prompt-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  .section {
    width: min(100% - 28px, 1120px);
  }

  .hero {
    min-height: 0;
    padding: 96px 0 42px;
  }

  h1 {
    font-size: clamp(2.2rem, 13vw, 4rem);
  }

  .prompt-box {
    min-height: 148px;
  }

  .response-card,
  .answer-panel,
  .quiet-grid {
    grid-template-columns: 1fr;
  }

  .mini-captain {
    justify-self: end;
  }

  main > section {
    padding: 54px 0;
  }

  .prompt-grid,
  .setup-strip {
    grid-template-columns: 1fr;
  }

  .actions .button {
    width: 100%;
  }

  .response-card .actions {
    flex-direction: column;
    gap: 10px;
  }

  .response-card .actions .button {
    width: 100%;
    font-size: .95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  .typed-text::after {
    display: none;
  }

  .response-card {
    opacity: 1;
    transform: none;
  }

  .admiral-peek,
  .admiral-bubble {
    display: none;
  }
}

/* Site bar shared by every page in the series */
.site-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
}

.site-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  background: var(--paper);
  object-fit: cover;
  object-position: 50% 6%;
  box-shadow: 3px 3px 0 var(--yellow);
}

.site-links {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-links a {
  display: inline-block;
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}

.site-links a:hover {
  background: var(--soft);
  color: var(--ink);
}

/* Episode cards on the landing page */
#episode-1 {
  scroll-margin-top: 20px;
}

.episode-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.episode-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 8px 8px 0 var(--ink);
  transition: transform .2s ease, box-shadow .2s ease;
}

.episode-card.live:hover,
.episode-card.live:focus-within {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--ink);
}

.episode-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-bottom: 2px solid var(--ink);
  object-fit: cover;
}

.episode-body {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 12px;
  padding: clamp(20px, 3vw, 28px);
}

.episode-body p {
  margin: 0;
  color: var(--muted);
}

.episode-tag {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 11px;
  background: #e8f6ee;
  color: var(--green);
  font-size: .82rem;
  font-weight: 800;
}

.episode-card h3 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1;
}

.episode-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.episode-meta li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
}

.episode-body .actions {
  margin-top: 6px;
}

.episode-card.next {
  border-style: dashed;
  background: var(--soft);
  box-shadow: none;
}

.episode-card.next .episode-tag {
  background: #fff4cc;
  color: #6b4e00;
}

.classified {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-bottom: 2px dashed var(--ink);
  background: radial-gradient(circle at 50% 120%, rgba(91,95,199,.18), transparent 60%), #ececf3;
}

.classified img {
  width: 34%;
  max-width: 150px;
  margin-top: 14%;
  filter: grayscale(1) blur(5px) opacity(.55);
}

.classified-stamp {
  position: absolute;
  border: 3px solid #c43e1c;
  border-radius: 8px;
  padding: 4px 14px;
  color: #c43e1c;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 900;
  letter-spacing: .12em;
  transform: rotate(-9deg);
  background: rgba(255,255,255,.7);
}

/* Download panel on episode pages */
.download-panel {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: 22px;
}

.download-panel small {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 740px) {
  .episode-grid {
    grid-template-columns: 1fr;
  }

  .site-links a {
    padding: 7px 10px;
  }
}

@media (max-width: 480px) {
  .brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .episode-card.live:hover,
  .episode-card.live:focus-within {
    transform: none;
  }
}
