:root {
  --primary-color: #2563eb;
  /* Modern blue */
  --primary-hover: #1d4ed8;
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --border-color: #e2e8f0;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --max-width: 60rem;
  --spacing-unit: 1rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: var(--font-serif);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 1.125rem;
  /* 18px equivalent */
  padding: var(--spacing-unit);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.75em;
  color: var(--text-primary);
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

/* Layout Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  background-color: var(--surface-color);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  flex: 1;
}

/* Header & Navigation */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-sans);
}

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

nav a {
  font-family: var(--font-sans);
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

nav a:hover {
  background-color: var(--bg-color);
  color: var(--primary-color);
  text-decoration: none;
}

/* Main Content */
main {
  text-align: center;
}

.hero-text {
  margin: 2rem 0;
}

.hero-text h2 {
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.fractal-image {
  margin: 2rem auto;
  max-width: 80%;
  /* Don't let it take over the whole screen */
}

/* Table Styles (for other pages like lift.html) */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--bg-color);
  font-weight: 600;
}

/* Link Grid System */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.link-card {
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.link-card h2 {
  font-size: 1.25rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-list a {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}

.link-list a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Responsive adjustments */
/* Responsive adjustments */
@media (max-width: 600px) {
  body {
    padding: 0;
  }

  .container {
    padding: 1.25rem;
    border-radius: 0;
    /* Full width on mobile looks cleaner */
    box-shadow: none;
  }

  header {
    flex-direction: column;
    align-items: center;
    /* Center title */
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    text-align: center;
  }

  .site-title {
    font-size: 1.75rem;
    /* Slightly larger for presence */
  }

  /* Horizontal Scrollable Menu (Pills) */
  nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    /* Space for scrollbar if visible */
    justify-content: flex-start;
    /* Start from left */
    /* Hide scrollbar for cleaner look in some browsers */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav a {
    flex: 0 0 auto;
    /* Don't shrink */
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 0.95rem;
    white-space: nowrap;
  }

  nav a:hover,
  nav a:active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
  }

  /* Hero Text adjustments */
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .hero-text h2 {
    font-size: 1.25rem;
  }

  /* Table scrolling fix */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}