/* Modern accessible design with dark/light mode toggle */
/* Using Atkinson Hyperlegible font for better accessibility */
/* Updated with better contrast ratios and accessibility */

/* CSS Variables for theming - WCAG AA compliant colors */
:root {
  --primary-color: #E6D7A3; /* Warm beige from AsNeeded logo background */
  --primary-dark: #D4C086;
  --primary-light: #F0E5B8;
  --base-font-size: 24px;
  --h1-font-size: 3.5rem;
  --h2-font-size: 2.5rem;
  --h3-font-size: 1.8rem;
  --lead-font-size: 1.25rem;
  --bg-color: #ffffff;
  --text-color: #202124; /* Darker for better contrast */
  --text-light: #5f6368; /* Better contrast than #aaa */
  --border-color: #dadce0;
  --shadow: rgba(0, 0, 0, 0.15);
  --header-bg: #f8f9fa;
  --section-bg: #ffffff;
  --section-alt-bg: #f1f3f4;
  --success-color: #137333;
  --warning-color: #ea4335;
}

/* Dark mode variables - WCAG AA compliant */
.theme-toggle:checked ~ * {
  --bg-color: #202124;
  --text-color: #e8eaed;
  --text-light: #9aa0a6;
  --border-color: #3c4043;
  --shadow: rgba(0, 0, 0, 0.3);
  --header-bg: #292a2d;
  --section-bg: #202124;
  --section-alt-bg: #292a2d;
  --primary-color: #F0E5B8; /* Lighter beige for dark mode */
  --primary-dark: #E6D7A3;
}

/* Dark mode text overrides for beige backgrounds */
.theme-toggle:checked ~ * .theme-toggle-icon .icon {
  stroke: black;
}

.theme-toggle:checked ~ * .font-size-btn {
  color: black;
}

.theme-toggle:checked ~ * .skills {
  color: black;
}

.theme-toggle:checked ~ * .skills h2 {
  color: black;
}

.theme-toggle:checked ~ * .skill-item h3 {
  color: black;
}

.theme-toggle:checked ~ * .skill-item p {
  color: black;
}

.theme-toggle:checked ~ * .skill-icon .heroicon {
  color: black;
}

.theme-toggle:checked ~ * .contact-cta {
  color: black;
}

.theme-toggle:checked ~ * .contact-cta:hover,
.theme-toggle:checked ~ * .contact-cta:focus {
  color: black;
}

.theme-toggle:checked ~ * .social-links a:hover,
.theme-toggle:checked ~ * .social-links a:focus {
  color: black;
}

/* Base styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Atkinson Hyperlegible', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: var(--base-font-size); /* Dynamic font size for accessibility */
}

/* Dark mode toggle */
.theme-toggle {
  display: none;
}

.theme-toggle-label {
  position: fixed;
  top: 20px;
  z-index: 1000;
  background: var(--primary-color);
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px var(--shadow);
}

.theme-toggle-label {
  right: 20px;
  width: 40px;
  height: 40px;
}

.theme-toggle-label:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
}

.theme-toggle-label:focus {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.theme-toggle-icon {
  transition: transform 0.3s ease;
}

.theme-toggle-icon .icon {
  width: 24px;
  height: 24px;
  stroke: black;
}

.theme-toggle:checked ~ * .theme-toggle-icon {
  transform: rotate(180deg);
}

.theme-toggle:checked ~ * .theme-toggle-icon .icon path {
  d: path("M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z");
}

/* Font Size Controls */
.font-size-radio {
  display: none;
}

.font-size-controls {
  position: fixed;
  top: 20px;
  right: 80px;
  z-index: 1000;
  display: flex;
  gap: 5px;
}

.font-size-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 6px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px var(--shadow);
  color: black;
  font-weight: bold;
  font-size: 12px;
  opacity: 0.7;
  flex-direction: column;
  gap: 2px;
}

.font-size-btn:hover {
  transform: scale(1.05);
  background: var(--primary-dark);
}

.font-size-btn .icon {
  display: none; /* Hide the plus icons for now */
}

.font-size-text {
  font-size: 12px;
  font-weight: bold;
}

/* Show active state for selected font size */
#font-size-1:checked ~ * .font-size-btn:nth-child(1),
#font-size-2:checked ~ * .font-size-btn:nth-child(2),
#font-size-3:checked ~ * .font-size-btn:nth-child(3) {
  opacity: 1;
  background: var(--primary-dark);
}

/* Font size variations */
#font-size-1:checked ~ * {
  --base-font-size: 24px;
  --h1-font-size: 3.5rem;
  --h2-font-size: 2.5rem;
  --h3-font-size: 1.8rem;
  --lead-font-size: 1.25rem;
}

#font-size-2:checked ~ * {
  --base-font-size: 28px;
  --h1-font-size: 4rem;
  --h2-font-size: 3rem;
  --h3-font-size: 2.2rem;
  --lead-font-size: 1.5rem;
}

