:root {
  --bg: #0a1430;
  --panel: #0f203d;
  --card: rgba(255, 255, 255, 0.04);
  --text: #e8edf7;
  --muted: #b4c0d5;
  --accent: #1d4ed8;
  --accent-2: #3b82f6;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
}

body.light {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #374151;
  --accent: #1d4ed8;
  --accent-2: #3b82f6;
  --border: rgba(15, 23, 42, 0.14);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(76, 129, 255, 0.22) 0%, rgba(10, 20, 48, 0.1) 30%, rgba(10, 20, 48, 0.4) 70%, rgba(10, 20, 48, 0.7) 100%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.light {
  background:
    linear-gradient(180deg, rgba(96, 165, 255, 0.25) 0%, rgba(243, 246, 251, 0.6) 30%, rgba(243, 246, 251, 0.9) 100%),
    var(--bg);
}

h1, h2, h3 { font-family: 'Source Serif 4', 'Sora', serif; margin: 0 0 8px; }
h2 { font-size: clamp(24px, 2.6vw, 30px); }
h3 { font-size: 22px; }
p { margin: 0 0 12px; color: var(--muted); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 28px;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mobile-sidebar { display: none; }

.identity-card, .card, .quick-stats {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.identity-card h1 { font-size: 24px; }
.subtitle { color: var(--text); font-weight: 600; }
.subtitle.small { font-size: 13px; opacity: 0.9; }
.meta { color: var(--muted); font-size: 14px; }
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.18);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
}
body.light .badge { background: rgba(29, 78, 216, 0.12); color: var(--accent); }

.contact-actions { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.download { margin-top: 10px; }
.download .note { color: var(--muted); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(12, 23, 48, 0.9), rgba(12, 23, 48, 0.65));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
body.light .topbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  border-color: rgba(15, 23, 42, 0.08);
}
.brand { font-weight: 700; color: var(--text); }
.brand { text-decoration: none; }
.brand-accent { color: var(--accent); }
body:not(.light) .brand-accent { color: #9cc4ff; }
.nav { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--text); font-weight: 600; padding: 6px 8px; border-radius: 10px; }
.nav a:hover { background: rgba(255,255,255,0.08); text-decoration: none; }
body.light .nav a:hover { background: rgba(15, 23, 42, 0.08); }
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  align-items: center;
  gap: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(76, 136, 255, 0.3); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.block { width: 100%; justify-content: center; }
.btn.tiny { padding: 8px 10px; font-size: 13px; border-radius: 10px; }
body.light .btn { color: #fff; }
body.light .btn.ghost { color: var(--text); }

.quick-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
}
.stat-title { color: var(--muted); font-size: 13px; }
.stat-value { color: var(--text); font-weight: 700; }

.content { display: flex; flex-direction: column; gap: 18px; }
.card { box-shadow: var(--shadow); }
.section-header { margin-bottom: 12px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.4px; font-size: 12px; color: var(--accent); margin: 0 0 6px; }

.intro { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 18px; }
.hero-photo img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
  box-shadow: var(--shadow);
}

.slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  touch-action: pan-y;
}
.slides { display: flex; transition: transform 0.4s ease; }
.slide { min-width: 100%; }
.slide img { width: 100%; height: 420px; object-fit: cover; display: block; }
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  padding: 10px 12px;
  border-radius: 50%;
  cursor: pointer;
}
.slider-btn:hover { background: rgba(0,0,0,0.55); }
.slider-btn.prev { left: 12px; }
.slider-btn.next { right: 12px; }
.dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.35);
  cursor: pointer;
}
.dot.active { background: var(--accent); border-color: transparent; }

.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.pill {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
}
body.light .pill { background: rgba(15, 23, 42, 0.06); }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 60px 1fr; gap: 12px; align-items: start; }
.timeline .when { color: var(--accent); font-weight: 700; }
.title { font-weight: 700; color: var(--text); }
.list { display: flex; flex-direction: column; gap: 12px; }
.list-item { padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-item .link { white-space: normal; }
body.light .list-item { background: rgba(255,255,255,0.9); }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cert { padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.cert-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.bullet-list { padding-left: 18px; color: var(--muted); }
.bullet-list li { margin-bottom: 8px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.gallery img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 180px;
  object-fit: cover;
}
.gallery img:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,0.35); }

.contact-block { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: center; }
.cta-bottom { display: flex; gap: 10px; flex-wrap: wrap; }

.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 20; }
.modal.active { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.65); }
.modal-body { position: relative; max-width: 90vw; max-height: 90vh; z-index: 21; }
.modal-content { background: #0b1523; padding: 10px; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.modal-content img { max-width: 80vw; max-height: 80vh; border-radius: 10px; }
.modal-loading { display: none; margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 14px; width: 100%; }
.modal-loading.show { display: block; }
.modal-close { position: absolute; top: -10px; right: -10px; border: none; background: #1f2f46; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; }

.letter-page { background: var(--bg); color: var(--text); }
.letter-wrapper { max-width: 900px; margin: 32px auto; padding: 0 20px; }
.letter-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.letter-actions { display: flex; gap: 10px; }
.letter-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.letter-address { margin-bottom: 12px; color: var(--muted); }
.letter-signoff { margin-top: 16px; }
.mobile-sidebar .quick-stats { margin-top: 12px; }

.footer { margin: 18px 0 8px; text-align: center; }
.footer .btn { min-width: 200px; }

.copy-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.copy-note.show { opacity: 1; }

@media (max-width: 1080px) {
  .page { display: flex; flex-direction: column; padding-top: 0; }
  .content { order: 1; }
  .sidebar { position: static; order: 2; }
  .intro { grid-template-columns: 1fr; }
  .modal-content img { max-width: 90vw; max-height: 80vh; }
  .slide img { height: 300px; }
  .list-item { flex-direction: column; align-items: flex-start; }
  .list-item .link { margin-top: 6px; }
}

@media (max-width: 640px) {
  .page { padding: 12px; }
  .topbar { flex-direction: row; align-items: center; gap: 10px; flex-wrap: nowrap; justify-content: space-between; width: 100%; }
  .identity-card h1 { font-size: 22px; }
  h2 { font-size: 22px; }
  .contact-actions { width: 100%; }
  .btn { width: 100%; justify-content: center; }
  .btn.ghost, .btn.primary { width: auto; }
  .nav { gap: 8px; }
  .menu-toggle { display: inline-flex; align-self: flex-start; }
  .nav { display: none; flex-direction: column; width: 100%; background: var(--panel); padding: 10px; border-radius: 12px; position: absolute; top: 60px; left: 0; right: 0; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .brand, .menu-toggle { white-space: nowrap; }
  .sidebar { display: none; }
  .mobile-sidebar { display: block; }
}
