/* ============================================================
   SUIKOHP — Modern Design 2025
   水工学研究室 | 愛媛大学
============================================================ */

/* ── Variables ────────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-base:    #07111e;
  --bg-surface: #0c1a2e;
  --bg-card:    #101e33;
  --bg-card-hover: #152440;

  /* Accent palette */
  --accent-blue:   #3b82f6;
  --accent-cyan:   #0ea5e9;
  --accent-purple: #818cf8;

  /* Text */
  --text-primary:   #eef4ff;
  --text-secondary: #7fa3c0;
  --text-accent:    #38bdf8;

  /* Borders */
  --border-base:   rgba(255, 255, 255, 0.06);
  --border-accent: rgba(14, 165, 233, 0.35);

  /* Shadows */
  --shadow-md:   0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg:   0 12px 48px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.18);

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;

  /* Typography */
  --font: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;

  /* Easing */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a    { text-decoration: none; color: inherit; }
img  { max-width: 100%; display: block; }
ul   { list-style: none; }

/* ── Header ───────────────────────────────────────────── */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  padding: 1.1rem 2rem;
  /* backdrop-filter を ::before に移動 — これをしないと子の position:fixed が
     viewport 基準にならずモバイルメニューが全画面にならない */
  border-bottom: 1px solid var(--border-base);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: padding .3s var(--ease);
}
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(7, 17, 30, 0.75);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  z-index: -1;
  transition: background .3s;
}
header.scrolled {
  padding: .75rem 2rem;
  box-shadow: 0 1px 0 var(--border-base), var(--shadow-md);
}
header.scrolled::before {
  background: rgba(7, 17, 30, 0.94);
}

.logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .025em;
  background: linear-gradient(95deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav ul {
  display: flex;
  gap: .15rem;
}
nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: .45rem .9rem;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, .07);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 38px; height: 38px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-base);
  border-radius: var(--r-sm);
  cursor: pointer;
  gap: 5px;
  position: relative; /* メニューオーバーレイより前面に出す */
  z-index: 10001;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 100dvh;
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

/* Animated radial gradient mesh */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 15% 35%, rgba(14,165,233,.14) 0%, transparent 55%),
    radial-gradient(ellipse 55% 70% at 85% 70%, rgba(129,140,248,.11) 0%, transparent 55%),
    radial-gradient(ellipse 40% 50% at 55% 20%, rgba(59,130,246,.07) 0%, transparent 50%);
  animation: mesh-pulse 9s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes mesh-pulse {
  0%   { opacity: .6; transform: scale(1); }
  100% { opacity: 1;  transform: scale(1.04); }
}

/* Bottom gradient fade */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 35%;
  background: linear-gradient(to bottom, transparent, var(--bg-base));
  pointer-events: none;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: .18;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
  padding: 0 1.5rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(14,165,233,.1);
  border: 1px solid rgba(14,165,233,.28);
  border-radius: 100px;
  padding: .35rem 1.1rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}
.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 5.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.025em;
  margin-bottom: 1.5rem;
  background: linear-gradient(145deg, #fff 25%, #c7e8ff 60%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(.95rem, 1.8vw, 1.15rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 580px;
  margin-inline: auto;
}

.btn-group {
  display: flex;
  gap: .875rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.875rem;
  font-size: .9rem;
  font-weight: 600;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(14,165,233,.3), 0 4px 20px rgba(14,165,233,.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(14,165,233,.5), 0 8px 32px rgba(14,165,233,.4);
}
.btn-ghost {
  background: rgba(255,255,255,.06);
  color: var(--text-primary);
  border: 1px solid var(--border-base);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.14);
  transform: translateY(-2px);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  color: var(--text-secondary);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  animation: hint-bob 2.5s ease-in-out infinite;
}
.scroll-hint::after {
  content: '';
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, var(--text-secondary), transparent);
}
@keyframes hint-bob {
  0%, 100% { opacity: .3; transform: translateX(-50%) translateY(0); }
  50%       { opacity: .7; transform: translateX(-50%) translateY(6px); }
}

/* ── Sections ─────────────────────────────────────────── */
section {
  padding: clamp(60px, 8vw, 100px) clamp(1.25rem, 4vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  margin-bottom: 3.25rem;
}
.section-title.centered { text-align: center; }
.section-title p {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: .65rem;
}
.section-title h2 {
  font-size: clamp(1.75rem, 3.8vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
}

/* ── About ────────────────────────────────────────────── */
#about .about-body {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
#about .about-body > p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.95;
}

/* stats-row removed from HTML; hide via CSS for any cached browser versions */
.stats-row { display: none !important; }
.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  padding: 1.75rem 1rem;
  text-align: center;
  transition: border-color .3s, transform .3s var(--ease);
}
.stat-item:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
}
.stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: .4rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: .82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Research Cards ───────────────────────────────────── */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border-base);
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-8px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}

/* Research cards: uniform 16:9 aspect ratio, no hover zoom */
.research-grid .card {
  overflow: hidden;
}
.research-grid .card-img-wrapper {
  aspect-ratio: 16 / 9;
  height: auto;
  overflow: hidden;
}
.research-grid .card-img-wrapper::after { display: none; }
.research-grid .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none !important;
}
.research-grid .card:hover .card-img { transform: none; }

