:root {
  --page-bg: #111015;
  --purple-950: #180030;
  --purple-800: #5e00b2;
  --purple-700: #8000ff;
  --purple-500: #ae00ff;
  --purple-300: #b388ff;
  --purple-200: #d9c8ff;
  --white: #ffffff;
  --muted: #c5c1cc;
  --line: rgba(179, 136, 255, 0.24);
  --content-width: 1200px;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Konkhmer Sleokchher", var(--font-body);
  --font-serif: "Koh Santepheap", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  scroll-behavior: smooth;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 22%, rgba(128, 0, 255, 0.13), transparent 36rem),
    linear-gradient(145deg, #19171d 0%, var(--page-bg) 55%, #0e0d11 100%);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  color: inherit;
  font: inherit;
}

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
p {
  margin-top: 0;
}

::selection {
  background: var(--purple-700);
  color: var(--white);
}

:focus-visible {
  outline: 3px solid var(--purple-200);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 12px;
  left: 12px;
  padding: 9px 15px;
  border-radius: 9px;
  background: var(--white);
  color: var(--purple-950);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Decorative background */
.visual-layer {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ambient-glow {
  position: absolute;
  top: max(130px, 18vh);
  left: 50%;
  width: min(1160px, 115vw);
  height: min(640px, 70vh);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(179, 136, 255, 0.2), rgba(179, 136, 255, 0.06) 43%, transparent 72%);
  filter: blur(34px);
  transform: translateX(-50%);
}

body[data-page="home"] .ambient-glow {
  background: radial-gradient(ellipse, rgba(179, 136, 255, 0.12), rgba(179, 136, 255, 0.035) 43%, transparent 72%);
  filter: blur(48px);
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(179, 136, 255, 0.1), rgba(179, 136, 255, 0.025) 48%, transparent 70%);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease;
  will-change: left, top;
}

body[data-page="home"] .cursor-glow {
  background: radial-gradient(circle, rgba(179, 136, 255, 0.065), rgba(179, 136, 255, 0.015) 48%, transparent 70%);
}

.custom-cursor {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  display: none;
  width: 36px;
  height: 36px;
  border: 2px solid var(--purple-300);
  border-radius: 50%;
  background: rgba(179, 136, 255, 0.12);
  box-shadow: 0 0 16px 4px rgba(179, 136, 255, 0.27);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 140ms ease, height 140ms ease, background-color 140ms ease, opacity 140ms ease;
  will-change: left, top;
}

.custom-cursor.is-visible,
.cursor-glow.is-visible {
  opacity: 1;
}

.custom-cursor.is-active {
  width: 44px;
  height: 44px;
  background: rgba(179, 136, 255, 0.26);
}

/* Navigation */
.site-header,
main {
  position: relative;
  z-index: 2;
}

.site-header {
  width: min(calc(100% - 48px), var(--content-width));
  margin: 24px auto 0;
  overflow: hidden;
  border: 2px solid rgba(179, 136, 255, 0.22);
  border-radius: 999px;
  background: transparent;
  box-shadow: 0 0 28px rgba(179, 136, 255, 0.18);
  backdrop-filter: blur(8px) brightness(1.08);
}

.site-header::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(179, 136, 255, 0.16), transparent 70%);
  content: "";
  pointer-events: none;
}

.navbar {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 84px;
  padding: 0 32px;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
}

.brand {
  justify-self: start;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--purple-300), var(--white));
  background-clip: text;
  color: transparent;
  font-family: var(--font-display);
  font-size: 2.3rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(179, 136, 255, 0.28);
}

.nav-panel {
  display: contents;
}

.nav-menu {
  display: flex;
  grid-column: 2;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 1.13rem;
  letter-spacing: 0.03em;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.nav-link:hover,
.nav-link.is-current {
  background: rgba(179, 136, 255, 0.1);
  color: var(--purple-300);
  box-shadow: 0 2px 12px rgba(179, 136, 255, 0.2);
}

.resume-button {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  justify-self: end;
  padding: 0 28px;
  grid-column: 3;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--purple-700), var(--purple-300));
  box-shadow: 0 2px 16px rgba(179, 136, 255, 0.27);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.resume-button:hover {
  box-shadow: 0 5px 28px rgba(179, 136, 255, 0.42);
  transform: translateY(-2px);
}

