/* ============================================
   GILMIER EJ CABIL — PORTFOLIO
   Editorial Layout Reference: Oleksandra Maiboroda
   ============================================ */

:root {
  --bg: #fcfbfa;
  --bg-pure: #ffffff;
  --text-dark: #121212;
  --text-body: #323232;
  --text-muted: #828282;
  --line-color: #121212;
  --line-subtle: #e6e4df;
  --card-radius: 16px;
  --site-width: 980px;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  background-color: var(--bg);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  border: none;
  background: none;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background-color: var(--text-dark);
  z-index: 1000;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* Site Shell & Wrapper */
.site-shell {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(252, 251, 250, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px 0 20px;
  transition: background-color var(--transition-fast), padding var(--transition-fast);
}

.site-header.is-scrolled {
  background-color: rgba(252, 251, 250, 0.98);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 16px 0 14px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-dark);
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dark);
  opacity: 0.75;
  transition: opacity var(--transition-fast);
  padding: 4px 0;
}

.nav-link:hover,
.nav-link.active {
  opacity: 1;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background-color: var(--text-dark);
  transition: transform var(--transition-fast);
}

.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* ============================================
   1. HERO / ABOUT ME
   ============================================ */
.hero-section {
  padding-top: 36px;
  padding-bottom: 50px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(48px, 9vw, 92px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 0.94;
  color: var(--text-dark);
  text-transform: uppercase;
  margin-bottom: 42px;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

@media (min-width: 720px) {
  .hero-split {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.hero-media-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--card-radius);
  overflow: hidden;
  background-color: #e8e6e1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.hero-bio {
  max-width: 440px;
}

.bio-text {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-body);
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */
.section-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 80px;
  margin-bottom: 34px;
}

.divider-line {
  display: block;
  width: 58px;
  height: 1px;
  background-color: var(--line-color);
}

.section-heading {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.5vw, 40px);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1;
}

/* ============================================
   2. PROJECTS GRID
   ============================================ */
.projects-section {
  padding-bottom: 40px;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 580px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

@media (min-width: 860px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

.video-card {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  background-color: #0d0d0d;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  transform: translateZ(0);
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.video-card.is-playing {
  transform: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.video-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  overflow: hidden;
  background-color: #111;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.video-poster-box {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.video-card:hover .video-thumb {
  transform: scale(1.03);
}

.card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.72) 100%);
  pointer-events: none;
}

.card-title {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 400;
  color: #ffffff;
  z-index: 2;
  pointer-events: none;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.video-card:hover .play-overlay {
  opacity: 1;
}

@media (hover: none), (max-width: 768px) {
  .play-overlay {
    opacity: 1;
    background-color: transparent;
  }
}

.play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.92);
  color: #121212;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: auto;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.play-btn-icon {
  width: 15px;
  height: 15px;
  display: block;
}

.play-btn:hover {
  transform: scale(1.06);
  background-color: #ffffff;
}

.play-btn:active {
  transform: scale(0.94);
}

.static-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1b1b1b;
  color: #ffffff;
  padding: 16px;
  text-align: center;
}

/* Inline Direct Player */
.video-embed-box {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.video-embed-box iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  border: 0;
  display: block;
  -webkit-overflow-scrolling: touch;
}

.embed-top-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.video-stop-btn,
.video-ext-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 16px;
  background-color: rgba(18, 18, 18, 0.88);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.embed-btn-icon {
  width: 10px;
  height: 10px;
  display: block;
}

.video-stop-btn:hover,
.video-ext-btn:hover {
  background-color: #000000;
  border-color: rgba(255, 255, 255, 0.35);
}

.video-stop-btn:active,
.video-ext-btn:active {
  transform: scale(0.96);
}

.embed-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0d0d0d;
  z-index: 4;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.loader-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* More Videos Link Button */
.projects-action {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

.drive-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  border: 1px solid var(--text-dark);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dark);
  background-color: transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.drive-btn:hover {
  background-color: var(--text-dark);
  color: var(--bg-pure);
}

.drive-btn-icon {
  transition: transform var(--transition-fast);
}

.drive-btn:hover .drive-btn-icon {
  transform: translate(2px, -2px);
}

/* ============================================
   3. TOOLS & CAPABILITIES SECTION
   ============================================ */
.skills-section {
  padding-bottom: 60px;
}

.skills-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: flex-start;
}

@media (min-width: 760px) {
  .skills-split {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 48px;
  }

  .skills-media-wrap {
    position: sticky;
    top: 90px;
  }
}

.skills-media-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--card-radius);
  overflow: hidden;
  background-color: #e8e6e1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.skills-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.skills-content {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.skill-group {
  display: flex;
  flex-direction: column;
}

.skill-category-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 26px);
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 14px;
  line-height: 1.25;
}

.skill-subgroups-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-subgroup {
  display: flex;
  flex-direction: column;
}

.skill-subgroup-title {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 9px;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 15px;
  border: 1px solid var(--text-dark);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-dark);
  background-color: transparent;
  line-height: 1.35;
  white-space: normal;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  cursor: default;
  user-select: none;
}

.skill-pill:hover {
  background-color: var(--text-dark);
  color: var(--bg-pure);
}

/* Restrained entrance animation */
.reveal-group {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-group.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   4. FOOTER / CONTACT
   ============================================ */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 60px 0 70px;
  border-top: 1px solid var(--line-subtle);
  margin-top: 40px;
  gap: 24px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-label {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  transition: color var(--transition-fast);
}

.footer-value:hover {
  color: #000;
  text-decoration: underline;
}

.footer-col-right {
  align-items: flex-end;
  text-align: right;
}

.footer-social-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-social-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  transition: opacity var(--transition-fast);
}

.footer-social-link:hover {
  opacity: 0.65;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #121212;
  color: #ffffff;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 2000;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .site-shell {
    padding: 0 20px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background-color: rgba(252, 251, 250, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line-subtle);
    padding: 20px;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 14px;
    text-align: center;
  }

  .hero-title {
    margin-bottom: 28px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .footer-col-right {
    align-items: flex-start;
    text-align: left;
  }

  .play-btn {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .play-btn-icon {
    width: 13px;
    height: 13px;
  }

  .card-title {
    font-size: 15px;
    bottom: 11px;
    left: 11px;
    right: 11px;
  }

  .embed-top-bar {
    top: 6px;
    left: 6px;
    right: 6px;
  }

  .video-stop-btn,
  .video-ext-btn {
    padding: 3px 8px;
    font-size: 10px;
    gap: 4px;
    border-radius: 12px;
  }

  .embed-btn-icon {
    width: 8.5px;
    height: 8.5px;
  }
}

@media (max-width: 480px) {
  .site-shell {
    padding: 0 16px;
  }

  .video-grid {
    gap: 14px;
  }

  .play-btn {
    width: 32px;
    height: 32px;
  }

  .play-btn-icon {
    width: 11px;
    height: 11px;
  }

  .card-title {
    font-size: 14px;
    bottom: 9px;
    left: 9px;
    right: 9px;
  }

  .embed-top-bar {
    top: 5px;
    left: 5px;
    right: 5px;
  }

  .video-stop-btn,
  .video-ext-btn {
    padding: 2.5px 7px;
    font-size: 9.5px;
    gap: 3px;
    border-radius: 10px;
  }

  .embed-btn-icon {
    width: 8px;
    height: 8px;
  }

  .skills-split {
    gap: 24px;
  }

  .skills-content {
    gap: 24px;
  }

  .skill-pill {
    padding: 4px 11px;
    font-size: 11.5px;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-group {
    opacity: 1 !important;
    transform: none !important;
  }
}
