:root {
  --bg: #f5efe0;
  --chrome: #21382d;
  --accent: coral;
  --nav-width: 220px;
  --header-height: 56px;
  --nav-mobile-height: 46px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  padding-left: var(--nav-width);
  padding-top: var(--header-height);
  min-height: 100vh;
  font-family: sans-serif;
}

/* ── Full-width top header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--chrome);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Left sidebar nav (below header) ── */
nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--nav-width);
  height: calc(100vh - var(--header-height));
  background: var(--chrome);
  padding: 1rem 0;
  overflow-y: auto;
  z-index: 90;
  display: flex;
  flex-direction: column;
}

.nav-social {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
}

.nav-social a {
  color: var(--bg);
  opacity: 0.6;
  display: flex;
  align-items: center;
}

.nav-social a:hover {
  opacity: 1;
  color: var(--accent);
}

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

nav ul li a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--bg);
  text-decoration: none;
  font-size: 0.95rem;
}

nav ul li a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

/* ── Page content ── */
main {
  padding: 2rem;
}

/* ── Project cards ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.project-card {
  display: block;
  background: white;
  border-left: 4px solid var(--accent);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.project-card h2 {
  margin: 0 0 0.75rem 0;
  color: var(--chrome);
}

.project-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.project-card:hover {
  border-left-color: var(--chrome);
}

/* ── Canvas: scale to fit content area, preserve aspect ratio ── */
canvas {
  display: block;
  margin: 2rem auto;
  width: min(
    calc(100vw - var(--nav-width) - 4rem),
    calc(100vh - var(--header-height) - 4rem)
  );
  aspect-ratio: 1;
}

/* ── Mobile: nav drops below header as horizontal bar ── */
@media (max-width: 640px) {
  body {
    padding-left: 0;
    padding-top: calc(var(--header-height) + var(--nav-mobile-height));
  }

  nav {
    top: var(--header-height);
    width: 100%;
    height: var(--nav-mobile-height);
    display: flex;
    align-items: center;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  nav ul {
    display: flex;
    flex-direction: row;
  }

  .nav-social {
    margin-top: 0;
    margin-left: auto;
    padding: 0 1rem;
    flex-shrink: 0;
  }

  nav ul li a {
    white-space: nowrap;
    padding: 0 1rem;
    line-height: var(--nav-mobile-height);
  }
}