.nav-toggle {
  position: relative;
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(179, 136, 255, 0.36);
  border-radius: 15px;
  appearance: none;
  background: rgba(179, 136, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.nav-toggle span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 21px;
  height: 2px;
  margin: 0;
  border-radius: 3px;
  background: var(--white);
  box-shadow: 0 0 8px rgba(217, 200, 255, 0.2);
  transform: translate(-50%, -50%);
  transform-origin: center;
  transition: width 180ms ease, opacity 140ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-toggle span:first-child {
  transform: translate(-50%, calc(-50% - 7px));
}

.nav-toggle span:last-child {
  transform: translate(-50%, calc(-50% + 7px));
}

.nav-toggle[aria-expanded="true"] {
  border-color: rgba(217, 200, 255, 0.7);
  background: rgba(179, 136, 255, 0.2);
  box-shadow: 0 0 0 4px rgba(179, 136, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  width: 0;
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Home */
.hero {
  width: min(calc(100% - 40px), var(--content-width));
  min-height: calc(100svh - 110px);
  margin: 0 auto;
  padding: clamp(52px, 8vh, 86px) 0 58px;
}

.hero-content {
  display: grid;
  min-height: clamp(470px, 62vh, 600px);
  grid-template-columns: minmax(270px, 0.8fr) minmax(460px, 1.2fr);
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 3;
  padding-left: clamp(16px, 4vw, 60px);
}

.hero-title {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 6rem);
  font-weight: 400;
  line-height: 1.08;
}

.hero-title span,
.hero-title strong {
  display: block;
}

.hero-title strong {
  position: relative;
  width: max-content;
  color: var(--purple-500);
  font-weight: 400;
  text-shadow: 0 10px 24px rgba(128, 0, 255, 0.24);
}

.hero-title strong::after {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 8px;
  left: 0;
  height: 20px;
  background: radial-gradient(ellipse, rgba(128, 0, 255, 0.28), transparent 72%);
  content: "";
  filter: blur(7px);
}

.hero-portrait {
  position: relative;
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: flex-end;
}

.hero-portrait::before {
  position: absolute;
  top: 45%;
  left: 54%;
  width: min(580px, 80%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(128, 0, 255, 0.14), transparent 67%);
  content: "";
  filter: blur(28px);
  transform: translate(-50%, -50%);
}

.hero-portrait img {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  max-height: 600px;
  object-fit: contain;
  object-position: right center;
  animation: portrait-float 3.2s ease-in-out infinite;
}

.hero-footer {
  display: flex;
  align-items: center;
  gap: 28px;
}

.about-button {
  position: relative;
  display: grid;
  width: 95px;
  height: 95px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: url("https://codia-f2c.s3.us-west-1.amazonaws.com/image/2025-06-08/6grj5sa0N1.png") no-repeat center / cover;
  transition: transform 300ms ease;
}

.about-button:hover {
  transform: scale(1.05);
}

.play-icon {
  width: 0;
  height: 42px;
  background: url("https://codia-f2c.s3.us-west-1.amazonaws.com/image/2025-06-08/sdZgYAqCT4.png") no-repeat center / cover;
}

.hero-line {
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, var(--white), rgba(255, 255, 255, 0.05));
}

.social-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-links a {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border-radius: 50%;
  transition: background-color 180ms ease, transform 180ms ease;
}

.social-links a:hover {
  background: rgba(179, 136, 255, 0.1);
  transform: translateY(-3px);
}

.social-links img {
  width: 88%;
  height: 88%;
  filter: invert(1);
}

/* About */
.about {
  display: grid;
  width: min(calc(100% - 40px), var(--content-width));
  min-height: calc(100svh - 110px);
  margin: 0 auto;
  padding: clamp(80px, 12vh, 130px) 0;
  grid-template-columns: 210px minmax(0, 800px);
  justify-content: center;
  gap: clamp(44px, 7vw, 100px);
}

.about-heading {
  display: flex;
  min-height: 430px;
  align-items: center;
  justify-content: center;
}

.about-heading h1 {
  margin: 0;
  color: #35333a;
  font-family: var(--font-display);
  font-size: clamp(5.5rem, 10vw, 7.5rem);
  font-weight: 400;
  line-height: 1;
  text-shadow: -35px 28px 6px rgba(0, 0, 0, 0.28);
  transform: rotate(-90deg);
  white-space: nowrap;
}

.about-content {
  min-width: 0;
}

.about-intro {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 36px;
}

.about-intro h2 {
  margin-bottom: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.7rem, 6vw, 3.6rem);
  font-weight: 400;
  line-height: 1.2;
}

.about-intro > span {
  padding: 8px 15px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #f6f6f6;
  color: #090909;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.about-copy {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.8;
}

.about-copy p {
  margin-bottom: 22px;
}

.about-copy strong,
.about-copy a {
  color: var(--purple-500);
  font-weight: 400;
}

.about-copy a {
  text-decoration: underline;
  text-decoration-color: rgba(179, 136, 255, 0.46);
  text-underline-offset: 5px;
}

.about-copy a:hover {
  color: var(--purple-200);
  text-decoration-color: currentColor;
}

@keyframes portrait-float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(8px);
  }
}

