/* ============================================
   Portfolio — Shadab Riyaz Tango
   Single-Page · "Warm Signal" Design
   ============================================ */

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

/* ---- DESIGN TOKENS ---- */

:root {
  /* Light (default) */
  --bg-primary: #f5f0e8;
  --bg-surface: #ece6db;
  --bg-card: #e2dbd0;
  --text-primary: #1a1714;
  --text-secondary: #6b6560;
  --accent: #c4563a;
  --glow-color: rgba(196, 86, 58, 0.08);

  --footer-height: 100px;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

[data-theme="dark"] {
  --bg-primary: #0e0e0e;
  --bg-surface: #161616;
  --bg-card: #1c1c1c;
  --text-primary: #f0ece2;
  --text-secondary: #a09b90;
  --accent: #e07a5f;
  --glow-color: rgba(224, 122, 95, 0.07);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ---- SCROLL PROGRESS BAR ---- */

.scroll-progress {
  display: none;
}

/* ---- PAGE LOADER ---- */

.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9998;
  pointer-events: none;
  animation: loaderFade 0.6s ease 0.2s forwards;
}

@keyframes loaderFade {
  to { opacity: 0; visibility: hidden; }
}

/* ---- NOISE TEXTURE (global) ---- */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.3;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  z-index: 0;
}

/* ---- CURSOR GLOW ---- */

.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.cursor-glow--visible {
  opacity: 1;
}

/* ---- CUSTOM CURSOR ---- */

.custom-cursor {
  position: fixed;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  mix-blend-mode: difference;
  background: transparent;
}

.custom-cursor--hover {
  width: 48px;
  height: 48px;
  background: rgba(224, 122, 95, 0.15);
  border-color: var(--accent);
}

/* ---- THEME TOGGLE ---- */

.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 100;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 2s;
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
}

/* Light default: show moon (to switch to dark). Dark: show sun. */
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---- HERO SECTION ---- */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 3rem 4rem;
  position: relative;
  z-index: 1;
  margin-bottom: var(--footer-height);
  background: var(--bg-primary);
}

/* Aurora waves background */
.aurora-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora-bg svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70%;
}

.aurora-wave-1 {
  animation: auroraFlow1 20s ease-in-out infinite alternate;
  transform-origin: center bottom;
}

.aurora-wave-2 {
  animation: auroraFlow2 25s ease-in-out infinite alternate;
  transform-origin: center bottom;
}

.aurora-wave-3 {
  animation: auroraFlow3 30s ease-in-out infinite alternate;
  transform-origin: center bottom;
}

@keyframes auroraFlow1 {
  0% { transform: translateY(0) scaleY(1); opacity: 1; }
  100% { transform: translateY(-20px) scaleY(1.08); opacity: 0.7; }
}

@keyframes auroraFlow2 {
  0% { transform: translateX(0) translateY(0); opacity: 1; }
  100% { transform: translateX(30px) translateY(-15px); opacity: 0.6; }
}

@keyframes auroraFlow3 {
  0% { transform: translateY(0) scaleY(1); opacity: 1; }
  100% { transform: translateY(-25px) scaleY(1.12); opacity: 0.8; }
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  gap: 4rem;
  position: relative;
  z-index: 1;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

/* Tagline */
.tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards 1s;
}

/* ---- NAME — SPLIT LETTER ANIMATION ---- */

.name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 5.5vw, 5.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards 1.2s;
}

.letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(40deg);
  animation: letterIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes letterIn {
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

/* Role */
.role {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.2vw, 0.95rem);
  color: var(--text-secondary);
  margin-top: 1.25rem;
  opacity: 0;
  visibility: hidden;
}

.role--visible {
  visibility: visible;
  animation: fadeInUp 0.6s ease forwards;
}

/* Bio */
.bio {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.3vw, 1.05rem);
  color: var(--accent);
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
}

.bio--visible {
  visibility: visible;
  animation: fadeInUp 0.6s ease forwards;
}

/* Scroll indicator */
.scroll-indicator {
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards 3.5s;
  cursor: none;
  display: inline-block;
  color: var(--text-secondary);
  transition: color 0.3s ease, transform 0.3s ease;
}

.scroll-indicator:hover {
  color: var(--accent);
  transform: translateY(4px);
}

.scroll-indicator svg {
  animation: bounce 2s ease infinite 4s;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(10px); }
  60% { transform: translateY(5px); }
}

/* ---- PHOTO WITH RING ---- */

.hero-photo {
  flex-shrink: 0;
  opacity: 0;
  animation: photoReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 1.5s;
  will-change: transform;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes photoReveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.photo-ring {
  position: absolute;
  width: calc(clamp(180px, 18vw, 260px) + 16px);
  height: calc(clamp(180px, 18vw, 260px) + 16px);
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--accent),
    transparent 30%,
    var(--accent) 50%,
    transparent 80%,
    var(--accent)
  );
  animation: ringRotate 6s linear infinite;
  opacity: 0.5;
}

@keyframes ringRotate {
  to { transform: rotate(360deg); }
}

.photo-frame {
  width: clamp(180px, 18vw, 260px);
  height: clamp(180px, 18vw, 260px);
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.photo-frame:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(100%) contrast(1.05);
  transition: filter 0.4s ease;
}

.photo-frame:hover img {
  filter: grayscale(0%) contrast(1);
}

/* ---- SCROLL REVEAL ---- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- FOOTER (fixed behind hero, revealed on scroll) ---- */

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 0;
  height: var(--footer-height);
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  transition: color 0.4s ease;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.footer-links {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0.75rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: color 0.3s ease, background 0.3s ease, transform 0.2s ease;
  cursor: none;
}

.footer-link:hover {
  color: var(--accent);
  background: rgba(224, 122, 95, 0.08);
  transform: translateY(-2px);
}

.footer-link svg {
  flex-shrink: 0;
}


/* ---- KEYFRAME ANIMATIONS ---- */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- RESPONSIVE ---- */

@media (max-width: 900px) {
  .hero {
    padding: 4rem 2rem 3rem;
  }

  .hero-content {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 2rem;
  }

  .name {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
  }

  .scroll-indicator {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
  }

  .photo-frame {
    width: 160px;
    height: 160px;
  }

  .photo-ring {
    width: 176px;
    height: 176px;
  }

  .theme-toggle {
    top: 1.5rem;
    right: 1.5rem;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 5rem 1.5rem 2rem;
  }

  .name {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .photo-frame {
    width: 130px;
    height: 130px;
  }

  .photo-ring {
    width: 146px;
    height: 146px;
  }

  .theme-toggle {
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
  }

  .aurora-bg svg {
    height: 50%;
  }

  :root {
    --footer-height: 80px;
  }

  .footer-heading {
    font-size: 0.8rem;
  }

  .footer-link {
    width: 34px;
    height: 34px;
  }

  .footer-link svg {
    width: 16px;
    height: 16px;
  }
}

@media (pointer: coarse) {
  .custom-cursor,
  .cursor-glow {
    display: none;
  }

  body,
  .scroll-indicator,
  .footer-link,
  .theme-toggle,
  .photo-frame {
    cursor: auto;
  }
}
