@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Outfit:wght@300;400;500;600&family=Noto+Serif+Thai:wght@300;400;500;600;700&display=swap');

/* ── Variables ── */
:root {
  --bg:        #080808;
  --surface:   #111111;
  --accent:    #c0392b;
  --accent-2:  #e85d4a;
  --glow:      rgba(192, 57, 43, 0.45);
  --glow-soft: rgba(192, 57, 43, 0.10);
  --text:      #f2ede8;
  --muted:     #7a7370;
  --dim:       #2a2520;
  --border:    rgba(192, 57, 43, 0.22);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none; outline: none;
}
html { font-size: 62.5%; scroll-behavior: smooth; }
body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  cursor: none;
}

/* ── Cursor ── */
#cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .25s, height .25s, background .25s, border .25s;
}
#cursor-ring {
  position: fixed;
  width: 34px; height: 34px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: all .14s ease;
  opacity: .55;
}
body.hovering #cursor {
  width: 40px; height: 40px;
  background: transparent;
  border: 1.5px solid var(--accent);
}
body.hovering #cursor-ring { opacity: 0; }

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  padding: 2.2rem 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 500;
  background: linear-gradient(to bottom, rgba(8,8,8,.97) 60%, transparent);
}
header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.logo {
  font-family: 'Noto Serif Thai', sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.02em;
  cursor: none;
  transition: opacity .3s;
}
.logo:hover { opacity: .75; }

nav { display: flex; align-items: center; gap: .2rem; }
nav a {
  font-size: 1.5rem;
  color: var(--muted);
  padding: .6rem 1.6rem;
  border-radius: 3rem;
  font-weight: 500;
  transition: color .3s, background .3s;
  cursor: none;
}
nav a:hover { color: var(--text); }
nav a.active { color: var(--accent); background: var(--glow-soft); }

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: none;
  z-index: 600;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .35s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Home ── */
.home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8%;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Red orb behind photo */
.home::before {
  content: '';
  position: absolute;
  left: 3%;
  top: 50%;
  transform: translateY(-50%);
  width: 44vw; height: 44vw;
  max-width: 560px; max-height: 560px;
  background: radial-gradient(circle, rgba(192,57,43,.55) 0%, rgba(192,57,43,.18) 42%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: orb-breathe 7s ease-in-out infinite;
  z-index: 0;
}
@keyframes orb-breathe {
  0%,100% { transform: translateY(-50%) scale(1); opacity: 1; }
  50%      { transform: translateY(-50%) scale(1.1); opacity: .75; }
}

/* ── Photo ── */
.home-img {
  flex: 0 0 auto;
  width: 36%;
  max-width: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  position: relative;
}

.img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

/* Spinning ring */
.img-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) 0deg 80deg,
    transparent 80deg 180deg,
    var(--accent) 180deg 260deg,
    transparent 260deg 360deg
  );
  animation: spin-ring 9s linear infinite;
  z-index: 2;
}

/* White/dark gap */
.img-gap {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg);
  z-index: 3;
}

.img-wrapper img {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  z-index: 4;
  filter: brightness(.95) contrast(1.04) saturate(.88);
  transition: filter .4s;
  box-shadow: 0 0 50px rgba(192,57,43,.25);
}
.img-wrapper img:hover {
  filter: brightness(1.05) contrast(1.08) saturate(1);
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-16px); }
}
@keyframes spin-ring { to { transform: rotate(360deg); } }

/* ── Content ── */
.home-content {
  flex: 1;
  padding-left: 6%;
  z-index: 1;
}

