:root {
  /* Layout Dimensions */
  --cutout-gap: 24px;
  --nav-width: 260px;
  --border-radius: 16px;
  
  /* Typography Colors */
  --text-main: #2d241e;
  --text-muted: #574a41;
  --accent-color: #c85a32; /* Warm Terracotta */
  --muted-accent: #8c3b1d;
  
  /* Card Styling */
  --glass-bg: #fffcf7;
  --glass-border: #e8dfd5;
  --glass-shadow: 0 10px 30px -10px rgba(60, 40, 20, 0.08);
  --glass-blur: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Cousine', 'Courier Prime', monospace;
  color: var(--text-main);
  line-height: 1.6;
  background-color: #f4eee6;
  background-image: radial-gradient(#dfd4c6 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
  display: flex;
  min-height: 100vh;
  padding: var(--cutout-gap);
}

nav {
  position: fixed;
  top: var(--cutout-gap);
  left: var(--cutout-gap);
  bottom: var(--cutout-gap);
  width: var(--nav-width);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2.5rem 1.5rem;
  z-index: 10;
}

nav h2 {
  margin: 0;
  font-family: 'Permanent Marker', cursive;
  color: var(--text-main);
  font-size: 1.8rem;
  letter-spacing: 1px;
  font-weight: 400;
  text-align: center;
}

nav h3 {
  margin: 0;
  font-family: system-ui;
  font-size: .95rem;
  letter-spacing: 1px;
  font-weight: bold;
  margin-top: -2rem;
  color: var(--accent-color);
  text-align: center;
}

nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  display: block;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
}

nav a:hover {
  color: var(--text-main);
  background-color: #f1e9df;
  transform: translateX(3px);
}

nav a.active {
  color: #ffffff;
  background-color: var(--accent-color);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(200, 90, 50, 0.25);
  position: relative;
}

main {
  margin-left: calc(var(--nav-width) + var(--cutout-gap));
  width: calc(100% - (var(--nav-width) + var(--cutout-gap)));
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--glass-shadow);
}

section {
  display: flex;
  flex-direction: column;
  justify-content: start;
  padding: 1rem 2.5rem 2rem;
  border-bottom: 1px solid var(--glass-border);
  margin: 0 auto;
  max-width: 126ch;
}

hr {
  border: none;
  height: 1px;
  background-color: var(--glass-border);
  margin: 2rem 0;
}

.panel {
  background: #faf5ee;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-column-gap: 64px;
  margin: 2rem 0;
}

.panel h2 { margin-top: 0; padding-top: 0; color: var(--accent-color); }
.panel h3 { font-size: 1.3em; }

.panel img {
  max-width: 90%;
  background-color: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
}

.panel img:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.panel .span { grid-column: 1 / -1; }

.span img {
  margin: 2rem auto 3rem;
  display: block;
  padding: 14px;
}

section:last-of-type { border-bottom: none; }

section img {
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
  display: block;
}

h1 {
  font-family: system-ui, 'Permanent Marker', cursive;
  font-size: 2.75rem;
  margin-bottom: 1rem;
  color: var(--text-main);
  font-weight: 400;
}

h2 { font-family: system-ui, 'Permanent Marker', cursive; font-size: 1.75rem; letter-spacing: 1px; }

p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 300;
}

#about-me h1 {
  text-align: center;
  color: var(--text-main);
  font-size: 3.5rem;
  font-weight: bold;
}

#about-me h2 {
  color: var(--text-main);
  font-family: system-ui, 'Permanent Marker', cursive;
  font-size: 2rem;
  text-align: center;
  font-weight: 400;
  line-height: 1.3;
  margin-top: -.75rem;
}

#testimonials h2 {
  font-style: italic;
  font-weight: normal;
  letter-spacing: 0px;
}

#contact a {
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 18px 24px;
  border-radius: 10px;
  color: #ffffff;
  background-color: var(--accent-color);
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(200, 90, 50, 0.25);
  display: inline-block;
}

#contact a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 90, 50, 0.35);
}

dl, dd, dt { display: inline; }
dd { margin-inline-start: 5px; }
dd::after { content: "\A"; white-space: pre; }
dt { font-weight: bold; margin: 0; color: var(--accent-color); }

@media (max-width: 768px) {
  body { padding: 12px; flex-direction: column; }
  nav { position: relative; top: auto; left: auto; width: 100%; margin-bottom: 12px; height: auto; bottom: auto; padding: 1.5rem 1rem; }
  main { margin-left: 0; width: 100%; padding: 2rem 1.5rem; }
  section { min-height: auto; padding: 1rem 0rem 2rem; }
  section img { margin: 0 auto; }
  .panel { background: none; border: 0; padding: 0; display: grid; grid-template-columns: 1fr; margin: 2rem 0; }
  .panel img { max-width: 100%; }
  #contact a { display: block; text-align: center; }
  #about-me h1 { font-size: 2.75rem; }
  #about-me h2 { font-size: 1.75rem; }
}

/* Lightbox backdrop overlay */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(45, 36, 30, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active { opacity: 1; visibility: visible; }

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  cursor: default;
}

.lightbox-overlay.active img { transform: scale(1); }

img.lb { cursor: zoom-in; }

.theme-switcher label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.theme-switcher select {
  background-color: #f5f2eb;
  color: #2c3531;
  border: 1px solid #d3cbd8;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}