:root {
  --bg: #0b0f14;
  --bg-alt: #101720;
  --panel: #131b26;
  --border: #23303f;
  --text: #e6edf3;
  --text-dim: #93a3b3;
  --accent: #5ee6c8;
  --accent-dim: #2f6a5f;
  --danger: #e6875e;
  --radius: 8px;
  --max-width: 1080px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: "Consolas", "SFMono-Regular", Menlo, Monaco, monospace;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em 0;
}

a { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

/* ---------- Menu toggle (hamburger) ---------- */
.menu-toggle {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.menu-toggle:hover { border-color: var(--accent-dim); }

.menu-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
}

.menu-icon line {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.15s, opacity 0.15s;
}

.menu-toggle[aria-expanded="true"] .menu-icon line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-icon line:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .menu-icon line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Drawer ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 30;
}

.drawer-overlay[hidden] { display: none; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(280px, 84vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 40;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  position: absolute;
  top: 14px;
  right: 16px;
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 44px;
}

.drawer-group {
  display: flex;
  flex-direction: column;
}

.drawer-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 4px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.drawer-dropdown-toggle:hover { color: var(--accent); }

.drawer-dropdown-toggle .chevron {
  transition: transform 0.15s;
  color: var(--text-dim);
}

.drawer-dropdown-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.drawer-dropdown {
  display: flex;
  flex-direction: column;
}

.drawer-dropdown[hidden] { display: none; }

.drawer-link {
  color: var(--text);
  text-decoration: none;
  padding: 12px 4px;
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
}

.drawer-sublink {
  padding-left: 16px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

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

/* ---------- Banner ---------- */
.banner {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

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

/* ---------- Hero ---------- */
.hero {
  padding: 0 0 56px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 20% 20%, rgba(94,230,200,0.07), transparent 40%),
    var(--bg);
}

.hero-inner {
  display: flex;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-photo {
  flex: 0 0 auto;
  width: 160px;
  height: 160px;
  margin-top: -80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border);
}

.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; display: block; }

.hero-text { flex: 1 1 380px; padding-top: 16px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0 0 8px;
}

.hero h1 { font-size: 2.1rem; }

.hero-tagline {
  color: var(--text-dim);
  max-width: 46ch;
  margin: 12px 0 20px;
}

.contact-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

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

.contact-link .icon { font-weight: 700; }

.contact-link .icon-svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.copy-email.copied { border-color: var(--accent); color: var(--accent); }

/* ---------- Section heading ---------- */
.section-heading {
  padding: 48px 0 8px;
}

.section-heading h2 {
  font-size: 1.6rem;
  color: var(--text-dim);
}

/* ---------- Project blocks ---------- */
.project {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.project-header h3 { font-size: 1.5rem; }

.project-sub {
  color: var(--text-dim);
  margin: 0 0 20px;
}

/* Tabs (RefRemote iterations) */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tab {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.tab:hover { color: var(--text); border-color: var(--accent-dim); }

.tab.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Slideshow */
.slideshow {
  margin-bottom: 20px;
}

.slideshow-viewport {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.slide {
  display: none;
  margin: 0;
}

.slide.active {
  display: block;
}

.media-img, .media-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-alt);
  cursor: pointer;
}

.media-video {
  cursor: default;
}

.slide figcaption {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.slideshow-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(11, 15, 20, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}

.slideshow-arrow:hover { border-color: var(--accent); color: var(--accent); }
.slideshow-arrow.prev { left: 12px; }
.slideshow-arrow.next { right: 12px; }

.slideshow-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.slideshow-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
}

.slideshow-dot:hover { background: var(--accent-dim); }
.slideshow-dot.active { background: var(--accent); }

/* Placeholder box shown when a media file is missing */
.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(45deg, var(--bg-alt), var(--bg-alt) 10px, #0e141b 10px, #0e141b 20px);
  border: 1px dashed var(--border);
  color: var(--text-dim);
  text-align: center;
  padding: 12px;
  font-size: 0.78rem;
}

.media-placeholder .ph-icon {
  font-size: 1.6rem;
  color: var(--accent-dim);
}

.media-placeholder .ph-label {
  color: var(--text);
  font-weight: 600;
}

.media-placeholder .ph-path {
  font-family: "Consolas", monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  word-break: break-all;
}

.description {
  max-width: 70ch;
}

.placeholder-text {
  color: var(--danger);
  font-style: italic;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 48px 0 64px;
  text-align: center;
}

.footer-inner .contact-row { justify-content: center; margin: 16px 0; }

.fine-print {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 24px;
}

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

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 560px) {
  .banner { height: 140px; }
  .hero-photo { width: 120px; height: 120px; margin-top: -60px; }
  .hero-inner { text-align: center; justify-content: center; }
  .contact-row { justify-content: center; }
}