/* Tablet */
@media (max-width: 1020px) {
  .site-header {
    z-index: 20;
    width: calc(100% - 28px);
    overflow: visible;
    border-radius: 26px;
  }

  .navbar {
    min-height: 72px;
    padding: 0 18px;
    grid-template-columns: 1fr auto;
    gap: 0;
  }

  .nav-toggle {
    display: grid;
    grid-column: 2;
    place-items: center;
  }

  .nav-toggle:active {
    transform: scale(0.94);
  }

  .nav-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: auto;
    display: grid;
    visibility: hidden;
    width: min(100%, 380px);
    padding: 10px;
    border: 1px solid rgba(179, 136, 255, 0.28);
    border-radius: 20px;
    background: rgba(22, 16, 29, 0.94);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), 0 0 28px rgba(128, 0, 255, 0.14);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
    backdrop-filter: blur(20px) saturate(1.2);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 220ms;
  }

  .nav-panel.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
  }

  .nav-menu {
    display: grid;
    grid-column: auto;
    gap: 3px;
  }

  .nav-link {
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 1.05rem;
  }

  .nav-link:hover,
  .nav-link.is-current {
    border-color: rgba(179, 136, 255, 0.14);
  }

  .nav-panel .nav-link,
  .nav-panel .resume-button {
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 140ms ease, transform 180ms ease, color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  }

  .nav-panel.is-open .nav-link,
  .nav-panel.is-open .resume-button {
    opacity: 1;
    transform: translateY(0);
  }

  .nav-panel.is-open li:nth-child(2) .nav-link {
    transition-delay: 35ms;
  }

  .nav-panel.is-open li:nth-child(3) .nav-link {
    transition-delay: 70ms;
  }

  .resume-button {
    width: 100%;
    min-height: 50px;
    margin-top: 7px;
    grid-column: auto;
    justify-self: stretch;
    border-radius: 12px;
  }

  .nav-panel.is-open .resume-button {
    transition-delay: 105ms;
  }

  .hero {
    padding-top: 72px;
  }

  .hero-content {
    grid-template-columns: minmax(250px, 0.72fr) minmax(370px, 1.28fr);
  }

  .about {
    grid-template-columns: 1fr;
  }

  .about-heading {
    min-height: 0;
  }

  .about-heading h1 {
    font-size: clamp(3.4rem, 11vw, 5.5rem);
    text-align: center;
    text-shadow: -14px 14px 6px rgba(0, 0, 0, 0.28);
    transform: none;
  }
}

/* Phone */
@media (max-width: 680px) {
  .site-header {
    margin-top: 14px;
  }

  .brand {
    font-size: clamp(1.35rem, 7vw, 1.75rem);
  }

  .hero {
    width: calc(100% - 32px);
    padding: 70px 0 48px;
  }

  .hero-content {
    min-height: 0;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy {
    padding-left: 0;
  }

  .hero-title {
    font-size: clamp(3.2rem, 16vw, 4.75rem);
  }

  .hero-title strong {
    margin: 0 auto;
  }

  .hero-portrait {
    min-height: 330px;
    justify-content: center;
  }

  .hero-portrait img {
    width: min(100%, 480px);
    max-height: 430px;
    object-position: center;
  }

  .hero-footer {
    gap: 14px;
  }

  .about-button {
    width: 70px;
    height: 70px;
  }

  .social-links {
    gap: 5px;
  }

  .social-links a {
    width: 50px;
    height: 50px;
  }

  .about {
    width: calc(100% - 32px);
    padding: 72px 0;
    gap: 48px;
  }

  .about-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .about-intro h2 {
    font-size: clamp(2.25rem, 12vw, 3rem);
  }

  .about-copy {
    font-size: 1rem;
    line-height: 1.75;
  }
}

@media (hover: hover) and (pointer: fine) {
  body,
  a,
  button {
    cursor: none;
  }

  .custom-cursor,
  .cursor-glow {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .custom-cursor,
  .cursor-glow {
    display: none !important;
  }
}