/* Card topic tag badge */
.card-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, .35);
  border-radius: 4px;
  padding: .15rem .5rem;
  margin-bottom: .65rem;
}

.card-img-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, var(--bg-card) 100%);
}
.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .55s var(--ease);
}
.card:hover .card-img { transform: scale(1.07); }

.card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .75rem;
  letter-spacing: -.01em;
}
.card p {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.8;
  flex: 1;
}

/* ── Members Section ──────────────────────────────────── */
.member-section {
  background: var(--bg-surface);
  padding: clamp(60px, 8vw, 100px) clamp(1.25rem, 4vw, 3rem);
}
/* Override max-width for full-bleed bg */
.member-section > * {
  max-width: 1100px;
  margin-inline: auto;
}
.member-section .section-title { text-align: center; margin-bottom: 3rem; }

.member-category { margin-bottom: 3rem; }

.member-category-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.member-category-label h3 {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  white-space: nowrap;
}
.member-category-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-base);
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 1.1rem;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  padding: 1.5rem 1rem 1.25rem;
  text-align: center;
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.member-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.member-img {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto .9rem;
  border: 2px solid var(--border-base);
  transition: border-color .3s, box-shadow .3s;
}
.member-card:hover .member-img {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px rgba(14,165,233,.25);
}

.member-name {
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
}
.member-name small {
  display: block;
  font-size: .67rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: .2rem;
  letter-spacing: .01em;
}
.member-role {
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(14,165,233,.1);
  border: 1px solid rgba(14,165,233,.2);
  display: inline-block;
  padding: .18rem .65rem;
  border-radius: 100px;
  margin-top: .55rem;
}

/* ── Blog / Events ────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
}
.blog-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.blog-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.blog-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .55s var(--ease);
}
.blog-card:hover .blog-img { transform: scale(1.07); }

.blog-date-badge {
  position: absolute;
  top: .875rem; right: .875rem;
  background: rgba(7,17,30,.88);
  backdrop-filter: blur(8px);
  color: var(--accent-cyan);
  padding: .25rem .8rem;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
  border: 1px solid rgba(14,165,233,.22);
  letter-spacing: .03em;
}

.blog-content {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: .6rem;
  letter-spacing: -.01em;
}
.blog-content > p {
  font-size: .86rem;
  color: var(--text-secondary);
  line-height: 1.75;
  flex: 1;
}
.blog-meta {
  margin-top: .875rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border-base);
  font-size: .78rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

/* ── Footer ───────────────────────────────────────────── */
footer {
  background: #030a14;
  border-top: 1px solid var(--border-base);
  padding: 3.5rem 2rem 2rem;
  text-align: center;
}
footer .footer-logo {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
}
footer p {
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.9;
  margin-bottom: .4rem;
}
footer .footer-copy {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-base);
  font-size: .78rem;
  color: rgba(127, 163, 192, .35);
}
.footer-sns {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.25rem 0;
}
.footer-sns a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-base);
  border-radius: 24px;
  padding: .45rem 1rem;
  transition: border-color .25s, color .25s;
}
.footer-sns a:hover {
  border-color: var(--border-accent);
  color: var(--text-accent);
}
.footer-sns svg { flex-shrink: 0; }

/* ── Reveal animations ────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  nav ul {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000; /* ヘッダー(1000)より上、ハンバーガー(10001)より下 */
    background: rgba(7, 17, 30, .97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: 2rem;
    /* フェードイン */
    opacity: 0;
    transition: opacity .25s;
  }
  nav ul.open {
    display: flex;
    opacity: 1;
  }
  nav ul a {
    font-size: 1.25rem;
    padding: 1rem 2.5rem;
    color: var(--text-primary);
    border-radius: 12px;
    transition: background .15s;
  }
  nav ul a:hover,
  nav ul a:active {
    background: rgba(255,255,255,.07);
  }

  .stats-row { gap: .875rem; }
  .stat-number { font-size: 2rem; }

  .member-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .research-grid,
  .blog-grid { grid-template-columns: 1fr; }

  /* Hero h1: モバイルで大きすぎるのを抑制 */
  .hero h1 {
    font-size: 1.75rem;
    letter-spacing: -.01em;
  }

  /* インスタボタンが折り返さないように */
  .btn-instagram {
    font-size: .82rem !important;
    padding: .75rem 1.25rem !important;
    white-space: nowrap;
  }
}

/* ── Awards Section ───────────────────────────────────── */
.awards-list {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 0 1.5rem;
}

.award-year {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  padding: 1.5rem 2rem;
  transition: border-color .2s, box-shadow .2s;
}

.award-year:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.award-year h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-accent);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border-base);
}

.award-year ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.award-year li {
  color: var(--text-primary);
  font-size: .95rem;
  line-height: 1.7;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-blue);
}

.award-year li a {
  color: var(--text-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.award-year li a:hover {
  color: var(--accent-cyan);
}

.award-name {
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .award-year {
    padding: 1.25rem 1.25rem;
  }
}