.home-content h1 {
  font-family: 'Noto Serif Thai', sans-serif;
  font-size: clamp(4rem, 5.5vw, 7rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
  margin-bottom: 1.4rem;
  opacity: 0;
  animation: rise .8s ease .1s forwards;
}
.home-content h1 .name { color: var(--accent); font-style: italic; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typing line */
.typing-row {
  font-size: clamp(2rem, 2.8vw, 2.8rem);
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 2.4rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  opacity: 0;
  animation: rise .8s ease .25s forwards;
}
.typing-word {
  color: var(--accent-2);
  font-weight: 600;
  position: relative;
  min-width: 22rem;
}
.typing-word::before {
  content: "Web Developer";
  animation: cycle-words 18s infinite;
}
.typing-word::after {
  content: '';
  position: absolute;
  top: 0; right: -5px;
  width: 2px; height: 100%;
  background: var(--accent);
  animation: blink .65s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes cycle-words {
  0%,18%  { content: "Web Developer"; }
  20%,38% { content: "CS Student"; }
  40%,58% { content: "UI/UX Designer"; }
  60%,78% { content: "Problem Solver"; }
  80%,100%{ content: "Creative Coder"; }
}

/* Bio */
p.bio {
  font-size: clamp(1.4rem, 1.5vw, 1.62rem);
  line-height: 1.85;
  color: var(--muted);
  max-width: 460px;
  margin-bottom: 3rem;
  opacity: 0;
  animation: rise .8s ease .4s forwards;
}

/* Social icons */
.social-icons {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 3rem;
  opacity: 0;
  animation: rise .8s ease .55s forwards;
}
.social-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 4.4rem; height: 4.4rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 1.7rem;
  transition: all .35s ease;
  cursor: none;
  position: relative;
  overflow: hidden;
}
.social-icons a::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--accent);
  border-radius: 50%;
  transform: scale(0);
  transition: transform .35s ease;
}
.social-icons a i { position: relative; z-index: 1; }
.social-icons a:hover {
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 8px 24px var(--glow);
}
.social-icons a:hover::before { transform: scale(1); }

/* Info chips */
.info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  opacity: 0;
  animation: rise .8s ease .65s forwards;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  padding: .9rem 1.8rem;
  border-radius: 3rem;
  border: 1px solid var(--border);
  font-size: 1.3rem;
  color: var(--muted);
  background: var(--glow-soft);
  transition: border-color .3s, color .3s;
  cursor: default;
}
.chip i { color: var(--accent); font-size: 1.2rem; }
.chip:hover { border-color: var(--accent); color: var(--text); }

/* ── Scroll hint ── */
.scroll-hint {
  position: absolute;
  bottom: 3rem; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  opacity: .38;
  animation: hint-float 2.5s ease-in-out infinite;
  pointer-events: none;
}
.scroll-hint span {
  font-size: 1rem;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}
.scroll-hint .line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}
@keyframes hint-float {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(7px); }
}

/* ── Skills marquee ── */
.marquee-bar {
  overflow: hidden;
  padding: 1.5rem 0;
  border-top: 1px solid var(--dim);
  border-bottom: 1px solid var(--dim);
}
.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee-track span {
  font-size: 1.1rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.marquee-track span.dot { color: var(--accent); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hamburger { display: flex; }
  nav {
    position: fixed;
    top: 0; right: -100%;
    height: 100vh;
    width: min(300px, 82vw);
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 9rem 3rem 3rem;
    gap: .4rem;
    border-left: 1px solid var(--border);
    transition: right .4s cubic-bezier(.4,0,.2,1);
    z-index: 499;
  }
  nav.open { right: 0; }
  nav a { font-size: 1.7rem; width: 100%; padding: 1.2rem 1.4rem; }

  .home {
    flex-direction: column;
    text-align: center;
    padding: 11rem 6% 5rem;
    gap: 4rem;
  }
  .home::before {
    left: 50%; top: 13%;
    transform: translateX(-50%);
    width: 72vw; height: 72vw;
  }
  .home-img { width: 58vw; max-width: 260px; }
  .home-content { padding-left: 0; }
  p.bio { margin: 0 auto 3rem; }
  .social-icons, .info-chips { justify-content: center; }
  .typing-word { min-width: 18rem; }
}

@media (max-width: 480px) {
  html { font-size: 55%; }
  .home { padding: 10rem 5% 4rem; }
  .home-img { width: 68vw; }
}
