/* =====================================================
   PORTFOLIO — style.css
   Theme: Editorial dark/light with typographic drama
   ===================================================== */

/* ---------- 1. CSS VARIABLES (DESIGN TOKENS) ---------- */
:root {
  /* --- Dark theme (default) --- */
  --bg:        #0d0d0f;
  --surface:   #161618;
  --card:      #1e1e22;
  --border:    rgba(255,255,255,0.07);
  --text:      #f0ede8;
  --text-mute: #888;
  --accent:    #e8c77a;   /* warm gold */
  --accent-2:  #9b7ff5;   /* violet */
  --accent-3:  #5ed3a6;   /* teal */
  --shadow:    0 8px 40px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Spacing */
  --section-pad: 8rem 0;
  --radius:      14px;
  --radius-sm:   8px;

  /* Transition */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --dur:  0.4s;
}

/* ---------- LIGHT THEME ---------- */
[data-theme="light"] {
  --bg:        #faf9f6;
  --surface:   #f2efe9;
  --card:      #ffffff;
  --border:    rgba(0,0,0,0.08);
  --text:      #18171a;
  --text-mute: #666;
  --accent:    #b8860b;
  --accent-2:  #6b3fa0;
  --accent-3:  #207a5c;
  --shadow:    0 8px 40px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.06);
}

/* ---------- 2. RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  cursor: none; /* hidden — custom cursor */
}

/* Restore cursor on mobile */
@media (max-width: 768px) { body { cursor: auto; } }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea { font: inherit; }

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

/* ---------- 3. CUSTOM CURSOR ---------- */
.cursor {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s;
}
.cursor-follower {
  width: 36px; height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.22s var(--ease), opacity 0.3s;
  opacity: 0.6;
}
@media (max-width: 768px) { .cursor, .cursor-follower { display: none; } }

/* ---------- 4. NAVBAR ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  z-index: 1000;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* Scrolled state added via JS */
.navbar.scrolled {
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 2px;
}
.logo-bracket { color: var(--accent); }
.logo-name    { color: var(--text); }

/* Nav links */
.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-mute);
  position: relative;
  transition: color var(--dur), background var(--dur);
}
.nav-link::before {
  content: attr(data-num) " ";
  color: var(--accent);
  font-size: 0.65rem;
}
.nav-link:hover,
.nav-link.active { color: var(--text); background: var(--border); }

/* Controls */
.nav-controls { display: flex; align-items: center; gap: 0.75rem; }

/* Theme toggle */
.theme-toggle {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  transition: background var(--dur);
}
.toggle-icon {
  position: absolute;
  font-size: 0.85rem;
  transition: transform 0.35s var(--ease), opacity 0.35s;
}
.toggle-icon.sun  { transform: translateY(0); opacity: 1; }
.toggle-icon.moon { transform: translateY(24px); opacity: 0; }
[data-theme="light"] .toggle-icon.sun  { transform: translateY(-24px); opacity: 0; }
[data-theme="light"] .toggle-icon.moon { transform: translateY(0); opacity: 1; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
/* Active state */
.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); }

/* Mobile nav */
@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    inset: 72px 0 0 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    padding: 2rem;
    border-left: 1px solid var(--border);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-link { font-size: 1.1rem; padding: 0.75rem 1.25rem; }
  .hamburger { display: flex; }
}

/* ---------- 5. SECTION BASE ---------- */
.section {
  padding: var(--section-pad);
  position: relative;
}

.section-header {
  margin-bottom: 4rem;
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding-bottom: 0.2rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1;
}

/* ---------- 6. HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 5rem 2.5rem 2.5rem;
  gap: 3rem;
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* Giant BG text */
.hero-bg-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(5rem, 16vw, 14rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--border);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.hero-content {
  flex: 1;
  position: relative; z-index: 1;
}
.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.hero-tag::before {
  content: '';
  display: inline-block;
  width: 32px; height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}
.hero-title-outline {
  -webkit-text-stroke: 2px var(--text);
  color: transparent;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-mute);
  max-width: 440px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Hero visual */
.hero-visual {
  flex: 0 0 auto;
  width: clamp(280px, 38vw, 420px);
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
}
.avatar-ring {
  position: absolute;
  width: 110%; height: 110%;
  border-radius: 50%;
  border: 1px solid var(--border);
  animation: spinRing 20s linear infinite;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.avatar-ring::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateX(-50%);
}
@keyframes spinRing { to { transform: translate(-50%, -50%) rotate(360deg); } }

.avatar-svg {
  width: 100%;
  filter: drop-shadow(0 20px 60px rgba(0,0,0,0.4));
}

