/* 
 * Roydon D'Souza - Personal Website
 * Handcrafted ~ 2026
 */

:root {
  /* Colors - Minimal & Professional */
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --text-light: #555555;
  --accent-color: #0d09ff;
  /* Keeping the original blue accent */
  --accent-hover: #0a07c2;
  --border-color: #eeeeee;
  --code-bg: #f5f5f5;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  /* Keeping Lora for that professional/editorial feel if desired, otherwise all sans */

  /* Spacing */
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 32px;
  --spacing-xl: 64px;

  /* Layout */
  --container-width: 800px;
  --header-height: 70px;
}

/* Dark Mode overrides */
[data-theme="dark"] {
  --bg-color: #0a0a0a;
  --text-color: #f0f0f0;
  --text-light: #a0a0a0;
  --border-color: #2a2a2a;
  --code-bg: #1a1a1a;
  --accent-color: #8ab4f8;
  /* Softer, lighter blue for better contrast on dark */
  --accent-hover: #aecbfa;
}

[data-theme="dark"] header {
  background-color: rgba(10, 10, 10, 0.9);
}

/* Switch Design */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin-bottom: -4px;
  /* Vertical align adjustment */
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e0e0;
  /* Light mode base */
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Checked (Dark Mode) State */
input:checked+.slider {
  background-color: var(--accent-color);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

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

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: 1.75rem;
  margin-top: var(--spacing-xl);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-sm);
}

h3 {
  font-size: 1.25rem;
  margin-top: var(--spacing-lg);
}

p {
  margin-bottom: var(--spacing-md);
  font-size: 1.05rem;
}

.intro-text {
  font-size: 1.25rem;
  color: var(--text-light);
  font-weight: 300;
}

/* Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Header & Nav */
header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}



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

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-color);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
  /* Increased from 16px to give toggle breathin room */
  align-items: center;
  /* Ensures vertical alignment of text and icon */
}

nav a {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
}

nav a:hover,
nav a.active {
  color: var(--accent-color);
  text-decoration: none;
}

/* Sections */
section {
  padding: var(--spacing-xl) 0;
}

/* Hero Section */
.hero {
  padding: 120px 0 80px;
}

/* Footer */
footer {
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Utilities */
.text-center {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.social-links {
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-start;
  margin-top: var(--spacing-lg);
  list-style: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --container-width: 100%;
    --spacing-lg: 24px;
    --spacing-xl: 48px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero {
    padding: 100px 0 60px;
  }

}

@media (max-width: 480px) {

  /* Tighten header for small screens */
  header .container {
    padding: 0 12px;
  }

  .brand {
    font-size: 1rem;
    max-width: 140px;
    /* Force truncation if needed or just smaller */
  }

  nav ul {
    gap: 12px;
  }

  nav a {
    font-size: 0.85rem;
  }

  h1 {
    font-size: 1.75rem;
  }
}