/* ============================================
   金子研究室 — Global Stylesheet
   Theme: Dark Academic / Technical Precision
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;600;700&family=Noto+Sans+JP:wght@300;400;500;700&family=DM+Mono:wght@400;500&display=swap');

/* --- CSS Variables --- */
:root {
  --bg:        #0a0e1a;
  --bg-card:   #111827;
  --bg-glass:  rgba(17, 24, 39, 0.85);
  --border:    rgba(15, 191, 191, 0.18);
  --teal:      #0FBFBF;
  --teal-dim:  #0a8f8f;
  --navy:      #185a9d;
  --accent:    #39e6c8;
  --text:      #e8edf5;
  --text-mute: #8896a8;
  --white:     #ffffff;
  --grad:      linear-gradient(135deg, #185a9d 0%, #0FBFBF 100%);
  --grad-text: linear-gradient(90deg, #0FBFBF, #39e6c8);
  --font-head: 'Noto Serif JP', serif;
  --font-body: 'Noto Sans JP', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius:    8px;
  --shadow:    0 4px 24px rgba(0,0,0,0.45);
  --nav-h:     64px;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.8;
  /* subtle grid texture */
  background-image:
    linear-gradient(rgba(15,191,191,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,191,191,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

a { color: var(--teal); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

/* ============================================
   HEADER / NAV
   ============================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 1rem;
}

/* Logo */
.nav-logo img {
  height: 36px;
  width: auto;
  display: block;
}

/* Desktop nav */
.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-mute);
  padding: 0.4em 0.9em;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
  font-family: var(--font-body);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--teal);
  background: rgba(15,191,191,0.08);
}

/* Hamburger (mobile) */
.hamburger { display: none; }

.ham-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.ham-btn span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

#ham-check { display: none; }

#ham-check:checked ~ .ham-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#ham-check:checked ~ .ham-btn span:nth-child(2) { opacity: 0; }
#ham-check:checked ~ .ham-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  gap: 0.5rem;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  z-index: 99;
}

#ham-check:checked ~ .mobile-menu { transform: translateX(0); }

.mobile-menu a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.8em 1em;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu a::after {
  content: '→';
  color: var(--teal);
  font-size: 0.9em;
}

.mobile-menu a:hover { color: var(--teal); }

/* ============================================
   PAGE BANNER
   ============================================ */
.page-banner {
  width: 100%;
  position: relative;
  overflow: hidden;
  max-height: 320px;
}

.page-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.7) saturate(1.2);
}

.page-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg) 100%);
}

/* Hero slideshow (index) */
.hero {
  position: relative;
  height: 380px;
  overflow: hidden;
}

@media (min-width: 870px) {
  .hero { height: 480px; }
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.img-01 { background-image: url(./resources/3.png); animation: fade1 24s infinite; }
.img-02 { background-image: url(./resources/2.png); animation: fade2 24s infinite; }
.img-03 { background-image: url(./resources/1.png); animation: fade3 24s infinite; }

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,14,26,0.3) 0%, rgba(10,14,26,0.85) 100%);
  z-index: 1;
}

@keyframes fade1 {
  0%,33%  { opacity: 1; transform: scale(1.0); }
  40%,90% { opacity: 0; transform: scale(1.08); }
  100%    { opacity: 1; transform: scale(1.0); }
}
@keyframes fade2 {
  0%,30%  { opacity: 0; }
  40%,60% { opacity: 1; transform: scale(1.0); }
  70%,100%{ opacity: 0; transform: scale(1.06); }
}
@keyframes fade3 {
  0%,60%  { opacity: 0; }
  70%,90% { opacity: 1; transform: scale(1.0); }
  100%    { opacity: 0; transform: scale(1.04); }
}

/* ============================================
   SECTION LAYOUT
   ============================================ */
.section {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-sm {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ============================================
   SECTION HEADING
   ============================================ */
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid transparent;
  border-image: var(--grad) 1;
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.section-title .dot {
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 50%;
  flex-shrink: 0;
}

.section-sub {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--teal);
  margin: 2rem 0 0.8rem;
  letter-spacing: 0.03em;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}

.card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(15,191,191,0.12);
}

