
:root{
  --bg: #101010;
  --card: #1a1a1a;           /* Darker gray variant */
  --muted: #999999;          /* Medium gray for muted text */
  --text: #f5f5f5;           /* Light gray for text */
  --accent: #f89a00;         /* Primary orange */
  --border: #333333;         /* Dark gray border */
  --title-primary: #f89a00;    /* Main titles - primary orange */
  --title-secondary: #ee9200;  /* Secondary headings - darker orange */
  --title-tertiary: #e88d00;   /* Smaller headings - even darker orange */
  --title-highlight: #dd8400;  /* Special emphasis - darkest orange */
}
:root.light {
  --bg: #f5f5f5;            /* Light gray background */
  --card: #ffffff;          /* White cards */
  --muted: #666666;         /* Medium gray for muted text */
  --text: #101010;          /* Dark gray text */
  --accent: #d17a00;        /* Darker orange for light mode */
  --border: #dddddd;        /* Light gray border */
  --title-primary: #d17a00;    /* Darker orange for light mode */
  --title-secondary: #d77f00;  /* Secondary orange for light mode */
  --title-tertiary: #dd8400;   /* Tertiary orange for light mode */
  --title-highlight: #e88d00;  /* Highlight orange for light mode */
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif;line-height:1.6}
a{color:var(--accent);text-decoration:none}

/* ==== Title Styling with Orange Themes ==== */
h1, .hero-text h1{
  color:var(--title-primary);
  font-weight:800;
}
h2{
  color:var(--title-secondary);
  font-weight:700;
}
h3, .card h3{
  color:var(--title-tertiary);
  font-weight:600;
}
h4, h5, h6{
  color:var(--title-highlight);
  font-weight:600;
}

/* Special title highlights */
.accent{
  color:var(--title-primary) !important;
}
.lead{
  color:var(--title-secondary);
}

/* Hero accent text uses orange */
.hero .accent{
  color:var(--accent) !important;
}

/* Logo text gets the primary orange */
.logo-text{
  color:var(--title-primary) !important;
}
.container{max-width:1100px;margin:0 auto;padding:0 20px}
.site-header{position:sticky;top:0;backdrop-filter:saturate(180%) blur(10px);background:rgba(16,16,16,0.9);border-bottom:1px solid var(--border);z-index:10}
:root.light .site-header{background:rgba(245,245,245,0.9)}
.nav{display:flex;align-items:center;justify-content:space-between;height:64px}

/* ==== CORE LAYOUT STYLES ==== */
nav a{margin-left:18px;color:var(--muted)}
nav a.active{color:var(--text);font-weight:600}
.nav a:hover{color:var(--text)}
.btn{padding:12px 16px;border-radius:12px;border:1px solid var(--border);display:inline-block;cursor:pointer}
.btn.tiny{padding:6px 10px;border-radius:10px;font-size:13px}
.btn.primary{background:var(--accent);color:var(--bg);border-color:transparent;font-weight:700}
.btn.ghost{background:transparent;color:var(--text);border-color:var(--border)}
.btn.ghost:hover{background:var(--accent);color:var(--bg);border-color:var(--accent)}
.hero{display:grid;grid-template-columns:1.2fr .8fr;gap:28px;padding:72px 0}
.hero-text h1{font-size:48px;line-height:1.1;margin:0 0 8px}
.lead{font-size:20px;font-weight:600;margin:0 0 8px}
.sub{color:var(--muted);max-width:60ch;margin:0 0 16px}
.accent{color:var(--accent)}
.cta-row{display:flex;gap:12px;margin:18px 0 12px}
.quick.meta{margin:10px 0 0;padding-left:18px;color:var(--muted)}
.quick.meta li{margin:4px 0;display:flex;align-items:center;gap:8px}
.quick.meta li i{color:var(--accent);width:16px;text-align:center;font-size:14px}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:18px;
  color:var(--text);
}
.card h3{margin-top:0}

