/* =========================================
   JOSH TOBIAS — Portfolio Stylesheet
   Aesthetic: Editorial Minimalism
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Domine:wght@400..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black: #111010;
  --white: #f9f7f4;
  --gray-light: #e8e5e0;
  --gray-mid: #b0aba3;
  --gray-dark: #6b6660;
  --accent: #c8a96e;
  --sidebar-width: 220px;
  --content-max: 820px;
  --transition: 0.22s ease;
  --font-display: 'Domine', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* =========================================
   LAYOUT
   ========================================= */

.site-wrapper {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--gray-light);
  background: var(--white);
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand { margin-bottom: 40px; }

.sidebar-brand h1 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 4px;
}

.sidebar-brand .tagline {
  font-size: 0.72rem;
  color: var(--gray-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Nav --- */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-category { margin-bottom: 4px; }

.nav-category-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--black);
  padding: 6px 0;
  text-align: left;
  letter-spacing: 0.01em;
  transition: color var(--transition);
}

.nav-category-toggle:hover { color: var(--accent); }

.nav-category-toggle .chevron {
  display: inline-block;
  width: 10px; height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg) translateY(1px);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.nav-category.open .chevron {
  transform: rotate(45deg) translateY(-1px);
}

.nav-sub-links {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding-left: 16px;
  overflow: hidden;
}

.nav-category.open .nav-sub-links {
  display: flex;
  animation: slideDown 0.2s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-sub-links a {
  font-size: 0.78rem;
  color: var(--gray-dark);
  padding: 4px 0 4px 10px;
  margin-left: -10px;
  border-left: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0.01em;
}

.nav-sub-links a:hover,
.nav-sub-links a.active {
  color: var(--black);
  border-left-color: var(--accent);
}

.nav-divider {
  height: 1px;
  background: var(--gray-light);
  margin: 14px 0;
}

.nav-about {
  font-size: 0.78rem;
  color: var(--gray-mid);
  padding: 4px 0;
  letter-spacing: 0.03em;
  transition: color var(--transition);
}

.nav-about:hover { color: var(--black); }

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 64px 72px 100px;
  max-width: calc(var(--content-max) + var(--sidebar-width) + 144px);
}

/* =========================================
   HOMEPAGE
   ========================================= */

.home-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
  padding-top: 16px;
}

.home-photo-col { position: relative; width: 100%; }

.home-photo {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(8%);
  transition: filter 0.4s ease;
}

.home-photo:hover { filter: grayscale(0%); }

.home-photo-caption {
  font-size: 0.72rem;
  color: var(--gray-dark);
  margin-top: 10px;
  letter-spacing: 0.02em;
  font-style: italic;
}

.home-bio-col { padding-top: 8px; }

.home-bio-col h2 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

.home-bio-col p {
  font-size: 0.92rem;
  color: var(--gray-dark);
  margin-bottom: 18px;
  line-height: 1.75;
}

.home-bio-col p:last-child { margin-bottom: 0; }

/* =========================================
   CASE STUDY PAGE
   ========================================= */

.case-study-header {
  margin-bottom: 24px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--gray-light);
}

.case-study-meta {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-dark);
  margin-bottom: 16px;
}

.case-study-meta span { color: var(--accent); }

.case-study-header h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}

.case-study-header .role-tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--gray-light);
  padding: 5px 14px;
  color: var(--gray-dark);
  border-radius: 2px;
}

/* --- Sections --- */
.cs-section { margin-bottom: 56px; }

.cs-section h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.cs-section p {
  font-size: 0.92rem;
  color: var(--gray-dark);
  line-height: 1.8;
  margin-bottom: 14px;
}

.cs-section p:last-child { margin-bottom: 0; }

.cs-section ul {
  list-style: none;
  padding: 0;
  margin-top: 4px;
}

.cs-section ul li {
  font-size: 0.88rem;
  color: var(--gray-dark);
  line-height: 1.7;
  padding: 7px 0 7px 20px;
  position: relative;
  border-bottom: 1px solid var(--gray-light);
}

.cs-section ul li:first-child {
  border-top: 1px solid var(--gray-light);
}

.cs-section ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
}

/* =========================================
   IMAGE COMPONENT
   ========================================= */

.cs-image {
  position: relative;
  display: block;
  margin: 40px auto;
  max-width: 650px;
  width: fit-content;
}

.cs-image img {
  display: block;
  width: 100%;
  max-height: 650px;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.5s ease;
}

.cs-image:hover img {
  transform: scale(1.015);
}

.cs-image .caption {
  position: absolute;
  bottom: 20%;
  background: #2e2c2b;
  color: #f9f7f4;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.55;
  padding: 14px 18px;
  width: 160px;
  pointer-events: none;
  cursor: default;
  z-index: 1;
}

.cs-image .caption.left  { left: -48px; }
.cs-image .caption.right { right: -48px; }

/* Position: left (default) */
/* .cs-image .caption.left  { text-align: left; } */

/* Position: right */
/* .cs-image .caption.right { text-align: right; } */

/* =========================================
   LIGHTBOX
   ========================================= */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(17, 16, 16, 0.92);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 32px;
}

.lightbox.active {
  display: flex;
  animation: lbFade 0.25s ease both;
}

@keyframes lbFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  animation: lbScale 0.25s ease both;
}

@keyframes lbScale {
  from { transform: scale(0.96); }
  to   { transform: scale(1); }
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  font-weight: 300;
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-height: 90vh;
}

#lightbox-caption {
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 560px;
  pointer-events: none;
  cursor: default;
}

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

/* =========================================
   UTILITY
   ========================================= */

.divider {
  height: 1px;
  background: var(--gray-light);
  margin: 48px 0;
}

.page-fade-in {
  animation: pageFade 0.5s ease both;
}

@keyframes pageFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   MOBILE
   ========================================= */

.hamburger {
  display: none;
  position: fixed;
  top: 18px; left: 18px;
  z-index: 200;
  background: var(--white);
  border: 1px solid var(--gray-light);
  cursor: pointer;
  padding: 10px 12px;
  flex-direction: column;
  gap: 5px;
  border-radius: 2px;
}

.hamburger span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--black);
  transition: var(--transition);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,16,16,0.4);
  z-index: 90;
}

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 150;
  }

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

  .sidebar-overlay.visible { display: block; }

  .main-content {
    margin-left: 0;
    padding: 60px 24px 80px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 36px;
  }

.home-photo-col {
    width: 100%;
  }

  .home-photo {
    width: 75%;
    height: auto;
    aspect-ratio: unset;
    object-fit: contain;
    object-position: center top;
    filter: none;
  }
   
  .home-bio-col h2 { font-size: 2rem; }

  .case-study-header h1 { font-size: 2rem; }

  .cs-image {
    width: 100%;
    max-width: 100%;
    margin: 24px 0;
  }

  .cs-image img {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }

  .cs-image .caption {
    display: none;
  }
}
