/* ============================
   Custom Properties
============================ */
:root {
  --color-bg: #0b0b0d;
  --color-bg-alt: #131316;
  --color-surface: #1a1a1e;
  --color-border: #2a2a2f;
  --color-text: #ededf0;
  --color-text-muted: #9a9aa2;
  --color-accent: #d9ff4a;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-fast: 0.2s ease;
  --transition-med: 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  --header-height: 80px;
}

/* ============================
   Reset
============================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
}

/* ============================
   Loader
============================ */
.loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__text {
  font-family: var(--font-display);
  letter-spacing: 0.4em;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ============================
   Header / Nav
============================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  z-index: 500;
  background: linear-gradient(to bottom, rgba(11,11,13,0.85), transparent);
  transition: background var(--transition-fast);
}

.header.is-scrolled {
  background: rgba(11, 11, 13, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.logo span {
  color: var(--color-accent);
}

.nav {
  display: flex;
  gap: 2.5rem;
}

.nav__link {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--color-accent);
  transition: width var(--transition-fast);
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-text);
}

.nav__link.active::after,
.nav__link:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  z-index: 501;
}

.nav-toggle span {
  height: 2px;
  width: 100%;
  background: var(--color-text);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================
   Buttons
============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  font-weight: 600;
  border-radius: 2px;
  transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.btn--primary {
  background: var(--color-accent);
  color: #0b0b0d;
}

.btn--primary:hover {
  transform: translateY(-2px);
}

/* ============================
   Hero
============================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 11, 13, 0.85) 0%, rgba(11, 11, 13, 0) 40%);
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: blur(3px);
}

.hero__content {
  width: 90vw;
  max-width: 90vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding: clamp(2rem, 4vw, 3rem);
  background: rgba(26, 26, 30, 0.35);
  border: 1px solid rgba(237, 237, 240, 0.15);
  border-radius: 16px;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.hero__eyebrow {
  color: var(--color-accent);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  margin-bottom: 1.5rem;
}

.hero__subtitle {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin-bottom: 2.25rem;
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: clamp(1.5rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.scroll-cue__line {
  width: 40px;
  height: 1px;
  background: var(--color-text-muted);
  position: relative;
  overflow: hidden;
}

.scroll-cue__line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-accent);
  animation: scroll-line 1.8s ease-in-out infinite;
}

@keyframes scroll-line {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============================
   Section Heading
============================ */
section {
  padding: clamp(4rem, 10vw, 7rem) clamp(1.5rem, 5vw, 4rem);
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-number {
  font-family: var(--font-display);
  color: var(--color-accent);
  font-size: 0.9rem;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
}

/* ============================
   Work / Filters / Gallery
============================ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.filter-btn.active {
  background: var(--color-accent);
  color: #0b0b0d;
  border-color: var(--color-accent);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.gallery__item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery__item.is-hidden {
  display: none;
}

.gallery__trigger {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-surface);
}

.gallery__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease;
}

.gallery__image--hover {
  opacity: 0;
}

.gallery__trigger:hover .gallery__image--base {
  opacity: 0;
}

.gallery__trigger:hover .gallery__image--hover {
  opacity: 1;
}

.gallery__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
  text-align: left;
}

.gallery__trigger:hover .gallery__overlay {
  opacity: 1;
}

.gallery__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.gallery__tag {
  color: var(--color-accent);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

/* ============================
   About
============================ */
.about__grid {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.about__media img {
  width: 100%;
  border-radius: 6px;
  filter: grayscale(0.2);
}

.about__text {
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  max-width: 60ch;
}

.about__text code {
  color: var(--color-accent);
  font-family: monospace;
  background: var(--color-surface);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.skills li {
  border: 1px solid var(--color-border);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ============================
   Contact
============================ */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: clamp(2rem, 6vw, 5rem);
}

.contact__info p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.contact__email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-accent);
  margin-bottom: 2rem;
}

.socials {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.socials__link {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.socials__link:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 480px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

.form-field input,
.form-field textarea {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.75rem 0.9rem;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #ff6b6b;
}

.form-error {
  color: #ff6b6b;
  font-size: 0.75rem;
  min-height: 1em;
}

.form-success {
  color: var(--color-accent);
  font-size: 0.85rem;
}

/* ============================
   Footer
============================ */
.footer {
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* ============================
   Project Detail Page
============================ */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.page-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 13, 0.4);
}

.page-bg__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(10px);
}

.page-bg__frame--next {
  opacity: 0;
}

.project {
  max-width: 900px;
  margin: 0 auto;
  padding-top: calc(var(--header-height) + 3rem);
}

.project__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  transition: color var(--transition-fast);
}

.project__back:hover {
  color: var(--color-text);
}

.project__tag {
  display: block;
  color: var(--color-accent);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project__title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0.5rem 0 2rem;
}

.project__image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.project__image--85 {
  width: 85vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  display: block;
}

.project__image--70 {
  width: 70vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  display: block;
}

.project__video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 95vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 2rem;
}

.project__embed {
  width: 80vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.project__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project__video {
  width: 100%;
  border-radius: 8px;
  background: var(--color-surface);
}

@media (max-width: 700px) {
  .project__video-grid {
    grid-template-columns: 1fr;
  }
}

.project__anim {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.project__anim-frame {
  width: 100%;
  display: block;
}

.project__anim-toggle {
  margin-bottom: 2rem;
}

.project__desc {
  color: var(--color-text-muted);
  width: 65vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.05rem;
}

/* ============================
   Responsive
============================ */
@media (max-width: 860px) {
  .about__grid,
  .contact__grid {
    grid-template-columns: 1fr;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(320px, 80vw);
    background: var(--color-bg-alt);
    border-left: 1px solid var(--color-border);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform var(--transition-med);
  }

  .nav.is-open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 500px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}
