:root {
  --bg: #fafaf8;
  --sidebar-bg: #f1efea;
  --text: #17181a;
  --text-muted: #6b6b63;
  --border: #dad7cf;
  --accent: #b34700;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

a { color: inherit; }

.frame {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar-topbar {
  display: flex;
  align-items: stretch;
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-header:hover {
  background: rgba(0, 0, 0, 0.03);
}

.sidebar-header:hover .brand-name {
  color: var(--accent);
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: inherit;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.hamburger-btn {
  display: none;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 52px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  cursor: pointer;
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-btn:hover span {
  background: var(--accent);
}

.sidebar--open .hamburger-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sidebar--open .hamburger-btn span:nth-child(2) {
  opacity: 0;
}

.sidebar--open .hamburger-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 24px;
}

.nav-section-header {
  padding: 4px 24px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 24px;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text);
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.nav-item.active {
  border-left-color: var(--accent);
  background: rgba(179, 71, 0, 0.06);
}

.nav-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 34px;
}

.nav-item.active .nav-code {
  color: var(--accent);
}

.nav-label {
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  color: var(--text-muted);
}

.footer-link:hover {
  color: var(--accent);
}

.footer-easter-hint {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  opacity: 0.25;
  cursor: default;
  transition: opacity 0.2s ease, color 0.2s ease;
  user-select: none;
}

.footer-easter-hint:hover {
  opacity: 1;
  color: var(--accent);
}

.footer-easter-hint::before {
  content: "REV. ";
  opacity: 0.7;
}

/* ---------- Main content ---------- */

.content {
  height: 100vh;
  overflow-y: auto;
  padding: 64px 72px;
}

.view {
  max-width: 680px;
}

.view--home {
  max-width: 1000px;
}

.home-about {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 56px;
}

.about-text {
  flex: 1;
  min-width: 0;
}

.about-portrait-frame {
  flex-shrink: 0;
  width: 220px;
  border: 1px solid var(--border);
  background: var(--sidebar-bg);
}

.about-portrait-frame img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 860px) {
  .home-about {
    flex-direction: column;
  }
  .about-portrait-frame {
    width: 100%;
    max-width: 260px;
  }
}

.home-gallery-section {
  margin-top: 8px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--sidebar-bg);
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

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

.project-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

.project-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-title {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

.project-card:hover .project-card-title {
  color: var(--accent);
}

.view-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.view h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

.view-summary {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Hero image */
.hero-frame {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 24px;
  border: 1px solid var(--border);
  background: var(--sidebar-bg);
  cursor: zoom-in;
}

.hero-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}

/* Inline images between body paragraphs */
.inline-image {
  display: block;
  width: 100%;
  padding: 0;
  margin: 20px 0;
  border: 1px solid var(--border);
  background: var(--sidebar-bg);
  cursor: zoom-in;
  text-align: left;
}

.inline-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
}

.inline-image-caption {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 36px 0 8px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--sidebar-bg);
  cursor: zoom-in;
  text-align: left;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.gallery-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr; }
  .lightbox { padding: 16px; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(23, 24, 26, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 100;
  cursor: zoom-out;
}

.lightbox-inner {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-inner img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border: 1px solid var(--border);
}

.lightbox-caption {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #fafaf8;
  text-align: center;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(23, 24, 26, 0.55);
  border: 1px solid rgba(250, 250, 248, 0.25);
  color: #fafaf8;
  font-size: 28px;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  background: rgba(23, 24, 26, 0.8);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(250, 250, 248, 0.7);
}

@media (max-width: 520px) {
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

/* Spec block — title-block styling borrowed from drawing sheets */
.spec-block {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  margin-bottom: 36px;
}

.spec-cell {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
}

.spec-cell:last-child { border-right: none; }

.spec-cell .k {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.spec-cell .v {
  font-size: 13.5px;
  font-weight: 500;
}

.view-body p {
  font-size: 15.5px;
  line-height: 1.75;
  margin: 0 0 20px;
}

.about-interests {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.about-interests li {
  font-size: 14.5px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.about-interests li:first-child {
  border-top: 1px solid var(--border);
}

.empty-state {
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  padding: 1px 5px;
}

/* Resume view */
.view--resume {
  max-width: 900px;
}

.resume-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.resume-toolbar h1 {
  margin: 0;
}

.resume-download {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 7px 12px;
  white-space: nowrap;
}

.resume-download:hover {
  background: var(--accent);
  color: #fafaf8;
}

.resume-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.resume-page {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(23, 24, 26, 0.06);
}

@media (max-width: 760px) {
  .view--resume { max-width: 100%; }
}

@media (max-width: 760px) {
  .frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 100vh;
  }
  .sidebar { height: auto; max-height: none; }
  .content { height: auto; padding: 32px 24px; }
  .spec-block { grid-template-columns: repeat(2, 1fr); }

  .hamburger-btn {
    display: flex;
  }

  .nav-list {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.25s ease, padding 0.25s ease;
  }

  .sidebar--open .nav-list {
    max-height: 60vh;
    overflow-y: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .nav-item {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .view h1 {
    font-size: 25px;
  }
}
