/* =========================
   VARIABLES (HIGH CONTRAST)
========================= */
:root {
  --bg: #f4f4f5; 
  --surface: #ffffff;
  --surface-2: #e4e4e7;
  
  --text: #09090b; 
  --text-muted: #3f3f46; 
  --text-light: #52525b; 
  
  --primary: #0066cc;
  --primary-text: #ffffff;
  
  --header-bg: rgba(255, 255, 255, 0.85);
  --border: #d2d2d7;
  
  --shadow: rgba(0, 0, 0, 0.05);
  --shadow-hover: rgba(0, 0, 0, 0.12);
  
  --img-bg: #ffffff;
}

[data-theme="dark"] {
  --bg: #000000;
  --surface: #18181b;
  --surface-2: #27272a;
  
  --text: #ffffff; 
  --text-muted: #d4d4d8; 
  --text-light: #a1a1aa;
  
  --primary: #2997ff;
  --primary-text: #ffffff;
  
  --header-bg: rgba(0, 0, 0, 0.85);
  --border: #3f3f46;
  
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-hover: rgba(0, 0, 0, 0.6);
  
  --img-bg: #e5e5ea; 
}

/* =========================
   RESET & TYPOGRAPHY
========================= */
html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand, .tabs button, .mobile-menu button {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  color: var(--text);
  letter-spacing: -0.02em;
  font-weight: 600;
}

h1 {
  font-size: 34px;
  margin-bottom: 24px;
}

h2 {
  margin-top: 0;
}

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

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

/* =========================
   TOP BAR (GLASSMORPHISM)
========================= */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background 0.3s ease, border 0.3s ease;
}

.brand {
  font-size: 20px;
}

/* =========================
   TABS (SEGMENTED CONTROL STYLE)
========================= */
.tabs {
  display: flex;
  gap: 8px;
}

.tabs button {
  background: transparent;
  border: none;
  color: var(--text); 
  opacity: 0.8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 99px;
  transition: all 0.2s ease;
}

.tabs button:hover {
  opacity: 1;
  background: var(--surface-2);
}

.tabs button.active {
  background: var(--text);
  color: var(--bg);
  opacity: 1;
  font-weight: 600;
}

/* =========================
   LAYOUT
========================= */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 50px 30px;
}

.tab {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab.active {
  display: block;
}

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

.page-wrapper {
  flex: 1;
}

/* =========================
   GENERAL CARD
========================= */
.card {
  background: var(--surface);
  color: var(--text);
  padding: 24px;
  margin-bottom: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow);
  transition: all 0.3s ease;
}

/* =========================
   MODAL
========================= */
.img-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.zoomed-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  background: var(--img-bg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* =========================
   BUTTONS
========================= */
.read-btn {
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
  padding: 0;
}

/* =========================
   FOOTER (HIGH VISIBILITY)
========================= */
.site-footer {
  margin-top: 60px;
  padding: 30px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-icons img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.8;
  transition: transform 0.3s ease, opacity 0.3s ease;
  background: #ffffff; /* keeps partner logos legible */
  border-radius: 8px;
  padding: 4px;
}

.footer-icons img:hover {
  transform: translateY(-4px) scale(1.05);
  opacity: 1;
}

.footer-text {
  font-size: 15px; 
  color: var(--text); 
  font-family: -apple-system, sans-serif;
  font-weight: 500;
}

/* =========================
   THEME TOGGLE
========================= */
.theme-switch {
  position: relative;
  width: 60px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] .switch-thumb {
  transform: translateX(28px);
}

.sun, .moon {
  position: absolute;
  font-size: 14px;
  pointer-events: none;
  z-index: 0;
}

.sun { left: 6px; }
.moon { right: 6px; }

/* =========================
   MOBILE MENU & OVERLAY
========================= */
.left-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-btn {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: -240px;          
  width: 200px;
  height: 100%;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--border);
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 2000;
}

.mobile-menu button {
  background: transparent;
  border: none;
  color: var(--text); 
  font-size: 16px;
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mobile-menu button:hover {
  background: var(--surface-2);
}

.mobile-menu.open { left: 0; }

.overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 1500;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* =========================
   RESPONSIVE DESIGN
========================= */
@media (max-width: 900px) {
  .pub-bottom { grid-template-columns: 1fr; }
  .about-section { grid-template-columns: 1fr; }
  .topbar { padding: 16px 24px; }
}

@media (max-width: 768px) {
  .menu-btn { display: block; }
  .desktop-tabs { display: none; }
  .container { padding: 40px 20px; }
}