#font-size-3:checked ~ * {
  --base-font-size: 32px;
  --h1-font-size: 4.5rem;
  --h2-font-size: 3.5rem;
  --h3-font-size: 2.6rem;
  --lead-font-size: 1.75rem;
}


/* Typography with better contrast */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-color);
  line-height: 1.3;
}

h1 {
  font-size: var(--h1-font-size);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: var(--h2-font-size);
}

h3 {
  font-size: var(--h3-font-size);
}

p {
  font-size: 1.125rem; /* 18px for better readability */
  margin-bottom: 1rem;
  line-height: 1.7;
}

.lead {
  font-size: var(--lead-font-size);
  font-weight: 400;
  color: var(--text-light);
  line-height: 1.6;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  padding: 1rem 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px var(--shadow);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand a {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.navbar-brand a:hover,
.navbar-brand a:focus {
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--primary-color);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a:focus::after {
  width: 100%;
}

/* Header */
header {
  padding: 120px 0 80px;
  background: linear-gradient(135deg, var(--header-bg) 0%, var(--section-alt-bg) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  text-align: left;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.asneeded-section {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px var(--shadow);
  text-align: center;
  max-width: 400px;
  border: 1px solid var(--border-color);
}

.theme-toggle:checked ~ * .asneeded-section {
  background: rgba(32, 33, 36, 0.9);
  border-color: var(--border-color);
}

.app-icon {
  margin-bottom: 1rem;
}

.app-icon-image {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.app-icon-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.asneeded-section h2 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

.app-description {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  font-size: calc(var(--base-font-size) * 0.85);
}

.app-values {
  margin-bottom: 2rem;
  text-align: left;
}

.value-item {
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  font-size: calc(var(--base-font-size) * 0.75);
  line-height: 1.4;
  color: var(--text-color);
}

.value-item strong {
  color: var(--primary-color);
  display: block;
  margin-bottom: 0.25rem;
}

.source-link {
  display: block;
  margin-top: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-size: calc(var(--base-font-size) * 0.7);
  font-weight: bold;
}

.source-link:hover {
  text-decoration: underline;
}

.app-store-button {
  display: inline-block;
  transition: transform 0.3s ease;
}

.app-store-button:hover {
  transform: scale(1.05);
}

/* App Store image theming */
.app-store-image {
  width: 135px;
  height: 40px;
  display: block;
}

/* Show black version in light mode, hide white version */
.app-store-light {
  display: block;
}

.app-store-dark {
  display: none;
}

/* Show white version in dark mode, hide black version */
.theme-toggle:checked ~ * .app-store-light {
  display: none;
}

.theme-toggle:checked ~ * .app-store-dark {
  display: block;
}

.profile-image {
  margin-bottom: 2rem;
}

/* Photo styling */
.profile-photo, .about-photo {
  border-radius: 50%;
  border: 4px solid var(--primary-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.profile-photo {
  width: 350px;
  height: 350px;
  object-fit: cover;
}

.about-photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
}

.profile-photo:hover, .about-photo:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px var(--shadow);
}

/* Sections */
section {
  padding: 80px 0;
}

.intro {
  background: var(--section-bg);
}

.intro h2 {
  color: var(--text-color);
  margin-bottom: 1rem;
}

.statement {
  background: var(--section-alt-bg);
  padding: 100px 0;
}

.statement h2 {
  font-size: 2rem;
  font-weight: 400;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.5;
  color: var(--text-color);
}

/* About section */
.about {
  background: var(--section-bg);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  text-align: left;
}

.about-text h2 {
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.about-text p {
  color: var(--text-color);
}

/* Skills section - much better contrast */
.skills {
  background: var(--primary-color);
  color: black;
}

.skills h2 {
  color: black;
  margin-bottom: 3rem;
}

.skills-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
}

.skill-item {
  text-align: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  transition: transform 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.skill-item:hover {
  transform: translateY(-5px);
  background: rgba(0, 0, 0, 0.15);
}

.skill-icon {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.skill-icon .heroicon {
  width: 64px;
  height: 64px;
  stroke-width: 1.5;
  color: black;
}

.skill-item h3 {
  color: black;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 1.2rem;
}

.skill-item p {
  color: black;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
}

/* Contact section */
.contact {
  background: var(--section-alt-bg);
  padding: 100px 0;
}

.contact h2 {
  margin-bottom: 3rem;
  color: var(--text-color);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--text-color);
  font-size: 1.2rem;
  font-weight: 500;
  text-decoration: none;
  padding: 15px 30px;
  border: 2px solid var(--primary-color);
  border-radius: 50px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  justify-content: center;
}

.social-icon {
  width: 20px;
  height: 20px;
}

.social-links a:hover,
.social-links a:focus {
  background: var(--primary-color);
  color: black;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow);
}

/* Footer */
.footer {
  background: var(--section-bg);
  padding: 60px 0;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  text-align: center;
}

.coffee-link {
  display: inline-block;
  background: #ffdd00; /* Buy Me a Coffee brand yellow */
  color: #000000; /* Black text for contrast */
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 1.1rem;
  border: 2px solid #ffdd00;
}

.coffee-link:hover,
.coffee-link:focus {
  background: #ffcc00; /* Slightly darker yellow on hover */
  border-color: #ffcc00;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow);
}

.footer p {
  color: var(--text-light);
  margin: 0;
}

/* CSS-only Mobile Navigation Toggle */
.mobile-menu-toggle-input {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 8px;
  position: relative;
  z-index: 101;
}

.hamburger {
  display: block;
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.mobile-menu-toggle-input:checked ~ .navbar .mobile-menu-toggle .hamburger {
  transform: rotate(90deg);
}

.mobile-nav {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px var(--shadow);
  z-index: 99;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu-toggle-input:checked ~ .mobile-nav {
  max-height: 300px;
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 1rem 0;
  text-align: center;
}

.mobile-nav li {
  margin: 0;
}

.mobile-nav a {
  display: block;
  padding: 1rem 2rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.mobile-nav a:hover,
.mobile-nav a:focus {
  background: var(--section-alt-bg);
  color: var(--primary-color);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

/* Responsive design */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .navbar .container {
    justify-content: space-between;
    position: relative;
  }

  .theme-toggle-label {
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
  }


  .theme-toggle-icon .icon {
    width: 20px;
    height: 20px;
  }

  /* Typography adjustments for mobile */
  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 2rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.5rem;
  }

  p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .lead {
    font-size: 1.125rem;
  }

  /* Layout adjustments */
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .hero-left {
    order: 1;
  }

  .hero-right {
    order: 2;
  }

  .asneeded-section {
    max-width: 100%;
    padding: 1.5rem;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .about-text {
    order: 2;
  }

  .about-image {
    order: 1;
  }

  .skills-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .skill-item {
    padding: 1.5rem;
  }

  .social-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .social-links a {
    width: 200px;
    text-align: center;
    padding: 12px 20px;
    font-size: 1.1rem;
  }

  .container {
    padding: 0 20px;
  }

  section {
    padding: 50px 0;
  }

  header {
    padding: 120px 0 50px;
    min-height: 70vh;
  }

  .profile-photo {
    width: 250px;
    height: 250px;
  }

  .about-photo {
    width: 150px;
    height: 150px;
  }

  /* Make buttons and links more touch-friendly */
  .coffee-link {
    padding: 16px 32px;
    font-size: 1rem;
    min-height: 44px;
  }

  .statement h2 {
    font-size: 1.75rem;
    padding: 0 1rem;
  }

  /* Improve spacing for mobile */
  .intro, .statement, .contact {
    padding: 60px 0;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .statement h2 {
    font-size: 1.4rem;
    padding: 0 1.5rem;
    line-height: 1.4;
  }

  .profile-photo {
    width: 180px;
    height: 180px;
  }

  .about-photo {
    width: 120px;
    height: 120px;
  }

  p, .lead {
    font-size: 1rem;
    line-height: 1.5;
  }

  .container {
    padding: 0 15px;
  }

  section {
    padding: 40px 0;
  }

  header {
    padding: 100px 0 40px;
  }

  .skills-content {
    gap: 1.5rem;
  }

  .skill-item {
    padding: 1.25rem;
  }

  .skill-item h3 {
    font-size: 1.1rem;
  }

  .skill-item p {
    font-size: 0.9rem;
  }

  .social-links a {
    width: 180px;
    padding: 10px 16px;
    font-size: 1rem;
  }

  .coffee-link {
    padding: 14px 28px;
    font-size: 0.95rem;
  }

  .theme-toggle-label {
    width: 40px;
    height: 40px;
    top: 12px;
    right: 12px;
  }


  .theme-toggle-icon .icon {
    width: 18px;
    height: 18px;
  }

  .mobile-menu-toggle {
    padding: 6px;
    font-size: 1.25rem;
  }

  .mobile-nav {
    top: 65px;
  }

  .mobile-nav a {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .statement h2 {
    font-size: 1.25rem;
    padding: 0 1rem;
  }

  .social-links a {
    width: 160px;
    font-size: 0.95rem;
  }

  .profile-photo {
    width: 150px;
    height: 150px;
  }

  .about-photo {
    width: 100px;
    height: 100px;
  }
}

/* Large Contact CTA */
.contact-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: var(--primary-color);
  color: black;
  padding: 25px 50px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px var(--shadow);
  border: 3px solid var(--primary-color);
  min-width: 300px;
}

.contact-cta:hover,
.contact-cta:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 15px 40px var(--shadow);
  color: black;
  text-decoration: none;
}

.contact-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Enhanced focus styles for accessibility */
a:focus,
button:focus,
input:focus,
.theme-toggle-label:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #B8A76B; /* High contrast beige-brown */
    --primary-dark: #9A8B56;
    --text-color: #000;
    --text-light: #444;
  }

  .theme-toggle:checked ~ * {
    --primary-color: #F0E5B8; /* Bright beige for dark mode */
    --primary-dark: #E6D7A3;
    --text-color: #fff;
    --text-light: #ccc;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}