/* ============================================================
   Xi-kki — Developer Portfolio | Dark Theme
   ============================================================ */

/* ─── Reset & Base ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --bg-alt: #12121a;
  --bg-card: #181825;
  --bg-card-hover: #1e1e30;
  --text: #e4e4e7;
  --text-muted: #888899;
  --text-dim: #555566;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-glow: rgba(167, 139, 250, 0.15);
  --accent-subtle: rgba(167, 139, 250, 0.08);
  --border: #252535;
  --border-hover: #353550;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
  --nav-h: 72px;
}

[data-theme="light"] {
  --bg: #f8f8fc;
  --bg-alt: #eeeef4;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f8;
  --text: #1a1a2e;
  --text-muted: #555570;
  --text-dim: #9999aa;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.1);
  --accent-subtle: rgba(124, 58, 237, 0.05);
  --border: #d4d4e0;
  --border-hover: #bbbbd0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
  cursor: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ─── Custom Cursor ─── */
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.15s, height 0.15s, background 0.15s;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s, transform 0.08s;
}

.cursor-ring.hovering {
  width: 52px;
  height: 52px;
  border-color: var(--accent-hover);
  background: var(--accent-glow);
}

/* ─── Scroll Progress ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  z-index: 1000;
  width: 0%;
  transition: width 0.1s;
}

/* ─── Container ─── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

[data-theme="light"] .nav.scrolled {
  background: rgba(248, 248, 252, 0.85);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 16px; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.nav-cta {
  padding: 8px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}
.nav-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ─── Reveal Animations ─── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s, transform 0.7s;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-right {
  transform: translateX(40px);
}
.reveal-right.visible {
  transform: translateX(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── Hero ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: calc(100vh - var(--nav-h) - 80px);
}

.hero-copy {
  position: relative;
}

.hero-overline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  font-family: var(--font-mono);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.typewriter-text::after {
  content: '|';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-name {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-bio {
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-ghost-large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.btn-ghost-large:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ─── Hero Proof ─── */
.hero-proof {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}

.proof-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.proof-item svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ─── Scroll Indicator ─── */
.scroll-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  animation: bounce 2s infinite;
}

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

/* ─── Hero Visual ─── */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.hero-photo-frame {
  width: 300px;
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border);
  position: relative;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.hero-photo-frame:hover {
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 12px 48px var(--accent-glow);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.6s;
}

.hero-photo-frame:hover .hero-photo {
  transform: scale(1.08);
}

.hero-photo-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.badge-primary {
  right: -20px;
  bottom: 60px;
  color: var(--accent);
}

.badge-secondary {
  left: -20px;
  bottom: 20px;
  color: #60a5fa;
}

.badge-icon { display: flex; }

/* ─── Media / Tech Strip ─── */
.media-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.media-label {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 24px;
}

.media-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.tech-logo {
  padding: 8px 20px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-mono);
  transition: all var(--transition);
}
.tech-logo:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
  transform: translateY(-2px);
}

/* ─── Section ─── */
.section {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 60px;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ─── Ventures / Projects Grid ─── */
.ventures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.venture-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
  position: relative;
}

.venture-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.venture-card.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-subtle) 100%);
}

.venture-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.venture-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.status-live { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-beta { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.status-building { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }

.venture-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.venture-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.venture-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.venture-tags span {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent-subtle);
  color: var(--accent);
  font-family: var(--font-mono);
}

.venture-links {
  display: flex;
  gap: 16px;
}

.venture-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  transition: all var(--transition);
}
.venture-link:hover { color: var(--accent-hover); gap: 4px; }

.venture-link-gh {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color var(--transition);
}
.venture-link-gh:hover { color: var(--text); }

/* ─── About ─── */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-copy .section-label { text-align: left; }

.about-copy h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.about-text p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-text em {
  color: var(--text);
  font-style: italic;
}

.about-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.about-actions .btn svg {
  width: 18px;
  height: 18px;
}

/* ─── Stats ─── */
.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.about-link-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition);
}

.about-link:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.about-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-dim);
}

.about-link:hover svg {
  color: var(--accent);
}

.about-link .arrow {
  margin-left: auto;
  transition: transform var(--transition);
}
.about-link:hover .arrow {
  transform: translateX(4px);
}

/* ─── Timeline ─── */
.milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.milestone-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
  position: relative;
}

.milestone-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}

.milestone-card.featured {
  grid-column: 1 / -1;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-subtle) 100%);
}

.milestone-card.origin {
  border-color: var(--border);
}

.milestone-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.milestone-icon svg {
  color: var(--accent);
}

.milestone-year-badge {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-bottom: 8px;
}

.milestone-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.milestone-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.milestone-card.featured .milestone-content {
  padding-left: 0;
}

/* ─── Writing ─── */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.writing-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
}

.writing-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.writing-source {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-bottom: 12px;
}

.writing-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.writing-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.writing-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap var(--transition);
}

.writing-card:hover .writing-link {
  gap: 4px;
}

.writing-cta {
  text-align: center;
  margin-top: 48px;
}

/* ─── Contact ─── */
.contact-section {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.contact-inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-inner h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.contact-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}

.social-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
  transform: translateY(-2px);
}

.social-btn--primary {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}
.social-btn--primary:hover {
  background: var(--accent);
  color: #fff;
}

.social-btn svg {
  width: 18px;
  height: 18px;
}

/* ─── Footer ─── */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-name {
  font-size: 1rem;
  font-weight: 600;
}

.footer-real {
  font-weight: 400;
  color: var(--text-dim);
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ─── Tilt Effect (JS applied data-tilt) ─── */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero-copy { order: 2; }
  .hero-visual { order: 1; }
  .hero-bio { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-proof { align-items: center; }
  .scroll-indicator { display: none; }
  .hero-photo-frame { width: 200px; height: 266px; }
  .avatar-initials { font-size: 4rem; }
  .badge-primary { right: 0; bottom: 50px; }
  .badge-secondary { left: 0; bottom: 10px; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-copy h2 { text-align: center; }
  .about-copy .section-label { text-align: center; }
  .about-actions { justify-content: center; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .ventures-grid { grid-template-columns: 1fr; }
  .writing-grid { grid-template-columns: 1fr; }
  .milestones-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-photo-frame { width: 160px; height: 213px; }
  .avatar-initials { font-size: 3rem; }
  .contact-social { flex-direction: column; align-items: center; }
}