/* Floating tech badges */
.badge {
  position: absolute;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  animation: floatBadge 3s ease-in-out infinite;
}
.badge-1 { top: 12%;  left: -5%;  animation-delay: 0s; }
.badge-2 { top: 55%;  right: -8%; animation-delay: 0.8s; }
.badge-3 { bottom: 8%; left: 5%;  animation-delay: 1.6s; }
@keyframes floatBadge {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem; left: 2.5rem;
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  z-index: 1;
}
.scroll-line {
  width: 50px; height: 1px;
  background: var(--text-mute);
  position: relative; overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine { to { left: 100%; } }

@media (max-width: 900px) {
  .hero { flex-direction: column; text-align: center; padding-top: 7rem; }
  .hero-desc { margin-inline: auto; }
  .hero-cta  { justify-content: center; }
  .hero-tag  { justify-content: center; }
  .hero-visual { width: min(340px, 80vw); }
  .hero-scroll-hint { left: 50%; transform: translateX(-50%); }
}

/* ---------- 7. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  font-weight: 500;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, color 0.25s;
  cursor: none;
}
@media (max-width: 768px) { .btn { cursor: pointer; } }

.btn-primary {
  background: var(--accent);
  color: #111;
  box-shadow: 0 0 0 0 var(--accent);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,199,122,0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--card);
  transform: translateY(-2px);
}
.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.75rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---------- 8. ABOUT ---------- */
.about { background: var(--surface); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 5rem;
  align-items: center;
}

.about-image-wrap { position: relative; }
.about-image-frame {
  width: 300px; height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}
.profile-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.02em;
}
.about-image-deco {
  position: absolute;
  bottom: -16px; right: -16px;
  width: 100%; height: 100%;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  z-index: -1;
}

.stat-chip {
  position: absolute;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  box-shadow: var(--shadow-sm);
}
.stat-chip strong { display: block; font-size: 1.3rem; color: var(--accent); font-family: var(--font-display); }
.chip-1 { top: -1rem; right: -2.5rem; }
.chip-2 { bottom: 3rem; right: -3rem; }

.about-lead {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}
.about-text p { color: var(--text-mute); margin-bottom: 1rem; }

.about-tags {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.75rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-image-frame { width: 220px; height: 270px; margin: 0 auto; }
  .chip-1 { right: 0.5rem; }
  .chip-2 { right: 0; bottom: -0.5rem; }
}

/* ---------- 9. SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur);
  animation-delay: var(--delay, 0s);
}
.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.skill-icon {
  width: 48px; height: 48px;
  margin-bottom: 1.25rem;
}
.skill-icon svg { width: 100%; height: 100%; }
.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.skill-card p { font-size: 0.88rem; color: var(--text-mute); margin-bottom: 1.25rem; }

/* Progress bar */
.skill-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  width: 0;
  transition: width 1.2s var(--ease);
}

/* ---------- 10. PROJECTS ---------- */
.projects { background: var(--surface); }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}

/* Thumbnail */
.project-thumb {
  height: 180px;
  background: hsl(var(--card-hue), 50%, 15%);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
[data-theme="light"] .project-thumb {
  background: hsl(var(--card-hue), 40%, 88%);
}
.project-thumb-art {
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.thumb-icon { font-size: 4rem; }

/* Decorative grid pattern inside thumbnail */
.thumb-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 30px 30px;
}
.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, var(--card));
}
.project-card:hover .thumb-icon { transform: scale(1.15); transition: transform 0.4s var(--ease); }

/* Card body */
.project-body { padding: 1.75rem; flex: 1; display: flex; flex-direction: column; gap: 0.6rem; }
.project-meta  { display: flex; align-items: center; justify-content: space-between; }
.project-num   { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); }
.project-tags  { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-mute);
}
.project-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.project-desc  { font-size: 0.875rem; color: var(--text-mute); flex: 1; }
.project-links { display: flex; gap: 0.75rem; margin-top: 0.75rem; }

/* ---------- 11. CONTACT ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 5rem;
  align-items: start;
}
.contact-lead {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 2.5rem;
}
.contact-lead em { color: var(--accent); font-style: italic; }
.contact-links { display: flex; flex-direction: column; gap: 1rem; }
.contact-link {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-mute);
  transition: color var(--dur), transform var(--dur);
}
.contact-link:hover { color: var(--accent); transform: translateX(6px); }
.contact-icon {
  width: 40px; height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur), border-color var(--dur);
}
.contact-icon svg { width: 20px; height: 20px; }
.contact-link:hover .contact-icon { background: var(--accent); border-color: var(--accent); color: #111; }

/* Contact form */
.contact-form {
  display: flex; flex-direction: column; gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--dur), box-shadow var(--dur);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,199,122,0.12);
}
.form-group input.invalid,
.form-group textarea.invalid { border-color: #e05d5d; }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ---------- 12. FOOTER ---------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy {
  font-size: 0.82rem;
  color: var(--text-mute);
  font-family: var(--font-mono);
}
.footer-socials {
  display: flex; gap: 1rem;
}
.footer-socials a {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}
.footer-socials a:hover { color: var(--accent); border-color: var(--accent); }
.footer-socials svg { width: 16px; height: 16px; }

@media (max-width: 600px) { .footer-inner { flex-direction: column; text-align: center; } }

/* ---------- 13. SCROLL REVEAL ANIMATIONS ---------- */
/* Elements start hidden; JS adds 'visible' class on scroll */
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  /* stagger via inline style --delay */
  transition-delay: var(--delay, 0s);
}
.reveal-up    { transform: translateY(40px); }
.reveal-left  { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translate(0);
}

/* ---------- 14. SCROLLBAR ---------- */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ---------- 15. SELECTION ---------- */
::selection { background: var(--accent); color: #111; }