/* Light mode card adjustments */
:root.light .card{
  box-shadow:0 1px 3px rgba(16,16,16,0.1);
}
.checklist{list-style:none;padding-left:0;margin:0}
.checklist li{padding-left:28px;position:relative;margin:10px 0;color:var(--text)}
.checklist li::before{
  content:'\f00c'; /* fa-check */
  font-family:'Font Awesome 6 Free';
  font-weight:900;
  position:absolute;
  left:8px;
  top:0;
  color:var(--accent);
  font-size:14px;
}

/* Light mode adjustments for checklist */
:root.light .checklist li{color:var(--text)}
:root.light .checklist li::before{color:var(--accent)}
.two-col{display:grid;grid-template-columns:1fr .8fr;gap:28px;padding:40px 0}
.bullets{margin:0;padding-left:18px}
.grid.two{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
.list{display:grid;gap:16px}
.list .item{border-top:1px solid var(--border);padding-top:12px}
.timeline{list-style:none;padding-left:0;margin:0;border-left:2px dashed var(--border);display:grid;gap:18px}
.timeline li{display:grid;grid-template-columns:80px 16px 1fr;gap:12px;align-items:start}
.timeline .time{color:var(--muted)}
.timeline .dot{width:12px;height:12px;border-radius:50%;background:var(--accent);margin-top:6px}
.form label{display:block;font-weight:600;margin:8px 0}
.form input,.form textarea{width:100%;padding:12px;border-radius:10px;border:1px solid var(--border);background:transparent;color:var(--text)}
.site-footer{border-top:1px solid var(--border);margin-top:48px}
.footer-grid{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:18px 0;color:var(--muted)}
.links{margin-top:12px}
.link{color:var(--accent);margin-right:16px;font-size:14px;text-decoration:none}
.link:hover{text-decoration:underline}

/* Card styles consolidated - removed duplicate */
/* ==== RESPONSIVE DESIGN - ORGANIZED BY BREAKPOINT ==== */

/* Global responsive styles */
@media (max-width:960px){
  .hero{grid-template-columns:1fr}
  .two-col{grid-template-columns:1fr}
  .grid.two{grid-template-columns:1fr}
}

/* Tablet adjustments */
@media (max-width:768px){
  .container{padding:0 20px}
  
  .hero{
    padding:56px 0;
    gap:32px;
  }
  
  .hero-text h1{
    font-size:40px;
    line-height:1.1;
    margin-bottom:12px;
  }
  
  .lead{
    font-size:20px;
    margin-bottom:12px;
  }
  
  .sub{
    font-size:16px;
    line-height:1.5;
  }
  
  .two-col{
    gap:32px;
    padding:40px 0;
  }
  
  .card{
    padding:20px;
    box-shadow:0 2px 8px rgba(16,16,16,0.2);
  }
  
  :root.light .card{
    box-shadow:0 2px 8px rgba(16,16,16,0.1);
  }
  
  .card h3{
    font-size:20px;
  }
  
  .cta-row{
    flex-direction:column;
    gap:12px;
    margin:20px 0 16px;
  }
  
  .btn{
    text-align:center;
    width:100%;
    padding:12px 16px;
    font-size:16px;
    min-height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  
  /* Improve button touch targets */
  .cta-row .btn{
    min-height:48px;
    border-radius:8px;
    font-weight:600;
  }
  
  /* Timeline tablet */
  .timeline{
    gap:20px;
  }
  
  .timeline li{
    grid-template-columns:80px 14px 1fr;
    gap:12px;
  }
  
  /* Navigation tablet */
  .nav{
    height:64px;
  }
  
  .nav a{
    padding:6px 12px;
    font-size:15px;
    min-height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  
  .nav nav a{
    padding:6px 12px;
    font-size:15px;
  }
  
  /* Better touch targets for links */
  .links .link{
    display:inline-block;
    min-height:44px;
    line-height:44px;
    padding:0 12px;
    border-radius:6px;
    transition:background 0.2s ease;
  }
  
  .links .link:hover{
    background:rgba(248, 154, 0, 0.1);
  }
  
  /* Better spacing for touch */
  .checklist li{
    min-height:36px;
    display:flex;
    align-items:flex-start;
    padding-top:8px;
  }
  
  /* Better section spacing */
  section + section{
    margin-top:48px;
  }
  
  /* Mobile-friendly text selection */
  body{
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
  }
}

/* Mobile phone adjustments */
@media (max-width:480px){
  .container{padding:0 16px}
  
  /* Header adjustments */
  .nav{
    height:60px;
    gap:12px;
    padding:0 16px;
  }
  
  .nav nav{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    align-items:center;
  }
  
  .nav nav a{
    margin-left:0;
    font-size:14px;
    padding:6px 12px;
    border-radius:6px;
    transition:background 0.2s ease;
  }
  
  .nav nav a:hover{
    background:var(--card);
  }
  
  /* Hero section mobile */
  .hero{
    padding:40px 0;
    gap:24px;
  }
  
  .hero-text h1{
    font-size:32px;
    margin-bottom:16px;
    line-height:1.1;
  }
  
  .lead{
    font-size:18px;
    margin-bottom:16px;
    line-height:1.4;
  }
  
  .sub{
    font-size:16px;
    margin-bottom:20px;
    line-height:1.5;
  }
  
  /* CTA buttons mobile */
  .cta-row{
    margin:24px 0 20px;
  }
  
  .btn{
    padding:14px 20px;
    font-size:16px;
    font-weight:600;
    border-radius:8px;
  }
  
  /* Meta list mobile */
  .quick.meta{
    margin:20px 0 0;
    padding-left:0;
  }
  
  .quick.meta li{
    font-size:15px;
    margin:8px 0;
    padding:4px 0;
  }
  
  .quick.meta li i{
    font-size:14px;
    width:18px;
  }
  
  /* Cards mobile */
  .card{
    padding:20px;
    border-radius:12px;
    margin-bottom:16px;
  }
  
  .card h3{
    font-size:18px;
    margin-bottom:16px;
  }
  
  .checklist li{
    font-size:15px;
    margin:10px 0;
    padding-left:28px;
    line-height:1.4;
  }
  
  .checklist li::before{
    font-size:14px;
    left:8px;
  }
  
  .bullets li{
    font-size:15px;
    margin:8px 0;
  }
  
  /* Links in cards */
  .links{
    margin-top:16px;
  }
  
  .links .link{
    font-size:15px;
    margin-right:20px;
    padding:8px 0;
  }
  
  /* Two column to single column */
  .two-col{
    gap:32px;
    padding:32px 0;
  }
  
  /* Timeline mobile */
  .timeline{
    gap:20px;
    margin-top:24px;
  }
  
  .timeline li{
    grid-template-columns:70px 14px 1fr;
    gap:12px;
    font-size:15px;
  }
  
  .timeline .time{
    font-size:13px;
    font-weight:600;
  }
  
  .timeline .dot{
    width:12px;
    height:12px;
    margin-top:5px;
  }
  
  .timeline .desc{
    line-height:1.4;
  }
  
  /* Footer mobile */
  .footer-grid{
    flex-direction:column;
    gap:12px;
    text-align:center;
    font-size:14px;
    padding:24px 0;
  }
  
  /* Section spacing */
  section{
    margin-bottom:24px;
  }
  
  h2{
    font-size:24px;
    margin-bottom:20px;
  }
}

/* Extra small mobile adjustments */
@media (max-width:360px){
  .container{padding:0 12px}
  
  .hero{
    padding:32px 0;
  }
  
  .hero-text h1{
    font-size:28px;
    margin-bottom:14px;
  }
  
  .lead{
    font-size:16px;
    margin-bottom:14px;
  }
  
  .sub{
    font-size:15px;
    margin-bottom:18px;
  }
  
  .nav{
    height:56px;
    padding:0 12px;
  }
  
  .nav nav{
    gap:8px;
  }
  
  .nav nav a{
    font-size:13px;
    padding:4px 8px;
  }
  
  .card{
    padding:16px;
  }
  
  .card h3{
    font-size:16px;
  }
  
  .checklist li{
    font-size:14px;
    margin:8px 0;
  }
  
  .quick.meta li{
    font-size:14px;
  }
  
  .btn{
    padding:12px 16px;
    font-size:15px;
  }
  
  .timeline li{
    grid-template-columns:60px 12px 1fr;
    gap:8px;
    font-size:14px;
  }
  
  .timeline .time{
    font-size:12px;
  }
  
  .timeline .dot{
    width:10px;
    height:10px;
  }
  
  h2{
    font-size:22px;
  }
}

/* ==== UNIVERSAL STYLES FOR MOBILE OPTIMIZATION ==== */

/* Prevent horizontal scroll */
*{
  max-width:100%;
  word-wrap:break-word;
}

/* ==== HEADER LOGO STYLES ==== */
.site-header .logo{
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  height:48px;
  padding:0;
  margin:0;
  background:none;      /* kill old gradient box */
  border:0;
  gap:12px;            /* space between logo and text */
  text-decoration:none;
}

.site-header .logo img{
  height:32px !important;   /* FORCE a small logo */
  width:auto !important;
  max-width:none !important; /* beat any img{max-width:100%} */
  display:block;
  flex-shrink:0;           /* prevent logo from shrinking */
}

.logo-text{
  font-size:18px;
  font-weight:700;
  color:var(--title-primary);
  white-space:nowrap;      /* prevent text wrapping */
}

/* Dark theme (default) = show DARK logo (but your dark logo file might be named "light") */
.logo-img.light-mode{ display:none !important; }
.logo-img.dark-mode{  display:block !important; }

/* Light theme = show LIGHT logo (but your light logo file might be named "dark") */
:root.light .logo-img.light-mode{ display:block !important; }
:root.light .logo-img.dark-mode{  display:none !important; }

/* Logo responsive styles */
@media (min-width:960px){
  .site-header .logo img{ height:36px !important; }
  .logo-text{ font-size:20px; }
}

/* Hide text on smaller screens to save space */
@media (max-width:640px){
  .logo-text{ display:none; }
  
  /* Adjust logo spacing when text is hidden */
  .site-header .logo{
    gap:0;
    width:auto;
  }
}

/* ==== COMPREHENSIVE MOBILE IMPROVEMENTS ==== */

/* Global image constraint */
img {
  max-width: 100%;
  height: auto;
}

/* Mobile-friendly navigation */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Mobile: Keep theme toggle visible next to hamburger */
.theme-toggle-mobile {
  display: inline-flex;
  order: 2; /* Ensure it appears after the nav */
}

/* Enhanced Hamburger Menu */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-width: 48px;
  min-height: 48px;
}

.nav-toggle:hover {
  background: var(--accent);
  color: #101010;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(248, 154, 0, 0.3);
}

.nav-toggle:active {
  transform: translateY(0);
}

/* Custom Hamburger Icon */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 18px;
  height: 14px;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger Animation - Open State */
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Menu Text */
.nav-toggle-text {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mobile Navigation Links */
.nav-links {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 2px solid var(--border);
  border-top: none;
  padding: 0;
  box-shadow: 0 8px 32px rgba(16, 16, 16, 0.3);
  z-index: 100;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

:root.light .nav-links {
  box-shadow: 0 8px 32px rgba(16, 16, 16, 0.2);
}

.nav-links.show {
  display: flex;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-links a {
  display: block;
  padding: 16px 20px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
}

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

.nav-links a:hover {
  background: var(--accent);
  color: #101010;
  padding-left: 28px;
}

.nav-links a.active {
  background: rgba(248, 154, 0, 0.1);
  color: var(--accent);
  border-left: 4px solid var(--accent);
}

.nav-links.open {
  display: flex;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  background: rgba(248, 154, 0, 0.1);
}

.nav-links a.active {
  background: var(--accent);
  color: var(--bg);
}

/* Enhanced theme toggle pill switch with fixed icons */
.theme-toggle {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 50px;
  width: 48px;
  height: 28px;
  padding: 0;
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  overflow: hidden;
}

/* Toggle circle/pill */
.theme-toggle::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(248, 154, 0, 0.4);
  z-index: 2;
}

/* Moon icon - fixed on left, visible only in dark mode */
.theme-toggle::after {
  content: "\f186"; /* fa-moon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  font-size: 10px;
  top: 50%;
  left: 8px; /* Fixed position on left */
  transform: translateY(-50%);
  transition: all 0.3s ease;
  z-index: 3;
  line-height: 1;
  opacity: 1;
  visibility: visible;
}

/* Sun icon - fixed on right, visible only in light mode */
.sun-icon {
  position: absolute;
  font-size: 10px;
  top: 50%;
  right: 8px; /* Fixed position on right */
  transform: translateY(-50%);
  transition: all 0.3s ease;
  z-index: 3;
  line-height: 1;
  opacity: 0; /* Hidden in dark mode */
  visibility: hidden;
}

:root.light .theme-toggle {
  background: var(--card);
  border-color: var(--border);
}

/* Toggle circle position in light mode */
:root.light .theme-toggle::before {
  left: 25px;
}

/* In light mode, hide moon and show sun */
:root.light .theme-toggle::after {
  opacity: 0;
  visibility: hidden;
}

:root.light .sun-icon {
  opacity: 1;
  visibility: visible;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(248, 154, 0, 0.3);
}

/* Icon styling for inline Font Awesome icons */
.fa-external-link-alt {
  margin-left: 4px;
  font-size: 0.85em;
  opacity: 0.8;
}

.fa-arrow-up {
  margin-left: 4px;
  font-size: 0.9em;
}

.fa-circle {
  color: var(--accent);
  margin: 0 8px;
}

/* Meta list icons */
.quick.meta li i {
  margin-right: 8px;
  color: var(--accent);
  width: 16px;
  text-align: center;
}

/* Theme toggle visibility controls */
/* By default (mobile), show mobile toggle and hide desktop toggle */
.nav-links .theme-toggle {
  display: none;
}

.theme-toggle-mobile {
  display: inline-flex;
}

/* Desktop navigation - show links, hide toggle */
@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }
  
  /* Hide mobile theme toggle, show desktop theme toggle */
  .theme-toggle-mobile {
    display: none;
  }
  
  .nav-links .theme-toggle {
    display: inline-flex;
  }
  
  .nav-controls {
    gap: 24px;
  }
  
  .nav-links {
    display: flex;
    flex-direction: row;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    gap: 24px;
    border-radius: 0;
    align-items: center;
  }
  
  /* Theme toggle positioning in desktop nav */
  .nav-links .theme-toggle {
    margin-left: 12px;
    order: 999; /* Ensure it appears at the end */
  }
  
  .nav-links a {
    padding: 8px 12px;
    border-radius: 8px;
    border-bottom: none;
    border-left: none;
    font-size: 15px;
  }
  
  .nav-links a:hover {
    background: var(--accent);
    color: #101010;
    padding-left: 12px;
  }
  
  .nav-links a.active {
    background: rgba(248, 154, 0, 0.1);
    color: var(--accent);
    border-left: none;
  }
}

/* Enhanced hero section for small screens */
@media (max-width: 480px) {
  /* Mobile Navigation Adjustments */
  .nav {
    padding: 0 4px; /* Minimal padding for tight fit */
  }
  
  /* Override container padding for navigation */
  .site-header .container {
    padding: 0 12px; /* Reduced padding for header container */
  }
  
  .nav-controls {
    gap: 6px; /* Reduce gap for tighter fit */
    flex-shrink: 0;
  }
  
  /* Mobile: Ensure correct order - nav first, then theme toggle */
  .site-nav {
    order: 1;
  }
  
  .theme-toggle-mobile {
    order: 2;
    flex-shrink: 0;
  }
  
  .nav-toggle {
    min-width: 42px;
    min-height: 42px;
    padding: 8px;
  }
  
  .nav-toggle-text {
    display: none;
  }
  
  /* Compact theme toggle for mobile */
  .theme-toggle {
    width: 40px;
    height: 22px;
    border-width: 1px; /* Thinner border */
    flex-shrink: 0;
  }
  
  .theme-toggle::before {
    width: 16px;
    height: 16px;
    left: 2px;
  }
  
  .theme-toggle::after {
    font-size: 8px;
    left: 6px; /* Fixed moon position on left */
  }
  
  .sun-icon {
    font-size: 8px;
    right: 6px; /* Fixed sun position on right */
  }
  
  :root.light .theme-toggle::before {
    left: 21px;
  }
  
  /* Logo adjustments for mobile */
  .logo {
    flex: 1;
    min-width: 0; /* Allow logo to shrink if needed */
  }
  
  .logo-text {
    font-size: 18px; /* Slightly smaller on mobile */
  }
  
  .nav-links a {
    padding: 18px 20px;
    font-size: 17px;
  }
  
  .hero {
    padding: 44px 0;
    gap: 18px;
  }
  
  .hero-text h1 {
    font-size: 32px;
    line-height: 1.15;
    margin-bottom: 16px;
  }
  
  .lead {
    font-size: 18px;
    margin-bottom: 16px;
  }
  
  .sub {
    font-size: 16px;
    margin-bottom: 20px;
  }
  
  .cta-row {
    flex-wrap: wrap;
    margin: 24px 0 16px;
  }
  
  .btn {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 16px;
    min-height: 48px;
  }
}

/* Stack timeline items on small screens */
@media (max-width: 480px) {
  .timeline {
    border-left: none;
    padding-left: 0;
  }
  
  .timeline li {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
  }
  
  .timeline .time {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
  }
  
  .timeline .dot {
    display: none;
  }
  
  .timeline .desc {
    margin-top: 8px;
  }
}

/* Extra small mobile devices (320px and below) */
@media (max-width: 360px) {
  .nav {
    padding: 0 2px;
  }
  
  .site-header .container {
    padding: 0 8px; /* Even more reduced padding */
  }
  
  .nav-controls {
    gap: 4px;
  }
  
  .nav-toggle {
    min-width: 38px;
    min-height: 38px;
    padding: 6px;
  }
  
  .theme-toggle {
    width: 36px;
    height: 20px;
  }
  
  .theme-toggle::before {
    width: 14px;
    height: 14px;
    left: 2px;
  }
  
  .theme-toggle::after {
    font-size: 7px;
    left: 5px; /* Fixed moon position on left */
  }
  
  .sun-icon {
    font-size: 7px;
    right: 5px; /* Fixed sun position on right */
  }
  
  :root.light .theme-toggle::before {
    left: 19px;
  }
  
  .logo-text {
    font-size: 16px;
  }
}

/* Tablet Navigation Adjustments */
@media (min-width: 481px) and (max-width: 899px) {
  .nav-controls {
    gap: 16px;
  }
  
  .nav-toggle {
    padding: 12px 16px;
  }
  
  .nav-toggle-text {
    display: inline;
  }
  
  .nav-links a {
    padding: 16px 24px;
    font-size: 16px;
  }
}

/* Improve form spacing on phones */
@media (max-width: 600px) {
  .form .grid.two {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .form input,
  .form textarea {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .form button.btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    min-height: 48px;
  }
}

/* Adjust container padding and footer for very narrow screens */
@media (max-width: 420px) {
  .container {
    padding: 0 14px;
  }
  
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
  }
  
  .site-header .container {
    padding: 0 14px;
  }
}

/* Extra mobile typography improvements */
@media (max-width: 480px) {
  h2 {
    font-size: 28px;
    margin-bottom: 16px;
  }
  
  h3 {
    font-size: 22px;
    margin-bottom: 12px;
  }
  
  .card {
    padding: 18px;
    margin-bottom: 16px;
  }
  
  .card h3 {
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .checklist li {
    font-size: 15px;
    line-height: 1.5;
    margin: 8px 0;
  }
  
  .quick.meta li {
    font-size: 14px;
    margin: 6px 0;
  }
}

/* Improve navigation spacing */
.site-header {
  position: relative;
}

.site-header .container {
  position: relative;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
  .nav-links a,
  .btn,
  .link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
  }
  
  .links .link {
    margin-right: 12px;
    margin-bottom: 8px;
  }
}

/* Enhanced accessibility */
.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;
}

/* Focus styles for better accessibility */
.nav-toggle:focus,
.theme-toggle:focus,
.nav-links a:focus,
.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Smooth transitions */
* {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Prevent horizontal overflow */
body {
  overflow-x: hidden;
}

/* Better card spacing on mobile */
@media (max-width: 480px) {
  .grid.two {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .project.card {
    margin-bottom: 20px;
  }
  
  .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
    padding: 0;
    list-style: none;
  }
  
  .tags li {
    background: rgba(248, 154, 0, 0.1);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
  }
}
