/* ═══════════════════════════════════════════════
   Daniel Savage — Portfolio Styles
   ═══════════════════════════════════════════════ */

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

:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #777;
  --side-pad: 11vw;
  --col-gap: 8vw;
  --row-gap: 160px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── PASSWORD GATE ─── */
.pw-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  overflow-y: auto;
  transition: opacity .5s ease;
}
.pw-gate.hidden {
  opacity: 0;
  pointer-events: none;
}
.pw-gate .pw-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 var(--side-pad);
  background: var(--bg);
  z-index: 10000;
}
.pw-fields {
  margin-top: 32px;
}
.pw-gate input {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .01em;
  padding: 10px 16px;
  border: 1px solid #ddd;
  border-radius: 0;
  outline: none;
  width: 220px;
  transition: border-color .25s;
}
.pw-gate input:focus { border-color: var(--fg); }
.pw-gate input::placeholder { color: #bbb; font-weight: 400; }
.pw-gate .pw-enter {
  margin-top: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--fg);
  background: none;
  border: 1px solid #ddd;
  padding: 8px 32px;
  cursor: pointer;
  transition: border-color .25s;
  display: block;
}
.pw-gate .pw-enter:hover { border-color: var(--fg); }
.pw-gate .pw-error {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .01em;
  color: #c44;
  opacity: 0;
  transition: opacity .25s;
}
.pw-gate .pw-error.show { opacity: 1; }

/* ─── NAV ─── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 var(--side-pad);
  background: var(--bg);
  z-index: 100;
}
nav .name {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--fg);
  text-decoration: none;
}
nav .links {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
}
nav .links a {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--fg);
  text-decoration: none;
  transition: opacity .25s;
}
nav .links a:hover { opacity: .5; }

/* ─── FOOTER ─── */
footer {
  padding: 0 var(--side-pad) 28px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: .01em;
}

/* ─── FADE IN ─── */
.fade-in,
.item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.25,.1,.25,1), transform .8s cubic-bezier(.25,.1,.25,1);
}
.fade-in.visible,
.item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── TWO-COLUMN LAYOUT (work page) ─── */
.columns {
  padding: 110px var(--side-pad) 0;
  display: flex;
  gap: var(--col-gap);
  align-items: flex-start;
}
.col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--row-gap);
}
.masonry { display: none; }

.item video,
.item img {
  display: block;
  width: 100%;
  height: auto;
}
.item img,
.item video { cursor: pointer; }

.item .caption {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .01em;
  color: var(--fg);
}

/* ─── LIGHTBOX ─── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img,
.lightbox video {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
  cursor: default;
}
.lightbox video { display: none; }
.lightbox img { display: none; }
.lightbox.show-img img { display: block; }
.lightbox.show-vid video { display: block; }
.lightbox .close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox .close-btn::before,
.lightbox .close-btn::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 1.5px;
  background: var(--fg);
}
.lightbox .close-btn::before { transform: rotate(45deg); }
.lightbox .close-btn::after { transform: rotate(-45deg); }

/* ─── ABOUT PAGE ─── */
.about-hero {
  padding: 120px var(--side-pad) 0;
  display: flex;
  gap: 8vw;
  align-items: flex-start;
}
.about-portrait { flex: 0 0 320px; }
.about-portrait img { display: block; width: 100%; height: auto; }
.photo-credit { font-size: 11px; color: #aaa; margin-top: 6px; }

.about-bio {
  flex: 1;
  max-width: 600px;
  padding-top: 4px;
}
.about-bio p {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .01em;
  color: var(--fg);
}
.about-contact { margin-top: 32px; }
.about-contact .connect-label {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .01em;
  margin-bottom: 12px;
}
.about-contact a.email {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,.2);
  padding-bottom: 2px;
  transition: border-color .3s;
}
.about-contact a.email:hover { border-color: var(--fg); }
.about-contact .socials {
  margin-top: 12px;
  display: flex;
  gap: 20px;
}
.about-contact .socials a {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--muted);
  text-decoration: none;
  transition: color .25s;
}
.about-contact .socials a:hover { color: var(--fg); }

/* ─── CV SECTIONS ─── */
.cv {
  padding: 100px var(--side-pad) 0;
  max-width: 900px;
}
.cv-section { margin-bottom: 72px; }
.cv-section h2 {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--fg);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e5e5;
}
.cv-entry {
  display: flex;
  gap: 24px;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.6;
  color: var(--fg);
}
.cv-entry .year {
  flex: 0 0 100px;
  color: var(--muted);
}
.cv-entry .detail { flex: 1; }
.cv-entry .detail em { font-style: italic; }
.cv-entry .detail a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,.15);
  padding-bottom: 1px;
  transition: border-color .3s;
}
.cv-entry .detail a:hover { border-color: var(--fg); }

/* ─── PRESS SECTION ─── */
.press-entry {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.6;
}
.press-entry a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,.15);
  padding-bottom: 1px;
  transition: border-color .3s;
}
.press-entry a:hover { border-color: var(--fg); }
.press-entry .press-source {
  color: var(--muted);
}

/* ─── 404 PAGE ─── */
.page-404 {
  padding: 200px var(--side-pad) 0;
  max-width: 500px;
}
.page-404 h1 {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .01em;
  margin-bottom: 16px;
}
.page-404 p {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.6;
  color: var(--muted);
}
.page-404 a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,.2);
  padding-bottom: 2px;
}
.page-404 a:hover { border-color: var(--fg); }

/* ─── VIDEO WRAP ─── */
.item .video-wrap {
  position: relative;
  cursor: pointer;
}
.item .video-wrap .play-btn {
  display: none;
}
.item .video-wrap .mobile-poster {
  display: none;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  :root {
    --side-pad: 24px;
    --col-gap: 16px;
    --row-gap: 60px;
  }
  .columns { flex-direction: column; }
  .about-hero { flex-direction: column; gap: 40px; }
  .about-portrait { flex: none; width: 100%; max-width: 320px; order: -1; }
  .cv { padding-top: 60px; }
  .cv-section { margin-bottom: 48px; }
  .cv-section h2 { font-size: 15px; margin-bottom: 12px; padding-bottom: 10px; }
  .cv-entry { gap: 12px; margin-bottom: 6px; font-size: 14px; line-height: 1.55; }
  .cv-entry .year { flex: 0 0 72px; font-size: 13px; }

}

@media (max-width: 420px) {
  .cv-entry { flex-direction: column; gap: 1px; margin-bottom: 14px; }
  .cv-entry .year { flex: none; font-size: 12px; opacity: .55; }
  .cv-entry .detail { font-size: 14px; }
}

/* ─── MOBILE VIDEO (JS-driven via body.is-mobile) ─── */
body.is-mobile .item .video-wrap video {
  display: none;
}
body.is-mobile .item .video-wrap .mobile-poster {
  display: block;
  width: 100%;
  height: auto;
}
body.is-mobile .item .video-wrap .play-btn {
  display: flex;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  transition: opacity .3s;
  z-index: 2;
  pointer-events: none;
}
body.is-mobile .item .video-wrap .play-btn svg {
  width: 48px;
  height: 48px;
  opacity: .6;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.3));
}
body.is-mobile .item .video-wrap.playing video {
  display: block;
}
body.is-mobile .item .video-wrap.playing .mobile-poster {
  display: none;
}
body.is-mobile .item .video-wrap.playing .play-btn {
  opacity: 0;
  pointer-events: none;
}
