@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;600;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* Colors */
  --bg-color: #050505;
  --panel-color: #0a0a0a;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --accent-blue: #0088ff;
  --accent-orange: #ff4400;
  --border-color: #1a1a1a;

  /* Typography */
  --font-main: 'Be Vietnam Pro', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-speed: 0.4s;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
  line-height: 1.6;
}

#cursor {
  width: 20px;
  height: 20px;
  background-color: #fff;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: transform 0.1s ease-out;
  display: none; /* Only show on desktop */
}

@media (hover: hover) {
  #cursor { display: block; }
  body { cursor: none; }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

section {
  padding: 120px 0;
  position: relative;
}

h1, h2, h3 {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-family: 'Be Vietnam Pro', sans-serif;
  line-height: 1.2; /* Required for Vietnamese stacked diacritics: Ổ Ầ Ễ Ữ etc. */
}

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--accent-blue);
  letter-spacing: 0;
}

/* Hero subtitle mono tag spacing */
.hero-text > .mono {
  display: block;
  margin-bottom: 24px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding-top: 4px;
}

/* --- Navigation --- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 2px;
}

.logo-flip-wrapper {
  display: inline-block;
  perspective: 600px;
  overflow: hidden;
  height: 1.4em;
  vertical-align: bottom;
}

.logo-flip-word {
  display: inline-block;
  transform-origin: center bottom;
  white-space: nowrap;
}

.accent-dot {
  color: var(--accent-orange);
}

@keyframes flipOut {
  0%   { transform: rotateX(0deg);   opacity: 1; }
  100% { transform: rotateX(90deg);  opacity: 0; }
}

@keyframes flipIn {
  0%   { transform: rotateX(-90deg); opacity: 0; }
  100% { transform: rotateX(0deg);   opacity: 1; }
}

.logo-flip-word.flip-out {
  animation: flipOut 0.35s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

.logo-flip-word.flip-in {
  animation: flipIn 0.35s cubic-bezier(0, 0.55, 0.45, 1) forwards;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 150px;
}

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

.hero-text h1 {
  font-size: 6vw;
  line-height: 1.15; /* Vietnamese diacritics (Ầ Ễ etc.) extend above cap-height */
  margin-top: 0;
  margin-bottom: 30px;
}

.hero-text .dynamic-role {
  font-size: 1.2rem;
  color: var(--text-secondary);
  display: block;
}

.hero-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: 4px;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter 0.8s ease, transform 0.8s ease;
}

.hero-image:hover img {
  filter: grayscale(0);
  transform: scale(1.05);
}

/* --- Slanted Ribbon --- */
.ribbon {
  background: var(--accent-orange);
  color: var(--bg-color);
  padding: 30px 0;
  transform: rotate(-3deg) scale(1.1);
  width: 120%;
  margin-left: -10%;
  white-space: nowrap;
  overflow: hidden;
  z-index: 10;
  margin: 100px 0;
}

.ribbon-content {
  display: flex;
  animation: marquee 20s linear infinite;
}

.ribbon-item {
  font-size: 4rem;
  font-weight: 800;
  text-transform: uppercase;
  padding-right: 60px;
  flex-shrink: 0;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Projects --- */
.section-title {
  font-size: 4rem;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 24px;
  padding-top: 8px; /* Prevent diacritics from being clipped by element above */
}

/* Hover cross-fade effect */
.project-media-layered {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 2px;
}

.project-media-layered img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-thumbnail {
  z-index: 2;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.img-hover {
  z-index: 1;
}

.project-card:hover .img-thumbnail {
  opacity: 0;
}

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

.project-card {
  background: var(--panel-color);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 4px;
  transition: transform 0.4s ease;
}

.project-card:hover {
  transform: translateY(-20px);
}

.project-media {
  aspect-ratio: 16/9;
  background: #111;
  overflow: hidden;
  margin-bottom: 20px;
  border-radius: 2px;
}

.project-info {
  padding: 20px;
}

.project-card .mono {
  display: block;
  margin-bottom: 10px;
}

.project-card h3 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.project-desc {
  color: var(--text-secondary);
}

/* --- Mobile Fixes --- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 15vw; }
  .project-grid { grid-template-columns: 1fr; }
}