/* ============================================
   NEWS LIST (index)
   ============================================ */
.news-list { display: flex; flex-direction: column; gap: 0; }

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
  flex-wrap: wrap;
}

.news-item:first-child { border-top: 1px solid var(--border); }

.news-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-mute);
  white-space: nowrap;
  padding-top: 0.15em;
  min-width: 6em;
}

.news-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 0.1em;
}

.news-link {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  transition: color .2s;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.news-link:hover {
  color: var(--teal);
  text-decoration-color: var(--teal);
}

/* ============================================
   PROFESSOR BLOCK
   ============================================ */
.prof-block {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.prof-img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.prof-info { flex: 1; min-width: 220px; }

.prof-name {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.8rem;
}

.prof-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }

.prof-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em 1em;
  border: 1px solid var(--teal);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--teal);
  transition: background .2s, color .2s;
}

.prof-link-btn:hover {
  background: var(--teal);
  color: var(--bg);
}

/* ============================================
   WAKA (poem block)
   ============================================ */
.waka-block {
  margin: 1.5rem 0 2rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-head);
  font-size: 1.05rem;
  line-height: 2.2;
  color: var(--text);
}

/* ============================================
   MEMBER LIST
   ============================================ */
.member-group { margin-bottom: 2.5rem; }

.member-group-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

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

.member-item {
  font-size: 0.92rem;
  color: var(--text);
  padding: 0.3rem 0;
}

.member-item.leader {
  font-weight: 700;
  color: var(--accent);
  grid-column: 1 / -1;
  font-family: var(--font-head);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  padding-top: 0.6rem;
}

/* ============================================
   RESEARCH CONTENT
   ============================================ */
.research-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

.research-card h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--teal);
  margin-bottom: 1rem;
}

.research-card p, .research-card li {
  font-size: 0.95rem;
  line-height: 2;
  color: var(--text);
}

.research-card ul {
  padding-left: 1em;
}

.research-card ul li::before {
  content: '▸ ';
  color: var(--teal);
  font-size: 0.8em;
}

/* ============================================
   NEWS PAGE
   ============================================ */
.news-entry { margin-bottom: 3rem; }

.news-year-month {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
  border-image: var(--grad) 1;
}

.news-detail-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 1.2rem 0 0.4rem;
}

.news-detail-body {
  font-size: 0.93rem;
  color: var(--text-mute);
  line-height: 1.9;
  margin-left: 0.5rem;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--teal);
  padding: 0.6em 0;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

details summary::before {
  content: '▶';
  font-size: 0.7em;
  transition: transform .2s;
}

details[open] summary::before { transform: rotate(90deg); }

/* ============================================
   CONTACT
   ============================================ */
.contact-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.contact-value {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 2;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  margin-top: 6rem;
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-mute);
  transition: color .2s;
}

.footer-links a:hover { color: var(--teal); }

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

/* ============================================
   FADE-IN ANIMATION
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   NEWS — Paper list & external links
   ============================================ */
.news-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.news-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.3em 0.9em;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--teal);
  font-family: var(--font-mono);
  transition: background .2s, border-color .2s;
}

.news-ext-link:hover {
  background: rgba(15,191,191,0.1);
  border-color: var(--teal);
  color: var(--accent);
}

.news-paper-list {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.news-paper {
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.88rem;
  line-height: 1.7;
}

.paper-author {
  display: block;
  color: var(--teal);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.paper-title {
  color: var(--text);
}

.news-year-details {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.year-summary {
  padding: 1rem 1.5rem !important;
  background: var(--bg-card);
  font-size: 1rem !important;
  font-weight: 600;
  margin: 0 !important;
  color: var(--text) !important;
}

.year-summary:hover { color: var(--teal) !important; }

.news-year-details .news-entry {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}


@media (max-width: 869px) {
  :root { --nav-h: 56px; }

  .nav-links { display: none; }
  .hamburger { display: block; }

  .prof-img { width: 120px; height: 120px; }

  .section, .section-sm { padding: 2.5rem 1.2rem; }

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

@media (min-width: 870px) {
  .hamburger { display: none; }
}
