/* Cyprus expedition: photographic surfaces, live HTML instruments. */
html { scroll-behavior: smooth; scrollbar-color: #51636d #01040a; }
body { overflow-x: clip; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: #ffc857; color: #01040a; }
.mobile-island-image, .mobile-explore { display: none; }
.quiz-link { position: absolute; z-index: 8; bottom: max(8px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 48px; height: 48px; color: var(--terminal-amber); font: 700 13px 'Space Mono', monospace; text-decoration: none; }
.quiz-link::after { content: ''; width: 16px; height: 16px; border-right: 2px solid; border-bottom: 2px solid; transform: translateY(-4px) rotate(45deg); }
.quiz-link-hint { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none; visibility: hidden; color: var(--terminal-amber); text-shadow: 0 2px 4px #000; }
.quiz-link:focus .quiz-link-hint { visibility: visible; }
@media (hover: hover) { .quiz-link:hover .quiz-link-hint { visibility: visible; } }
.quiz-link.is-hint-dismissed .quiz-link-hint { visibility: hidden; }
.quiz-scene { position: relative; isolation: isolate; min-height: max(780px, 100svh); overflow: hidden; background: #020609; color: #d9f7ff; }
.cockpit-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: -2; }
.quiz-heading { position: relative; display: flex; align-items: start; justify-content: space-between; padding: 30px 4vw 0; }
.quiz-heading h2 { margin: 0; max-width: 650px; color: var(--terminal-amber); font: 700 clamp(24px, 2.8vw, 48px)/1.15 'Space Mono', monospace; letter-spacing: -.025em; text-wrap: balance; text-shadow: 0 3px 14px #000; }
.quiz-language { color: var(--terminal-amber); background: #020609b8; border: 0; font: 700 18px 'Space Mono', monospace; min-width: 48px; min-height: 48px; cursor: pointer; }
.quiz-console { position: relative; margin: calc(max(860px, 100svh) * .49 - var(--quiz-header-height, 90px)) auto 95px; width: min(53%, 940px); padding: 24px 30px; background: #04090e; box-shadow: 0 16px 35px #0008; min-height: 310px; }
.quiz-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: #9cc3cc; font: 500 12px/1.6 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
.quiz-stats b { color: #7ee7ff; font-weight: 500; }
#quiz-progress { display: block; width: 100%; height: 2px; margin: 10px 0 20px; border: 0; background: #18303a; accent-color: #ffc857; }
#quiz-progress::-webkit-progress-bar { background: #18303a; }
#quiz-progress::-webkit-progress-value { background: #ffc857; }
.quiz-demo { margin: 0 0 10px; color: #9cc3cc; font: 500 12px 'IBM Plex Mono', monospace; }
.quiz-question { margin: 0 0 24px; font: 500 clamp(20px, 1.8vw, 30px)/1.35 'IBM Plex Mono', monospace; color: #e3faff; text-wrap: balance; }
.quiz-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-answer { display: flex; gap: 12px; align-items: center; text-align: left; min-height: 56px; padding: 12px 16px; font: 500 16px/1.35 'IBM Plex Mono', monospace; border: 1px solid #375660; border-radius: 3px; color: #d9f7ff; background: #101c23; cursor: pointer; transition: background 160ms, border-color 160ms; }
.quiz-answer span { color: #9cc3cc; font-size: 12px; }
.quiz-answer:disabled { cursor: default; opacity: 1; }
.quiz-answer.is-correct { border-color: #8ce7b0; background: #17352c; color: #b5ffd1; }
.quiz-answer.is-wrong { border-color: #ffac97; background: #39211f; color: #ffd4c8; }
.quiz-feedback { margin: 18px 0 0; font: 500 14px/1.5 'IBM Plex Mono', monospace; color: #d9f7ff; }
.quiz-feedback strong { display: block; color: #ffc857; margin-bottom: 5px; }
.quiz-feedback p { margin: 6px 0; }
.quiz-correct-answer { color: #b5ffd1; }
.quiz-source { display: inline-block; padding: 10px 0; color: #7ee7ff; text-underline-offset: 4px; overflow-wrap: anywhere; }
.quiz-source:hover { color: #ffc857; }
.quiz-console { scrollbar-color: #51636d #04090e; scrollbar-width: thin; }
.quiz-answers[hidden] { display: none; }
.quiz-selected-answer { color: #ffd4c8; }
.has-answer .quiz-feedback { margin-top: 0; }
@media (min-width: 901px) and (max-height: 800px) {
  #quiz-content.has-answer { align-items: end; }
}
.quiz-action { margin-top: 18px; min-height: 46px; padding: 10px 18px; border: 1px solid #ffc857; background: #ffc857; color: #091117; font: 700 14px/1.4 'Space Mono', monospace; cursor: pointer; }
.quiz-result { position: relative; overflow: hidden; }
.quiz-result h3 { color: #ffc857; font: 700 clamp(22px, 2vw, 34px)/1.2 'Space Mono', monospace; margin: 18px 0; }
.quiz-result p { font: 500 16px/1.6 'IBM Plex Mono', monospace; }
.quiz-result::after { content: ''; pointer-events: none; position: absolute; left: 0; top: -10%; width: 100%; height: 2px; background: #7ee7ff; animation: mission-scan 1.2s ease-out 1; }
.quiz-companion { position: absolute; width: clamp(260px, 27vw, 460px); right: -1%; top: 16%; pointer-events: none; }
.quiz-companion img { display: block; width: 100%; height: auto; }
.quiz-companion { mix-blend-mode: normal; }
.kitten-reaction { position: absolute; inset: 0; width: 100%; height: 100%; }
.kitten-reaction[hidden] { display: none; }
.quiz-companion.is-playing-video img { visibility: hidden; }
.cockpit-lights { position: absolute; left: 6%; top: 66%; display: flex; gap: 6px; }
.cockpit-lights i { width: 4px; height: 4px; background: #ffc857; animation: instrument-light 3s steps(1) infinite; }
.cockpit-lights i:nth-child(2) { background: #7ee7ff; animation-delay: .6s; }
.cockpit-lights i:nth-child(3) { animation-delay: 1.8s; }
.quiz-scene:not(.is-in-view) *, .quiz-scene.is-paused * { animation-play-state: paused; }
.quiz-scene :focus-visible, .quiz-link:focus-visible, .mobile-explore button:focus-visible { outline: 2px solid #7ee7ff; outline-offset: 5px; }
@media (hover: hover) { .quiz-answer:not(:disabled):hover { background: #1c3440; border-color: #7ee7ff; } }
@keyframes instrument-light { 0%, 75% { opacity: .85; } 35% { opacity: .2; } }
@keyframes mission-scan { from { top: 0; opacity: .8; } to { top: 100%; opacity: 0; } }
@media (min-width: 901px) {
  .quiz-scene { --quiz-console-width: min(53%, 940px); height: 100dvh; min-height: 0; }
  /* Reserve the full video frame beside the console, including outstretched paws. */
  .quiz-companion { width: min(460px, calc((100% - var(--quiz-console-width)) / 2 - 16px)); right: 8px; }
  .cockpit-background { height: 100%; transform: translateY(-4dvh); }
  .quiz-heading { padding-top: clamp(14px, 3dvh, 30px); }
  .quiz-console { position: absolute; top: 44%; left: 50%; transform: translateX(-50%); margin: 0; width: var(--quiz-console-width); height: 52%; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
}
@media (min-width: 901px) and (max-height: 800px) {
  .quiz-scene { --quiz-console-width: 57%; }
  .quiz-console { padding: 12px 20px; }
  #quiz-progress { margin: 6px 0 10px; }
  .quiz-demo { margin-bottom: 8px; }
  .quiz-question { font-size: 21px; margin-bottom: 12px; }
  .quiz-answers { gap: 8px; }
  .quiz-answer { min-height: 44px; padding: 8px 12px; }
  #quiz-content { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: center; }
  #quiz-content > .quiz-demo, #quiz-content > .quiz-question, #quiz-content > .quiz-answers, #quiz-content > .quiz-result { grid-column: 1 / -1; }
  .quiz-feedback { margin-top: 10px; font-size: 13px; }
  .quiz-feedback strong { margin-bottom: 2px; }
  #quiz-content > .quiz-action { margin-top: 10px; min-height: 44px; padding: 8px 12px; }
  .quiz-result h3 { margin: 8px 0 12px; }
  .quiz-result p { margin: 8px 0; font-size: 14px; }
  .quiz-result .quiz-action { margin-top: 8px; }
}
@media (min-width: 901px) and (min-height: 801px) {
  .quiz-console { height: 42%; }
}
@media (max-width: 900px) {
  .space-landing { display: flex; flex-direction: column; min-height: 100svh; padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: 24px; }
  .space-landing::after { box-shadow: none; }
  .space-landing .proposition { position: relative; top: auto; left: auto; width: auto; margin: 26px 22px 16px; padding-right: 20px; order: 0; }
  .proposition h1 { max-width: none; font-size: clamp(23px, 5.3vw, 40px); line-height: 1.1; }
  .proposition p { font-size: clamp(16px, 3.5vw, 23px); line-height: 1.45; max-width: 32ch; margin-top: 18px; }
  .space-landing .media-stage { position: relative; top: auto; left: auto; width: min(100%, 500px); height: auto; aspect-ratio: 950 / 1080; min-height: 0; transform: none; margin: 0 auto; order: 1; z-index: 0; touch-action: pan-y; mask-image: linear-gradient(transparent, #000 5%, #000 93%, transparent); }
  .media-stage .hero-fallback, .media-stage .hero-motion-video { width: 201.684%; max-width: none; height: 100%; object-fit: fill; object-position: left; }
  .scene-shade { display: none; }
  .space-landing .landmark-stage { position: relative; top: auto; left: auto; width: min(100%, 650px); height: auto; aspect-ratio: 1056 / 460; min-height: 0; transform: none; margin: 8px auto 0; order: 2; z-index: 4; mask-image: linear-gradient(transparent, #000 4%, #000 96%, transparent); }
  .mobile-island-image { display: block; position: absolute; inset: 0; width: 1916px; height: 1080px; max-width: none; pointer-events: none; }
  .landmark-label { display: none; }
  .mobile-explore { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 16px 16px; order: 3; }
  .mobile-explore button { min-height: 44px; padding: 9px 12px; color: #bceeff; background: #0a1822; border: 1px solid #34525f; border-radius: 3px; font: 500 12px/1.4 'IBM Plex Mono', monospace; }
  .mobile-explore button[aria-pressed='true'] { color: #ffc857; border-color: #ffc857; }
  .space-landing .moon-language { position: absolute; top: max(6px, env(safe-area-inset-top)); right: 12px; width: 48px; height: 44px; min-width: 0; transform: none; font-size: 16px; }
  .space-landing .moon-language span { transform: none; }
  .space-landing .request-trigger { position: relative; right: auto; bottom: auto; order: 4; align-self: center; margin: 8px 0; min-height: 48px; }
  .quiz-link { position: relative; left: auto; bottom: auto; transform: none; order: 5; align-self: center; margin-top: 8px; }
  .space-landing .request-sheet { position: fixed; inset: max(8px, env(safe-area-inset-top)) 8px auto; width: auto; max-height: calc(100dvh - 16px - env(safe-area-inset-top)); min-height: 0; margin: 0; padding: 46px 20px 24px; overflow-y: auto; z-index: 50; }
  .request-sheet input, .request-sheet textarea { font-size: 16px; }
  .quiz-scene { height: 100svh; height: 100dvh; min-height: 0; padding-bottom: 0; }
  .cockpit-background { height: 100%; object-fit: fill; object-position: center; }
  .quiz-heading { padding: max(16px, env(safe-area-inset-top)) 8% 0; gap: 8px; }
  .quiz-heading h2 { max-width: 82%; font-size: clamp(20px, 5vw, 28px); }
  .quiz-language { min-width: 44px; min-height: 44px; font-size: 16px; }
  .quiz-companion { width: min(36vw, 21dvh, 170px); top: max(calc(var(--quiz-header-height, 80px) + 8px), 18%); right: 6%; }
  .quiz-console { position: absolute; top: max(43%, calc(var(--quiz-header-height, 80px) + 24px)); bottom: max(16px, env(safe-area-inset-bottom)); left: 10%; width: 80%; height: auto; margin: 0; padding: 12px; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; border: 1px solid #66523a; box-shadow: none; }
  .quiz-answers { grid-template-columns: 1fr; gap: 8px; }
  .quiz-question { font-size: clamp(18px, 4.6vw, 22px); margin-bottom: 12px; }
  .quiz-answer { min-height: 44px; padding: 8px; font-size: 16px; gap: 8px; }
  #quiz-progress { margin: 8px 0 12px; }
  .quiz-feedback { font-size: 16px; }
  .quiz-result p { font-size: 16px; }
  .quiz-stats { gap: 4px 12px; font-size: 11px; }
  .cockpit-lights { top: 53%; left: 3%; }
}
@media (max-width: 900px) and (orientation: landscape) {
  .cockpit-background { object-fit: cover; }
  .quiz-heading { width: 40%; padding: max(12px, env(safe-area-inset-top)) 16px 0; }
  .quiz-heading h2 { font-size: 20px; }
  .quiz-console { top: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 42%; width: 54%; }
  .quiz-companion { top: auto; bottom: 12%; right: 64%; width: min(22vw, 44dvh); }
}
/* Fixed instrument header and actions; only the reading area scrolls. */
.quiz-console { display: flex; flex-direction: column; overflow: hidden; }
.quiz-stats, #quiz-progress, .quiz-actions { flex: 0 0 auto; }
.quiz-console #quiz-content { display: block; min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; padding: 4px 5px; }
.quiz-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; }
.quiz-actions:empty { display: none; }
.quiz-actions .quiz-action { margin: 0; flex: 1 1 140px; }
.quiz-actions .quiz-action:disabled { opacity: .6; cursor: wait; }
.quiz-actions .quiz-secondary { color: #7ee7ff; border-color: #375660; background: transparent; }
.quiz-result canvas { display: block; width: 100%; height: auto; margin: 10px 0; }
.quiz-result h3 { margin: 4px 0 8px; }
.quiz-result p { margin: 6px 0; }
.quiz-share-status { font: 13px/1.4 'IBM Plex Mono', monospace; color: #7ee7ff; }
.quiz-share-fallback { display: flex; flex-wrap: wrap; gap: 10px; }
.quiz-share-fallback[hidden] { display: none; }
.quiz-share-fallback a, .quiz-share-fallback button { color: #7ee7ff; background: none; border: 0; min-height: 44px; font: 14px 'IBM Plex Mono', monospace; padding: 8px; text-decoration: underline; cursor: pointer; }
@media (max-width: 900px) {
  .quiz-actions { flex-wrap: nowrap; }
  .quiz-actions .quiz-action { min-width: 0; font-size: 12px; padding: 8px; }
  .quiz-console #quiz-progress { margin-bottom: 6px; }
}
@media (max-width: 1100px) and (max-height: 600px) and (orientation: landscape) {
  .quiz-scene { height: 100dvh; min-height: 0; }
  .cockpit-background { object-fit: cover; transform: none; }
  .quiz-heading { width: 25%; padding: max(8px, env(safe-area-inset-top)) 12px 0; }
  .quiz-heading h2 { font-size: clamp(16px, 2vw, 21px); max-width: 100%; }
  .quiz-language { position: absolute; top: auto; right: 10px; bottom: -48px; }
  .quiz-console { left: 26%; width: 72%; top: max(8px, env(safe-area-inset-top)); bottom: max(8px, env(safe-area-inset-bottom)); height: auto; transform: none; margin: 0; padding: 8px 10px; }
  .quiz-companion { top: auto; bottom: 6%; right: 76%; width: min(23vw, 48dvh); }
  .quiz-answers { grid-template-columns: 1fr 1fr; gap: 6px; }
  .quiz-question { font-size: 17px; line-height: 1.25; margin-bottom: 8px; text-wrap: pretty; }
  .quiz-answer { font-size: 16px; min-height: 44px; padding: 6px 8px; line-height: 1.25; }
  .quiz-stats { gap: 4px 8px; font-size: 11px; flex-wrap: nowrap; }
  .quiz-console #quiz-progress { margin: 4px 0 5px; }
  .quiz-actions { padding-top: 6px; flex-wrap: nowrap; }
  .quiz-actions .quiz-action { min-height: 44px; padding: 6px 8px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .quiz-scene *, .quiz-scene *::after { animation: none !important; transition: none !important; }
}
