/* ==========================================================
   Aquatica — page-specific components
   ========================================================== */

.swap { animation: swap-in .5s cubic-bezier(.2,.8,.2,1); }
@keyframes swap-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.check-list { list-style: none; padding: 0; margin: 0 0 1em; }
.check-list li { position: relative; padding-left: 30px; margin-bottom: 8px; }
.check-list li::before { content: "💧"; position: absolute; left: 0; top: 0; }
.check-list.warn li::before { content: "⚠️"; }
.btn.small { padding: 10px 18px; font-size: .9rem; }
.modal-hero { font-size: 4rem; line-height: 1; margin-bottom: 10px; animation: bob 3s ease-in-out infinite; }
.big-emoji { font-size: 4rem; animation: bob 3s ease-in-out infinite; }

/* ---------- Home ---------- */
.explore a { color: inherit; text-decoration: none; display: block; }
.explore p { color: var(--text-dim); }
.more { color: var(--aqua); font-weight: 800; display: inline-block; transition: transform .3s; }
.explore a:hover .more { transform: translateX(8px); }
.quote { text-align: center; padding: 50px 30px; }
.big-quote { font-family: var(--font-display); font-size: clamp(1.4rem, 3.5vw, 2.2rem); line-height: 1.35; color: var(--foam); max-width: 900px; margin: 0 auto 14px; }

.bay { max-width: 1000px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.bay-hud { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; justify-content: space-between; padding: 14px 20px; background: rgba(2, 30, 55, .8); font-weight: 700; }
.bay-hud strong { color: var(--aqua); font-size: 1.2rem; }
.bay-water { position: relative; height: 420px; overflow: hidden; background: linear-gradient(180deg, rgba(27,156,201,.55), rgba(4,64,110,.75) 60%, rgba(2,34,63,.95)); }
.bay-water::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(100deg, transparent 0 60px, rgba(255,255,255,.04) 60px 90px); animation: caustic-drift 12s linear infinite; }
.bay-reef { position: absolute; left: 0; right: 0; bottom: 0; font-size: 2.6rem; letter-spacing: 1.2rem; text-align: center; white-space: nowrap; overflow: hidden; padding-bottom: 4px; background: linear-gradient(180deg, transparent, rgba(246,214,143,.25)); }
.bay-msg { position: absolute; left: 0; right: 0; top: 45%; transform: translateY(-50%); text-align: center; padding: 20px; font-size: 1.2rem; margin: 0; z-index: 3; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.trash {
  position: absolute; z-index: 2; font-size: 2.3rem; line-height: 1; background: none; border: 0; cursor: pointer; padding: 6px;
  animation: trash-bob 6s ease-in-out infinite, trash-in .6s backwards cubic-bezier(.2,.9,.3,1.4);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); transition: transform .2s;
}
.trash:hover { transform: scale(1.2); }
.trash.caught { animation: scoop .5s forwards ease-in; }
@keyframes trash-bob { 0%,100% { translate: 0 0; rotate: -8deg; } 50% { translate: var(--drift) 18px; rotate: 10deg; } }
@keyframes trash-in { from { opacity: 0; transform: translateY(-60px) scale(.3); } }
@keyframes scoop { to { transform: translateY(-140px) scale(.2) rotate(180deg); opacity: 0; } }
.critter { position: absolute; left: -60px; z-index: 1; font-size: 2rem; animation: critter-swim 8s linear forwards; }
@keyframes critter-swim { to { transform: translateX(calc(1000px + 120px)); } }

