:root {
  --hero: #ff9091;
  --projects: #ffa850;
  --experience: #fcdc3e;
  --skills: #aad84d;
  --contact: #6fcf88;
}

body {
  margin: 0;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.7;
  scroll-behavior: smooth;
}

/* Layout grid */
.layout {
  display: grid;
  grid-template-columns: 180px 1fr; /* wider for sidebar links */
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1rem;
  transition: background 0.3s;
  color: black;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 0.5rem;
}

.sidebar a {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: black;
  font-weight: bold;
  border-radius: 6px;
  transition: background 0.2s;
}

.sidebar a.active,
.sidebar a:focus {
  background: rgba(255, 255, 255, 0.6);
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 10px;
  top: 10px;
  background: white;
  padding: 8px;
  z-index: 10;
}

/* Panel sections */
.panel {
  padding: 4rem 2rem;
  border-top: 10px solid white;
}

/* Panel colours (for full-width) */
.hero { background: var(--hero); }
.projects { background: var(--projects); }
.experience { background: var(--experience); }
.skills { background: var(--skills); }
.contact { background: var(--contact); }

/* Constrain content */
.content {
  max-width: 70ch;
  margin: 0 auto;
}

/* Floating section headers */
.section-header {
  position: sticky;
  top: 20px;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  z-index: 1;
  margin-bottom: 2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Cards */
.cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: rgba(255, 255, 255, 0.6);
  padding: 1.2rem;
  border-radius: 8px;
}

.card h3 { margin-top: 0; }
.card p { margin-bottom: 0; }

/* Accessibility */
a { text-decoration: underline; }
:focus { outline: 4px solid black; outline-offset: 3px; }

/* Responsive tweaks */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    flex-direction: row;
    overflow-x: auto;
  }
  .sidebar ul {
    display: flex;
    flex-direction: row;
  }
  .sidebar li {
    margin-right: 0.5rem;
  }
}

/* Reading mode */
body.reading-mode .panel {
  background: #ffffff !important;
}

body.reading-mode .card {
  background: #f2f2f2 !important;
}

/* Text size */
body.text-small { font-size: 18px; }
body.text-medium { font-size: 20px; }
body.text-large { font-size: 24px; }

.sidebar-controls {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-controls button, .sidebar-controls select {
    font-weight: bold;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s color 0.2s;
}

/* Reading mode button */
.sidebar-controls button {
  background: rgba(255,255,255,0.6);
  color: black;
}

.sidebar-controls button:hover,
.sidebar-controls button:focus {
  background: rgba(255,255,255,0.8);
  outline: none;
}

/* Text size select styling */
.sidebar-controls select {
  background: rgba(255,255,255,0.6);
  color: black;
  appearance: none;
}

.sidebar-controls select:focus {
  background: rgba(255,255,255,0.8);
  outline: none;
}

/* Reading mode adjustments */
body.reading-mode .panel {
  background: #fdfdfd !important;
}

body.reading-mode .card {
  background: #f2f2f2 !important;
}

/* Optional: slightly darker section headers for readability */
body.reading-mode .section-header {
  background: rgba(240,240,240,0.95);
}
