/* ============================================================
   CHANNING WILLIFORD — Portfolio Site
   ============================================================
   HOW TO CUSTOMIZE:
   - Colors: edit the --color-* variables below
   - Fonts: swap the Google Fonts import and --font-* variables
   - Spacing: adjust --space-* variables
   - Add projects: copy a .panel block in index.html

   TYPE SETTINGS — PANELS:
   Every text rule below sets font-family + font-size + line-height
   explicitly. None of them rely on inheriting from a parent or from
   body. Adjust freely without worrying about cascade conflicts.
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=DM+Mono:ital,wght@0,300;0,400;1,300&display=swap');

/* ---- Design Tokens ---- */
:root {
  --color-bg:         #f1f0ef;
  --color-text:       #1a1a18;
  --color-muted:      #5a5a55;
  --color-border:     #c8c4bc;
  --color-panel-bg:   #e4e4e3;
  --color-btn-border: #2a2a28;
  --color-hover:      #437c3b;

  --font-display: 'Spectral', serif;
  --font-body:    'Spectral', serif;

  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 48px;
  --space-lg: 64px;

  --panel-width: min(55vw, calc(100vw - 500px));
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: hidden;
}

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


/* ============================================================
   MAIN LEFT PANEL
   ============================================================ */

.main {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--space-sm) var(--space-md);
  pointer-events: none;
  z-index: 15;
}

.main > * { pointer-events: all; }

.site-header {
  padding-top: var(--space-md);
  padding-bottom: 0;
}

.logo-container {
  display: inline-block;
  line-height: 0;
  font-size: 0;
}

.logo-desktop {
  display: block;
  width: clamp(300px, 40vw, 1000px);
  height: auto;
  max-width: 100%;
}

.logo-mobile {
  display: none;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: var(--space-sm);
}

.role {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(14px, 2vw, 45px);
  line-height: 2.2;
  letter-spacing: -0.014em;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-link {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(14px, 1.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.014em;
  color: var(--color-text);
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}

.project-link:hover {
  color: var(--color-hover);
  font-weight: 200;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-link.active {
  color: var(--color-hover);
  font-weight: 200;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: var(--space-sm);
}

.footer-nav {
  display: flex;
  gap: var(--space-xs);
}

.btn {
  font-family: var(--font-body);
  font-size: 14px;
  border: 1px solid var(--color-btn-border);
  padding: 4px 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: inline-block;
}

.btn:hover, .btn.active {
  background-color: var(--color-text);
  color: var(--color-bg);
}

.footer-credit {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-muted);
  text-align: center;
  line-height: 1.5;
}


/* ============================================================
   OVERLAY PANELS (right-side slide-in)
   ============================================================ */

.overlay-bg {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 10;
  pointer-events: none;
  transition: background 0.3s ease;
}

.overlay-bg.active {
  pointer-events: all;
  right: var(--panel-width);
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--panel-width);
  min-width: 320px;
  height: 100vh;
  background: var(--color-panel-bg);
  z-index: 20;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid var(--color-border);
}

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

.panel-header {
  position: sticky;
  top: 0;
  background: var(--color-panel-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-muted);
  z-index: 5;
}

.panel-close {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.05em;
}

.panel-close:hover {
  opacity: 0.5;
}

.panel-body {
  padding: var(--space-md) var(--space-md) var(--space-lg);
}

.panel-intro {
  text-align: center;
  margin-bottom: var(--space-lg);
}


/* -------- PANEL TEXT — TYPE SETTINGS LIVE HERE -------- */

.panel-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2.5vw, 40px);
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-sm);
}

.panel-meta {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-text);
}

.panel-credits {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--color-text);
}

.panel-description {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--color-text);
}

.panel-description p + p {
  margin-top: var(--space-sm);
}

.panel-media {
  width: 100%;
  margin-bottom: var(--space-lg);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-media video,
.panel-media iframe {
  width: 70%;
  margin: 0 auto;
  display: block;
  aspect-ratio: 16 / 9;
  background: transparent;
}

.panel-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}


/* ============================================================
   ABOUT PANEL
   ============================================================ */

.about-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.about-section:first-child {
  padding-top: 0;
}

.about-left {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--color-text);
}

.about-right {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--color-text);
}

.about-right > p + p {
  margin-top: var(--space-sm);
}

.about-entry {
  margin-bottom: var(--space-sm);
}

.about-entry:last-child {
  margin-bottom: 0;
}

.about-entry em {
  font-style: italic;
}

.about-right a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-divider {
  border-top: 1px solid var(--color-border);
}

.entry-company {
  font-weight: 600;
  margin-bottom: 6px;
}

.entry-role {
  margin-bottom: 4px;
}

.entry-date {
  color: var(--color-muted);
  font-size: 0.9em;
}

.about-entry p + p {
  margin-top: 2px;
}


/* ============================================================
   ARCHIVE PANEL
   ============================================================ */

.archive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.archive-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.archive-item video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: transparent;
}

.archive-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.3;
}


/* ============================================================
   CAROUSEL
   ============================================================ */

.carousel {
  position: relative;
  width: 70%;
  margin: 0 auto var(--space-lg);
}

.carousel-inner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.carousel-track-wrapper {
  flex: 1;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
}

.carousel-slide video,
.carousel-slide img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: transparent;
}

.carousel-arrow {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text);
  width: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.15s ease;
  padding: 0;
}

.carousel-arrow img {
  width: 24px;
  height: auto;
  display: block;
}

.carousel-arrow:hover {
  opacity: 1;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: var(--space-sm);
}

.carousel-dot {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.25;
  transition: opacity 0.2s ease;
}

.carousel-dot.active {
  opacity: 1;
}

.dot-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.dot-static {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.carousel-dot:not(.active) .dot-video {
  display: none;
}

.carousel-dot.active .dot-static {
  display: none;
}


/* ============================================================
   RESPONSIVE — tablet and mobile (900px and below)
   ============================================================ */

@media (max-width: 900px) {
  :root {
    --panel-width: 100vw;
  }

  .main {
    padding: var(--space-sm) 16px;
  }

  .logo-desktop {
    display: none;
  }

  .logo-mobile {
    display: block;
  }

  .role {
    font-size: 1.3rem;
  }

  .project-link {
    font-size: 1.3rem;
  }

  .panel-details,
  .about-section {
    grid-template-columns: 1fr;
  }

  .carousel {
    width: 100%;
  }

  .carousel-inner {
    gap: 0;
  }

  .carousel-arrow {
    display: none;
  }

  .panel-media video,
  .panel-media iframe {
    width: 100%;
  }

  .panel-title {
    font-size: 1.4rem;
  }

  .panel-meta {
    font-size: 1rem;
  }

  .panel-credits {
    font-size: 0.9rem;
  }

  .panel-description {
    font-size: 0.9rem;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .panel,
  .carousel-track {
    transition: none;
  }
}
