html, body, #root { height: 100%; margin: 0; }
* { box-sizing: border-box; }
.App {
  background: url('background.jpeg') center / cover;
  width: 100%; height: 100%; min-height: 100svh;
  position: relative; isolation: isolate; overflow: hidden;
  color: #1a1a1a;
}
.App::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgba(255,255,255,.55); backdrop-filter: blur(2px);
}
.content-container { display: flex; flex-direction: column; height: 100%; }
.content-window { flex: 1; min-height: 0; padding: 0 10px; }
.monospace {
  height: 100%; overflow: auto;
  padding: clamp(20px,4vh,48px) clamp(8px,2.5vw,36px) 18px;
  font-family: 'Courier New', monospace;
  font-size: clamp(13px,1.65vh,18px); line-height: 1.4; font-weight: 700;
  transition: opacity 220ms ease, filter 220ms ease;
}
.transition-out { opacity: 0; filter: blur(1.6px); }
.transition-in { animation: settle 260ms ease-out; }
@keyframes settle { from { opacity: 0; filter: blur(1.6px); } to { opacity: 1; filter: blur(0); } }
.stanza { margin: 0 0 1.2em; }
.poem-title-stanza { margin-bottom: 1.7em; }
.title-line { font-size: 1.08em; }
.poem-line { min-height: 1.4em; }
.poem-text, .code {
  appearance: none; border: 0; padding: 0; margin: 0; background: none;
  font: inherit; line-height: inherit; color: inherit; cursor: pointer;
  text-align: left; border-radius: 2px;
}
.poem-text { display: block; max-width: 100%; }
.code { white-space: nowrap; display: inline-block; }
.poem-text:hover, .code:hover, .highlighted-line, .selected-code { color: #94323a; }
.poem-text:focus-visible, .code:focus-visible, .cta-button:focus-visible,
.close-bubble:focus-visible, .map-link:focus-visible { outline: 2px solid #94323a; outline-offset: 3px; }
.app-footer {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(12px,2.5vw,36px) max(10px,env(safe-area-inset-bottom));
  font: 11px/1.35 'Helvetica Neue', Arial, sans-serif;
}
.credits-text { background: rgba(255,255,255,.82); padding: 5px 8px; border-radius: 3px; }
.cta-button {
  border: 0; border-radius: 20px; background: #286491; color: white;
  font: 14px/1.3 'Helvetica Neue', Arial, sans-serif;
  padding: 9px 17px; cursor: pointer; flex-shrink: 0;
}
.cta-button:hover { background: #194b73; }
.info-bubble {
  position: fixed; z-index: 20; width: min(360px, calc(100vw - 20px));
  max-height: calc(100vh - 20px); overflow: auto;
  background: rgba(252,252,252,.98); border: 1px solid #d7d4ce; border-left: 3px solid #4a6670;
  border-radius: 5px; box-shadow: 0 8px 32px rgba(0,0,0,.2);
  font: 14px/1.45 'Helvetica Neue', Arial, sans-serif;
  padding: 34px 18px 16px;
}
.close-bubble {
  position: absolute; top: 3px; right: 5px; border: 0; background: transparent;
  font: 26px/1 Arial, sans-serif; width: 32px; height: 32px; color: #444; cursor: pointer;
}
.itinerary { font: 700 13px/1.6 'Courier New', monospace; white-space: normal; padding-bottom: 10px; border-bottom: 1px solid #ddd; }
.length, .carbon-footprint { margin: 12px 0; }
.estimate-note { margin: 10px 0 0; font-size: 11px; color: #555; }
.airport-heading { padding-bottom: 12px; }
.airport-heading div { margin-top: 4px; }
.airport-map { display: block; width: 100%; height: 205px; border: 1px solid #ddd; background: #eee; object-fit: cover; }
.map-link { display: inline-block; margin-top: 10px; color: #285b74; font-size: 12px; }
@media (max-width: 480px) {
  .content-window { padding: 0 3px; }
  .monospace { font-size: 12px; line-height: 1.5; padding: 18px 8px; }
  .poem-line { padding-left: 1em; text-indent: -1em; }
  .poem-text { text-indent: -1em; }
  .app-footer { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .credits-text { font-size: 10px; }
  .cta-button { font-size: 12px; padding: 9px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .monospace { transition: none; animation: none; }
}

/* Reserve the footer before fitting the poem; never lay credits over a verse. */
html, body, #root { height: 100%; margin: 0; }
.App, .App * { box-sizing: border-box; }
.App { height: 100vh; height: 100dvh; min-height: 0; }
.content-container { height: 100%; max-height: 100%; padding: 0; }
.content-window { flex: 1; min-height: 0; height: auto; padding: 0; }
.responsive-container { height: 100%; min-height: 0; }
.monospace {
  height: 100%; max-height: 100%; margin: 0;
  padding: clamp(12px, 2vh, 24px) clamp(16px, 4vw, 60px) 14px;
  font-size: 14px; line-height: 1.28;
  white-space: normal; overflow: auto; overflow-wrap: break-word;
  text-shadow: 0 1px 2px rgba(255,255,255,.5);
  transition: opacity 220ms ease-out, filter 260ms ease-out, transform 260ms ease-out;
}
.stanza { margin: 0 0 .65em; }
.stanza:last-child { margin-bottom: 0; }
.poem-title-stanza { margin-bottom: 1.35em; }
.poem-line { min-height: 1.28em; }
.selected-code, .highlighted-line { font-size: inherit; }
.app-footer {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px clamp(16px, 4vw, 60px) max(10px, env(safe-area-inset-bottom));
  font: 11px/1.35 'Helvetica Neue', Arial, sans-serif;
}
.credits-text { background: rgba(255,255,255,.82); padding: 5px 8px; border-radius: 3px; }
.app-footer .cta-button { flex-shrink: 0; font-size: 13px; min-height: 36px; }
@media (max-width: 480px) {
  .monospace { padding: 12px 12px 14px; line-height: 1.28; }
  .app-footer { padding-inline: 12px; gap: 8px; }
  .app-footer .credits-text { font-size: 10px; }
  .app-footer .cta-button { font-size: 11px; padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) { .monospace { transition: none; } }

/* Verse indentation is data, shared by the poem and its code view. */
.poem-line { padding-left: 0; text-indent: 0; }
.poem-text { padding-left: 1em; text-indent: -1em; overflow-wrap: anywhere; }
.reader-error { padding: 1rem; background: #f8f5f0; color: #2c2825; }
.reader-error a { color: #285b74; }
.cta-button:disabled { opacity: .6; cursor: wait; }
