/* ============================================================
   JACOB ACKERMAN — PORTFOLIO
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.2s ease-out; }
::view-transition-new(root) { animation: vt-in 0.25s ease-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

:root {
  --bg: #FAFAFA;
  --bg-alt: #F2F2F0;
  --surface: #fff;
  --text: #111;
  --text-2: #555;
  --text-3: #888;
  --accent: #D94F2B;
  --accent-h: #C14325;
  --border: #E5E5E3;
  --border-h: #CCC;
  --display: 'Bricolage Grotesque', sans-serif;
  --body: 'DM Sans', sans-serif;
  --px: clamp(1.25rem, 4vw, 2.5rem);
  --max: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }

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

/* === NAV === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,250,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem var(--px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav__logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  color: #fff;
  border-radius: 6px;
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
  justify-self: center;
}

.nav__links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
}

.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--text); }

.nav__spacer { justify-self: end; }

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 14px;
  position: relative;
  z-index: 101;
  justify-self: end;
}

.nav__toggle span {
  display: block; width: 100%; height: 1.5px;
  background: var(--text); position: absolute; left: 0;
  transition: all 0.3s;
}

.nav__toggle span:nth-child(1) { top: 0; }
.nav__toggle span:nth-child(2) { top: 6px; }
.nav__toggle span:nth-child(3) { top: 12px; }

.nav__toggle.open span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* === SCROLL REVEAL === */
@supports (animation-timeline: view()) {
  .reveal {
    animation: reveal 0.5s var(--ease) both;
    animation-timeline: view();
    animation-range: entry 0% entry 25%;
  }
  @keyframes reveal {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

@supports not (animation-timeline: view()) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  }
  .reveal.visible { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  @view-transition { navigation: none; }
}

/* === PROJECT CARDS (homepage) === */
.projects { padding: 2.5rem 0 4rem; }

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, box-shadow 0.35s var(--ease);
}

.project-card:hover {
  border-color: var(--border-h);
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

.project-card__thumb {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-alt);
}

.project-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.project-card:hover .project-card__thumb img {
  transform: scale(1.03);
}

/* placeholder when no thumbnail yet */
.project-card__thumb-ph {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  color: var(--border);
  letter-spacing: -0.02em;
  user-select: none;
}

.project-card__body { padding: 1.25rem 1.5rem 1.5rem; }

.project-card__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.project-card__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.project-card__desc {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.55;
}

.project-card__arrow {
  position: absolute;
  bottom: 1.35rem;
  right: 1.35rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, border-color 0.25s;
}

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

.project-card__arrow svg {
  width: 14px; height: 14px;
  stroke: var(--text-2);
  transition: stroke 0.25s;
}

.project-card:hover .project-card__arrow svg { stroke: #fff; }

/* === HERO (small, not dominant) === */
.hero {
  padding: 3.5rem 0 2rem;
}

.hero__intro {
  max-width: 600px;
}

.hero__name {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.hero__desc {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.65;
}

.hero__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* === CASE STUDY PAGE === */
.case-hero {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.case-hero__title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.case-hero__sub {
  font-size: 1rem;
  color: var(--text-2);
  margin-top: 0.5rem;
}

.case-meta {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.case-meta dt {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.case-meta dd { font-size: 0.9rem; color: var(--text); margin-top: 0.1rem; }

.case-section { padding: 3rem 0; }

.case-section h2 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.case-section p {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-2);
  max-width: 640px;
}

.case-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.stat-row {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-card {
  flex: 1;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stat-card__num {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.15rem;
}

.stat-card__label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

/* === MEDIA === */
.media-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.85rem;
}

/* Horizontal scroll strip */
.hscroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--px);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  -webkit-overflow-scrolling: touch;
}

/* hide scrollbar but keep functionality */
.hscroll::-webkit-scrollbar { height: 6px; }
.hscroll::-webkit-scrollbar-track { background: var(--border); border-radius: 3px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 3px; }
.hscroll::-webkit-scrollbar-thumb:hover { background: var(--text-2); }

.hscroll > .card {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

/* Video cards in scroll strip: taller, phone-sized */
.hscroll--video > .card {
  width: 240px;
}

.hscroll--video .card video {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
}

/* Image cards in scroll strip: wider */
.hscroll--image > .card {
  width: 320px;
}

.hscroll--image .card img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

/* Grid (for gallery page) */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.05);
}

.card video,
.card img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.card img { cursor: pointer; }

.card__info { padding: 0.65rem 0.85rem; }
.card__info h4 { font-size: 0.78rem; font-weight: 600; }
.card__info p  { font-size: 0.68rem; color: var(--text-2); }

.play {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  aspect-ratio: 4/5;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.06);
  cursor: pointer;
  transition: background 0.25s;
}

/* Override play aspect ratio for hscroll videos */
.hscroll--video .play {
  aspect-ratio: 9/16;
}

.play:hover { background: rgba(0,0,0,0.16); }
.play svg { width: 40px; height: 40px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); transition: transform 0.25s; }
.play:hover svg { transform: scale(1.06); }
.play.hidden { display: none; }