/* ---------- Projects ---------- */
.journey { max-width: 900px; margin: 0 auto; }
.journey-track { position: relative; display: flex; justify-content: space-between; gap: 8px; margin-bottom: 28px; padding: 30px 0 0; }
.journey-track::before { content: ""; position: absolute; left: 6%; right: 6%; top: 62px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #8fd3ff, var(--aqua), var(--teal), #1f6fb8); opacity: .5; }
.journey-stop { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; background: none; border: 0; color: var(--text-dim); font: 700 .95rem var(--font-body); cursor: pointer; }
.journey-stop span { display: grid; place-items: center; width: 64px; height: 64px; font-size: 1.8rem; border-radius: 50%; background: rgba(2,34,63,.9); border: 2px solid var(--glass-border); transition: transform .3s, border-color .3s, box-shadow .3s; }
.journey-stop:hover span { transform: scale(1.1); }
.journey-stop[aria-selected="true"] { color: var(--foam); }
.journey-stop[aria-selected="true"] span { border-color: var(--aqua); box-shadow: 0 0 0 6px rgba(110,231,249,.18), 0 0 30px rgba(110,231,249,.5); }
.journey-drop { position: absolute; top: 0; left: 0; font-size: 1.6rem; transform: translateX(-50%); transition: left .7s cubic-bezier(.5,-0.4,.4,1.4); animation: bob 2s ease-in-out infinite; }
.journey-panel h3 { color: var(--aqua); }
.fact-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .journey-stop { font-size: .75rem; }
  .journey-stop span { width: 48px; height: 48px; font-size: 1.3rem; }
  .journey-track::before { top: 54px; }
}

.search-row { max-width: 460px; margin: -14px auto 30px; }
.search-row input { border-radius: 999px; padding-left: 20px; }
.empty { text-align: center; color: var(--text-dim); font-size: 1.1rem; }
.project { display: flex; flex-direction: column; }
.project > p:not(.place) { color: var(--text-dim); flex: 1; }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.project-icon { font-size: 2.6rem; transition: transform .4s; }
.project:hover .project-icon { transform: rotate(-10deg) scale(1.15); }
.place { color: var(--sand); font-size: .9rem; font-weight: 700; margin-bottom: 10px; }
.progress-meta { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; color: var(--text-dim); margin: 8px 0 16px; flex-wrap: wrap; }
.project .btn { align-self: flex-start; }
.impact-calc { margin-top: 20px; padding: 18px; border-radius: 16px; background: rgba(110,231,249,.08); border: 1px dashed var(--glass-border); }
.impact-calc output { color: var(--aqua); font-weight: 800; }
.impact-out { margin: 10px 0 0; font-size: 1.1rem; }
.impact-out strong { color: var(--sand); font-size: 1.4rem; }

