/* ===========================================
   さかな図鑑 — Global Design System
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;500;700;900&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Theme Colors */
  --color-sky: #87CEEB;
  --color-surface: #4FC3F7;
  --color-shallow: #00ACC1;
  --color-mid: #00838F;
  --color-deep: #0D1B2A;
  --color-abyss: #050A12;

  /* Accent Colors */
  --color-coral: #FF6F61;
  --color-sun: #FFD54F;
  --color-seaweed: #66BB6A;
  --color-pearl: #F5F5F5;
  --color-bubble: rgba(255, 255, 255, 0.25);

  /* UI Colors */
  --color-text: #263238;
  --color-text-light: #FFFFFF;
  --color-text-muted: rgba(255, 255, 255, 0.7);
  --color-card-bg: rgba(255, 255, 255, 0.92);
  --color-card-shadow: rgba(0, 0, 0, 0.15);

  /* Typography */
  --font-main: 'Zen Maru Gothic', 'Rounded Mplus 1c', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-hero: 3.5rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.6s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: var(--font-main);
  cursor: pointer;
  border: none;
  outline: none;
}

/* --- Ruby (Furigana) --- */
ruby {
  ruby-align: center;
}

rt {
  font-size: 0.55em;
  color: inherit;
  opacity: 0.8;
}

/* --- Utility Classes --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* --- Header / Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(135, 206, 235, 0.95) 0%, rgba(79, 195, 247, 0.9) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-sm) 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-normal);
}

.site-header.hidden {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xl);
  font-weight: 900;
  color: var(--color-text-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.site-logo .logo-emoji {
  font-size: 1.8em;
  animation: swim 3s ease-in-out infinite;
}

@keyframes swim {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(4px) rotate(3deg); }
  75% { transform: translateX(-4px) rotate(-3deg); }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text-light);
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.nav-link:hover,
.nav-link:focus {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-link .nav-icon {
  font-size: 1.3em;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  color: var(--color-text-light);
  padding: var(--space-xs);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-deep);
  color: var(--color-text-light);
  padding: var(--space-2xl) 0 var(--space-lg);
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--color-text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.footer-nav a:hover {
  color: var(--color-sun);
}

.footer-copy {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(79, 195, 247, 0.98) 0%, rgba(0, 172, 193, 0.98) 100%);
    padding: var(--space-md);
    gap: var(--space-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  .main-nav.open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    justify-content: center;
    font-size: var(--font-size-lg);
    padding: var(--space-md);
  }

  .footer-nav {
    flex-direction: column;
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }
}
