:root {
  --bg: #0b1b3b;
  --bg-2: #0e234d;
  --text: #ffffff;
  --muted: #c9d6ffcc;
  --card: #112a60;
  --accent: #5fa8ff;
  --ring: #93c5fd;
  --shadow: 0 10px 25px rgba(2, 6, 23, 0.45);
  --radius: 18px;
  --face-y: 20%;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  background:#021427;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  margin: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 20px 80px;
  position: relative;
}

header { text-align: center; margin-bottom: 36px; position: relative; }
h1 { font-size: clamp(28px, 3vw, 40px); margin: 0 0 8px; letter-spacing: 0.5px; }
.subtitle { color: var(--muted); margin: 0 auto; max-width: 60ch; font-size: 15px; }

/* BACK button (top-left) */
.back-btn {
  position: fixed;
  top: 16px; left: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06);
  color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.16);
  padding: 8px 12px; border-radius: 12px; font-size: 14px;
  backdrop-filter: blur(6px) saturate(140%);
  transition: background .2s ease, border-color .2s ease, transform .06s ease;
  z-index: 60;
}
.back-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.28); }
.back-btn:active { transform: translateY(1px); }

/* Language toggle (top-right of header) */
.lang-switch {
  position: absolute; right: 0; top: 0; display: inline-flex; gap: 8px; align-items: center;
}
.lang-btn {
  appearance: none; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06);
  color: #fff; padding: 6px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s ease, border-color .2s ease, transform .06s ease;
}
.lang-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.28); }
.lang-btn:active { transform: translateY(1px); }
.lang-btn[aria-pressed="true"] { outline: 2px solid var(--ring); }
.lang-flag { font-size: 16px; }

/* GRID */
.team-grid{
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
}
@media (max-width: 980px){ .team-grid{ grid-template-columns: repeat(3,1fr); } }
@media (max-width: 640px){ .team-grid{ grid-template-columns: repeat(2,1fr); } }

.card{
  background: none;
  border: none;
  padding: 18px 16px 20px;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  cursor: pointer;
  outline: none;
}
.card:focus-visible{ box-shadow: 0 0 0 3px var(--ring), var(--shadow); }
.card:hover{ transform: translateY(-4px); border-color: rgba(255,255,255,0.16); }

/* AVATAR */
.avatar{
  width: 100%;
  max-width: 240px;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  margin: 6px auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(2,6,23,.25);
}
.avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% var(--face-y);
  display: block;
}

/* captions */
.name{
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: whitesmoke;
}
.role{
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* MODAL */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(4px);
  z-index: 50;
}
.modal-backdrop.open{ display: flex; }

.modal{
  width: min(780px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;

  background: rgba(9, 25, 56, 0.65);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}

.modal-header{
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* MODAL AVATAR */
.modal-avatar{
  width: clamp(180px, 28vmin, 260px);
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  flex: 0 0 auto;
  box-shadow: 0 10px 28px rgba(2,6,23,.28);
}
.modal-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% var(--face-y);
  display: block;
}

.modal-title{ display: grid; gap: 2px; }
.modal-title .name{ text-align: left; font-size: 20px; }
.modal-title .role{ text-align: left; color: var(--muted); }

.close-btn{
  display: none;
  margin-left: auto;
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background .2s ease, border-color .2s ease, transform .08s ease;
}
.close-btn:hover{ background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,.28); }
.close-btn:active{ transform: translateY(1px); }

.modal-body{
  padding: 18px 22px 24px;
  overflow: auto;
  min-height: 0;
}
.bio{ color: var(--muted); margin-bottom: 18px; }

.meta-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 720px){ .meta-grid{ grid-template-columns: 1fr; } }

.meta-card{
  background: #0b1f4a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
}
.meta-title{ font-size: 12px; text-transform: uppercase; opacity: .8; letter-spacing: .08em; margin-bottom: 4px; }
.meta-content{ font-size: 14px; }

a.inline{ color: var(--accent); text-decoration: none; }
a.inline:hover{ text-decoration: underline; }

/* MOBILE modal + language switch */
@media (max-width: 720px){
  .modal-backdrop{ padding: 12px; }
  .modal{ width: min(520px, 94vw); max-height: 88vh; }
  .modal-header{ display: block; padding: 14px 16px 12px; }
  .modal-avatar{ width: 100%; max-width: 520px; margin: 0 auto 12px auto; aspect-ratio: 4 / 5; border-radius: 16px; }
  .modal-title{ text-align: center; margin-top: 6px; }
  .modal-title .name,
  .modal-title .role{ text-align: center; }
  .close-btn{ position: absolute; top: 8px; right: 8px; padding: 6px 9px; font-size: 13px; }
  .modal-body{ padding: 14px 16px 16px; }
  .lang-switch{ position: static; margin-top: 10px; justify-content: center; }
}

/* FOOTER */
.footer{
  width: 100%;
  background-color: transparent;
  padding: 24px 20px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.footer-content{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.footer-socials{ display: flex; gap: 20px; margin-left: 0; }
.footer-socials a{ color: #fff; font-size: 1.2rem; transition: color 0.3s ease; }
.footer-socials a:hover{ color: #60c7ff; }
@media (max-width: 640px){
  .footer-content{ flex-direction: column; text-align: center; }
}