/* ---------- Statistics ---------- */
.chart-card h3 { margin-top: 6px; }
.chart-help { color: var(--text-dim); font-size: .95rem; }
.small-chips { justify-content: flex-start; margin-bottom: 18px; }
.small-chips .chip { padding: 7px 14px; font-size: .85rem; }
.donut-wrap { position: relative; max-width: 260px; margin: 0 auto; }
.donut-seg { cursor: pointer; outline: none; }
.donut-seg:hover, .donut-seg:focus { stroke-width: 36; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-family: var(--font-display); font-size: 2.2rem; color: var(--aqua); line-height: 1; }
.donut-center span { font-size: .85rem; color: var(--text-dim); }
.legend { list-style: none; padding: 0; margin: 20px 0 10px; display: grid; gap: 6px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.legend li strong { margin-left: auto; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

.hbars { display: grid; gap: 22px; margin: 26px 0 16px; }
.hbar { outline: none; }
.hbar-label { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }
.hbar-label strong { color: var(--aqua); font-family: var(--font-display); font-size: 1.2rem; }
.hbar-track { height: 34px; border-radius: 12px; background: rgba(255,255,255,.06); overflow: hidden; }
.hbar-fill { height: 100%; width: 0; border-radius: 12px; background: linear-gradient(90deg, #1f6fb8, var(--aqua)); transition: width 1.6s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden; }
.hbar-fill::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 60%, rgba(255,255,255,.5) 0 3px, transparent 4px), radial-gradient(circle at 55% 30%, rgba(255,255,255,.4) 0 2px, transparent 3px), radial-gradient(circle at 80% 70%, rgba(255,255,255,.45) 0 3px, transparent 4px); background-size: 80px 34px; animation: fizz 3s linear infinite; }
@keyframes fizz { to { background-position: 0 -34px; } }
.hbar-note { font-size: .85rem; color: var(--text-dim); margin: 6px 0 0; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .3s, opacity .3s; }
.hbar:hover .hbar-note, .hbar:focus .hbar-note { max-height: 40px; opacity: 1; }

.line-wrap { margin: 10px 0; }
#line { width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
#line .axis { fill: var(--text-dim); font-size: 13px; font-family: var(--font-body); }
.line-area { opacity: 0; transition: opacity 1.5s 1s; }
.line-area.show { opacity: 1; }
.line-dot { fill: var(--abyss); stroke: var(--aqua); stroke-width: 3; cursor: pointer; transform-box: fill-box; transform-origin: center; animation: dot-pop .5s backwards; outline: none; }
.line-dot.active, .line-dot:focus { fill: var(--sand); stroke: var(--sand); transform: scale(1.5); }
@keyframes dot-pop { from { transform: scale(0); } }
.chart-tooltip { position: fixed; z-index: 150; pointer-events: none; background: rgba(2, 25, 48, .95); border: 1px solid var(--aqua); color: var(--foam); padding: 8px 12px; border-radius: 12px; font-size: .9rem; box-shadow: var(--shadow); max-width: 240px; }

.calc { display: grid; gap: 24px; grid-template-columns: 1.2fr 1fr; align-items: stretch; }
@media (max-width: 800px) { .calc { grid-template-columns: 1fr; } }
.calc-form output { color: var(--aqua); font-weight: 800; }
.calc-result { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tank { width: 140px; height: 180px; border: 3px solid var(--glass-border); border-top: 0; border-radius: 0 0 24px 24px; position: relative; overflow: hidden; margin-bottom: 18px; background: rgba(0,0,0,.15); }
.tank-water { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, rgba(110,231,249,.9), #1f6fb8); transition: height .8s cubic-bezier(.2,.8,.2,1); }
.tank-water svg { position: absolute; top: -12px; left: 0; width: 200%; height: 14px; animation: wave-move 3s linear infinite; }
.calc-total { font-family: var(--font-display); font-size: 1.4rem; color: var(--text-dim); }
.calc-total span { font-size: 3rem; color: var(--aqua); font-weight: 700; }
.calc-split { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--text-dim); margin: 6px 0 12px; }
.calc-tip { background: rgba(246,214,143,.12); border-radius: 14px; padding: 10px 14px; color: var(--sand); }

/* ---------- Awareness ---------- */
.threat-panel { max-width: 900px; margin: 0 auto; }
.threat-body { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.threat-icon { font-size: 4.5rem; animation: bob 3s ease-in-out infinite; }
@media (max-width: 600px) { .threat-body { grid-template-columns: 1fr; } .threat-icon { font-size: 3.2rem; } }
.severity { display: grid; gap: 6px; font-size: .85rem; color: var(--text-dim); font-weight: 700; }
.progress .danger { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sand), var(--coral)); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }

.flip { background: none; border: 0; padding: 0; perspective: 1200px; cursor: pointer; text-align: left; color: inherit; font: inherit; min-height: 230px; }
.flip-inner { position: relative; display: block; width: 100%; height: 100%; min-height: 230px; transition: transform .8s cubic-bezier(.3,1.4,.5,1); transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-back { transform: rotateY(180deg); background: linear-gradient(160deg, rgba(46,196,182,.25), rgba(4,64,110,.6)); }
.flip .tag { align-self: flex-start; }
.flip-text { font-size: 1.08rem; font-weight: 700; flex: 1; }
.flip-hint { font-size: .8rem; color: var(--text-dim); }
.tag.myth { background: rgba(255,123,107,.2); color: var(--coral); }
.flip:hover:not(.flipped) .flip-inner { transform: rotateY(12deg); }

.quiz { max-width: 760px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 700; }
.quiz-progress { margin-bottom: 22px; height: 8px; }
.quiz-progress span { transition: width .5s; }
.quiz-q { font-size: 1.5rem; }
.quiz-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 18px 0; }
.quiz-a { text-align: left; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--glass-border); background: rgba(0, 20, 40, .45); color: var(--foam); font: 700 1rem var(--font-body); cursor: pointer; transition: transform .2s, background .2s, border-color .2s; }
.quiz-a:hover:not(:disabled) { transform: translateY(-3px); background: var(--glass-strong); border-color: var(--aqua); }
.quiz-a:disabled { cursor: default; opacity: .7; }
.quiz-a.right { background: rgba(46,196,182,.35); border-color: var(--teal); opacity: 1; animation: pop .4s; }
.quiz-a.wrong { background: rgba(255,123,107,.3); border-color: var(--coral); opacity: 1; animation: shake .4s; }
@keyframes pop { 50% { transform: scale(1.04); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.quiz-why { min-height: 1.6em; color: var(--text-dim); }
.quiz-result { text-align: center; }
.quiz-rank { font-size: 5rem; animation: bob 3s ease-in-out infinite; }

.accordion { max-width: 820px; margin: 0 auto; display: grid; gap: 14px; }
.accordion details { padding: 0; }
.accordion summary { padding: 22px 28px; cursor: pointer; font-family: var(--font-display); font-size: 1.25rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; font-size: 1.6rem; color: var(--aqua); transition: transform .3s; }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion .check-list { padding: 0 28px 14px; animation: swap-in .4s; }

.pledge-wrap { align-items: stretch; }
.pledge-options { border: 0; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.pledge-options legend { font-weight: 700; color: var(--text-dim); margin-bottom: 10px; }
.pledge-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(0,20,40,.4); border: 1px solid var(--glass-border); cursor: pointer; transition: background .2s, border-color .2s; }
.pledge-opt:hover { background: var(--glass-strong); }
.pledge-opt input { width: 20px; height: 20px; accent-color: var(--teal); }
.pledge-opt:has(input:checked) { border-color: var(--aqua); background: rgba(110,231,249,.12); }
.pledge-reef { display: flex; flex-direction: column; gap: 14px; text-align: center; }
.pledge-tank { position: relative; flex: 1; min-height: 280px; border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, rgba(27,156,201,.45), rgba(2,34,63,.9)); border: 1px solid var(--glass-border); }
.tank-sand { position: absolute; bottom: 0; left: 0; right: 0; font-size: 1.8rem; letter-spacing: .4rem; padding: 6px; background: linear-gradient(180deg, transparent, rgba(246,214,143,.3)); white-space: nowrap; overflow: hidden; }
.tank-fish { position: absolute; left: 0; font-size: 2rem; animation: tank-swim 8s ease-in-out infinite alternate; }
@keyframes tank-swim {
  0% { transform: translateX(10px) scaleX(-1); }
  49% { transform: translateX(calc(min(40vw, 420px))) scaleX(-1); }
  51% { transform: translateX(calc(min(40vw, 420px))) scaleX(1); }
  100% { transform: translateX(10px) scaleX(1); }
}
@media (max-width: 700px) { @keyframes tank-swim { 0% { transform: translateX(10px) scaleX(-1); } 49% { transform: translateX(60vw) scaleX(-1); } 51% { transform: translateX(60vw) scaleX(1); } 100% { transform: translateX(10px) scaleX(1); } } }

/* ---------- Team ---------- */
.member { text-align: center; outline: none; }
.member-avatar { position: relative; width: 120px; margin: 0 auto 16px; }
.avatar { width: 120px; height: 120px; display: block; transition: transform .5s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 8px 20px rgba(0,0,0,.35)); }
.spirit { position: absolute; right: -6px; bottom: -4px; font-size: 2.2rem; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: rgba(2,34,63,.95); border: 2px solid var(--glass-border); transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.member:hover .avatar, .member:focus .avatar { transform: scale(.9) translateY(-4px); }
.member:hover .spirit, .member:focus .spirit { transform: translate(-34px, -38px) scale(1.5) rotate(-12deg); }
.member .role { color: var(--aqua); font-weight: 800; margin-bottom: 8px; }
.member .bio { color: var(--text-dim); font-size: .95rem; }
.spirit-label { font-size: .82rem; color: var(--sand); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; margin: 0; }
.member:hover .spirit-label, .member:focus .spirit-label { opacity: 1; transform: none; }
.join { align-items: center; }
.form-error { color: var(--coral); font-weight: 700; min-height: 1.2em; margin: 0 0 10px; }
.join-done { text-align: center; padding: 30px 10px; animation: swap-in .6s; }

/* ---------- Goals ---------- */
.goal { display: flex; flex-direction: column; align-items: center; text-align: center; color: inherit; font: inherit; cursor: pointer; }
.ring { position: relative; width: 150px; height: 150px; display: block; margin-bottom: 14px; }
.ring svg { width: 100%; height: 100%; }
.ring-fill { transition: stroke-dashoffset 2s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px currentColor); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-icon { font-size: 1.8rem; line-height: 1; }
.ring-label strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--foam); }
.goal-meta { color: var(--text-dim); font-size: .92rem; }
.milestones { list-style: none; padding: 0; display: grid; gap: 10px; }
.milestones li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04); }
.milestones li.done { background: rgba(46,196,182,.15); }

