:root {
  --bg: #f4f8fc;
  --bg-soft: #eaf2f9;
  --surface: #ffffff;
  --surface-alt: #f7fbff;

  --line: #b8c6d6;
  --line-strong: #7f94ab;

  --text: #142536;
  --text-soft: #31465d;
  --text-muted: #4f647b;

  --blue: #1f5d99;
  --blue-strong: #163f68;
  --blue-soft: #dcecff;

  --silver: #c7d1da;
  --silver-deep: #8ea1b3;

  --success: #1f6a4e;
  --warning: #8a5a00;
  --danger: #8d1f1f;

  --shadow-sm: 0 4px 10px rgba(20, 37, 54, 0.06);
  --shadow-md: 0 10px 24px rgba(20, 37, 54, 0.08);
  --shadow-lg: 0 14px 34px rgba(20, 37, 54, 0.12);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 56px;

  --container: 1180px;
  --header-height: 88px;

  --hero-height-desktop: 520px;
  --hero-height-tablet: 400px;
  --hero-height-mobile: 280px;

  --font-base: clamp(16px, 1rem, 18px);
  --font-lg: clamp(18px, 1.15rem, 22px);
  --font-xl: clamp(22px, 1.5rem, 30px);
  --font-xxl: clamp(30px, 3vw, 52px);

  --line-height-base: 1.9;
  --line-height-tight: 1.5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  font-size: var(--font-base);
  line-height: var(--line-height-base);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic",
    "Yu Gothic UI", "Meiryo", sans-serif;
  letter-spacing: 0.02em;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue-strong);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(calc(100% - 24px), var(--container));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

/* =========================
   Focus
========================= */
a:focus-visible,
button:focus-visible,
label:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #111111;
  outline-offset: 3px;
  border-radius: 6px;
}

/* =========================
   Header
========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 2px 8px rgba(20, 37, 54, 0.04);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
}

.site-brand {
  text-align: center;
}

.site-brand-sub {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-family: "Times New Roman", Georgia, serif;
}

.site-title {
  margin: 0;
  color: var(--blue-strong);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  font-weight: 700;
  font-family:
    "Hiragino Mincho ProN",
    "Yu Mincho",
    "MS PMincho",
    serif;
}

/* =========================
   Hero
========================= */
.hero {
  position: relative;
  overflow: hidden;
  background: #dfeaf5;
}

.hero-slider {
  display: flex;
  width: 100%;
  height: var(--hero-height-desktop);
  overflow: hidden;
}

.hero-slide {
  min-width: 100%;
  position: relative;
}

.hero-slide img {
  width: 100%;
  height: var(--hero-height-desktop);
  object-fit: cover;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(8, 18, 32, 0.2) 0%,
      rgba(8, 18, 32, 0.58) 100%
    );
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  padding-bottom: var(--space-7);
}

.hero-content {
  color: #ffffff;
}

.eyebrow,
.section-subtitle {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 12px;
  font-size: var(--font-xxl);
  line-height: 1.25;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.hero-description {
  margin: 0;
  max-width: 760px;
  font-size: clamp(1rem, 1.25rem, 1.125rem);
  line-height: 1.9;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* =========================
   Sections
========================= */
.section {
  padding: var(--space-8) 0;
}

.section-heading {
  margin-bottom: var(--space-5);
}

.section-subtitle {
  color: var(--blue);
}

.section-title {
  margin: 0;
  color: var(--blue-strong);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.35;
  font-weight: 800;
}

.section-lead {
  margin: 12px 0 0;
  max-width: 72ch;
  color: var(--text-soft);
}

.stack-grid {
  display: grid;
  gap: var(--space-4);
}

.event-layout {
  display: grid;
  gap: var(--space-4);
}

.subsection {
  margin-top: var(--space-6);
}

.subsection-header {
  margin-bottom: var(--space-4);
}

.subsection-title {
  margin: 0 0 6px;
  color: var(--blue-strong);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.5;
  font-weight: 800;
}

.subsection-note {
  margin: 0;
  color: var(--text-soft);
}

/* =========================
   Card Base
========================= */
.info-card,
.event-header-card,
.boats-panel,
.sponsor-card,
.flyer-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* =========================
   Info Card
========================= */
.info-card {
  position: relative;
  padding: 24px;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--surface-alt) 100%);
}

