/* Fonts loaded via <link> in HTML head for non-blocking rendering */

:root {
  /* -- Palette -- */
  --bg-deep: #0B0E14;
  --bg-panel: #151B25;
  --bg-card: rgba(21, 27, 37, 0.7);
  --bg-glass: rgba(21, 27, 37, 0.4);

  --accent-primary: #38BDF8;
  /* Electric Blue */
  --accent-secondary: #A78BFA;
  /* Soft Purple */
  --accent-glow: rgba(56, 189, 248, 0.5);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.3);

  /* -- Type -- */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', monospace;

  /* -- Spacing -- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --header-height: 80px;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(167, 139, 250, 0.08), transparent 25%);
  background-attachment: fixed;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  /* Deep Blue scanning beam */
  background: linear-gradient(to right,
      transparent 0%,
      rgba(28, 78, 216, 0.05) 40%,
      rgba(37, 99, 235, 0.2) 50%,
      rgba(28, 78, 216, 0.05) 60%,
      transparent 100%);
  background-size: 250% 100%;
  animation: bg-scan 36s linear infinite;
}

@keyframes bg-scan {
  0% {
    background-position: 250% 0;
  }

  100% {
    background-position: -150% 0;
  }
}

/* --- Creative Link Buttons (from card.html) --- */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-btn {
  position: relative;
  display: flex;
  align-items: center;
  padding: 14px 20px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
  overflow: hidden;
  cursor: pointer;
  width: 100%;
}

.link-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.link-btn:active {
  transform: translateY(0);
}

.link-icon {
  width: 24px;
  height: 24px;
  margin-right: 14px;
  fill: currentColor;
  opacity: 0.9;
  flex-shrink: 0;
}

.link-arrow {
  margin-left: auto;
  opacity: 0.5;
  transition: transform 0.3s;
}

.link-btn:hover .link-arrow {
  transform: translateX(4px);
  opacity: 1;
}

/* Specific Colors */
.btn-wa {
  color: #4ade80;
}

.btn-wa:hover {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.3);
}

.btn-tg {
  color: #38BDF8;
}

.btn-tg:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

/* Email Copy Utility overrides */
.link-btn.is-copy {
  width: auto;
  padding: 0 16px;
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -- Typography -- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 24px;
  background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
}

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-secondary);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* -- Layout -- */
.container {
  width: min(100%, 1100px);
  margin-inline: auto;
  padding-inline: 20px;
}

section {
  padding-block: 80px;
  position: relative;
}

/* -- Components: Buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(167, 139, 250, 0.1));
  border-color: rgba(56, 189, 248, 0.2);
  color: var(--accent-primary);
  backdrop-filter: blur(8px);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(167, 139, 250, 0.2));
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.15);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.btn-ghost:hover {
  border-color: var(--text-dim);
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* -- Components: Cards -- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.04), transparent 40%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.glass-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.glass-card:hover::before {
  opacity: 1;
}

/* -- Hero Section -- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 120px 20px 80px;
}

.hero-content {
  max-width: 800px;
  width: 100%;
}

.hero-label {
  font-family: var(--font-mono);
  color: var(--accent-primary);
  margin-bottom: 12px;
  display: inline-block;
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 32px;
  max-width: 600px;
}

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

/* -- Navigation -- */
.floating-nav {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(16px);
  padding: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  display: flex;
  gap: 4px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.floating-nav:hover {
  background: rgba(11, 14, 20, 0.95);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%) translateY(-2px);
}

.nav-link {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.12);
}

/* -- App Store Section -- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.project-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.project-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-secondary);
  margin-bottom: 12px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: var(--text-dim);
}

/* -- Skills -- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.skill-item h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.skill-item p {
  color: var(--text-main);
  font-size: 0.95rem;
  margin: 0;
}

/* -- Experience (Timeline) -- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-primary), transparent);
  border-radius: 2px;
  opacity: 0.5;
}

.role-card {
  position: relative;
}

.role-card::before {
  content: '';
  position: absolute;
  left: -29px;
  /* 24px padding + 2px line/2 + 4px dot/2 approx */
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.role-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.role-title {
  font-size: 1.25rem;
  color: #fff;
}

.role-company {
  color: var(--accent-primary);
}

.role-period {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.role-bullets li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.role-bullets li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent-secondary);
}

/* -- Footer -- */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 40px 0 100px;
  /* Extra bottom padding for floating nav */
  margin-top: 80px;
  text-align: center;
}

.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.visitor-counter svg {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
}

.visitor-counter .count {
  color: #fff;
  font-weight: 700;
}

.project-modal[hidden],
.contact-modal[hidden],
.recruiter-modal[hidden] {
  display: none !important;
}

.project-modal,
.contact-modal,
.recruiter-modal {
  display: grid;
  /* 'hidden' overrides this via !important above when set */
}



/* -- Scroll Reveal -- */
.section-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* -- Staggered Card Animation -- */
.app-card,
#web-projects .glass-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.app-card.visible,
#web-projects .glass-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-card.visible:nth-child(1) { transition-delay: 0.05s; }
.app-card.visible:nth-child(2) { transition-delay: 0.15s; }
.app-card.visible:nth-child(3) { transition-delay: 0.25s; }
.app-card.visible:nth-child(4) { transition-delay: 0.35s; }

/* -- Enhanced Hover on Project Cards -- */
#web-projects .glass-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 40px rgba(56, 189, 248, 0.15);
}

.app-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.12);
}

/* -- Timeline Draw Animation -- */
.timeline::before {
  animation: drawLine 1.5s ease forwards;
  transform-origin: top;
}

@keyframes drawLine {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* -- Skill Tag Hover -- */
.skill-tag:hover {
  background: rgba(56, 189, 248, 0.15);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  .floating-nav {
    bottom: 20px;
    width: 90%;
    justify-content: center;
    overflow-x: auto;
  }

  .hero {
    min-height: auto;
    padding-block: 120px 60px;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }
}