.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; transform: translateX(-50%); background: rgba(255,255,255,.08); border-radius: 6px; }
.timeline-fill { position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: 6px; background: linear-gradient(180deg, var(--aqua), var(--teal), #2a5bd7); box-shadow: 0 0 18px rgba(110,231,249,.5); }
.sub { position: absolute; left: 50%; top: 0; width: 80px; transform: translate(-50%, -50%); z-index: 3; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(246,214,143,.5)); }
.sub::before { content: ""; position: absolute; left: 50%; top: 50%; width: 220px; height: 120px; transform: translate(-50%, -20%); background: radial-gradient(ellipse at top, rgba(246,214,143,.18), transparent 70%); pointer-events: none; }
.timeline-items { list-style: none; padding: 0; margin: 0; display: grid; gap: 40px; }
.tl { position: relative; width: 50%; padding-right: 60px; }
.tl:nth-child(even) { margin-left: 50%; padding-right: 0; padding-left: 60px; }
.tl-year { position: absolute; top: 18px; right: -40px; z-index: 2; width: 80px; text-align: center; font-family: var(--font-display); font-weight: 700; padding: 4px 0; border-radius: 999px; background: rgba(2,34,63,.95); border: 2px solid var(--glass-border); transition: border-color .4s, color .4s, box-shadow .4s; }
.tl:nth-child(even) .tl-year { right: auto; left: -40px; }
.tl.passed .tl-year { border-color: var(--aqua); color: var(--aqua); box-shadow: 0 0 18px rgba(110,231,249,.45); }
.tl.done h3 { color: var(--teal); }
.tl.now .card { border-color: var(--sand); }
.tl.now .tl-year { animation: now-pulse 2s infinite; }
@keyframes now-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(246,214,143,.5); } 50% { box-shadow: 0 0 0 10px rgba(246,214,143,0); } }
@media (max-width: 760px) {
  .timeline-line { left: 24px; }
  .sub { left: 24px; width: 56px; }
  .tl, .tl:nth-child(even) { width: 100%; margin-left: 0; padding: 40px 0 0 56px; }
  .tl-year, .tl:nth-child(even) .tl-year { top: 0; left: 56px; right: auto; }
}

.sdg { display: flex; gap: 22px; align-items: flex-start; }
.sdg-num { flex: none; width: 76px; height: 76px; border-radius: 18px; display: grid; place-items: center; font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: #fff; }
.sdg6 .sdg-num { background: #26bde2; }
.sdg14 .sdg-num { background: #0a97d9; }
.cta-band { margin-top: 40px; text-align: center; background: linear-gradient(135deg, rgba(46,196,182,.25), rgba(31,111,184,.3)); }
