/* --------------------------------------------------------
   Fonts
   -------------------------------------------------------- */

@font-face {
  font-family: 'Barriecito';
  src: url('fonts/Barriecito/Barriecito-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------
   Custom properties & color scheme
   -------------------------------------------------------- */

:root {
  color-scheme: light dark;
  --page-left: max(32px, 50vw - 212px);
  --bg: #ffffff;
  --fg: #111111;
  --accent: #0077cc;
  --muted: #555555;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111517;
    --fg: #e8e6e3;
    --accent: #fff348;
    --muted: #aaaaaa;
  }
}

/* --------------------------------------------------------
   Reset & base
   -------------------------------------------------------- */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100svh;
  display: flex;
  align-items: center;
  font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

a {
  font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
}

/* --------------------------------------------------------
   Page layout
   -------------------------------------------------------- */

.page {
  width: 100%;
  padding: 40px 0 100px var(--page-left);
  margin: 0 0 0 0
}

header {
  margin-bottom: 8px;
}

/* --------------------------------------------------------
   Header details
   -------------------------------------------------------- */

#header-details > summary {
  font-size: 2rem;
  font-weight: 400;
  font-family: 'Barriecito', system-ui, sans-serif;
}

#header-details > summary h1 {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

summary::-webkit-details-marker {
  display: none;
}

summary::marker {
  content: none;
}

/* --------------------------------------------------------
   Client & project navigation
   -------------------------------------------------------- */

.client > summary {
  cursor: pointer;
  font-size: 1rem;
  font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  text-decoration: none;
  display: inline-block;
  padding: 2px 0;
}

.client[open] > summary {
  color: var(--accent);
  font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
}

.project-details > summary {
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  margin-left: 1.5rem;
  display: inline-block;
  padding: 2px 0;
}

.project-details[open] > summary {
  color: var(--accent);
  font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
}

.project {
  margin-left: 1.5rem;
  padding-top: 0;
}

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

/* --------------------------------------------------------
   Hover states
   -------------------------------------------------------- */

@media (hover: hover) {
  .client > summary:hover {
    color: var(--accent);
    font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
  }

  .project-details > summary:hover {
    color: var(--accent);
    font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
  }

  .contact a:hover,
  .project-description a:hover,
  .page-description a:hover {
    color: var(--accent);
    text-decoration: underline;
  }
}

/* --------------------------------------------------------
   Contact
   -------------------------------------------------------- */

.contact {
  margin: 0 0 8px;
  font-size: 0.8rem;
  margin-left: 1.5rem;
}

.contact a,
.project-description a,
.page-description a {
  color: var(--fg);
  text-decoration: none;
}

/* --------------------------------------------------------
   Text content
   -------------------------------------------------------- */

.project-description {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  max-width: min(400px, calc(100vw - var(--page-left) - 64px));
  padding-bottom: 8px;
}

.page-description {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  max-width: min(424px, calc(100vw - var(--page-left) - 32px));
  padding-bottom: 8px;
}

.video-title {
  font-size: 0.65rem;
  color: var(--muted);
  margin: 4px 0 0 0;
  padding: 0 2px;
}

/* --------------------------------------------------------
   Video row (carousel)
   -------------------------------------------------------- */

.video-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 2px;
  --end-spacer: 0px;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}

.video-row::-webkit-scrollbar {
  display: none;
}

.video-row::after {
  content: "";
  flex: 0 0 var(--end-spacer);
  pointer-events: none;
}

.video-row .video-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 0 0 auto;
}

/* Drag states */

.video-row.is-dragging {
  cursor: grabbing;
}

.video-row.is-dragging .thumb-container {
  cursor: grabbing;
}

body.is-row-dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

/* --------------------------------------------------------
   Video items & wrappers
   -------------------------------------------------------- */

.video-wrapper {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  transform: translateZ(0);
  transition: transform 0.15s ease;
}

.video-wrapper.horizontal {
  aspect-ratio: 16 / 9;
  width: clamp(200px, calc(100vw - var(--page-left) - 64px), 400px);
}

.video-wrapper.vertical {
  aspect-ratio: 9 / 16;
  height: clamp(150px, calc((100vw - var(--page-left) - 2px) * 9 / 16), 260px);
}

.video-wrapper.scope {
  aspect-ratio: 1920 / 800;
  width: clamp(200px, calc(100vw - var(--page-left) - 64px), 400px);
}

.video-wrapper.is-grabbed {
  transform: scale(0.95) translateZ(0);
}

/* --------------------------------------------------------
   Thumbnails
   -------------------------------------------------------- */

.thumb-container {
  position: absolute;
  inset: 0;
  cursor: inherit;
  overflow: hidden;
}

.video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* --------------------------------------------------------
   Video lightbox modal
   -------------------------------------------------------- */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.video-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.video-modal-iframe {
  border: none;
  display: block;
  pointer-events: auto;
  background: #000;
  color-scheme: light;
}
