:root {
  --bg-color: #f5f5dc;           /* Light mode background: Beige */
  --text-color: #000000;         /* Light mode text: Black */
  --tile-bg: #000000;            /* Light mode tile: Black */
  --tile-text: #f5f5dc;          /* Light mode tile text: Beige */
  --tile-hover-bg: #1a1a1a;
  --tile-border: rgba(0, 0, 0, 0.1);
  --button-bg: #000000;          /* Light mode button background: Black */
  --button-text: #f5f5dc;        /* Light mode button text: Beige */
  --button-hover-bg: #333333;
}

body.dark-theme {
  --bg-color: #000000;           /* Dark mode background: Black */
  --text-color: #f5f5dc;         /* Dark mode text: Beige */
  --tile-bg: #f5f5dc;            /* Dark mode tile: Beige */
  --tile-text: #000000;          /* Dark mode tile text: Black */
  --tile-hover-bg: #e0e0c0;
  --tile-border: rgba(255, 255, 255, 0.1);
  --button-bg: #f5f5dc;          /* Dark mode button background: Beige */
  --button-text: #000000;        /* Dark mode button text: Black */
  --button-hover-bg: #dcdcb8;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}

h1, h2, h3, h4, h5, h6, p, a, span, button {
  color: var(--text-color);
  transition: color 0.3s ease;
}

header {
  text-align: center;
  padding: 60px 20px 10px;
}

header h1 {
  font-size: 3.5em;
  font-weight: 700;
  margin-bottom: 8px;
}

header p {
  font-size: 1.1em;
  font-weight: 300;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  max-width: 1100px;
  margin: 60px auto 50px;
  padding: 0 20px;
}

.tile {
  background-color: var(--tile-bg);
  border-radius: 15px;
  padding: 30px 20px;
  text-align: center;
  transition: all 0.3s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--tile-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.tile h2,
.tile p {
  color: var(--tile-text);
  transition: color 0.3s ease;
}

.tile:hover {
  transform: translateY(-6px);
  background-color: var(--tile-hover-bg);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.tile h2 {
  margin-bottom: 8px;
  font-size: 1.4em;
  font-weight: 600;
}

.tile p {
  font-size: 0.95em;
}

footer {
  text-align: center;
  color: var(--text-color);
  font-size: 0.9em;
  padding: 30px 10px;
}

/* Home button (on non-index pages) */
.home-button {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 10px 18px;
  font-size: 15px;
  background-color: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  border-radius: 6px;
  border: none;
  transition: background-color 0.3s, color 0.3s;
}

.home-button:hover {
  background-color: var(--button-hover-bg);
}

/* Floating Theme Switch */
.theme-switch {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.theme-switch input {
  display: none;
}

.theme-switch .slider {
  width: 50px;
  height: 26px;
  background-color: var(--button-bg);
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.4s;
  display: inline-block;
}

.theme-switch .slider::before {
  content: "☀️";
  position: absolute;
  left: 4px;
  top: 3px;
  height: 20px;
  width: 20px;
  background-color: var(--button-text);
  color: var(--button-bg);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.4s, background-color 0.4s, color 0.4s;
}

.theme-switch input:checked + .slider::before {
  transform: translateX(24px);
  content: "🌙";
  background-color: var(--button-text);
  color: var(--button-bg);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  header h1 {
    font-size: 2.4em;
  }

  header p {
    font-size: 1em;
  }

  .tiles {
    margin-top: 40px;
    gap: 20px;
  }

  .theme-switch .slider {
    width: 44px;
    height: 24px;
  }

  .theme-switch .slider::before {
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
  }
}
