:root {
  --dark: #1D1A1B;
  --cream: #F6F2E4;
  --transition: 0.3s ease;
}

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

html {
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--dark);
  color: var(--cream);
  min-height: 100vh;
}

/* HEADER */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 40px;
  background: var(--dark);
  color: var(--cream);
  border-bottom: 1px solid var(--cream);
}

.desktop-nav {
  display: flex;
  gap: 32px;
}

.desktop-nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 400;
  font-size: 16px;
  transition: opacity var(--transition);
}

.desktop-nav a:hover {
  opacity: 0.6;
}

.logo,
a.logo,
a.logo:hover,
a.logo:visited {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0;
  color: var(--cream);
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  display: flex;
  border: 1.5px solid var(--cream);
  border-radius: 4px;
  overflow: hidden;
}

.lang-btn {
  background: transparent;
  color: var(--cream);
  border: none;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-btn.active {
  background: var(--cream);
  color: var(--dark);
}

.social-link {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--cream);
  transition: var(--transition);
}

/* MOBILE MENU */
.mobile-menu {
  position: fixed;
  top: 84px;
  left: 20px;
  right: auto;
  width: auto;
  min-width: 200px;
  background: var(--dark);
  border: 1px solid var(--cream);
  border-radius: 8px;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  display: none;
  z-index: 99;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  color: var(--cream);
  text-decoration: none;
  font-size: 16px;
}

/* HERO */
.hero {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
  text-align: center;
  z-index: 1;
}

.name {
  font-size: clamp(40px, 7vw, 100px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 40px;
  display: inline-block;
}

.hero-frame {
  border: none;
  border-radius: 0;
  padding: 30px 80px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  background: transparent;
}

.illustration-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  margin-top: -20px;
}

.character {
  width: 180px;
  height: 228px;
  margin-bottom: -10px;
  position: relative;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 1.5s forwards;
}

.frame-wrap {
  position: relative;
  display: inline-block;
}

.role-frame {
  display: inline-block;
  padding: 18px 40px;
  border: 1.5px solid var(--cream);
  transform: scale(0);
  transform-origin: bottom left;
  animation: frameGrow 0.6s cubic-bezier(0.22, 1, 0.36, 1) 2.3s forwards;
  position: relative;
}

.corner {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--cream);
  border: 1px solid var(--dark);
  opacity: 0;
}

.corner.tl { top: -4px; left: -4px; animation: fadeIn 0.3s ease-out 2.3s forwards; }
.corner.bl { bottom: -4px; left: -4px; animation: fadeIn 0.3s ease-out 2.5s forwards; }
.corner.br { bottom: -4px; right: -4px; animation: fadeIn 0.3s ease-out 2.7s forwards; }
.corner.tr { top: -4px; right: -4px; animation: fadeIn 0.3s ease-out 2.9s forwards; }

.role-text-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.role-text {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.01em;
  display: inline-block;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
  animation: typewriter 1.8s steps(35, end) 3.1s forwards;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 22px;
  background: var(--cream);
  margin-left: 4px;
  opacity: 0;
  animation: caretAppear 0.1s linear 4.9s forwards, blink 1s steps(2) 4.9s infinite;
}

.pen {
  position: absolute;
  width: 32px;
  height: 32px;
  z-index: 3;
  opacity: 0;
  bottom: -16px;
  left: -16px;
  top: auto;
  right: auto;
  animation: fadeIn 0.4s ease-out 2.1s forwards, penDrag 0.6s cubic-bezier(0.22, 1, 0.36, 1) 2.3s forwards, fadeOutPen 0.3s ease-out 2.9s forwards;
}

/* View my work cue */
.view-work-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  margin-bottom: 40px;
  animation: fadeIn 0.8s ease-out 5.5s forwards;
  opacity: 0;
}

