:root {
  --deep: #0a2a43;
  --sea: #0e4d64;
  --wave: #1b6f8c;
  --foam: #cdeef2;
  --sky: #eaf7fb;
  --sun: #ffd166;
  --coral: #ff6b6b;
  --kelp: #2a9d8f;
  --pearl: #fffdf7;
  --ink: #06212f;
  --shadow: 0 8px 24px rgba(6, 33, 47, 0.18);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0%, #d6eef5 40%, #bfe3ee 100%);
  min-height: 100vh;
}

a { color: var(--wave); }

/* animated wave band behind the hero */
.waves {
  position: fixed;
  inset: 0 0 auto 0;
  height: 340px;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255,209,102,.25), transparent 60%),
    linear-gradient(180deg, var(--deep), var(--sea));
  z-index: -1;
}
.waves::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 60px;
  background: radial-gradient(circle at 12px -8px, var(--sky) 14px, transparent 15px) repeat-x;
  background-size: 28px 60px;
  animation: drift 8s linear infinite;
}
@keyframes drift { from { background-position-x: 0; } to { background-position-x: 28px; } }

/* ---------- hero ---------- */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.4rem 1.25rem 1rem;
  color: var(--pearl);
  text-align: center;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.5px;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.hero h1 .year {
  background: var(--sun);
  color: var(--deep);
  padding: 0 .45rem;
  border-radius: 10px;
  transform: rotate(-3deg);
  display: inline-block;
}
.tagline {
  margin: .6rem auto 1.4rem;
  max-width: 620px;
  font-size: 1.05rem;
  opacity: .95;
}

.dashboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 1.4rem;
}
.stat {
  background: rgba(255, 253, 247, 0.95);
  color: var(--ink);
  border-radius: var(--radius);
  padding: .7rem 1.1rem;
  min-width: 116px;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.stat .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin-top: .25rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.btn {
  display: inline-block;
  background: rgba(255,253,247,.92);
  color: var(--deep);
  text-decoration: none;
  font-weight: 700;
  padding: .6rem 1.05rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--sun); }

