:root{
  --bg: #0a0a0a;
  --bg-elevated: #151515;
  --text: #f2f0ec;
  --text-muted: #8a8883;
  --border: rgba(255,255,255,0.09);
  --accent: #ffffff;
  --page-gutter: clamp(20px, 4vw, 48px);
}

*{ box-sizing: border-box; margin:0; padding:0; }

html{
  background: var(--bg);
  scroll-behavior: smooth;
}

body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* subtle film-grain overlay, purely decorative */
.grain{
  position: fixed; inset:0; pointer-events:none; z-index: 50;
  opacity: 0.03; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a{ color: inherit; text-decoration: none; }

/* ---------- header ---------- */
.site-header{
  position: sticky; top:0; z-index: 20;
  display:flex; align-items:center; justify-content: flex-start;
  padding: 26px var(--page-gutter);
}

.site-nav{
  display:flex;
  align-items:baseline;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  gap: 22px;
}

.site-nav-left{
  display:flex;
  align-items:baseline;
  gap: 22px;
}

.wordmark{
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
}

.site-nav a:not(.wordmark),
.filter-button{
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-muted);
  transition: color .2s ease;
}
.site-nav a:not(.wordmark):hover,
.filter-button:hover,
.filter-button.is-active{
  color: var(--text);
}

.site-filters{
  display:flex;
  align-items: baseline;
  justify-content: flex-end;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  gap: 22px;
  margin-left: auto;
  white-space: nowrap;
}

.filter-button{
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: right;
  width: 44px;
  white-space: normal;
  line-height: 1.05;
}

.filter-button.is-active{
  color: var(--text);
}

.project.is-hidden{
  display: none !important;
}

/* ---------- grid ---------- */
.grid{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  gap: 40px 32px;
  padding: 0 var(--page-gutter);
  margin-top: 32px;
  min-height: 640px;
}

.project{
  all: unset;
  cursor: pointer;
  display:flex; flex-direction: column;
}

.thumb{
  position: relative;
  aspect-ratio: 16/9;
  display:block;
  background: var(--bg-elevated);
  overflow: hidden;
}

.thumb.thumb--vertical{
  aspect-ratio: 4/5;
}

.thumb.thumb--3-4{
  aspect-ratio: 3/4;
}

.thumb img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 60ms linear;
}

.thumb img.is-visible{
  opacity: 1;
}

.project:focus-visible .thumb{
  outline: 1px solid var(--text);
  outline-offset: 3px;
}

.info{
  display:flex; flex-direction: column;
  gap: 4px;
  padding: 14px 0 0;
  margin-top: auto;
  text-align: left;
  min-height: 72px;
}

.info span{
  display: block;
  width: 100%;
  min-width: 0;
}

.title{
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta{
  font-family: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b0aea8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta.muted{ opacity: 0.75; text-transform: none; }

/* ---------- about ---------- */
.about-page{
  min-height: 100vh;
  padding: 72px clamp(20px, 4vw, 48px) 96px;
  background: #000;
  color: #fff;
}

.about-copy{
  max-width: 760px;
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.55;
}

.about-copy a{
  color: var(--text-muted);
  transition: color .2s ease;
}
.about-copy a:hover{ color: var(--text); }

.about-copy p + p{
  margin-top: 24px;
}

/* ---------- footer / contact ---------- */
#contact{
  scroll-margin-top: 90px;
  display:flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 72px clamp(20px, 4vw, 48px) 80px;
}

.email,
.handle{
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-muted);
  transition: color .2s ease;
}
.email:hover,
.handle:hover{ color: var(--text); }

/* ---------- lightbox ---------- */
.lightbox{
  position: fixed; inset: 0; z-index: 100;
  display:flex; align-items:flex-start; justify-content:center;
  background: rgba(6,6,6,0.94);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  padding: 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.lightbox.open{ opacity: 1; pointer-events: auto; }

.lightbox-inner{
  width: min(920px, 100%);
  margin: 0 auto;
  padding-bottom: 24px;
}

.lightbox-media-row{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.lightbox-media{
  width: 100%;
  min-width: 0;
  flex: 1 1 260px;
  aspect-ratio: 16/9;
  max-height: 70vh;
  background: #000;
  display:block;
  border: 0;
}
.lightbox-media[hidden]{ display: none; }

.lightbox.dual .lightbox-inner{
  width: min(920px, 100%);
}
.lightbox.dual .lightbox-media-row{
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.lightbox.dual .lightbox-media{
  max-height: 70vh;
  width: 100%;
  flex: none;
}
.lightbox.dual .lightbox-media:first-of-type{
  max-width: 920px;
  width: 100%;
}
.lightbox.dual .lightbox-media:not(:first-of-type){
  align-self: stretch;
}

.lightbox.vertical .lightbox-inner{
  width: min(420px, 88vw);
}
.lightbox.vertical .lightbox-media{
  aspect-ratio: 4/5;
  max-height: 80vh;
}

.lightbox.three-four .lightbox-inner{
  width: min(400px, 85vw);
}
.lightbox.three-four .lightbox-media{
  aspect-ratio: 3/4;
  max-height: 80vh;
}

.lightbox-info{
  padding-top: 16px;
  display:flex; align-items:baseline; gap: 14px; flex-wrap: wrap;
}
.lightbox-info h3{ font-size: 16px; font-weight: 600; }
.lightbox-info p{
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.lightbox-close{
  all: unset;
  position: absolute; top: 24px; right: clamp(20px, 4vw, 48px);
  font-size: 28px; color: var(--text-muted);
  cursor: pointer; line-height: 1;
  transition: color .2s ease;
}
.lightbox-close:hover{ color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 1100px){
  .grid{ grid-template-columns: repeat(3, 1fr); min-height: 900px; }
}
@media (max-width: 768px){
  .lightbox{ padding: 20px 16px 24px; align-items: flex-start; }
  .lightbox-inner{ width: min(100%, 560px); padding-top: 12px; }
  .lightbox-media-row{ flex-direction: column; align-items: stretch; }
  .lightbox-media{ width: 100%; max-width: 100%; flex-basis: auto; }
  .lightbox.dual .lightbox-inner{ width: min(100%, 560px); }
  .lightbox.vertical .lightbox-inner,
  .lightbox.three-four .lightbox-inner{ width: min(100%, 420px); }
}
@media (max-width: 680px){
  .grid{ grid-template-columns: repeat(2, 1fr); gap: 28px 16px; min-height: 1400px; }
  .site-header{ padding: 18px var(--page-gutter); }
  .site-filters{ gap: 12px; }
}
@media (max-width: 420px){
  .grid{ grid-template-columns: repeat(1, 1fr); min-height: 2200px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition: none !important; }
}
