/* =============================================
   JIMMYSAINT.COM -- Style Sheet
   Editorial / Academic / Paper-like
   ============================================= */

/* --- CSS Variables --- */
:root {
  --color-bg: #FAFAF8;
  --color-surface: #FFFFFF;
  --color-text: #1a1a1a;
  --color-text-secondary: #4a4a4a;
  --color-muted: #6b7280;
  --color-accent: #7B9EB8;
  --color-accent-hover: #6589a3;
  --color-border: #e5e7eb;
  --color-border-light: #f0f0ee;
  --color-sidebar-bg: #2c3e50;
  --color-sidebar-text: #e8edf2;
  --color-sidebar-muted: #94a3b8;
  --color-thumb-tax: #f0f4f8;
  --color-thumb-retire: #f4f0f8;
  --color-thumb-india: #f8f4f0;

  --font-display: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --sidebar-width: 240px;
  --max-content-width: 720px;
  --gutter: 60px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  min-height: 100vh;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-accent-hover);
}

/* --- Layout --- */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* --- Mobile Header (hidden on desktop) --- */
.mobile-header {
  display: none;
}

/* --- Mobile Nav Overlay (hidden on desktop) --- */
.mobile-nav {
  display: none;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding-top: 80px;
  background-color: var(--color-sidebar-bg);
  padding-left: 28px;
  padding-right: 28px;
  min-height: 100vh;
}

.sidebar-inner {
  position: sticky;
  top: 80px;
}

.site-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-sidebar-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 12px;
}

.site-name:hover {
  color: #ffffff;
}

.site-description {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-sidebar-muted);
  margin-bottom: 36px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav .nav-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.mobile-nav .nav-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.sidebar-nav .nav-link:hover {
  color: #a8c4d8;
}

.mobile-nav .nav-link:hover {
  color: var(--color-accent-hover);
}

.sidebar-nav .nav-link.active {
  color: var(--color-sidebar-text);
  font-weight: 700;
}

.mobile-nav .nav-link.active {
  color: var(--color-text);
  font-weight: 700;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  min-width: 0;
  max-width: var(--max-content-width);
  padding-top: 80px;
  padding-bottom: 80px;
  border-left: 1px solid var(--color-border);
  padding-left: var(--gutter);
  margin-left: 24px;
}

/* --- Page Heading --- */
.page-heading {
  margin-bottom: 32px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 32px;
}

.tab {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  background: none;
  border: none;
  padding: 10px 20px 12px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.tab:first-child {
  padding-left: 0;
}

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

.tab.active {
  color: var(--color-text);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-accent);
}

.tab:first-child.active::after {
  left: 0;
}

.tab-count {
  font-weight: 400;
  color: var(--color-muted);
}

.tab.active .tab-count {
  color: var(--color-muted);
}

/* --- Project List --- */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-item {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  align-items: flex-start;
}

.project-item:first-child {
  padding-top: 4px;
}

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

/* --- Thumbnails --- */
.project-thumbnail {
  flex-shrink: 0;
  display: block;
  text-decoration: none;
}

.thumb {
  width: 100px;
  height: 80px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-thumbnail:hover .thumb {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.thumb-tax {
  background: linear-gradient(135deg, #e8f0f8 0%, #dce8f0 100%);
  color: #5a7d95;
}

.thumb-retire {
  background: linear-gradient(135deg, #ede8f4 0%, #e0daf0 100%);
  color: #7a6895;
}

.thumb-india {
  background: linear-gradient(135deg, #f4ede4 0%, #efe6d8 100%);
  color: #957a5a;
}

.thumb-storage {
  background: linear-gradient(135deg, #e4f0e8 0%, #d8efe0 100%);
  color: #5a9570;
}

.thumb-fint {
  background: linear-gradient(135deg, #e4e8f4 0%, #d8dff0 100%);
  color: #5a6895;
}

.thumb-iran {
  background: linear-gradient(135deg, #f4ede0 0%, #f0e6d4 100%);
  color: #957855;
}

.thumb-reb {
  background: linear-gradient(135deg, #f0ede8 0%, #e8e4de 100%);
  color: #7a7060;
}

.thumb-ai {
  background: linear-gradient(135deg, #eae8f4 0%, #dddaf0 100%);
  color: #6a62a0;
}

.thumb-game {
  background: linear-gradient(135deg, #f4e8e8 0%, #f0dede 100%);
  color: #956060;
}

.thumb-taiwan {
  background: linear-gradient(135deg, #e8f0ec 0%, #dfe8e4 100%);
  color: #5a8070;
}

.thumb-belize {
  background: linear-gradient(135deg, #e0f0ee 0%, #d4ece8 100%);
  color: #4a8880;
}

.thumb-icon {
  opacity: 0.7;
}

.thumb-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
}

/* --- Project Info --- */
.project-info {
  flex: 1;
  min-width: 0;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.35;
  display: inline-block;
}

.project-title:hover {
  color: var(--color-accent);
}

.badge-protected {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  background: var(--color-border-light);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}

.project-subtitle {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-top: 2px;
  margin-bottom: 6px;
}

.project-description {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
}

.project-category {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  text-transform: uppercase;
}

/* --- Empty State --- */
.empty-state {
  padding: 48px 0;
}

.empty-state p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--color-muted);
}

/* --- About Section --- */
.about-content {
  padding-top: 8px;
}

.about-heading {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  line-height: 1.2;
}

.about-body p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  max-width: 560px;
}

.about-body p:last-child {
  margin-bottom: 0;
}

/* --- Tool View --- */
.tool-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border);
}

.tool-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.tool-back-btn:hover {
  color: var(--color-accent-hover);
}

.tool-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-muted);
}

.tool-iframe {
  width: 100%;
  min-height: calc(100vh - 140px);
  border: none;
  border-radius: 0;
  background: var(--color-bg);
}

/* --- Footer --- */
.footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.back-to-top {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.back-to-top:hover {
  color: var(--color-accent);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  /* Show mobile header */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .mobile-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
  }

  .hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
  }

  .hamburger span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Mobile Nav */
  .mobile-nav {
    display: block;
    position: fixed;
    top: 55px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 20px;
    z-index: 99;
    transform: translateY(-120%);
    transition: transform 0.25s ease;
  }

  .mobile-nav.open {
    transform: translateY(0);
  }

  .mobile-nav nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-nav .nav-link {
    font-size: 1rem;
    padding: 8px 0;
  }

  /* Hide desktop sidebar */
  .sidebar {
    display: none;
  }

  .main-content {
    border-left: none;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 32px;
    padding-bottom: 48px;
    max-width: 100%;
    margin-left: 0;
  }

  .layout {
    padding: 0;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .page-heading {
    margin-bottom: 24px;
  }

  .tabs {
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    font-size: 0.75rem;
    padding: 8px 14px 10px;
  }

  .project-item {
    gap: 16px;
    padding: 20px 0;
  }

  .thumb {
    width: 72px;
    height: 60px;
  }

  .thumb-icon svg {
    width: 22px;
    height: 22px;
  }

  .project-title {
    font-size: 1rem;
  }

  .project-description {
    font-size: 0.87rem;
  }

  .project-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Tool view mobile adjustments */
  .tool-header {
    gap: 10px;
    padding-bottom: 12px;
  }

  .tool-back-btn {
    font-size: 0.8rem;
  }

  .tool-title {
    font-size: 0.9rem;
  }

  .tool-iframe {
    min-height: calc(100vh - 120px);
  }
}

@media (max-width: 480px) {
  .project-item {
    flex-direction: column;
    gap: 12px;
  }

  .thumb {
    width: 100%;
    height: 56px;
  }
}