/* ---------- main ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  background: var(--pearl);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.legend .legend-title { width: 100%; text-align: center; font-weight: 800; color: var(--sea); margin-bottom: .3rem; }
.port-chip {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--sky);
  border: 1px solid #cfe7ef;
  border-radius: 999px;
  padding: .35rem .7rem;
  font-size: .85rem;
  font-weight: 600;
}
.port-chip .n { background: var(--wave); color: #fff; border-radius: 50%; width: 1.3rem; height: 1.3rem; display: grid; place-items: center; font-size: .72rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.controls label { font-weight: 600; color: var(--sea); margin-right: .4rem; }
.controls select, .controls input {
  font: inherit;
  padding: .5rem .7rem;
  border-radius: 999px;
  border: 1px solid #b9dbe5;
  background: var(--pearl);
}
.controls input { flex: 1; min-width: 180px; max-width: 320px; }

/* ---------- fleet cards ---------- */
.fleet { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
@media (min-width: 720px) { .fleet { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--pearl);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem 1.3rem;
  border-top: 6px solid var(--wave);
  position: relative;
  overflow: hidden;
}
.card.done { border-top-color: var(--sun); }
.card.idea { border-top-color: #b9c6cd; }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.card h3 { margin: 0 0 .15rem; font-size: 1.2rem; }
.card .authors { margin: 0; font-size: .82rem; color: #5a7682; }

.badges { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; flex-shrink: 0; }
.badge {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .22rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.status-Drafting { background: #d8ecff; color: #14507e; }
.badge.status-Revision { background: #fff0d2; color: #9a6800; }
.badge.status-Accepted { background: #d6f7e4; color: #14794a; }
.badge.status-Idea.Stage,
.badge.status-Idea { background: #eceff1; color: #5a7682; }
.badge.urgency { background: var(--coral); color: #fff; }

/* voyage progress */
.voyage {
  margin: 1.1rem 0 .6rem;
}
.voyage-track {
  position: relative;
  height: 30px;
  background: linear-gradient(180deg, #d6f0f7, #a9dcea);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #bfe1ec;
}
.voyage-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--kelp), var(--wave));
  border-radius: 999px;
  width: 0;
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}
.voyage-boat {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  transition: left 1.1s cubic-bezier(.2,.8,.2,1);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.25));
  z-index: 2;
}
.voyage-harbor { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; opacity: .85; }
.voyage-ports { position: absolute; inset: 0; }
.voyage-ports span {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.7);
}

.pct { font-weight: 800; color: var(--sea); }
.voyage-meta { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; margin-top: .4rem; }

/* section chips */
.sections { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0 .2rem; }
.sec {
  font-size: .74rem;
  padding: .25rem .5rem;
  border-radius: 8px;
  background: #eef3f5;
  color: #8aa0aa;
  border: 1px solid #e0e8eb;
  display: inline-flex;
  gap: .25rem;
  align-items: center;
}
.sec.done { background: #def3ea; color: #157a4f; border-color: #bfe6d3; }
.sec.next { background: var(--sun); color: var(--deep); border-color: #f1bf45; font-weight: 700; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,209,102,.6);} 50% { box-shadow: 0 0 0 6px rgba(255,209,102,0);} }

.next-line { font-size: .85rem; margin: .7rem 0 .2rem; color: var(--sea); }
.next-line b { color: var(--ink); }

.card-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.card-links a {
  font-size: .8rem; font-weight: 700; text-decoration: none;
  background: var(--sky); color: var(--sea);
  padding: .35rem .7rem; border-radius: 999px; border: 1px solid #cfe7ef;
}
.card-links a:hover { background: #ddeff5; }

.target { font-size: .8rem; color: #5a7682; }
.target.soon { color: var(--coral); font-weight: 700; }

.empty { text-align: center; color: #5a7682; padding: 2rem; }

/* ---------- peer feedback leaderboard ---------- */
.feedback-board {
  background: var(--pearl);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
}
.feedback-board .board-title { text-align: center; font-weight: 800; color: var(--sea); margin-bottom: .8rem; }
.board-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem 0;
}
.board-rank { width: 1.6rem; text-align: center; flex-shrink: 0; }
.board-user {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
  color: var(--sea);
  width: 11rem;
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.board-user:hover { color: var(--wave); text-decoration: underline; }
.board-avatar { border-radius: 50%; border: 2px solid #cfe7ef; flex-shrink: 0; }
.board-track {
  position: relative;
  flex: 1;
  height: 18px;
  background: linear-gradient(180deg, #d6f0f7, #a9dcea);
  border: 1px solid #bfe1ec;
  border-radius: 999px;
  overflow: hidden;
}
.board-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--kelp), var(--wave));
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}
.board-count { width: 2rem; text-align: right; font-weight: 800; color: var(--sea); flex-shrink: 0; }
.board-cta { text-align: center; margin: .9rem 0 0; }
.board-cta a {
  font-size: .8rem; font-weight: 700; text-decoration: none;
  background: var(--sky); color: var(--sea);
  padding: .35rem .7rem; border-radius: 999px; border: 1px solid #cfe7ef;
}
.board-cta a:hover { background: #ddeff5; }
@media (max-width: 540px) { .board-user { width: 7.5rem; } }

footer {
  text-align: center;
  padding: 1.5rem 1.25rem 2.5rem;
  font-size: .85rem;
  color: #41616e;
}
footer code { background: rgba(255,255,255,.6); padding: .1rem .3rem; border-radius: 5px; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

@media (prefers-reduced-motion: reduce) {
  .waves::after, .voyage-fill, .voyage-boat, .sec.next, .board-fill { animation: none; transition: none; }
}
