/* ============================================
   GRAFILO — Video Editor Portfolio
   Dark, cinematic, sage-green accent
   ============================================ */

:root {
  --bg: #0a0a0b;
  --bg-alt: #121214;
  --ink: #f3f2f6;
  --ink-dim: #8b8894;
  --ink-faint: #55525c;
  --accent: #9caf88;
  --accent-soft: rgba(156, 175, 136, 0.14);
  --line: rgba(243, 242, 246, 0.1);
  --line-strong: rgba(243, 242, 246, 0.22);

  --font-display: 'Onest', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --container: 1280px;
  --edge: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 55% 42% at 12% 88%, rgba(140, 180, 150, 0.30), transparent 62%),
    radial-gradient(ellipse 45% 38% at 88% 42%, rgba(172, 178, 110, 0.14), transparent 65%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 2px, transparent 2px, transparent 46px);
  background-attachment: fixed, fixed, fixed;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #0a0a0b; }

/* ============ MOTION ============ */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  animation: revealUp 0.9s var(--ease) both;
}
.reveal-d1 { animation-delay: 0.08s; }
.reveal-d2 { animation-delay: 0.16s; }
.reveal-d3 { animation-delay: 0.24s; }
.reveal-d4 { animation-delay: 0.32s; }

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children of a scroll-revealed list */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.stagger-children.in-view > *:nth-child(1) { transition-delay: 0.02s; }
.stagger-children.in-view > *:nth-child(2) { transition-delay: 0.08s; }
.stagger-children.in-view > *:nth-child(3) { transition-delay: 0.14s; }
.stagger-children.in-view > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.in-view > *:nth-child(5) { transition-delay: 0.26s; }
.stagger-children.in-view > *:nth-child(6) { transition-delay: 0.32s; }
.stagger-children.in-view > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- shared ---------- */
.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 4.6vw, 58px);
  letter-spacing: -0.01em;
  line-height: 1.04;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 15px 28px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  transition: all 0.35s var(--ease);
}
.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #0a0a0b;
  font-weight: 700;
}
.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(156, 175, 136, 0.25);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--edge);
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}
.nav--scrolled {
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav__logo-img {
  height: 22px;
  width: auto;
  transition: opacity 0.3s ease;
}
.nav__logo:hover .nav__logo-img { opacity: 0.75; }

.nav__links {
  display: flex;
  gap: 34px;
}

.nav__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
}
.nav__link-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-dim);
  transition: color 0.3s ease, font-weight 0.3s ease;
}
.nav__link.active .nav__link-label {
  color: var(--ink);
  font-weight: 700;
}
.nav__link:hover .nav__link-label { color: var(--ink); }

.nav__squiggle {
  width: 40px;
  height: 8px;
  overflow: visible;
}
.nav__squiggle path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
  transition: stroke-dashoffset 0.55s var(--ease);
}
.nav__link.active .nav__squiggle path {
  stroke-dashoffset: 0;
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav__burger span {
  width: 22px; height: 2px;
  background: var(--ink);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 38px;
  transform: translateY(-100%);
  transition: transform 0.45s var(--ease);
}
.mobile-menu.open {
  display: flex;
  transform: translateY(0);
}
.mobile-menu a { transition: color 0.2s ease; }
.mobile-menu a:hover { color: var(--accent); }

/* ============ HERO ============ */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 110px var(--edge) 40px;
  overflow: hidden;
}

.hero__name {
  position: relative;
  z-index: 1;
  font-family: 'Anton', var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 56px);
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 1.05;
  color: var(--accent);
}

.hero__meta {
  position: relative;
  z-index: 1;
  font-size: 15px;
  color: var(--ink-faint);
}
.hero__meta span:first-child { color: var(--ink-dim); font-weight: 600; }

.hero__sub {
  position: relative;
  z-index: 1;
  max-width: 42ch;
  font-size: 16px;
  color: var(--ink-dim);
  margin-top: 6px;
}

/* ============ PILL CTA ============ */
.pill-cta-wrap {
  display: flex;
  justify-content: center;
  padding: 8px var(--edge) 32px;
}

