/* Shared competition selector and CanSat Comeback introduction page. */

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

/* Always-available switch between the two independent competitions. */
.competition-quick-switch {
  position: sticky;
  top: 76px;
  z-index: 920;
  border-bottom: 1px solid rgba(16, 40, 71, 0.14);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(9, 24, 45, 0.07);
  backdrop-filter: blur(14px);
}

.competition-quick-switch .container {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-height: 58px;
}

.competition-quick-switch-label {
  flex: 0 0 auto;
  color: var(--muted, #60758a);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.competition-quick-switch-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  width: min(100%, 650px);
  margin-left: auto;
}

.competition-quick-link {
  position: relative;
  display: flex;
  gap: 0.48rem;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #39536c;
  background: #f2f6f9;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.competition-quick-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.competition-quick-link i {
  flex: 0 0 auto;
  font-size: 1rem;
}

.competition-quick-link:hover,
.competition-quick-link:focus-visible {
  color: #102847;
  border-color: #a7c6d6;
  background: #eaf5f8;
}

.competition-quick-link.is-current {
  color: #fff;
  border-color: #102847;
  background: #102847;
  box-shadow: 0 6px 16px rgba(16, 40, 71, 0.18);
}

.competition-quick-link.is-current::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  bottom: 0.3rem;
  left: 0.55rem;
  height: 2px;
  border-radius: 999px;
  background: var(--quick-accent, #4db8d4);
}

.competition-quick-link-main {
  --quick-accent: #4db8d4;
}

.competition-quick-link-comeback {
  --quick-accent: #f0c66d;
}

body:has(.competition-quick-switch) .side-toc {
  top: 152px;
}

.competition-switcher {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 0 0 0.35rem;
}

.competition-switcher-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.competition-switcher-head h2 {
  margin: 0.25rem 0 0;
  color: var(--navy, #102847);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  overflow-wrap: anywhere;
}

.competition-switcher-head p {
  max-width: 620px;
  margin: 0;
  color: var(--muted, #60758a);
}

.competition-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.competition-option {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 164px;
  padding: 1.35rem;
  overflow: hidden;
  border: 1px solid var(--rule, var(--border, #d5dee7));
  border-radius: 16px;
  color: var(--text, var(--ink, #16283c));
  background: #fff;
  box-shadow: 0 12px 30px rgba(11, 31, 54, 0.07);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.competition-option::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--option-accent, #4db8d4);
}

.competition-option:hover,
.competition-option:focus-visible {
  color: var(--text, var(--ink, #16283c));
  border-color: var(--option-accent, #4db8d4);
  box-shadow: 0 16px 36px rgba(11, 31, 54, 0.12);
  transform: translateY(-2px);
}

.competition-option.is-current {
  border-color: color-mix(in srgb, var(--option-accent, #4db8d4) 55%, #d5dee7);
  background: linear-gradient(135deg, color-mix(in srgb, var(--option-accent, #4db8d4) 7%, #fff), #fff 70%);
}

.competition-option-main {
  --option-accent: #4db8d4;
}

.competition-option-comeback {
  --option-accent: #dca63e;
}

.competition-option-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  color: #fff;
  background: var(--option-accent, #4db8d4);
  font-size: 1.55rem;
}

.competition-option-copy {
  min-width: 0;
}

.competition-option-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--option-accent, #4db8d4);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.competition-option h3 {
  margin: 0 0 0.45rem;
  color: var(--navy, #102847);
  font-size: clamp(1.08rem, 1.8vw, 1.32rem);
  overflow-wrap: anywhere;
}

.competition-option p {
  margin: 0;
  color: var(--muted, #60758a);
  font-size: 0.91rem;
  line-height: 1.52;
}

.competition-option-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--option-accent, #4db8d4);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.competition-option.is-current .competition-option-action {
  padding: 0.32rem 0.58rem;
  border-radius: 999px;
  color: var(--navy, #102847);
  background: color-mix(in srgb, var(--option-accent, #4db8d4) 18%, #fff);
}

/* CanSat Comeback page */
.comeback-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 82% 28%, rgba(220, 166, 62, 0.25), transparent 28%),
    radial-gradient(circle at 70% 82%, rgba(77, 184, 212, 0.14), transparent 24%),
    linear-gradient(115deg, #09182d 0%, #102847 60%, #263f5b 100%);
}

.comeback-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("../img/competition/comeback-pattern.svg") center / 720px 420px repeat;
  opacity: 0.22;
  pointer-events: none;
}

.comeback-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #dca63e, #4db8d4, #d86c91);
}

.comeback-hero .container {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  min-height: 470px;
  padding-block: clamp(3.2rem, 7vw, 5.8rem);
}

.comeback-hero .container > *,
.comeback-intro > *,
.competition-option-copy {
  min-width: 0;
}

.comeback-status {
  display: inline-flex;
  margin-bottom: 1rem;
  padding: 0.32rem 0.68rem;
  border-left: 3px solid #dca63e;
  color: #ffe7b3;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comeback-hero h1 {
  max-width: 720px;
  color: #fff;
  font-size: clamp(2.45rem, 5vw, 4.15rem);
  overflow-wrap: anywhere;
}

.competition-hero h1,
.competition-tagline {
  overflow-wrap: anywhere;
}

.comeback-hero h1 span {
  display: block;
  color: #f0c66d;
}

.comeback-tagline {
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--heading, "Raleway", sans-serif);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 800;
}

.comeback-lead {
  max-width: 680px;
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.02rem;
}

.comeback-hero-art {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  background: #07172b;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.comeback-hero-art::after {
  content: "Concept visual";
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(9, 24, 45, 0.68);
  backdrop-filter: blur(8px);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[lang="ja"] .comeback-hero-art::after {
  content: "コンセプト画像";
  letter-spacing: 0.03em;
}

.comeback-hero-art > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1821 / 864;
  object-fit: cover;
}

.comeback-sequence-visual {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px 0 0;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.comeback-visual-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  padding: 0.62rem 0.48rem;
  color: #fff;
  background: rgba(9, 24, 45, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.comeback-visual-step i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #102847;
  background: #f0c66d;
  font-size: 0.82rem;
}

.comeback-page-shell {
  min-width: 0;
  padding-block: clamp(2.8rem, 5vw, 4.8rem);
}

.comeback-page-shell .competition-switcher {
  margin-bottom: clamp(3.2rem, 6vw, 5rem);
}

.comeback-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(270px, 0.85fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.comeback-intro-copy h2,
.comeback-section h2 {
  margin: 0.3rem 0 1rem;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  overflow-wrap: anywhere;
}

.comeback-intro-copy p,
.comeback-section-head p {
  color: var(--muted, #56677d);
}

.comeback-principle {
  padding: 1.4rem;
  border: 1px solid #ead7a8;
  border-left: 5px solid #dca63e;
  border-radius: 14px;
  background: #fff9ec;
}

.comeback-principle i {
  color: #b77c10;
  font-size: 1.55rem;
}

.comeback-principle h3 {
  margin: 0.65rem 0 0.55rem;
  font-size: 1.25rem;
}

.comeback-principle p {
  color: #5f6570;
}

.comeback-section {
  padding-top: clamp(3.2rem, 6vw, 5rem);
}

.comeback-section-head {
  max-width: 760px;
  margin-bottom: 1.8rem;
}

.mission-step-grid,
.design-direction-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.comeback-mission-schematic {
  margin: 0 0 1rem;
}

.comeback-simple-figure {
  margin: 0 0 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border, #dce4ee);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(11, 31, 54, 0.06);
}

.comeback-simple-figure img,
.comeback-simple-figure picture {
  display: block;
  width: 100%;
  height: auto;
}

.comeback-field-figure {
  margin: 0 0 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border, #dce4ee);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(11, 31, 54, 0.08);
}

.comeback-field-figure > a {
  position: relative;
  display: block;
  color: inherit;
  background: #fff;
}

.comeback-field-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.comeback-map-action {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.52rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  color: #fff;
  background: rgba(10, 39, 72, 0.88);
  box-shadow: 0 6px 18px rgba(10, 39, 72, 0.2);
  font-size: 0.78rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.comeback-field-figure figcaption {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border, #dce4ee);
  color: var(--muted, #56677d);
  background: #f8fafc;
  font-size: 0.82rem;
  line-height: 1.55;
}

.mission-step,
.design-direction {
  position: relative;
  padding: 1.3rem;
  border: 1px solid var(--border, #dce4ee);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(11, 31, 54, 0.06);
}

.mission-step-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 1rem;
  border-radius: 50%;
  color: #102847;
  background: #f0c66d;
  font-weight: 900;
}

.mission-step h3,
.design-direction h3 {
  margin-bottom: 0.55rem;
  font-size: 1.05rem;
}

.mission-step p,
.design-direction p {
  color: var(--muted, #56677d);
  font-size: 0.9rem;
}

.design-direction-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.design-direction i {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 0.8rem;
  border-radius: 12px;
  color: #fff;
  background: #102847;
  font-size: 1.15rem;
}

.comeback-planning-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-top: clamp(3.2rem, 6vw, 5rem);
  padding: 1.4rem;
  border: 1px solid #cddfea;
  border-radius: 14px;
  background: #eef8fb;
}

.comeback-planning-note > i {
  color: #19718a;
  font-size: 1.45rem;
}

.comeback-planning-note h2 {
  margin-bottom: 0.45rem;
  font-size: 1.25rem;
}

.comeback-planning-note p {
  color: #4f6371;
}

.comeback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .competition-switcher-head {
    display: block;
  }

  .competition-switcher-head p {
    margin-top: 0.65rem;
  }

  .competition-option-grid,
  .comeback-hero .container,
  .comeback-intro {
    grid-template-columns: 1fr;
  }

  .comeback-hero .container {
    min-height: 0;
  }

  .comeback-hero-art {
    width: min(100%, 820px);
  }

  .mission-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .design-direction-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .competition-quick-switch {
    top: 66px;
  }

  .competition-quick-switch .container {
    min-height: 56px;
  }

  .competition-quick-switch-label {
    display: none;
  }

  .competition-quick-switch-links {
    width: 100%;
    margin-left: 0;
  }

  .competition-quick-link {
    gap: 0.35rem;
    min-height: 40px;
    padding-inline: 0.42rem;
    font-size: clamp(0.68rem, 3.15vw, 0.78rem);
  }

  body:has(.competition-quick-switch) .side-toc {
    position: static;
  }

  .competition-switcher-head h2 {
    font-size: 1.55rem;
  }

  .comeback-hero h1 {
    font-size: clamp(1.85rem, 9vw, 2.08rem);
  }

  .comeback-status {
    font-size: 0.67rem;
    letter-spacing: 0.045em;
  }

  .comeback-lead {
    font-size: 0.95rem;
  }

  .competition-option {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 0;
    padding: 1.1rem;
  }

  .competition-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    font-size: 1.3rem;
  }

  .competition-option-action {
    grid-column: 2;
    justify-self: start;
  }

  .mission-step-grid {
    grid-template-columns: 1fr;
  }

  .comeback-hero-art::after {
    top: 0.55rem;
    right: 0.55rem;
  }

  .comeback-sequence-visual {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .comeback-visual-step {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    justify-items: center;
    min-height: 67px;
    padding: 0.5rem 0.16rem;
    font-size: clamp(0.58rem, 2.55vw, 0.68rem);
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }

  .comeback-visual-step i {
    width: 23px;
    height: 23px;
    font-size: 0.72rem;
  }

  .comeback-hero-art > img {
    aspect-ratio: 16 / 7;
    object-position: center 42%;
  }

  .comeback-mission-schematic img {
    aspect-ratio: auto;
  }

  .comeback-map-action {
    right: 0.55rem;
    bottom: 0.55rem;
    padding: 0.42rem 0.55rem;
    font-size: 0.7rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .competition-option {
    transition: none;
  }
}
