:root {
  --page-bg: #0b1117;
  --panel-bg: #121a21;
  --panel-border: rgba(205, 193, 151, 0.12);
  --title-gold: #d2c58d;
  --heading-gold: #c8bb82;
  --body-text: #c2c7c8;
  --muted-text: #aeb6b8;
  --memorial-text: #bfc4c1;
}

* { box-sizing: border-box; }

html {
  background: var(--page-bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 1100px;
  background:
    radial-gradient(circle at 31% 44%, rgba(45, 62, 73, 0.18), transparent 36%),
    linear-gradient(180deg, #0b1117 0%, #090f14 100%);
  color: var(--body-text);
  font-family: Helvetica, Arial, sans-serif;
}

.page-shell {
  width: min(1600px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 0 20px;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 86px;
  padding-right: 126px;
}

.main-title {
  margin: 0;
  color: var(--title-gold);
  font-family: "American Typewriter", "Courier New", monospace;
  font-size: clamp(38px, 3.7vw, 58px);
  font-weight: 400;
  letter-spacing: 3px;
  line-height: 1.04;
  text-transform: uppercase;
  text-shadow: 0 0 0.4px currentColor;
  white-space: nowrap;
}

.night-mission { letter-spacing: 0.115em; }
.title-divider { display: inline-block; margin: 0 0.12em; }
.squadron-title { letter-spacing: 0.035em; }

.language-switch {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.flag-link {
  display: block;
  padding: 3px;
  opacity: 0.62;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: opacity 160ms ease, border-color 160ms ease;
}

.flag-link:hover,
.flag-link.active {
  opacity: 0.95;
  border-color: rgba(210, 197, 141, 0.28);
}

.flag {
  display: block;
  width: 28px;
  height: 18px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.11);
}

.flag-uk {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(33deg, transparent 43%, #fff 43%, #fff 49%, #c8102e 49%, #c8102e 54%, #fff 54%, #fff 60%, transparent 60%),
    linear-gradient(-33deg, transparent 43%, #fff 43%, #fff 49%, #c8102e 49%, #c8102e 54%, #fff 54%, #fff 60%, transparent 60%),
    linear-gradient(90deg, transparent 39%, #fff 39%, #fff 46%, #c8102e 46%, #c8102e 54%, #fff 54%, #fff 61%, transparent 61%),
    linear-gradient(0deg, transparent 34%, #fff 34%, #fff 43%, #c8102e 43%, #c8102e 57%, #fff 57%, #fff 66%, transparent 66%),
    #012169;
}

.flag-pl {
  background: linear-gradient(to bottom, #f5f5f2 0 50%, #dc143c 50% 100%);
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(500px, 0.88fr) minmax(650px, 1.12fr);
  gap: 38px;
  align-items: stretch;
  min-height: 690px;
}

.image-wrap {
  position: relative;
  overflow: hidden;
  min-height: 690px;
  background: #0a1117;
}

.image-wrap picture {
  display: block;
  width: 100%;
  height: 100%;
}

.image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset -38px 0 52px rgba(9, 15, 20, 0.23);
}

.hero-image {
  width: 100%;
  height: 100%;
  min-height: 690px;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.info-panel {
  min-height: 690px;
  padding: 34px 48px 24px;
  background:
    radial-gradient(circle at 10% 8%, rgba(41, 57, 68, 0.22), transparent 38%),
    linear-gradient(180deg, rgba(17, 27, 34, 0.98) 0%, rgba(10, 18, 24, 0.98) 100%);
  border: 1px solid var(--panel-border);
  border-radius: 42px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

.panel-row {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  column-gap: 24px;
  align-items: center;
  padding: 18px 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.085);
}

.panel-row:last-child { border-bottom: 0; }
.panel-row-copy { max-width: 100%; }

.panel-row-copy h2,
.story-section-title {
  margin: 0 0 9px;
  color: var(--heading-gold);
  font-family: "American Typewriter", "Courier New", Courier, monospace;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.05;
}

.panel-row-copy p {
  margin: 0;
  max-width: 48ch;
  color: var(--body-text);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
}

/* Solid-bodied arrow, retained from the desktop design. */
.panel-arrow {
  position: relative;
  justify-self: end;
  width: 36px;
  height: 18px;
  opacity: 0.92;
  transition: transform 160ms ease;
}

.panel-arrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 25px;
  height: 5px;
  border-radius: 2px;
  background: #c7c5bc;
}

.panel-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 2px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #c7c5bc;
}

.panel-row:hover h2 { color: #d7cc99; }
.panel-row:hover .panel-arrow { transform: translateX(4px); }

.memorial {
  padding: 18px 0 2px;
  color: var(--memorial-text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0.025em;
  text-align: center;
  opacity: 0.9;
}

/* ---------- STORY / PROJECT PAGES ---------- */
.story-page { min-height: 100vh; }
.story-topbar { min-height: 86px; }

.supplementary-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 4px 0 18px;
}

.story-back {
  display: inline-block;
  margin: 0;
  color: var(--muted-text);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.story-back:hover { color: var(--heading-gold); }

.supplementary-corner-image {
  display: block;
  width: 360px;
  height: 116px;
  object-fit: cover;
  object-position: center;
  border-radius: 3px;
  opacity: 0.94;
}

.story-panel {
  flex: 1;
  min-height: 690px;
  padding: 44px 54px 48px;
  background:
    radial-gradient(circle at 12% 10%, rgba(41, 57, 68, 0.24), transparent 40%),
    linear-gradient(180deg, rgba(17, 27, 34, 0.98) 0%, rgba(10, 18, 24, 0.98) 100%);
  border: 1px solid var(--panel-border);
  border-radius: 42px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.18);
}

.story-deck {
  max-width: 1000px;
  margin: 0 0 18px;
  color: #d0d4d4;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.48;
}

.story-rule {
  height: 1px;
  margin: 0 0 20px;
  background: rgba(255, 255, 255, 0.085);
}

.story-copy {
  max-width: 1080px;
  color: var(--body-text);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.56;
}

.story-section-title {
  margin-top: 30px;
  margin-bottom: 13px;
}

.story-copy .story-section-title:first-child { margin-top: 0; }

.story-subtitle {
  margin: 17px 0 3px;
  color: var(--heading-gold);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.story-copy p {
  margin: 0 0 10px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 17px;
}

.episode-block { margin-bottom: 18px; }

.section-content-panel {
  margin: 0 0 22px 0.4cm;
  padding: 16px 22px 18px;
  background: rgba(18, 26, 33, 0.72);
  border: 1px solid rgba(205, 193, 151, 0.10);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

.info-label {
  font-weight: 700;
  color: #c9b77a;
}

.section-content-panel > :first-child { margin-top: 0; }
.section-content-panel > :last-child { margin-bottom: 0; }

@media (max-width: 1240px) and (min-width: 701px) {
  .page-shell { width: calc(100vw - 40px); }

  .hero-grid {
    grid-template-columns: 48% 52%;
    gap: 26px;
  }

  .main-title { font-size: 35px; }
  .story-panel { padding: 38px 42px 44px; }
}

/* =========================================================
   PHONE LAYOUT
   Same HTML, automatically selected by the browser when the
   viewport is 700px wide or narrower.
   ========================================================= */
@media (max-width: 700px) {
  html, body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body {
    background:
      radial-gradient(circle at 50% 20%, rgba(45, 62, 73, 0.20), transparent 32%),
      linear-gradient(180deg, #0b1117 0%, #090f14 100%);
  }

  .page-shell {
    width: 100%;
    min-height: 100vh;
    padding: 18px 14px 18px;
  }

  .topbar {
    min-height: 0;
    padding: 0 0 16px;
    display: block;
  }

  .main-title {
    max-width: calc(100% - 72px);
    padding-top: 3px;
    font-size: clamp(23px, 7.1vw, 31px);
    line-height: 1.23;
    letter-spacing: 1.5px;
    white-space: normal;
  }

  .night-mission,
  .squadron-title {
    display: block;
  }

  .night-mission {
    letter-spacing: 0.12em;
  }

  .title-divider {
    display: none;
  }

  .squadron-title {
    margin-top: 4px;
    letter-spacing: 0.055em;
  }

  .language-switch {
    top: 3px;
    right: 0;
    gap: 7px;
  }

  .flag-link {
    padding: 2px;
  }

  .flag {
    width: 24px;
    height: 16px;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
  }

  .image-wrap {
    width: 100%;
    min-height: 0;
    aspect-ratio: 3 / 2;
    border-radius: 2px;
  }

  .image-wrap::after {
    box-shadow:
      inset 0 -42px 52px rgba(9, 15, 20, 0.18),
      inset 0 0 26px rgba(9, 15, 20, 0.10);
  }

  .hero-image {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center center;
  }

  .info-panel {
    min-height: 0;
    padding: 8px 10px;
    border-radius: 23px;
    background:
      radial-gradient(circle at 10% 8%, rgba(41, 57, 68, 0.19), transparent 42%),
      linear-gradient(180deg, rgba(17, 27, 34, 0.96) 0%, rgba(10, 18, 24, 0.97) 100%);
  }

  .panel-row {
    flex: none;
    grid-template-columns: minmax(0, 1fr) 34px;
    column-gap: 14px;
    min-height: 100px;
    padding: 15px 10px;
  }

  .panel-row-copy h2 {
    margin-bottom: 7px;
    font-size: clamp(18px, 5.2vw, 22px);
    letter-spacing: 0.10em;
    line-height: 1.08;
  }

  .panel-row-copy p {
    font-size: clamp(14px, 4vw, 16px);
    line-height: 1.38;
  }

  .panel-row-copy p:empty,
  .panel-row-copy p:has(> br:only-child) {
    display: none;
  }

  /* Remove desktop spacer paragraphs on mobile. */
  .panel-row-copy p[aria-hidden="true"] {
    display: none;
  }

  .panel-arrow {
    width: 30px;
    height: 20px;
  }

  .panel-arrow::before {
    top: 8px;
    width: 20px;
    height: 4px;
    background: var(--heading-gold);
  }

  .panel-arrow::after {
    top: 3px;
    border-top-width: 7px;
    border-bottom-width: 7px;
    border-left-width: 10px;
    border-left-color: var(--heading-gold);
  }

  .memorial {
    padding: 17px 14px 2px;
    font-size: 13px;
    line-height: 1.4;
  }

  /* Subpages: single readable column on a phone. */
  .story-topbar {
    min-height: 0;
  }

  .supplementary-nav-row {
    gap: 12px;
    margin: 0 0 12px;
  }

  .story-back {
    font-size: 12px;
  }

  .supplementary-corner-image {
    width: 132px;
    height: 66px;
    border-radius: 2px;
  }

  .story-panel {
    min-height: 0;
    padding: 24px 18px 28px;
    border-radius: 24px;
  }

  .story-deck {
    font-size: 17px;
    line-height: 1.45;
  }

  .story-copy,
  .story-copy p {
    font-size: 16px;
    line-height: 1.5;
  }

  .story-section-title {
    font-size: 21px;
    letter-spacing: 0.10em;
  }

  .story-subtitle {
    font-size: 15px;
  }

  .section-content-panel {
    margin-left: 0;
    padding: 14px 15px 16px;
    border-radius: 15px;
  }
}