.info-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: linear-gradient(180deg, var(--blue-strong), var(--blue));
}

.info-card-title {
  margin: 0 0 12px;
  padding-left: 2px;
  color: var(--blue-strong);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.5;
  font-weight: 800;
}

.info-card-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 2;
  white-space: normal;
}

.info-card-text strong {
  color: var(--text);
}

.info-card-text br + br {
  display: block;
  content: "";
  margin-top: 0.5em;
}

/* =========================
   Event Header
========================= */
.event-header-card {
  padding: 24px;
  border-left: 8px solid var(--blue);
  background: linear-gradient(135deg, #ffffff 0%, #edf5ff 100%);
}

.event-header-title {
  margin: 0 0 10px;
  color: var(--blue-strong);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.5;
  font-weight: 800;
}

.event-header-text {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.95;
}

/* =========================
   Tabs
========================= */
.tabs > input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--space-5);
}

.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 20px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue-strong);
  font-weight: 800;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.tab-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.tab-panels > .tab-panel {
  display: none;
}

#main-tab-challenge:checked ~ .tab-buttons label[for="main-tab-challenge"],
#main-tab-final:checked ~ .tab-buttons label[for="main-tab-final"] {
  background: var(--blue-strong);
  color: #ffffff;
  border-color: var(--blue-strong);
  box-shadow: 0 8px 20px rgba(22, 63, 104, 0.22);
}

#main-tab-challenge:checked ~ .tab-panels .challenge-panel {
  display: block;
}

#main-tab-final:checked ~ .tab-panels .final-panel {
  display: block;
}

/* =========================
   Port Tabs
========================= */
.tab-buttons-port {
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  padding: 10px 0 12px;
  margin-bottom: var(--space-4);
  background: rgba(244, 248, 252, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}

#port-hiroro:checked ~ .tab-buttons label[for="port-hiroro"],
#port-meinohama:checked ~ .tab-buttons label[for="port-meinohama"],
#port-hakozaki:checked ~ .tab-buttons label[for="port-hakozaki"],
#port-higashihama:checked ~ .tab-buttons label[for="port-higashihama"],
#port-kamome:checked ~ .tab-buttons label[for="port-kamome"] {
  background: linear-gradient(135deg, var(--blue-strong), var(--blue));
  color: #ffffff;
  border-color: var(--blue-strong);
}

#port-hiroro:checked ~ .tab-panels .port-panel-hiroro,
#port-meinohama:checked ~ .tab-panels .port-panel-meinohama,
#port-hakozaki:checked ~ .tab-panels .port-panel-hakozaki,
#port-higashihama:checked ~ .tab-panels .port-panel-higashihama,
#port-kamome:checked ~ .tab-panels .port-panel-kamome {
  display: block;
}

.tabs-port .tab-panels > .tab-panel {
  padding-top: 8px;
}

