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

:root {
  --navy: #0d1b2a;
  --navy-light: #1b263b;
  --blue: #415a77;
  --blue-light: #778da9;
  --rose: #9d4e5a;
  --rose-dark: #7a3a44;
  --rose-light: #c17b88;
  --cream: #faf8f5;
  --white: #ffffff;
  --text: #2a2a2a;
  --text-light: #6a6a6a;
  --border: #e8e4df;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.9;
  letter-spacing: 0.03em;
  font-weight: 300;
}

/* ========================================
   Header
======================================== */
.header {
  background: var(--navy);
  color: var(--white);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(255, 255, 255, 0.03) 20px,
      rgba(255, 255, 255, 0.03) 40px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 20px,
      rgba(255, 255, 255, 0.03) 20px,
      rgba(255, 255, 255, 0.03) 40px
    );
  background-size: 56.57px 56.57px;
  pointer-events: none;
  opacity: 0.6;
}

.header-inner {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.header-label {
  display: inline-block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--white);
  background: var(--rose);
  padding: 0.4rem 1.2rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.main-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--white);
  margin: 0.8rem 0 0.5rem;
  line-height: 1.4;
}

.title-main {
  display: inline;
}

.title-sub-text {
  display: inline;
}

.header-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.12em;
  color: var(--blue-light);
  margin-bottom: 0.8rem;
}

.header-tagline {
  font-size: 0.95rem;
  color: var(--white);
  margin-top: 1.2rem;
  letter-spacing: 0.15em;
  font-weight: 300;
}

/* ========================================
   Filter Navigation
======================================== */
.filter-nav {
  background: var(--white);
  padding: 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 768px) {
  .filter-nav {
    padding: 1.5rem 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .filter-nav::-webkit-scrollbar {
    height: 4px;
  }

  .filter-nav::-webkit-scrollbar-track {
    background: var(--cream);
  }

  .filter-nav::-webkit-scrollbar-thumb {
    background: var(--border);
  }

  .filter-inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.5rem;
    min-width: max-content;
  }

  .filter-label {
    flex-shrink: 0;
  }

  .filter-buttons {
    flex-wrap: nowrap;
    gap: 0.4rem;
  }
}

.filter-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--text-light);
  text-transform: uppercase;
  font-style: italic;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.filter-btn {
  width: 44px;
  height: 44px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.05em;
  position: relative;
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--rose);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.filter-btn:hover {
  color: var(--navy);
  border-color: var(--navy);
}

.filter-btn:hover::after {
  width: 60%;
}

.filter-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.filter-btn.active::after {
  width: 60%;
  background: var(--rose-light);
}

.filter-btn[data-generation="all"] {
  width: auto;
  padding: 0 1.5rem;
  font-style: italic;
}

/* ========================================
   Main Content
======================================== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.members-count {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 3rem;
  letter-spacing: 0.1em;
  font-style: italic;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

/* ========================================
   Member Card
======================================== */
.member-card {
  background: var(--white);
  padding: 2.5rem;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  border-left: 3px solid transparent;
}

.member-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  transition: height 0.4s ease;
}

.member-card:hover {
  background: var(--cream);
  border-left-color: var(--member-color);
}

.member-card:hover::before {
  height: 100%;
  background-color: var(--member-color);
}

.member-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 300;
  color: var(--border);
  line-height: 1;
  margin-bottom: 1rem;
  transition: color 0.4s ease;
}

.member-card:hover .member-number {
  color: var(--member-color);
  opacity: 0.3;
}

.member-name {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--navy);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.member-name-border {
  width: 40px;
  height: 2px;
  border-bottom: 2px solid;
  margin-bottom: 0.8rem;
  transition: width 0.3s ease;
}

.member-card:hover .member-name-border {
  width: 60px;
}

.member-name-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.member-dates {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.8;
  margin-top: auto;
}

.member-dates span {
  display: block;
}

.member-status {
  display: inline-block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 1.2rem;
  padding: 0.4rem 1rem;
}

.member-status.active {
  background: var(--rose);
  color: var(--white);
}

.member-status.graduated {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
}

/* ========================================
   Modal
======================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 27, 42, 0.92);
}

.modal-content {
  position: relative;
  background: var(--white);
  padding: 5rem 4rem;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.4s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 2.5rem;
  right: 2.5rem;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.modal-close span {
  display: block;
  position: absolute;
  width: 100%;
  height: 1px;
  background: var(--text);
  top: 50%;
  left: 0;
  transition: all 0.3s ease;
}

.modal-close span:first-child {
  transform: rotate(45deg);
}

.modal-close span:last-child {
  transform: rotate(-45deg);
}

.modal-close:hover span {
  background: var(--rose);
}

.modal-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 5rem;
  font-weight: 300;
  color: var(--border);
  line-height: 1;
  margin-bottom: 1rem;
}

.modal-name {
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--navy);
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}

.modal-name-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  color: var(--text-light);
  font-style: italic;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.modal-badges {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.modal-generation {
  display: inline-block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--white);
  background: var(--navy);
  padding: 0.5rem 1.5rem;
}

.modal-badges .member-status {
  margin-top: 0;
}

.modal-details {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.modal-detail-item {
  display: flex;
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.modal-detail-item:last-child {
  border-bottom: none;
}

.modal-detail-label {
  width: 120px;
  flex-shrink: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-style: italic;
}

.modal-detail-value {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-color-indicator {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

.modal-description {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--cream);
  border-left: 3px solid var(--rose);
  line-height: 2;
  color: var(--text);
}

/* ========================================
   Footer
======================================== */
.footer {
  background: var(--navy);
  color: var(--blue-light);
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(255, 255, 255, 0.03) 20px,
      rgba(255, 255, 255, 0.03) 40px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 20px,
      rgba(255, 255, 255, 0.03) 20px,
      rgba(255, 255, 255, 0.03) 40px
    );
  background-size: 56.57px 56.57px;
  pointer-events: none;
  opacity: 0.6;
}

.footer-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-deco {
  width: 40px;
  height: 1px;
  background: var(--rose-light);
  margin: 0 auto 2rem;
}

.footer-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

.footer-text a {
  color: var(--rose-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-text a:hover {
  color: var(--white);
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 768px) {
  .header {
    padding: 2rem 1.5rem;
  }

  .title-main::after {
    content: '\A';
    white-space: pre;
  }

  .filter-btn {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
  }

  .main-content {
    padding: 2rem 0;
  }

  .members-grid {
    grid-template-columns: 1fr;
    border-left: none;
    border-right: none;
  }

  .member-card {
    padding: 2rem 1.5rem;
  }

  .modal-content {
    padding: 3rem 2rem;
  }

  .modal-name {
    font-size: 1.8rem;
  }

  .modal-detail-item {
    flex-direction: column;
    gap: 0.3rem;
  }
}

/* ========================================
   Scrollbar
======================================== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--cream);
}

::-webkit-scrollbar-thumb {
  background: var(--navy);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--rose);
}

/* ========================================
   Selection
======================================== */
::selection {
  background: var(--rose);
  color: var(--white);
}
