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

/* ===== DARK MODE (default) ===== */
:root, [data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #181818;
  --surface-2: #202020;
  --surface-hover: #242424;
  --border: rgba(255,255,255,0.07);
  --text: #f0f0f0;
  --text-muted: #888;
  --text-dim: #555;
  --accent: #7c6ff7;
  --accent-soft: rgba(124,111,247,0.15);
  --green: #4ade80;
  --shadow: rgba(0,0,0,0.5);
  --modal-bg: #1a1a1a;
  --toggle-bg: var(--accent);
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
  --bg: #f0f0f0;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --surface-hover: #ebebeb;
  --border: rgba(0,0,0,0.08);
  --text: #111111;
  --text-muted: #555555;
  --text-dim: #999999;
  --accent: #5b4fcf;
  --accent-soft: rgba(91,79,207,0.1);
  --green: #16a34a;
  --shadow: rgba(0,0,0,0.12);
  --modal-bg: #ffffff;
  --toggle-bg: var(--accent);
}

/* ===== THEME TRANSITION ===== */
body, .card, .modal, .overlay, .social-btn, .tech-icon,
.modal-tech-item, .modal-project-item, .modal-exp-item,
.tag, .badge, .exp-year, .contact-btn, .resource-btn {
  transition: background 0.35s ease, color 0.35s ease,
              border-color 0.35s ease, box-shadow 0.35s ease;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  overflow-x: hidden;
}

/* ===== BENTO GRID ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 1100px;
  width: 100%;
  grid-template-areas:
    "hero   hero   img1   img2"
    "hero   hero   socials socials"
    "photo  tech   img3   img3"
    "photo  tech   img3   img3"
    "exp    exp    resource toggle"
    "learn  learn  contact contact";
}

/* ===== CARD BASE ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.35s ease,
    border-color 0.35s ease;
  will-change: transform;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(circle at 60% 20%, rgba(124,111,247,0.06) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  transform: scale(1.025) translateY(-2px);
  box-shadow: 0 16px 48px var(--shadow), 0 0 0 1px rgba(124,111,247,0.2);
  background: var(--surface-hover);
}

.card:hover::before { opacity: 1; }
.card:active { transform: scale(0.97); transition: transform 0.1s ease; }

.card.zooming {
  animation: cardZoom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cardZoom {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ===== GRID AREAS ===== */
.card--hero     { grid-area: hero; cursor: default; }
.card--img1     { grid-area: img1; }
.card--img2     { grid-area: img2; }
.card--socials  { grid-area: socials; cursor: default; }
.card--photo    { grid-area: photo; }
.card--tech     { grid-area: tech; }
.card--img3     { grid-area: img3; }
.card--resource { grid-area: resource; }
.card--toggle   { grid-area: toggle; }
.card--exp      { grid-area: exp; }
.card--learning { grid-area: learn; }
.card--contact  { grid-area: contact; }

.card--hero:hover, .card--socials:hover { transform: none; box-shadow: none; }

/* ===== HERO ===== */
.avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  background: #333;
}

.label { font-size: 11px; color: var(--text-muted); }
.name-tag { font-size: 14px; font-weight: 600; color: var(--text); }