.view-work-text {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.view-work-icon {
  font-size: 36px;
  animation: chevronBounce 2s ease-in-out infinite;
  color: var(--cream);
}

/* Name letter animation */
.name span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: letterReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.name span:nth-child(1)  { animation-delay: 0.10s; }
.name span:nth-child(2)  { animation-delay: 0.18s; }
.name span:nth-child(3)  { animation-delay: 0.26s; }
.name span:nth-child(4)  { animation-delay: 0.34s; }
.name span:nth-child(5)  { animation-delay: 0.42s; }
.name span:nth-child(6)  { animation-delay: 0.50s; }
.name span:nth-child(7)  { animation-delay: 0.58s; }
.name span:nth-child(8)  { animation-delay: 0.66s; }
.name span:nth-child(9)  { animation-delay: 0.74s; }
.name span:nth-child(10) { animation-delay: 0.82s; }
.name span:nth-child(11) { animation-delay: 0.90s; }
.name span:nth-child(12) { animation-delay: 0.98s; }
.name span:nth-child(13) { animation-delay: 1.06s; }
.name span:nth-child(14) { animation-delay: 1.14s; }

/* Keyframes */
@keyframes fadeIn { to { opacity: 1; } }
@keyframes fadeOutPen { to { opacity: 0; } }
@keyframes frameGrow { to { transform: scale(1); } }
@keyframes typewriter { to { clip-path: inset(0 0 0 0); } }
@keyframes caretAppear { to { opacity: 1; } }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes chevronBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes penDrag {
  to {
    left: calc(100% - 16px);
    bottom: calc(100% - 16px);
  }
}
@keyframes letterReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* No-intro (skip animations on back-navigation) */
.no-intro .name span,
.no-intro .character,
.no-intro .hero-frame,
.no-intro .view-work-cue,
.no-intro .role-frame,
.no-intro .corner,
.no-intro .role-text,
.no-intro .caret,
.no-intro .role-text-wrap {
  opacity: 1 !important;
  animation: none !important;
  transform: none !important;
  clip-path: none !important;
  width: auto !important;
}

.no-intro .pen {
  display: none !important;
}

.no-intro .corner {
  opacity: 1 !important;
  animation: none !important;
  display: inline-block !important;
}

/* PROJECTS GRID */
.projects {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 0 60px 120px;
  max-width: 1200px;
  margin: 100vh auto 0;
  background: transparent;
  scroll-margin-top: 200px;
}

.card {
  background: var(--cream);
  color: var(--dark);
  padding: 32px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-decoration: none;
  cursor: pointer;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-head h2 {
  font-size: 28px;
  font-weight: 500;
}

.duration {
  font-size: 14px;
  font-weight: 400;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 6px 14px;
  background: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 400;
}

.card-desc {
  font-size: 15px;
  line-height: 1.6;
  min-height: 3.2em;
}

.card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.card-image-placeholder {
  background: rgba(29, 26, 27, 0.05);
  border-radius: 4px;
  aspect-ratio: 16 / 10;
  width: 100%;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px;
  background: var(--dark);
  color: var(--cream);
  border-radius: 50px;
  text-decoration: none;
  margin-top: auto;
  align-self: flex-start;
  font-size: 20px;
  font-weight: 500;
  overflow: hidden;
  transition: padding 0.35s ease, background var(--transition);
}

.card-cta-text {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 0.35s ease, opacity 0.25s ease;
}

.card-cta-arrow {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.card:hover .card-cta {
  padding: 18px 28px;
}

.card:hover .card-cta-text {
  max-width: 200px;
  opacity: 1;
}

/* MOBILE */
@media (max-width: 768px) {
  .site-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .hamburger {
    display: flex;
  }
  
  .logo,
  a.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
  }
  
  .header-right {
    margin-left: auto;
  }
  
  .social-link {
    display: none;
  }

   .desktop-nav {
    display: none;
  }

  .hero {
    padding: 100px 20px 20px;
    height: 100vh;
    min-height: 100vh;
    justify-content: center;
  }

  .name {
    font-size: clamp(40px, 14vw, 62px);
    margin-bottom: 20px;
  }

  .hero-frame {
    border: none;
    border-radius: 0;
    padding: 20px 12px;
    width: calc(100% - 20px);
    background: transparent;
  }

  .character {
    width: clamp(80px, 25vw, 120px);
    height: auto;
  }

  .role-text {
    font-size: clamp(12px, 3.5vw, 16px);
  }

  .role-frame {
    padding: 12px 24px;
  }

  .view-work-text {
    font-size: 18px;
  }

  .view-work-icon {
    font-size: 28px;
  }

  .projects {
    grid-template-columns: 1fr;
    padding: 40px 20px 80px;
    margin: 100vh auto 0;
    gap: 40px;
    scroll-margin-top: 120px;
  }

  .card {
    padding: 24px;
  }

  .card-cta {
    padding: 16px 24px;
  }

  .card-cta-text {
    max-width: 200px;
    opacity: 1;
  }

  .pen {
    width: 24px;
    height: 24px;
    animation: fadeIn 0.4s ease-out 2.1s forwards, penDragMobile 0.6s cubic-bezier(0.22, 1, 0.36, 1) 2.3s forwards, fadeOutPen 0.3s ease-out 2.9s forwards;
  }

  @keyframes penDragMobile {
    to {
      left: calc(100% - 12px);
      bottom: 55px;
    }
  }
}