/* ===== Reset & Custom Properties ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #1a1a1a;
  --bg-card: #222220;
  --text: #e8e0d4;
  --text-muted: #9a938a;
  --accent: #8B4544;
  --accent-light: #a65a59;
  --border: #33322f;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Serif 4', 'Times New Roman', serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
header {
  text-align: center;
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin-bottom: 16px;
}



/* ===== Language Switcher ===== */
.lang-switcher {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.lang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 6px 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.06em;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text);
}

/* ===== About Section ===== */
#about {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

#about h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
}

#about p {
  color: var(--text-muted);
  font-style: italic;
  white-space: pre-line;
}

.about-image {
  display: block;
  max-width: 100%;
  margin-top: 28px;
  border: 1px solid var(--border);
}

/* ===== Name Index ===== */
#index-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

#index-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 28px;
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 28px;
}

.name-grid a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 5px 0;
  transition: color 0.25s ease;
  display: block;
  line-height: 1.35;
}

.name-grid a:hover {
  color: var(--accent-light);
}

/* ===== Cards ===== */
main {
  padding: 48px 0 32px;
}

.card {
  display: flex;
  gap: 32px;
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.card:last-child {
  border-bottom: none;
}

.card-photos {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  align-self: flex-start;
}

.card-photos img {
  width: 160px;
  height: 200px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #252523;
  display: block;
}

.card-text {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.35;
}

.card-bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ===== Dot Navigation ===== */
.dot-nav {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 100;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  display: block;
  text-decoration: none;
  flex-shrink: 0;
}

.dot:hover,
.dot.active {
  background: var(--accent);
  transform: scale(1.5);
}

.dot-separator {
  height: 6px;
  flex-shrink: 0;
}

.dot-tooltip {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 3px 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border-radius: 3px;
}

.dot:hover .dot-tooltip {
  opacity: 1;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 32px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ===== Footer ===== */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

#footer-text {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  header {
    padding: 48px 0 36px;
  }

  #about,
  #index-section {
    padding: 40px 0;
  }

  .name-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 16px;
  }

  .card {
    flex-direction: column;
    gap: 20px;
    padding: 36px 0;
  }

  .card-photos {
    justify-content: center;
  }

  .card-photos img {
    width: 130px;
    height: 165px;
  }

  .card-name {
    font-size: 1.15rem;
  }

  .dot-nav {
    display: none;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .name-grid {
    grid-template-columns: 1fr;
  }

  .card-photos img {
    width: 110px;
    height: 140px;
  }
}