.badge {
  margin-left: auto;
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.hero-heading {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== IMAGE CARDS ===== */
.card--image {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  padding: 16px;
}

.img-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.img-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 0;
}

.img-placeholder span { font-size: 2.5rem; }
.img-placeholder p { font-size: 12px; color: var(--text-muted); text-align: center; }

.card-arrow {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.card:hover .card-arrow {
  background: var(--accent);
  color: white;
  transform: rotate(45deg);
}

/* ===== SOCIALS ===== */
.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.social-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

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

/* ===== PHOTO ===== */
.card--photo {
  padding: 0;
  overflow: hidden;
  min-height: 280px;
}

/* ===== TECH ===== */
.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.3;
}

.tech-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tech-icon {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: default;
  transition: transform 0.2s, background 0.2s;
}

.tech-icon:hover {
  transform: scale(1.1) rotate(-3deg);
  background: var(--accent-soft);
}

/* ===== EXPERIENCE ===== */
.exp-list { display: flex; flex-direction: column; gap: 12px; }

.exp-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.exp-year {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  margin-top: 1px;
}

.exp-role { font-size: 13px; font-weight: 600; color: var(--text); }
.exp-company { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== RESOURCE ===== */
.resource-btn {
  display: inline-block;
  margin-top: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.resource-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ===== DARK/LIGHT TOGGLE CARD ===== */
.card--toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.card--toggle:hover { transform: scale(1.04) !important; box-shadow: 0 12px 36px var(--shadow) !important; }

.toggle-icon-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-sun,
.toggle-moon {
  position: absolute;
  font-size: 1.75rem;
  line-height: 1;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.toggle-moon { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .toggle-sun { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .toggle-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

.toggle-wrap {
  width: 52px;
  height: 28px;
  background: var(--accent);
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 3px;
  transition: background 0.4s ease;
}

[data-theme="light"] .toggle-wrap { background: #f59e0b; }

.toggle-dot {
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateX(0);
}

[data-theme="light"] .toggle-dot { transform: translateX(24px); }

.toggle-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}


/* ===== LEARNING ===== */
.learning-focus {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin: 8px 0 10px;
}

.learning-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.learn-icon {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 2rem;
  opacity: 0.5;
}

/* ===== CONTACT ===== */
.contact-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.contact-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.contact-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.active { opacity: 1; pointer-events: all; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  width: min(560px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover { background: var(--accent); color: white; }

.modal-body h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  padding-right: 32px;
}

.modal-body p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 10px;
}

.modal-body p strong { color: var(--text); }

.modal-body ul {
  margin: 8px 0 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-body ul li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.modal-tags span {
  background: var(--accent-soft);
  border: 1px solid rgba(124,111,247,0.3);
  color: var(--accent);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
}

.modal-tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.modal-tech-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

/* ===== MODAL PROJECT LIST ===== */
.modal-project-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-project-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.2s;
}

.modal-project-item:hover { border-color: rgba(124,111,247,0.4); }

.modal-project-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-project-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; margin-top: 2px; }

.modal-project-header strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 3px;
}

.modal-project-meta { font-size: 11px; color: var(--accent); font-weight: 500; }
.modal-project-item > p { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.modal-project-item .modal-tags { margin-top: 8px; }

/* ===== MODAL EXP ===== */
.modal-exp { display: flex; flex-direction: column; gap: 20px; }

.modal-exp-item {
  border-left: 2px solid var(--accent);
  padding-left: 16px;
}

.modal-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-exp-header strong { color: var(--text); font-size: 14px; }
.modal-exp-header span { font-size: 11px; color: var(--accent); }
.modal-exp-item > p { font-size: 12px; color: var(--text-muted); margin: 4px 0 8px; }
.modal-exp-item ul { list-style: disc; }

.modal-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ===== ENTRANCE ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card { animation: fadeUp 0.5s ease both; }
.card:nth-child(1)  { animation-delay: 0.05s; }
.card:nth-child(2)  { animation-delay: 0.10s; }
.card:nth-child(3)  { animation-delay: 0.15s; }
.card:nth-child(4)  { animation-delay: 0.20s; }
.card:nth-child(5)  { animation-delay: 0.25s; }
.card:nth-child(6)  { animation-delay: 0.30s; }
.card:nth-child(7)  { animation-delay: 0.35s; }
.card:nth-child(8)  { animation-delay: 0.40s; }
.card:nth-child(9)  { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.50s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.60s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "hero   hero"
      "img1   img2"
      "socials socials"
      "photo  tech"
      "img3   img3"
      "exp    exp"
      "resource toggle"
      "learn  contact";
  }
  .social-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 560px) {
  body { padding: 16px 10px; }
  .bento-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero" "img1" "img2" "socials"
      "photo" "tech" "img3" "exp"
      "resource" "toggle" "learn" "contact";
  }
  .card { padding: 18px; }
}