.pill-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  padding: 13px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.pill-cta:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.pill-cta__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* ============ WORK ============ */
.work {
  position: relative;
  background: linear-gradient(
    to bottom,
    transparent 0,
    var(--bg) 180px,
    var(--bg) calc(100% - 180px),
    transparent 100%
  );
}
.work__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 50px var(--edge) 40px;
}
.section-head { margin-bottom: 20px; }

.work__grid {
  border-top: 1px solid var(--line-strong);
}

.project-card {
  display: grid;
  grid-template-columns: 40px 108px 1.6fr 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: padding-left 0.4s var(--ease), background 0.4s var(--ease);
}
.project-card:hover {
  padding-left: 14px;
  background: var(--accent-soft);
}

.project-card__index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  transition: color 0.3s ease;
}
.project-card:hover .project-card__index { color: var(--accent); }

.project-card__thumb {
  width: 108px;
  aspect-ratio: 16/10;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-alt);
}
.project-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.8) saturate(0.9);
  transition: transform 0.6s var(--ease), filter 0.4s ease;
}
.project-card:hover .project-card__thumb img {
  transform: scale(1.08);
  filter: brightness(0.95) saturate(1);
}

.project-card__title-wrap { min-width: 0; }
.project-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.8vw, 32px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  transition: color 0.3s ease;
}
.project-card:hover .project-card__title { color: var(--accent); }

.project-card__caption {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-dim);
  max-width: 48ch;
}

.project-card__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
}
.project-card__meta span { display: block; }
.project-card__meta span:first-child { color: var(--ink-dim); margin-bottom: 4px; }

.project-card__arrow {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink-faint);
  transform: translateX(0);
  transition: transform 0.4s var(--ease), color 0.4s var(--ease);
}
.project-card:hover .project-card__arrow {
  transform: translateX(8px);
  color: var(--accent);
}

/* ============ ABOUT ============ */
.about {
  border-top: 1px solid var(--line);
  padding: 120px var(--edge);
  position: relative;
}
.about__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 70px;
  position: relative;
  z-index: 1;
}
.about__skills { margin-top: 36px; }
.about__skills-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}
.about__skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.about__skills-list span {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  color: var(--ink-dim);
  transition: border-color 0.3s ease, color 0.3s ease;
}
.about__skills-list span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.about__bio {
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 1.65;
  color: var(--ink-dim);
  font-weight: 400;
}
.about__bio p { margin-bottom: 24px; }
.about__bio p:first-child { color: var(--ink); font-weight: 500; }

/* ============ CONTACT ============ */
.contact {
  padding: 150px var(--edge);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact__inner { position: relative; z-index: 1; }
.contact .section-label { display: block; }
.contact__headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(42px, 7.4vw, 100px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin-bottom: 40px;
}
.contact__email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.8vw, 20px);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--accent);
  transition: color 0.3s ease, letter-spacing 0.3s ease;
}
.contact__email:hover {
  color: var(--accent);
  letter-spacing: 0.02em;
}

.contact__socials {
  margin-top: 38px;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.contact__socials a { transition: color 0.3s ease; }
.contact__socials a:hover { color: var(--accent); }
.contact__socials a:not(:last-child)::after {
  content: '/';
  margin-left: 10px;
  color: var(--line-strong);
}

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--line);
  padding: 30px var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}
.footer__logo { height: 15px; opacity: 0.6; }
.footer__back {
  color: var(--ink-dim);
  transition: color 0.3s ease;
}
.footer__back:hover { color: var(--accent); }

/* ============ PROJECT PAGE ============ */
.project-hero {
  padding: 150px var(--edge) 60px;
  max-width: var(--container);
  margin: 0 auto;
}
.project-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 40px;
  transition: color 0.3s ease, gap 0.3s ease;
}
.project-hero__back:hover { color: var(--accent); gap: 12px; }

.project-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 40px;
  align-items: start;
}
.project-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.project-hero__desc p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-dim);
  margin-bottom: 16px;
}
.project-hero__studio {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  text-align: right;
  white-space: nowrap;
}

.project-player {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--edge) 60px;
}
.project-player__frame {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
}
.project-player__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.6s ease;
  filter: brightness(0.75);
}
.project-player__frame:hover img {
  transform: scale(1.03);
  filter: brightness(0.9);
}
.project-player__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 1px solid rgba(243, 242, 246, 0.4);
  background: rgba(10, 10, 11, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease), background 0.4s ease;
}
.project-player__frame:hover .project-player__play {
  transform: translate(-50%, -50%) scale(1);
  background: var(--accent);
}
.project-player__play::after {
  content: '';
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--ink);
  margin-left: 4px;
}

