/* Personal Portfolio Website Styles */

:root {
  --bg: #fff;
  --ink: #111;
  --muted: #777;
  --rule: #e5e5e5;
  --accent: #111;
  --hover-bg: #f8f8f8;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --ink: #e5e5e5;
    --muted: #999;
    --rule: #2a2a2a;
    --accent: #fff;
    --hover-bg: #1a1a1a;
  }
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

/* Header styles */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 16px;
}

.navlinks {
  display: flex;
  gap: 12px;
}

.contact-link {
  font-size: 12px;
  text-transform: lowercase;
  padding: 4px 8px;
  border: 1px solid var(--rule);
  transition: all 0.2s ease;
}

.contact-link:hover {
  background: var(--hover-bg);
  text-decoration: none;
}

.search {
  margin-left: auto;
}

.search input {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  outline: none;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.2s ease;
}

.search input:focus {
  border-color: var(--accent);
}

.rule {
  border-top: 1px solid var(--rule);
}

/* Navigation styles */
.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12px;
  text-transform: lowercase;
}

.nav a {
  color: var(--muted);
  padding: 4px 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a.current {
  color: var(--ink);
  text-decoration: none;
}

.nav a.current::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

/* Main content */
.wrap {
  max-width: 1200px;
  margin: 18px auto 80px;
  padding: 0 16px;
}

/* Section styles */
.section {
  margin: 36px 0 60px;
}

.section .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
  margin: 0 0 8px;
  font-weight: 500;
}

.section .hr {
  height: 1px;
  background: var(--rule);
  margin: 8px 0 22px;
}

/* Project styles */
.project {
  margin: 0 0 48px;
  transition: opacity 0.3s ease;
}

.project.hidden {
  display: none;
}

figure {
  margin: 0;
}

.media {
  width: 100%;
  background: #f2f2f2 center/cover no-repeat;
  aspect-ratio: 16 / 9;
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
}

.media:hover {
  transform: scale(1.01);
}

.meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.title {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.kvs {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px 16px;
  justify-content: start;
  align-items: start;
}

.kvs > div:nth-child(odd) {
  font-weight: 500;
  color: var(--muted);
}

.kvs > div:nth-child(even) {
  color: var(--ink);
}

/* Utility classes */
.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
  .bar {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .search {
    margin-left: 0;
    order: -1;
    width: 100%;
  }
  
  .search input {
    width: 100%;
  }
  
  .nav {
    gap: 12px;
    justify-content: center;
  }
  
  .meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .kvs {
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 12px;
  }
  
  .bar {
    padding: 12px;
  }
  
  .nav {
    padding: 6px 12px;
    gap: 8px;
  }
  
  .brand {
    font-size: 14px;
  }
}

/* Media elements */
.media {
  position: relative;
}

/* Focus styles for accessibility */
a:focus,
input:focus,
button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Slideshow styles */
.slideshow {
  position: relative;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.slide.active {
  opacity: 1;
}

.slideshow-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 12px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.slide-btn {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.slide-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.slide-indicators {
  display: flex;
  gap: 6px;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.indicator.active {
  background: white;
}

.indicator:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Video container styles */
.video-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.project-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  outline: none;
  background: transparent;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

.project-video::-webkit-media-controls {
  background: transparent;
}

.video-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--muted);
  font-size: 10px;
  font-family: var(--mono);
  opacity: 0.7;
  background: transparent;
  padding: 4px 8px;
  border-radius: 0;
  pointer-events: none;
}

.project-video::-webkit-media-controls-panel {
  background: var(--bg) !important;
  border: 1px solid var(--rule) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.project-video::-webkit-media-controls-enclosure {
  background: var(--bg) !important;
  border: none !important;
  box-shadow: none !important;
}

.project-video::-webkit-media-controls-play-button,
.project-video::-webkit-media-controls-pause-button {
  background: transparent;
  border: none;
  color: var(--text);
  opacity: 1;
  filter: none;
  border-radius: 0;
}

.project-video::-webkit-media-controls-play-button:hover,
.project-video::-webkit-media-controls-pause-button:hover {
  opacity: 0.7;
}

.project-video::-webkit-media-controls-timeline {
  background: var(--rule);
  border: none;
  height: 1px;
  margin: 0 8px;
  border-radius: 0;
}

.project-video::-webkit-media-controls-timeline::-webkit-slider-thumb {
  background: var(--text);
  border: none;
  border-radius: 0;
  width: 8px;
  height: 8px;
}

.project-video::-webkit-media-controls-current-time-display,
.project-video::-webkit-media-controls-time-remaining-display {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  opacity: 1;
  text-shadow: none;
}

.project-video::-webkit-media-controls-volume-slider {
  background: var(--rule);
  border: none;
  height: 1px;
  width: 50px;
  border-radius: 0;
}

.project-video::-webkit-media-controls-volume-slider::-webkit-slider-thumb {
  background: var(--text);
  border: none;
  border-radius: 0;
  width: 6px;
  height: 6px;
}

.project-video::-webkit-media-controls-mute-button {
  background: transparent;
  border: none;
  color: var(--text);
  opacity: 1;
  filter: none;
}

.project-video::-webkit-media-controls-mute-button:hover {
  opacity: 0.7;
}

.project-video::-webkit-media-controls-fullscreen-button {
  background: transparent;
  border: none;
  color: var(--text);
  opacity: 1;
  filter: none;
}

.project-video::-webkit-media-controls-fullscreen-button:hover {
  opacity: 0.7;
}

/* Project description styles */
.description {
  margin: 16px 0;
  padding: 0;
}

.description p {
  margin: 0 0 12px 0;
  line-height: 1.5;
  color: var(--text);
  font-size: 14px;
}

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

.description h3 {
  margin: 20px 0 12px 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: bold;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.description h3:first-child {
  margin-top: 16px;
}

/* CV section wrapper for centering and spacing */
.cv-section {
  max-width: var(--content);
  margin: 2rem auto;
  padding: 0 16px;
}

/* CV grid */
.cv-grid {
  display: grid;
  grid-template-columns: 12rem 1fr; /* left label, right content */
  column-gap: 1.5rem;
  row-gap: 1.25rem;
  align-items: start;
}

/* Left headers stay visible while you scroll the right column */
.cv-left {
  position: sticky;
  top: calc(var(--header-height, 0px) + 1rem); /* adjust if your header is sticky */
  align-self: start;
}

.cv-left h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cv-right p {
  margin: 0 0 0.65rem 0;
  line-height: 1.35;
}

/* Responsive: stack on small screens */
@media (max-width: 800px) {
  .cv-grid {
    grid-template-columns: 1fr;
  }
  .cv-left {
    position: static;
    margin-top: 0.5rem;
  }
  .cv-left + .cv-right {
    margin-top: 0.25rem;
  }
}

/* Make left label use the same vertical rhythm as right column */
.cv-left h3 {
  font-size: 14px;          /* matches your base (1rem) */
  line-height: 1.35;        /* match .cv-right p */
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

/* Ensure the first item on the right has no sneaky top offset */
.cv-right > :first-child {
  margin-top: 0 !important;
  line-height: 1.35;
}

/* If you still see a hairline offset due to font rendering,
   uncomment the 1px optical nudge below. */
.cv-left h3 { position: relative; top: 1px; }

/* Don't treat videos like hover-zoom images */
.video-container { cursor: default; transform: none !important; filter: none !important; background: #000; }
.video-container:hover { transform: none !important; filter: none !important; }

/* Keep a solid 16:9 box even before metadata loads */
.video-container { aspect-ratio: 16 / 9; }

/* Make sure overlays aren't hidden by grayscale rule further down */
.video-container * { filter: none !important; }

/* Custom Audio Player Styles */
.audio-section {
  padding: 16px 0;
  background: transparent;
  border: none;
}

.custom-audio-player {
  width: 100%;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 12px;
  font-family: var(--mono);
  font-size: 11px;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.play-pause-btn {
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-pause-btn:hover {
  background: var(--text);
  color: var(--bg);
}

.time-display {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  min-width: 80px;
}

.progress-container {
  flex: 1;
  height: 1px;
  background: var(--rule);
  position: relative;
  cursor: pointer;
}

.progress-bar {
  height: 100%;
  background: var(--text);
  width: 0%;
  transition: width 0.1s ease;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.volume-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.volume-slider {
  width: 40px;
  height: 1px;
  background: var(--rule);
  outline: none;
  cursor: pointer;
}

/* Hide native audio element */
.project-audio {
  display: none;
}

/* Custom Video Player Styles */
.custom-video-player {
  width: 100%;
  background: transparent;
  border: 1px solid var(--rule);
  position: relative;
}

.video-container {
  position: relative;
  width: 100%;
  background: var(--bg);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-video {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  position: relative;
  z-index: 1;
}

.video-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, var(--rule) 25%, transparent 25%, transparent 75%, var(--rule) 75%, var(--rule)), 
              linear-gradient(45deg, var(--rule) 25%, transparent 25%, transparent 75%, var(--rule) 75%, var(--rule));
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0.1;
  z-index: 0;
}

.video-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  pointer-events: none;
  opacity: 0.8;
  z-index: 2;
}

.video-placeholder::before {
  content: "🎬";
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.custom-video-player:hover .video-controls {
  opacity: 1;
}

.video-play-pause-btn {
  background: transparent;
  border: 1px solid white;
  color: white;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play-pause-btn:hover {
  background: white;
  color: black;
}

.video-time-display {
  color: white;
  font-family: var(--mono);
  font-size: 10px;
  min-width: 80px;
}

.video-progress-container {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  position: relative;
  cursor: pointer;
}

.video-progress-bar {
  height: 100%;
  background: white;
  width: 0%;
  transition: width 0.1s ease;
}

.video-volume-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.video-volume-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 10px;
}

.video-fullscreen-btn {
  background: transparent;
  border: 1px solid white;
  color: white;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-fullscreen-btn:hover {
  background: white;
  color: black;
}

.project-audio {
  width: 100%;
  height: 32px !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  border-radius: 0 !important;
  filter: none !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

/* Hide native controls and use minimal styling */
.project-audio::-webkit-media-controls {
  display: none !important;
}

.project-audio::-moz-media-controls {
  display: none !important;
}

/* For browsers that support it, show minimal controls */
.project-audio {
  background: var(--bg) !important;
}

.project-audio::-webkit-media-controls-panel {
  background: var(--bg) !important;
  border: 1px solid var(--rule) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.project-audio::-webkit-media-controls-play-button,
.project-audio::-webkit-media-controls-pause-button {
  background: var(--bg) !important;
  border: none !important;
  color: var(--text) !important;
  border-radius: 0 !important;
}

.project-audio::-webkit-media-controls-timeline {
  background: var(--rule) !important;
  border: none !important;
  height: 1px !important;
  border-radius: 0 !important;
}

.project-audio::-webkit-media-controls-current-time-display,
.project-audio::-webkit-media-controls-time-remaining-display {
  color: var(--muted) !important;
  font-family: var(--mono) !important;
  font-size: 10px !important;
  text-shadow: none !important;
}

.project-audio:hover {
  filter: none;
}

.project-audio:focus {
  outline: none;
  filter: none;
}

/* Remove all webkit styling to match UI */
.project-audio::-webkit-media-controls-panel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.project-audio::-webkit-media-controls-enclosure {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.project-audio::-webkit-media-controls-play-button,
.project-audio::-webkit-media-controls-pause-button {
  background: transparent;
  border: none;
  color: var(--text);
  opacity: 1;
  filter: none;
}

.project-audio::-webkit-media-controls-play-button:hover,
.project-audio::-webkit-media-controls-pause-button:hover {
  opacity: 0.7;
}

.project-audio::-webkit-media-controls-timeline {
  background: var(--rule);
  border: none;
  height: 1px;
  margin: 0 8px;
  border-radius: 0;
}

.project-audio::-webkit-media-controls-timeline::-webkit-slider-thumb {
  background: var(--text);
  border: none;
  border-radius: 0;
  width: 8px;
  height: 8px;
}

.project-audio::-webkit-media-controls-current-time-display,
.project-audio::-webkit-media-controls-time-remaining-display {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  opacity: 1;
  text-shadow: none;
}

.project-audio::-webkit-media-controls-volume-slider {
  background: var(--rule);
  border: none;
  height: 1px;
  width: 50px;
  border-radius: 0;
}

.project-audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb {
  background: var(--text);
  border: none;
  border-radius: 0;
  width: 6px;
  height: 6px;
}

.project-audio::-webkit-media-controls-mute-button {
  background: transparent;
  border: none;
  color: var(--text);
  opacity: 1;
  filter: none;
}

.project-audio::-webkit-media-controls-mute-button:hover {
  opacity: 0.7;
}

/* Print styles */
@media print {
  .top {
    position: static;
  }
  
  .search {
    display: none;
  }
  
  .media {
    break-inside: avoid;
  }
  
  .audio-section {
    display: none;
  }
}

/* CONTENT WIDTH FIXES */

/* 1) One content width for everything */
:root { --content: 1000px; }

/* 2) Make all core blocks share the same width and centering */
.media,
.video-container,
.meta,
.audio-section {
  max-width: var(--content);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* 3) Constrain the actual players (video tags + embeds) */
.media video,
.media iframe,
.video-container video,
.video-container iframe {
  display: block;
  width: 100%;
  max-width: var(--content);
  height: auto;
  aspect-ratio: 16 / 9;   /* keep consistent shape */
  border: 0;
  margin: 0 auto;
}

/* Force video containers to not exceed content width */
.video-container {
  overflow: hidden;
  box-sizing: border-box;
}

/* Additional constraint for project videos */
.project-video {
  max-width: var(--content) !important;
  width: 100% !important;
  box-sizing: border-box;
}

/* (optional) if you want the grey hover/filter frame only on images, not on videos */
.media { filter: grayscale(100%); }
.media:hover { filter: grayscale(0%); }
/* but don't gray out the actual player */
.media video,
.media iframe { filter: none; }

/* Placeholder message styling */
.placeholder-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: #f5f5f5;
  border: 2px dashed #ccc;
  border-radius: 8px;
  color: #666;
  min-height: 120px;
}

.placeholder-message p {
  margin: 5px 0;
  font-size: 14px;
}

.placeholder-message p:first-child {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}
