/* ==========================================================================
   HUST (Hongik University Security Team) - Modern Engineering Theme
   Clean, sleek, restrained developer aesthetic (No excessive AI/cyberpunk gimmicks)
   ========================================================================== */

:root {
  /* Color Palette - Modern Zinc & Deep Charcoal */
  --bg-page: #09090b;
  --bg-surface: #121215;
  --bg-card: #18181b;
  --bg-card-hover: #202024;
  --bg-input: #121215;
  --bg-subtle: #27272a;
  
  --border: #27272a;
  --border-hover: #3f3f46;
  --border-focus: #3b82f6;
  
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-subtle: rgba(59, 130, 246, 0.1);
  --accent-border: rgba(59, 130, 246, 0.25);
  
  --emerald: #10b981;
  --emerald-subtle: rgba(16, 185, 129, 0.1);
  --rose: #f43f5e;
  --rose-subtle: rgba(244, 63, 94, 0.1);
  --amber: #f59e0b;
  --amber-subtle: rgba(245, 158, 11, 0.1);
  
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container-max: 1140px;
  --transition: all 0.15s ease-in-out;
}

/* Optional Clean Light Mode */
body.light {
  --bg-page: #ffffff;
  --bg-surface: #f4f4f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f4f4f5;
  --bg-input: #ffffff;
  --bg-subtle: #e4e4e7;
  
  --border: #e4e4e7;
  --border-hover: #d4d4d8;
  --border-focus: #3b82f6;
  
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.2);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  background-color: var(--bg-page);
  color: var(--text-primary);
}

/* Layout Container */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

p {
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* Section Common */
section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 2.75rem;
}

.section-header.text-center {
  text-align: center;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 1.95rem;
  margin-bottom: 0.6rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 580px;
}

.section-header.text-center .section-subtitle {
  margin: 0 auto;
}

/* Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: height 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, box-shadow 0.25s ease;
}

.navbar.scrolled {
  height: 48px;
  background: rgba(9, 9, 11, 0.94);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

body.light .navbar {
  background: rgba(255, 255, 255, 0.88);
}

body.light .navbar.scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  height: 30px;
  width: auto;
  max-width: 135px;
  object-fit: contain;
  display: block;
  transition: height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar.scrolled .brand img {
  height: 26px;
}

.brand img.logo-light {
  display: none !important;
}

.brand img.logo-dark {
  display: block !important;
}

body.light .brand img.logo-light {
  display: block !important;
}

body.light .brand img.logo-dark {
  display: none !important;
}

.brand-text {
  display: none;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.25rem;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-page);
  border-color: var(--text-primary);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

/* User Auth Slot in Nav */
.user-menu-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-badge-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.role-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--emerald-subtle);
  color: var(--emerald);
}

.role-badge.admin {
  background: var(--rose-subtle);
  color: var(--rose);
}

/* Hero Section */
.hero {
  padding: 6.5rem 0 5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.75rem;
}

.hero-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.hero-title span.accent-text {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2.25rem;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

/* Key Metrics / Stats Strip */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 860px;
  margin: 0 auto;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 0.2rem;
  font-family: var(--font-sans);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Cards & Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.card-header-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.25rem;
}

.tag-badge {
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--font-mono);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Pillars Grid (About) */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
}

.pillar-index {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 0.6rem;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-surface);
  border-color: var(--border);
  font-weight: 600;
}

/* Search Bar */
.search-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--border-focus);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 15px;
  height: 15px;
}

/* Notice List Items */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.notice-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.notice-row:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.notice-row.pinned {
  border-left: 3px solid var(--accent);
}

.notice-row-left {
  flex: 1;
}

.notice-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.notice-row-meta span {
  white-space: nowrap;
  flex-shrink: 0;
}

.notice-pinned-tag {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
}

.category-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.48rem;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
}

.category-pill.writeup {
  color: var(--accent);
  background: var(--accent-subtle);
  border-color: var(--accent-border);
}

.notice-row-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notice-row-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.notice-row-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mini CTF Section */
.ctf-overview-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

.challenge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.challenge-card.solved {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.02);
}

.challenge-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.difficulty-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.difficulty-pill.Baby { background: var(--emerald-subtle); color: var(--emerald); }
.difficulty-pill.Easy { background: var(--accent-subtle); color: var(--accent); }
.difficulty-pill.Medium { background: var(--amber-subtle); color: var(--amber); }
.difficulty-pill.Hard { background: var(--rose-subtle); color: var(--rose); }

.points-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.challenge-form {
  margin-top: auto;
  padding-top: 1.25rem;
}

.challenge-input-group {
  display: flex;
  gap: 0.5rem;
}

.challenge-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  outline: none;
}

.challenge-input:focus {
  border-color: var(--border-focus);
}

.hint-toggle-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 0.65rem;
  display: inline-block;
}

.hint-toggle-text:hover {
  color: var(--text-secondary);
}

/* Recruitment Layout */
.recruit-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2rem;
}

.recruit-info-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.step-item {
  display: flex;
  gap: 0.9rem;
}

.step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-label span.req {
  color: var(--rose);
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  animation: modalFadeIn 0.15s ease-out;
}

.modal-box.modal-lg {
  max-width: 900px;
}

.modal-box.modal-xl {
  max-width: 1120px;
  width: 95%;
}

