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

:root {
  --bg: #0f172a;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --accent: #5eead4;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  transition: opacity 0.3s ease;
}

body.loading {
  opacity: 0;
}

.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

/* ── Intro Section ── */
.intro {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.intro-text {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 520px;
}

.intro-image {
  flex: 0 0 480px;
}

.intro-image img {
  width: 100%;
  height: 500px;
  object-fit: contain;
  border-radius: 12px;
}

.intro-image iframe {
  display: block;
  width: 100%;
  height: 315px;
  border: none;
  border-radius: 12px;
}

.intro h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  white-space: nowrap;
}

.intro .role {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.intro p {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 480px;
  margin-bottom: 1rem;
}

.intro p a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--text-muted);
  transition: border-color 0.3s, color 0.3s;
}

.intro p a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Socials ── */
.socials {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
}

.socials a {
  color: var(--text-muted);
  transition: color 0.3s;
}

.socials a:hover { color: var(--accent); }
.socials svg { width: 22px; height: 22px; }

.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--text-muted);
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.3s;
}

.cv-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.cv-btn svg {
  width: 14px;
  height: 14px;
}

.see-work {
  text-align: center;
  padding: 2rem 0;
  transition: opacity 0.4s;
}

.see-work.hidden {
  opacity: 0;
  pointer-events: none;
}

.see-work a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.see-work a:hover {
  color: var(--accent);
}

/* ── Skills Section ── */
.skills-section {
  padding: 0 0 2rem;
  text-align: center;
}

.skills-section h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.skill {
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  background: rgba(56, 89, 160, 0.15);
  color: #7b9bd4;
  font-weight: 500;
}

/* ── Projects Section ── */
.projects-section { padding: 4rem 0 6rem; }

.projects-section h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.projects-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.projects-header h2 {
  margin-bottom: 0;
}

.projects-arrow {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.3s;
}

.projects-arrow:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.projects-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0 2rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.projects-track::-webkit-scrollbar { display: none; }

.project-card {
  flex-shrink: 0;
  width: 360px;
  scroll-snap-align: start;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(94,234,212,0.15);
  transform: translateY(-4px);
}

.project-thumb {
  width: 100%;
  height: 200px;
  background: var(--bg);
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.project-body { padding: 1.5rem; }

.project-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-body h3 .arrow {
  font-size: 0.85rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.3s;
}

.project-card:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}

.project-body p {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
  font-size: 0.7rem;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  background: rgba(94,234,212,0.1);
  color: var(--accent);
  font-weight: 500;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.project-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  align-self: center;
  line-height: 1;
  padding-top: 0.15rem;
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.scroll-hint svg {
  width: 16px;
  height: 16px;
  animation: nudge 2s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

/* ── Sub-page elements ── */
.back-btn {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s;
  z-index: 10;
}

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

.slideshow {
  position: relative;
  width: 420px;
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
}

.slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
}

.slides img {
  min-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  flex-shrink: 0;
}

.dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.3s;
}

.dot.active {
  background: #fff;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s;
  margin-top: 1rem;
}

.download-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
}

/* ── Tablet (768px) ── */
@media (max-width: 768px) {
  .wrapper {
    padding: 3rem 1.25rem;
  }

  .intro {
    flex-direction: column-reverse;
    text-align: center;
  }

  .intro-text {
    max-width: 100%;
    padding: 0 0.5rem;
  }

  .intro-image {
    flex: none;
    width: 100%;
  }

  .intro-image iframe {
    height: auto;
    aspect-ratio: 16/9;
  }

  .intro p {
    max-width: 100%;
    word-wrap: break-word;
  }

  .intro-image img {
    width: 240px;
    height: 300px;
  }

  .slideshow {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
  }

  .dots {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    justify-content: center;
    padding: 0.75rem 0;
  }

  .socials {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .see-work {
    width: 100%;
  }

  .skills-section {
    padding: 1.5rem 0;
  }

  .skills-list {
    gap: 0.5rem;
  }

  .skill {
    font-size: 0.7rem;
    padding: 0.35rem 0.8rem;
  }

  .projects-section {
    padding: 1.5rem 0 4rem;
  }

  .project-card {
    width: 280px;
  }

  .project-thumb {
    height: 160px;
  }

  .project-body {
    padding: 1.25rem;
  }

  .project-body h3 {
    font-size: 0.9rem;
  }

  .project-body p {
    font-size: 0.8rem;
  }

  .tags {
    gap: 0.4rem;
  }

  .tag {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
  }

  .projects-arrow {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .back-btn {
    font-size: 0.8rem;
  }

  .cv-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }

  .slides img {
    object-fit: contain;
  }

  .dot {
    width: 6px;
    height: 6px;
  }
}

/* ── Phone (480px) ── */
@media (max-width: 480px) {
  .intro h1 {
    font-size: 1.8rem;
  }

  .intro-image img {
    width: 200px;
    height: 260px;
  }

  .project-card {
    width: 260px;
  }

  .project-thumb {
    height: 140px;
  }

  .slideshow {
    width: 100%;
    height: 220px;
  }
}