/* =========================
   Boats
========================= */
.boats-panel {
  padding: var(--space-4);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.port-card-title {
  margin: 0 0 14px;
  color: var(--blue-strong);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.5;
  font-weight: 800;
}

.boat-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.boat-card.compact.boat-card-elegant {
  height: 100%;
}

.boat-card-elegant {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.boat-card-elegant:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.boat-card-top {
  height: 10px;
  background: linear-gradient(90deg, var(--blue-strong), var(--blue), var(--silver));
}

.boat-card-elegant .boat-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 20px 20px;
}

.boat-label {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.boat-card-elegant .boat-name {
  margin: 0 0 12px;
  color: var(--blue-strong);
  font-size: 1.35rem;
  line-height: 1.45;
  font-weight: 800;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.boat-card-elegant .boat-port {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 36px;
  margin: 0 0 18px;
  padding: 6px 14px;
  border: 2px solid #b5cbe2;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.boat-desc {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.9;
}

.boat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.boat-links-stack {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.boat-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  text-decoration: none;
  line-height: 1.5;
  font-weight: 800;
  border: 2px solid transparent;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.boat-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.boat-link-main {
  background: var(--blue-strong);
  color: #ffffff;
  border-color: var(--blue-strong);
}

.boat-link-sub {
  background: #ffffff;
  color: var(--blue-strong);
  border-color: var(--line-strong);
}

.placeholder-card {
  min-height: 160px;
}

/* =========================
   Sponsor
========================= */
.sponsor-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sponsor-card {
  min-height: 132px;
  padding: var(--space-4);
  background: #ffffff;
}

.sponsor-link {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.sponsor-logo {
  width: 100%;
  height: 76px;
  object-fit: contain;
}

/* =========================
   Flyer
========================= */
.flyer-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.flyer-card {
  overflow: hidden;
  background: #ffffff;
}

.flyer-thumb-wrap {
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, #dbe8f4, #f4f9fd);
}

.flyer-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flyer-body {
  padding: var(--space-4);
}

.flyer-title {
  margin: 0 0 10px;
  color: var(--blue-strong);
  font-size: 1.08rem;
  line-height: 1.6;
  font-weight: 800;
}

.flyer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flyer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue-strong);
  text-decoration: none;
  line-height: 1.5;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.flyer-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* =========================
   Footer
========================= */
.site-footer {
  border-top: 2px solid var(--line);
  background: linear-gradient(180deg, #eef5fb 0%, #e4edf6 100%);
}

.footer-inner {
  padding: 36px 0;
}

.footer-title {
  margin: 0 0 8px;
  color: var(--blue-strong);
  font-weight: 800;
  font-size: 1.05rem;
}

.footer-text {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.9;
}

/* =========================
   Utility
========================= */
.note-text {
  color: var(--text-soft);
}

.text-center {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0;
}

/* =========================
   Responsive
========================= */
@media (max-width: 1100px) {
  .boat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 959px) {
  .hero-slider,
  .hero-slide img {
    height: var(--hero-height-tablet);
  }

  .section {
    padding: 48px 0;
  }
}

@media (max-width: 820px) {
  .boat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-inner {
    min-height: 80px;
  }

  .info-card,
  .event-header-card,
  .boats-panel,
  .sponsor-card,
  .flyer-card {
    border-radius: 18px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 76px;
    --space-8: 44px;
  }

  body {
    font-size: 16px;
    line-height: 1.85;
  }

  .container {
    width: min(calc(100% - 16px), var(--container));
  }

  .hero-slider,
  .hero-slide img {
    height: var(--hero-height-mobile);
  }

  .hero-overlay {
    padding-bottom: 24px;
  }

  .hero-title {
    line-height: 1.3;
  }

  .tab-buttons,
  .flyer-actions,
  .boat-links {
    flex-direction: column;
  }

  .tab-button,
  .flyer-link,
  .boat-link {
    width: 100%;
  }

  .tab-button {
    min-height: 50px;
  }

  .boat-grid {
    grid-template-columns: 1fr;
  }

  .tab-buttons-port {
    top: var(--header-height);
    padding: 8px 0 10px;
  }

  .tab-buttons-port .tab-button {
    min-height: 46px;
  }

  .boat-card-elegant .boat-body {
    padding: 18px 16px 16px;
  }

  .boat-card-elegant .boat-name {
    font-size: 1.2rem;
  }

  .info-card,
  .event-header-card {
    padding: 20px;
  }

  .info-card::before {
    width: 6px;
  }

  .flyer-body {
    padding: 16px;
  }
}

/* =========================
   Reduced Motion
========================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================
   High Contrast Support
========================= */
@media (prefers-contrast: more) {
  :root {
    --line: #7a8ea4;
    --line-strong: #5f748b;
    --text-soft: #1f3144;
    --blue: #114d87;
    --blue-strong: #0d3458;
  }

  .info-card,
  .event-header-card,
  .boats-panel,
  .sponsor-card,
  .flyer-card,
  .boat-card-elegant,
  .tab-button,
  .flyer-link,
  .boat-link-sub {
    border-width: 3px;
  }
}

.sponsor-card.is-white-logo {
  background: #111;
  border-color: #444;
}