/* multi-clip projects — grid of clips instead of one hero player */
.project-clips {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--edge) 60px;
}

.project-clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  gap: 20px;
}

.project-clip-group { margin-bottom: 48px; }
.project-clip-group:last-child { margin-bottom: 0; }

.project-clip-group__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.project-clip { cursor: pointer; }

.project-clip__frame {
  position: relative;
  aspect-ratio: 9/16;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  overflow: hidden;
}
.project-clip__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.6s ease;
  filter: brightness(0.75);
}
.project-clip:hover .project-clip__frame img {
  transform: scale(1.05);
  filter: brightness(0.9);
}

.project-clip__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(243, 242, 246, 0.4);
  background: rgba(10, 10, 11, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease), background 0.4s ease;
}
.project-clip:hover .project-clip__play {
  transform: translate(-50%, -50%) scale(1);
  background: var(--accent);
}
.project-clip__play::after {
  content: '';
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent var(--ink);
  margin-left: 3px;
}

.project-clip__title {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-dim);
  transition: color 0.3s ease;
}
.project-clip:hover .project-clip__title { color: var(--accent); }

.project-process {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px var(--edge) 100px;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 40px;
  border-top: 1px solid var(--line);
}
.project-process__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-top: 40px;
}
.project-process__text {
  padding-top: 40px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-dim);
}
.project-process__note {
  padding-top: 40px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

.project-gifs {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--edge) 120px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px;
}
.project-gifs img,
.project-gifs video {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  transition: transform 0.5s var(--ease);
}
.project-gifs img:hover,
.project-gifs video:hover { transform: scale(1.02); }

.project-nextup {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: var(--container);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 40px var(--edge) 100px;
  transition: padding-left 0.4s var(--ease), background 0.4s var(--ease);
}
.project-nextup:hover {
  padding-left: calc(var(--edge) + 14px);
  background: var(--accent-soft);
}

.project-nextup__thumb {
  width: 140px;
  aspect-ratio: 16/10;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-alt);
}
.project-nextup__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.8) saturate(0.9);
  transition: transform 0.6s var(--ease), filter 0.4s ease;
}
.project-nextup:hover .project-nextup__thumb img {
  transform: scale(1.08);
  filter: brightness(0.95) saturate(1);
}

.project-nextup__text { min-width: 0; }
.project-nextup__text .section-label { margin-bottom: 6px; }
.project-nextup__text span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}
.project-nextup:hover .project-nextup__text span { color: var(--accent); }

.project-nextup__arrow {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink-faint);
  transform: translateX(0);
  transition: transform 0.4s var(--ease), color 0.4s var(--ease);
}
.project-nextup:hover .project-nextup__arrow {
  transform: translateX(8px);
  color: var(--accent);
}

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.modal.open { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 7, 0.92);
  backdrop-filter: blur(6px);
}
.modal__box {
  position: relative;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 16/9;
  background: #000;
  border: 1px solid var(--line-strong);
  animation: revealUp 0.4s var(--ease) both;
}
.modal__player, .modal__player iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.modal__close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.3s ease;
}
.modal__close:hover { color: var(--accent); }

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .about__inner { grid-template-columns: 1fr; gap: 36px; }
  .project-card {
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "thumb title"
      "thumb meta";
    row-gap: 6px;
  }
  .project-card__index { display: none; }
  .project-card__thumb { grid-area: thumb; width: 64px; }
  .project-card__title-wrap { grid-area: title; }
  .project-card__meta { grid-area: meta; text-align: left; }
  .project-card__arrow { display: none; }
  .hero { padding: 100px var(--edge) 30px; }
  .project-hero__grid { grid-template-columns: 1fr; gap: 20px; }
  .project-hero__studio { text-align: left; }
  .project-process { grid-template-columns: 1fr; gap: 8px; }
  .project-process__text, .project-process__note { padding-top: 0; }
  .project-nextup__thumb { width: 80px; }
  .project-nextup__arrow { display: none; }
}
