@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-text-secondary: #666666;
  --color-border: #e5e5e5;
  --color-gray-bg: #f9fafb;
  
  --ease-expo-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s var(--ease-smooth);
}

.nav--scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav__container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  transition: transform 0.3s var(--ease-expo-out);
}

.nav--scrolled .nav__logo {
  transform: scale(0.9);
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  position: relative;
  padding: 8px 0;
  transition: color 0.2s ease;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-text);
  transition: width 0.2s ease;
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-text);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav__menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: white;
    flex-direction: column;
    align-items: flex-start;
    padding: 100px 32px 32px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-expo-out);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  }
  
  .nav__menu--open {
    transform: translateX(0);
  }
  
  .nav__link {
    font-size: 1.25rem;
    font-weight: 300;
  }
  
  .nav__toggle {
    display: flex;
    z-index: 1001;
  }
  
  .nav__toggle--active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav__toggle--active span:nth-child(2) {
    opacity: 0;
  }
  
  .nav__toggle--active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  
  .nav__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .nav__overlay--active {
    opacity: 1;
    visibility: visible;
  }
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenBurns 20s ease-in-out infinite;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
  z-index: 2;
}

.hero__content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 120px;
  color: white;
}

.hero__title {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 0.8s var(--ease-expo-out) 0.5s forwards;
}

.hero__subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 300;
  opacity: 0.9;
  opacity: 0;
  transform: translateX(-20px);
  animation: fadeInLeft 0.6s var(--ease-expo-out) 0.9s forwards;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  opacity: 0;
  animation: fadeIn 0.6s ease 1.5s forwards;
}

.hero__scroll-text {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero__scroll-icon {
  width: 20px;
  height: 20px;
  animation: bounce 2s infinite;
}

@keyframes kenBurns {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* ===== Section Styles ===== */
.section {
  padding: 100px 0;
}

.section__container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.section__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  margin-bottom: 16px;
}

.section__subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 600px;
}

/* ===== Intro Section ===== */
.intro {
  background: white;
  padding: 120px 0;
}

.intro__content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.intro__text {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 300;
  line-height: 1.8;
  color: var(--color-text);
  margin-bottom: 32px;
}

.intro__desc {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

/* ===== Categories Section ===== */
.categories {
  background: var(--color-gray-bg);
  padding: 100px 0;
}

.categories__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 60px;
}

.category-card {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--color-border);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-expo-out);
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
}

.category-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  color: white;
}

.category-card__title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.category-card__desc {
  font-size: 0.875rem;
  opacity: 0.8;
}

@media (max-width: 1024px) {
  .categories__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .categories__grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Portfolio Page ===== */
.portfolio {
  padding-top: 120px;
  min-height: 100vh;
}

.portfolio__header {
  margin-bottom: 60px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px 40px;
}

.project {
  opacity: 0;
  transform: translateY(30px);
}

.project.visible {
  animation: fadeInUp 0.7s var(--ease-expo-out) forwards;
}

.project__title {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 12px;
}

.project__desc {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.project__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.project__image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-gray-bg);
  cursor: pointer;
}

.project__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-expo-out);
}

.project__image:hover img {
  transform: scale(1.05);
}

.project__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.project__image:hover::after {
  background: rgba(0, 0, 0, 0.1);
}

.project__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 16px;
  transition: color 0.2s ease;
}

.project__link:hover {
  color: var(--color-text-secondary);
}

.project__link svg {
  transition: transform 0.2s ease;
}

.project__link:hover svg {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .projects {
    grid-template-columns: 1fr;
  }
  
  .project__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox--active {
  opacity: 1;
  visibility: visible;
}

.lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
}

.lightbox__image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s ease;
  z-index: 10;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  color: white;
}

.lightbox__close {
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
}

.lightbox__prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}

.lightbox__next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}

.lightbox__counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
}

.lightbox__thumbs {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 0 20px;
  overflow-x: auto;
  max-width: 90vw;
}

.lightbox__thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  overflow: hidden;
  opacity: 0.5;
  transition: all 0.2s ease;
  cursor: pointer;
}

.lightbox__thumb:hover,
.lightbox__thumb--active {
  opacity: 1;
  box-shadow: 0 0 0 2px white;
}

.lightbox__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== About Page ===== */
.about {
  padding-top: 120px;
  min-height: 100vh;
}

.about__header {
  margin-bottom: 60px;
}

.about__content {
  max-width: 800px;
}

.about__name {
  font-size: 1.75rem;
  font-weight: 300;
  margin-bottom: 24px;
}

.about__bio {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.about__bio p + p {
  margin-top: 16px;
}

.about__section {
  margin-top: 60px;
}

.about__section-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.philosophy {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.philosophy__item {
  display: flex;
  gap: 16px;
}

.philosophy__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-bg);
  flex-shrink: 0;
}

.philosophy__title {
  font-weight: 500;
  margin-bottom: 4px;
}

.philosophy__desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timeline__item {
  display: flex;
  gap: 24px;
}

.timeline__year {
  width: 60px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.timeline__content {
  position: relative;
  padding-left: 24px;
  border-left: 1px solid var(--color-border);
}

.timeline__content::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 6px;
  width: 8px;
  height: 8px;
  background: var(--color-text-secondary);
  border-radius: 50%;
}

.timeline__title {
  font-weight: 500;
  margin-bottom: 4px;
}

.timeline__desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.contact-info {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.contact-info__items {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.contact-info__item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-info__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-bg);
}

.contact-info__label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.contact-info__value {
  font-weight: 500;
}

@media (max-width: 640px) {
  .philosophy {
    grid-template-columns: 1fr;
  }
  
  .timeline__item {
    flex-direction: column;
    gap: 8px;
  }
  
  .timeline__content {
    padding-left: 16px;
  }
}

/* ===== Footer ===== */
.footer {
  background: white;
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
}

.footer__container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.footer__content {
  display: flex;
  flex-direction: column;
  sm:flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.footer__copyright {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.footer__backtop {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.footer__backtop:hover {
  color: var(--color-text);
}

.footer__backtop svg {
  transition: transform 0.2s ease;
}

.footer__backtop:hover svg {
  transform: translateY(-3px);
}

.footer__icp {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  width: 100%;
  text-align: center;
}

.footer__icp a {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.footer__icp a:hover {
  color: var(--color-text);
}

@media (min-width: 640px) {
  .footer__content {
    flex-direction: row;
  }
}

/* ===== Scroll Reveal Animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s var(--ease-expo-out);
}

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

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