:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #6b6b6b;
  --border: #e2e2e2;
  --accent: #b0392f;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header / nav */
header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}

.brand img {
  height: 48px;
  width: auto;
  border-radius: 50%;
}

nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  justify-content: center;
}

nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

nav a:hover,
nav a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.social-icons {
  display: flex;
  gap: 14px;
  flex: 0 0 auto;
}

.social-icons a {
  display: grid;
  place-items: center;
  color: var(--ink-muted);
}

.social-icons a:hover {
  color: var(--accent);
}

.social-icons svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Page header */
.page-head {
  padding: 56px 0 32px;
}

.page-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 8px;
}

.page-head p {
  color: var(--ink-muted);
  max-width: 60ch;
  margin: 0;
}

/* Project grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  padding: 8px 0 64px;
}

.card {
  border: 1px solid var(--border);
}

.card .thumb {
  aspect-ratio: 4 / 3;
  background: #f2f2f2;
  overflow: hidden;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card .thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card .meta {
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card .meta h3 {
  margin: 0;
  font-size: 1rem;
}

.card .meta span {
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* Project detail page */
.back-link {
  display: inline-block;
  margin: 32px 0 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
}

.detail {
  padding: 8px 0 72px;
  max-width: 760px;
}

.detail .hero {
  border: 1px solid var(--border);
  margin-bottom: 28px;
}

.detail .hero img {
  width: 100%;
}

.detail .kicker {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.detail h1 {
  margin: 0 0 18px;
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
}

.detail .blurb {
  color: #333;
  font-size: 1.05rem;
  max-width: 60ch;
}

/* About page */
.about-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  padding: 8px 0 72px;
}

.about-layout img {
  width: 100%;
  border: 1px solid var(--border);
}

.about-layout .bio p {
  margin: 0 0 18px;
  color: #333;
}

@media (max-width: 720px) {
  .about-layout {
    grid-template-columns: 1fr;
  }
}

/* Contact form */
form.contact {
  max-width: 520px;
  padding: 8px 0 72px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
}

button.submit {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 12px 28px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.submit:hover {
  opacity: 0.9;
}

.form-note {
  margin-top: 14px;
  font-size: 0.9rem;
}

.form-note.ok {
  color: #2c7a3f;
}

.form-note.err {
  color: var(--accent);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Gallery grid (on project detail pages) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 28px 0 40px;
}

.gallery-grid .g-item {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.gallery-grid .g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-grid .g-item:hover img {
  transform: scale(1.04);
}

.video-note {
  border: 1px dashed var(--border);
  padding: 16px 18px;
  margin: 0 0 28px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* Lightbox / video modal overlays */
body.lb-locked {
  overflow: hidden;
}

.lightbox-overlay,
.video-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.92);
  padding: 40px;
}

.lightbox-overlay.is-open,
.video-modal-overlay.is-open {
  display: flex;
}

.lb-close {
  position: absolute;
  top: 18px;
  right: 24px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.lb-close:hover {
  opacity: 1;
}

.lightbox-img {
  max-width: min(1100px, 90vw);
  max-height: 86vh;
  object-fit: contain;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
}

.lb-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lb-prev {
  left: 16px;
}

.lb-next {
  right: 16px;
}

.video-modal-el {
  max-width: min(1000px, 92vw);
  max-height: 84vh;
  width: 100%;
  background: #000;
}

@media (max-width: 640px) {
  .lightbox-overlay,
  .video-modal-overlay {
    padding: 16px;
  }
  .lb-nav {
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
  }
}

/* Detail page body copy */
.detail .role {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 14px;
}

.detail .contributions {
  margin: 22px 0;
  padding: 0;
  list-style: none;
  max-width: 62ch;
}

.detail .contributions li {
  margin: 0 0 14px;
  color: #333;
  padding-left: 18px;
  position: relative;
}

.detail .contributions li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.detail h2 {
  font-size: 1.1rem;
  margin: 30px 0 4px;
}

.detail .outcome {
  max-width: 60ch;
  color: #333;
  margin: 0 0 22px;
}

.detail .credits {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* Video trigger thumbnails (open in the video modal) */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 0 0 30px;
}

.video-trigger {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #111;
}

.video-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.video-trigger:hover img {
  opacity: 1;
  transform: scale(1.03);
}

.video-trigger .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.video-trigger .play-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--ink);
  margin-left: 3px;
}

.video-trigger .video-label {
  position: absolute;
  left: 10px;
  bottom: 8px;
  color: #fff;
  font-size: 0.8rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
