:root {
  --bg: #060b14;
  --bg-2: #0a1422;
  --panel: rgba(16, 28, 46, 0.72);
  --panel-solid: #0e1a2c;
  --line: rgba(120, 170, 230, 0.16);
  --text: #e8f0fb;
  --muted: #8aa0bd;
  --navy: #2a6df0;
  --navy-deep: #0a3a8a;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans JP", system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, #102542 0%, var(--bg) 55%) fixed;
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* 背景の常時レーダースイープ */
#radar-sweep-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 82% 8%, transparent 0 78px, rgba(80,150,255,0.05) 79px 80px),
    conic-gradient(from 0deg at 82% 8%, rgba(70,140,255,0.10), transparent 18%, transparent 100%);
  animation: bg-sweep 9s linear infinite;
  opacity: 0.6;
}
@keyframes bg-sweep { to { transform: rotate(360deg); } }

/* ===== ヘッダー ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(6,11,20,0.92), rgba(6,11,20,0.6));
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { color: #5fa0ff; display: grid; place-items: center; }
.brand-sweep { transform-origin: 24px 24px; animation: bg-sweep 4s linear infinite; }
.brand-text h1 { font-size: 1.06rem; letter-spacing: .04em; font-weight: 900; }
.brand-text p { font-family: "Orbitron", sans-serif; font-size: .64rem; letter-spacing: .32em; color: var(--muted); }
.top-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.top-nav a {
  color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 700;
  padding: 6px 11px; border-radius: 999px; border: 1px solid transparent; transition: .2s;
}
.top-nav a:hover { color: var(--text); border-color: var(--line); background: rgba(60,120,220,0.12); }

/* ===== ヒーロー ===== */
.hero { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 90px 24px 60px; }
.hero-eyebrow { font-family: "Orbitron"; letter-spacing: .3em; color: #5fa0ff; font-size: .72rem; margin-bottom: 18px; }
.hero-title { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 900; line-height: 1.2; margin-bottom: 20px;
  background: linear-gradient(120deg, #ffffff, #7fb6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { max-width: 680px; color: #c4d4ea; font-size: 1.04rem; }
.hero-lead strong { color: #fff; }
.hero-stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 34px 0; }
.stat-chip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 22px;
  box-shadow: var(--shadow); min-width: 120px;
}
.stat-chip b { display: block; font-family: "Orbitron"; font-size: 1.8rem; color: #fff; line-height: 1; }
.stat-chip span { font-size: .74rem; color: var(--muted); letter-spacing: .08em; }
.hero-cta {
  display: inline-block; text-decoration: none; color: #fff; font-weight: 700;
  background: linear-gradient(120deg, var(--navy), var(--navy-deep));
  padding: 13px 28px; border-radius: 999px; box-shadow: 0 12px 30px rgba(42,109,240,.4);
  transition: transform .2s;
}
.hero-cta:hover { transform: translateY(-2px); }

/* ===== セクション ===== */
.fleet { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 40px 24px 80px; }
.section-title { font-size: 1.7rem; font-weight: 900; }
.section-sub { color: var(--muted); font-size: .82rem; letter-spacing: .1em; margin-bottom: 22px; }
.fleet-intro { margin-bottom: 30px; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .82rem; cursor: pointer; transition: .2s;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { color: #fff; border-color: transparent; }

/* ===== カテゴリ（艦種）ブロック ===== */
.category {
  margin-top: 46px; scroll-margin-top: 90px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(14,26,44,0.7), rgba(8,16,28,0.55));
  overflow: hidden; box-shadow: var(--shadow);
}
.category-head {
  display: flex; align-items: center; gap: 18px; padding: 22px 26px;
  border-bottom: 1px solid var(--line); position: relative;
}
.category-head::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent);
}
.cat-code {
  font-family: "Orbitron"; font-weight: 900; font-size: 1.05rem; color: #061018;
  background: var(--accent); padding: 8px 14px; border-radius: 10px; letter-spacing: .05em; white-space: nowrap;
}
.cat-titles h3 { font-size: 1.3rem; font-weight: 900; }
.cat-titles .cat-type { color: var(--accent); font-weight: 700; font-size: .86rem; }
.cat-summary { padding: 18px 26px 6px; color: #b9cbe4; font-size: .95rem; max-width: 900px; }

.ship-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 18px; padding: 22px 26px 28px;
}

/* ===== 艦カード ===== */
.ship-card {
  position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--panel-solid); cursor: pointer; transition: transform .25s, border-color .25s, box-shadow .25s;
}
.ship-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 16px 36px rgba(0,0,0,.5); }
.ship-stage {
  position: relative; height: 130px; overflow: hidden;
  background: linear-gradient(180deg, #0b1830 0%, #081120 70%, #05101e 100%);
  border-bottom: 1px solid var(--line);
}
.sea-line {
  position: absolute; left: 0; right: 0; bottom: 30px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(120,180,255,.5), transparent);
}
.ship-info { padding: 14px 16px 16px; }
.ship-info .pennant { font-family: "Orbitron"; color: var(--accent); font-size: .72rem; letter-spacing: .1em; }
.ship-info h4 { font-size: 1.15rem; font-weight: 900; margin: 2px 0 8px; }
.ship-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .74rem; }
.ship-meta span b { color: #cfe; font-weight: 700; }
.anim-tag {
  position: absolute; top: 10px; right: 10px; z-index: 5; font-size: .6rem; letter-spacing: .12em;
  font-family: "Orbitron"; color: var(--accent); background: rgba(6,12,22,.7);
  border: 1px solid var(--accent); padding: 3px 7px; border-radius: 6px; opacity: .85;
}

/* ============================================================
   艦ごとの特徴的なアニメーション（CSSで実装）
   ============================================================ */

/* 共通の艦シルエット */
.boat {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 26px;
}
.boat .hull {
  position: absolute; bottom: 0; left: 0; width: 120px; height: 14px;
  background: linear-gradient(180deg, #4a5e7a, #28384f);
  clip-path: polygon(4% 0, 100% 0, 92% 100%, 12% 100%);
  border-radius: 2px;
}
.boat .tower {
  position: absolute; bottom: 12px; left: 42px; width: 24px; height: 14px;
  background: #46597a; border-radius: 2px 2px 0 0;
}

/* --- 1. ステルス (FFM もがみ型): 統合マストが回転＋ステルス反射 --- */
.anim-stealth .boat .tower {
  clip-path: polygon(50% 0, 100% 40%, 80% 100%, 20% 100%, 0 40%);
  background: linear-gradient(180deg, #6fe0c8, #2a6d62); width: 30px; left: 40px;
}
.anim-stealth .mast {
  position: absolute; bottom: 26px; left: 53px; width: 4px; height: 18px; background: #aef3e4;
  transform-origin: bottom center; animation: stealth-radar 3.5s linear infinite;
}
.anim-stealth .mast::after {
  content: ""; position: absolute; top: -2px; left: -7px; width: 18px; height: 4px;
  background: linear-gradient(90deg, transparent, #aef3e4, transparent); border-radius: 2px;
}
@keyframes stealth-radar { to { transform: rotate(360deg); } }
.anim-stealth .facet {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(110,224,200,.35) 50%, transparent 60%);
  background-size: 250% 100%; animation: stealth-shine 3.5s ease-in-out infinite;
}
@keyframes stealth-shine { 0%,100% { background-position: 130% 0; } 50% { background-position: -30% 0; } }

/* --- 2. イージス (DDG): フェーズドアレイの探知ビームが扇状に広がる --- */
.anim-aegis .boat .tower { width: 30px; left: 40px; background: #3a567f; }
.anim-aegis .panel-face {
  position: absolute; bottom: 14px; left: 42px; width: 26px; height: 12px;
  background: #16335f; border: 1px solid #3b8dff; border-radius: 2px; overflow: hidden;
}
.anim-aegis .panel-face::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(59,141,255,.5) 2px 3px);
  animation: aegis-scanlines .8s linear infinite;
}
@keyframes aegis-scanlines { to { transform: translateY(3px); } }
.anim-aegis .beam {
  position: absolute; bottom: 44px; left: 50%; width: 2px; height: 70px;
  background: linear-gradient(180deg, rgba(59,141,255,.9), transparent);
  transform-origin: bottom center;
}
.anim-aegis .beam.b1 { animation: aegis-beam 3s ease-in-out infinite; }
.anim-aegis .beam.b2 { animation: aegis-beam 3s ease-in-out infinite .4s; opacity: .6; }
.anim-aegis .beam.b3 { animation: aegis-beam 3s ease-in-out infinite .8s; opacity: .4; }
@keyframes aegis-beam {
  0%, 100% { transform: rotate(-55deg); opacity: .15; }
  50% { transform: rotate(55deg); opacity: 1; }
}

/* --- 3. 全通甲板 (DDH): ヘリが甲板から離陸して旋回 --- */
.anim-flightdeck .boat { width: 150px; }
.anim-flightdeck .boat .hull {
  width: 150px; height: 18px; clip-path: polygon(2% 0, 100% 0, 96% 100%, 6% 100%);
  background: linear-gradient(180deg, #6a7385, #2f3a4d);
}
.anim-flightdeck .deck-line {
  position: absolute; bottom: 13px; left: 8px; right: 8px; height: 3px;
  background: repeating-linear-gradient(90deg, #ffb066 0 8px, transparent 8px 16px);
}
.anim-flightdeck .heli {
  position: absolute; bottom: 16px; left: 30px; font-size: 14px;
  animation: heli-takeoff 5s ease-in-out infinite;
}
.anim-flightdeck .rotor {
  position: absolute; top: -3px; left: -4px; width: 22px; height: 2px;
  background: rgba(220,235,255,.85); border-radius: 2px; animation: heli-rotor .12s linear infinite;
  transform-origin: center;
}
@keyframes heli-rotor { to { transform: scaleX(.15); } }
@keyframes heli-takeoff {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  35% { transform: translate(20px, -50px) rotate(-8deg); }
  60% { transform: translate(70px, -64px) rotate(-12deg); }
  85% { transform: translate(120px, -30px) rotate(-4deg); opacity: 1; }
  100% { transform: translate(150px, -10px); opacity: 0; }
}

/* --- 4. 対潜戦 (DD): ソナーのリングと爆雷の水柱 --- */
.anim-asw .sonar-ping {
  position: absolute; bottom: 18px; left: 50%; width: 16px; height: 16px; margin-left: -8px;
  border: 2px solid #9b7bff; border-radius: 50%; transform: translateY(0);
}
.anim-asw .sonar-ping.p1 { animation: asw-ping 2.6s ease-out infinite; }
.anim-asw .sonar-ping.p2 { animation: asw-ping 2.6s ease-out infinite .9s; }
.anim-asw .sonar-ping.p3 { animation: asw-ping 2.6s ease-out infinite 1.8s; }
@keyframes asw-ping {
  0% { transform: scale(.3) translateY(0); opacity: .9; }
  100% { transform: scale(4.5) translateY(8px); opacity: 0; }
}
.anim-asw .sub-target {
  position: absolute; bottom: 6px; left: 24px; width: 16px; height: 6px; border-radius: 50%;
  background: #2a3550; animation: asw-sub 6s ease-in-out infinite;
}
@keyframes asw-sub { 0%,100% { left: 18px; opacity:.5;} 50% { left: 80px; opacity:.9;} }

/* --- 5. 潜水艦 (SS): 潜航しながら気泡を上げる --- */
.anim-submarine .ship-stage { background: linear-gradient(180deg, #0b1830 0%, #06243a 50%, #03182c 100%); }
.anim-submarine .sub {
  position: absolute; bottom: 34px; left: 50%; width: 110px; height: 24px; transform: translateX(-50%);
  animation: sub-dive 7s ease-in-out infinite;
}
.anim-submarine .sub .body {
  position: absolute; bottom: 0; width: 110px; height: 18px; border-radius: 50%;
  background: linear-gradient(180deg, #38556e, #16242f);
}
.anim-submarine .sub .sail {
  position: absolute; bottom: 14px; left: 40px; width: 20px; height: 12px; border-radius: 4px 4px 0 0;
  background: #2c4456; clip-path: polygon(15% 0,85% 0,100% 100%,0 100%);
}
@keyframes sub-dive {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(22px); }
}
.anim-submarine .bubble {
  position: absolute; bottom: 50px; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(170,225,255,.6);
}
.anim-submarine .bubble.x1 { left: 46%; animation: bubble-rise 2.4s linear infinite; }
.anim-submarine .bubble.x2 { left: 52%; animation: bubble-rise 2.4s linear infinite .8s; }
.anim-submarine .bubble.x3 { left: 49%; animation: bubble-rise 2.4s linear infinite 1.5s; }
@keyframes bubble-rise {
  0% { transform: translateY(0) scale(.4); opacity: 0; }
  20% { opacity: .8; }
  100% { transform: translateY(-46px) scale(1); opacity: 0; }
}

/* --- 6. 機雷戦 (MSO/MCM): 探知ソナーが機雷をロックオン --- */
.anim-minehunt .mine {
  position: absolute; bottom: 8px; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe680, #b58a00); box-shadow: 0 0 0 2px rgba(255,210,61,.2);
}
.anim-minehunt .mine::before, .anim-minehunt .mine::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid #ffd23d;
}
.anim-minehunt .mine.m1 { left: 28px; animation: mine-found 4s ease-in-out infinite; }
.anim-minehunt .mine.m2 { left: 82px; animation: mine-found 4s ease-in-out infinite 2s; }
@keyframes mine-found { 0%,40%,100% { box-shadow: 0 0 0 2px rgba(255,210,61,.15);} 60%,80% { box-shadow: 0 0 14px 3px rgba(255,210,61,.8);} }
.anim-minehunt .scan-cone {
  position: absolute; bottom: 30px; left: 50%; width: 0; height: 0; transform-origin: top center;
  border-left: 26px solid transparent; border-right: 26px solid transparent;
  border-top: 44px solid rgba(255,210,61,.18); animation: mine-scan 4s ease-in-out infinite;
}
@keyframes mine-scan { 0%,100% { transform: translateX(-50%) rotate(-30deg);} 50% { transform: translateX(-50%) rotate(30deg);} }

/* --- 7. 揚陸 (LST): LCAC（エアクッション艇）が艦から発進 --- */
.anim-transport .boat { width: 150px; }
.anim-transport .boat .hull { width: 150px; }
.anim-transport .door {
  position: absolute; bottom: 0; right: 8px; width: 6px; height: 14px; background: #1c2c44;
  animation: lst-door 6s ease-in-out infinite;
}
.anim-transport .lcac {
  position: absolute; bottom: 28px; left: 50%; font-size: 13px;
  animation: lcac-launch 6s ease-in-out infinite;
}
.anim-transport .lcac::after {
  content: ""; position: absolute; bottom: -4px; left: -2px; right: -2px; height: 4px;
  background: rgba(180,220,255,.5); border-radius: 50%; filter: blur(1px);
}
@keyframes lcac-launch {
  0%, 25% { transform: translate(-10px, 0); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translate(70px, 8px); opacity: 1; }
}
@keyframes lst-door { 0%,20% { transform: rotate(0);} 40%,100% { transform: rotate(60deg);} }

/* --- 8. 補給 (AOE): 洋上補給のホースが僚艦へ伸びる --- */
.anim-supply .boat { left: 32%; width: 110px; }
.anim-supply .escort {
  position: absolute; bottom: 30px; right: 12px; width: 70px; height: 16px;
  background: linear-gradient(180deg, #3f566f, #20303f);
  clip-path: polygon(6% 0,100% 0,90% 100%,16% 100%); border-radius: 2px;
  animation: escort-sway 4s ease-in-out infinite;
}
.anim-supply .hose {
  position: absolute; bottom: 44px; left: 40%; width: 30%; height: 3px;
  background: linear-gradient(90deg, #7ee787, rgba(126,231,135,.2));
  transform-origin: left center; animation: hose-pulse 2.2s ease-in-out infinite;
}
.anim-supply .fuel {
  position: absolute; bottom: 44px; left: 42%; width: 6px; height: 3px; border-radius: 2px;
  background: #c8ffcf; animation: fuel-flow 2.2s linear infinite;
}
@keyframes fuel-flow { 0% { left: 42%; opacity: 0;} 20% { opacity: 1;} 100% { left: 68%; opacity: 0;} }
@keyframes hose-pulse { 0%,100% { opacity: .5;} 50% { opacity: 1;} }
@keyframes escort-sway { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-3px);} }

/* ===== モーダル ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 24px;
  background: rgba(3,7,14,.78); backdrop-filter: blur(6px);
}
.modal-overlay.open { display: grid; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: min(640px, 100%); max-height: 88vh; overflow: auto;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); animation: pop .25s ease;
}
@keyframes pop { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 12px; right: 14px; z-index: 6; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(10,18,30,.8); color: #fff; font-size: 1.3rem; cursor: pointer;
}
.modal-close:hover { background: #1c2c44; }
.modal-stage { height: 200px; position: relative; overflow: hidden; border-radius: 18px 18px 0 0; }
.modal-text { padding: 22px 26px 28px; }
.modal-text .pennant { font-family: "Orbitron"; color: var(--accent); letter-spacing: .12em; }
.modal-text h3 { font-size: 1.7rem; font-weight: 900; margin: 4px 0 4px; }
.modal-text .cat-line { color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.modal-text .note { color: #c4d4ea; margin-bottom: 18px; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.spec-table td:first-child { color: var(--muted); width: 38%; }
.spec-table td:last-child { font-weight: 700; }

/* ===== フッター ===== */
.site-footer {
  position: relative; z-index: 1; text-align: center; padding: 40px 24px 60px;
  color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); margin-top: 40px;
}
.footer-note { font-family: "Orbitron"; letter-spacing: .2em; margin-top: 8px; font-size: .7rem; }

.category.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

@media (max-width: 640px) {
  .brand-text h1 { font-size: .92rem; }
  .hero { padding-top: 60px; }
}