.admin-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding: 0.25rem 1.5rem 0;
  background: var(--bg-surface);
  overflow-x: auto;
}

.admin-nav-tab {
  padding: 0.8rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.admin-nav-tab:hover {
  color: var(--text-primary);
}

.admin-nav-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.modal-header {
  padding: 1.15rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  line-height: 1.65;
}

/* Admin Data Table */
.data-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.data-table th {
  background: var(--bg-surface);
  padding: 0.7rem 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: var(--bg-surface);
}

.status-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.status-tag.APPROVED { background: var(--emerald-subtle); color: var(--emerald); }
.status-tag.PENDING { background: var(--amber-subtle); color: var(--amber); }
.status-tag.SUSPENDED { background: var(--rose-subtle); color: var(--rose); }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  animation: toastSlideIn 0.2s ease-out;
}

.toast.success { border-color: rgba(16, 185, 129, 0.4); }
.toast.error { border-color: rgba(244, 63, 94, 0.4); }

/* ==========================================
   President Greeting & History Timeline
   ========================================== */
.greeting-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.greeting-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, var(--emerald) 100%);
}

.president-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.president-avatar-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.president-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.president-role {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.greeting-quote {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  word-break: keep-all;
}

.greeting-body p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
  word-break: keep-all;
}

.greeting-signature {
  margin-top: 1.5rem;
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* History Timeline Styles */
.timeline {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--emerald) 50%, var(--border) 100%);
}

.timeline-item {
  position: relative;
  padding-left: 54px;
  margin-bottom: 2.25rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 11px;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
  z-index: 2;
}

.timeline-item.current .timeline-dot {
  border-color: var(--emerald);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.6);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  transition: var(--transition);
}

.timeline-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.timeline-year {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
}

.timeline-current-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-top: 0.65rem;
}

.timeline-desc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-desc li {
  margin-bottom: 0.4rem;
  position: relative;
  padding-left: 1.2rem;
  word-break: keep-all;
}

.timeline-desc li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Footer */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  margin-top: 0.65rem;
  max-width: 380px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Media Queries
   Fixes all horizontal overflowing, awkward widths, and mobile usability
   ========================================================================== */

@media (max-width: 860px) {
  .hero-title { font-size: 2.25rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .recruit-grid { grid-template-columns: 1fr; }
  .pillars-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  
  /* Responsive Navbar Height */
  .navbar {
    height: 52px;
  }
  .navbar.scrolled {
    height: 46px;
  }
  .navbar .brand img {
    height: 26px;
  }
  .navbar.scrolled .brand img {
    height: 23px;
  }

  /* Mobile Navigation Drawer */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-page);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    z-index: 999;
  }
  .nav-links.active {
    display: flex !important;
  }
  .nav-links li {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  .nav-links a {
    display: block;
    padding: 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
  }
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  /* Prevent horizontal screen overscrolling */
  body, html {
    overflow-x: hidden;
    width: 100%;
  }

  .container {
    padding: 0 1rem;
    width: 100%;
    max-width: 100%;
  }

  /* Hero Section */
  .hero-title {
    font-size: 1.85rem;
    line-height: 1.3;
    word-break: keep-all;
  }
  .hero-desc {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  .hero-cta {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  /* Grid Layouts - Full Single Column */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .stat-card {
    padding: 1rem 0.75rem;
  }
  .stat-value {
    font-size: 1.35rem;
  }
  .stat-label {
    font-size: 0.75rem;
  }

  .feature-grid, .grid-3, .challenge-grid, .podium-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  /* Smooth Horizontally Swipeable Filter Tabs */
  .filter-tabs {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
    padding-bottom: 0.5rem;
    width: 100%;
  }
  .filter-tabs::-webkit-scrollbar {
    display: none;
  }
  .filter-tabs .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
  }

  /* Form & Modal Responsiveness */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .modal-box {
    width: 94%;
    max-width: 100%;
    padding: 1.25rem 1rem;
    margin: 1rem auto;
  }

  /* Table Horizontal Scrolling with indicator */
  .data-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }
  .data-table {
    min-width: 580px;
  }

  /* Notice and Toolbar Stacking */
  .board-header-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }
  .board-header-actions > * {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Challenge Cards */
  .challenge-input-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  .challenge-input-group .btn {
    width: 100%;
  }

  /* Notice List Cards Mobile Optimization */
  .notice-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.95rem 1.1rem;
    gap: 0.5rem;
  }
  .notice-row-left {
    width: 100%;
  }
  .notice-row-title {
    font-size: 0.95rem;
    line-height: 1.45;
    word-break: keep-all;
  }
  .notice-row-summary {
    font-size: 0.82rem;
    line-height: 1.5;
    word-break: keep-all;
  }
  .notice-row-right {
    width: 100%;
    justify-content: flex-end;
    font-size: 0.75rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--border);
  }
}

@media (max-width: 420px) {
  .navbar {
    height: 48px;
  }
  .navbar.scrolled {
    height: 42px;
  }
  .navbar .brand img {
    height: 24px;
  }
  .navbar.scrolled .brand img {
    height: 21px;
  }
  .hero-title {
    font-size: 1.65rem;
  }
  .container {
    padding: 0 0.85rem;
  }
  .brand-badge {
    display: none;
  }
  .stat-card {
    padding: 0.85rem 0.5rem;
  }
  .stat-value {
    font-size: 1.2rem;
  }
}