/* === GALLERY === */
.gallery-section { padding: 2rem 0 4rem; }

.filters { display: flex; gap: 0.35rem; margin-bottom: 1.5rem; }

.fil {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}

.fil:hover { border-color: var(--text); color: var(--text); }
.fil.on { background: var(--text); border-color: var(--text); color: #fff; }

.gal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.gal-item.hide { display: none; }

/* === ABOUT === */
.about-section { padding: 2.5rem 0 4rem; }

.about-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: start;
}

.about-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.about-photo img { width: 100%; height: 100%; object-fit: cover; }

.about-photo__ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; color: var(--text-3); text-align: center;
}

.about-copy h2 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.about-copy p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-2);
  margin-bottom: 0.65rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 1.25rem; }

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-2);
}

/* === CONTACT === */
.contact-section {
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.contact-section h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.contact-section p {
  font-size: 0.9rem;
  color: var(--text-2);
  margin-bottom: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.65rem 1.5rem;
  border: 1.5px solid var(--text);
  border-radius: 100px;
  color: var(--text);
  transition: all 0.25s;
}

.btn:hover { background: var(--text); color: #fff; }
.btn svg { width: 14px; height: 14px; }

/* === FOOTER === */
.footer { border-top: 1px solid var(--border); background: var(--surface); }

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  padding: 3rem 0 2rem;
}

.footer__brand p {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 260px;
  margin-top: 0.35rem;
}

.footer__brand h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
}

.footer__col h4 {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.65rem;
}

.footer__col ul { list-style: none; }
.footer__col li { margin-bottom: 0.35rem; }
.footer__col a { font-size: 0.82rem; color: var(--text-2); text-decoration: none; transition: color 0.2s; }
.footer__col a:hover { color: var(--text); }

.footer__bottom {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-3);
}

/* === LIGHTBOX === */
.lb {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.lb.on { opacity: 1; pointer-events: all; }
.lb img {
  max-width: min(90vw,800px);
  max-height: 85vh;
  border-radius: 6px;
  object-fit: contain;
  background: #000;
}
.lb video {
  max-width: min(90vw,420px);
  max-height: 85vh;
  border-radius: 6px;
  background: #000;
}
.lb__close {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: #fff; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* === PAGE HEADER === */
.page-header {
  padding: 2.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-header__tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .projects__grid { grid-template-columns: 1fr; }
  .case-cols { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-photo { max-width: 200px; }
}

@media (max-width: 680px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; justify-self: end; }

  .nav__links.open {
    display: flex; flex-direction: column;
    position: fixed; inset: 0;
    background: rgba(250,250,250,0.98);
    backdrop-filter: blur(16px);
    padding: 4rem 1.5rem; gap: 1rem; z-index: 100;
  }
  .nav__links.open a { font-size: 1.3rem; font-family: var(--display); font-weight: 700; color: var(--text); }

  .grid-4 { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .gal { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .stat-row { flex-direction: column; }
  .case-meta { gap: 1.5rem; }

  .hscroll--video > .card { width: 180px; }
  .hscroll--image > .card { width: 240px; }
}

@media (max-width: 420px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .gal { grid-template-columns: 1fr 1fr; }
  .hscroll--video > .card { width: 160px; }
  .hscroll--image > .card { width: 200px; }
}
