/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'Space Grotesk', sans-serif; background: var(--bg); color: var(--light); -webkit-font-smoothing: antialiased; position: relative; overflow-x: hidden; }
.gradient-bg { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.gradient-bg::before {
  content: ""; position: absolute; width: 80%; height: 60%; left: -10%; top: 10%; background: radial-gradient(ellipse at center, rgba(254,201,63,0.50) 0%, rgba(254,201,63,0) 70%); filter: blur(40px); animation: animate_2 12s infinite;
}
.gradient-bg::after {
  content: ""; position: absolute; width: 80%; height: 60%; right: -10%; top: 15%; background: radial-gradient(ellipse at center, rgba(93,248,240,0.50) 0%, rgba(93,248,240,0) 70%); filter: blur(40px); animation: animate_3 12s infinite;
}
body::before {
  content: ""; position: fixed; width: 70%; height: 50%; left: 15%; top: -15%; background: radial-gradient(ellipse at center, rgba(243,86,146,0.50) 0%, rgba(243,86,146,0) 70%); filter: blur(40px); pointer-events: none; z-index: -1; animation: animate_1 12s infinite;
}
body::after {
  content: ""; position: fixed; width: 70%; height: 50%; left: 15%; bottom: -15%; background: radial-gradient(ellipse at center, rgba(48,51,107,0.50) 0%, rgba(48,51,107,0) 70%); filter: blur(40px); pointer-events: none; z-index: -1;
}
@keyframes animate_1 { 25%{opacity:0.8} 50%{opacity:1} 75%{opacity:0.85} 100%{opacity:0.9} }
@keyframes animate_2 { 50%{opacity:0.85} 75%{opacity:0.7} }
@keyframes animate_3 { 50%{opacity:0.7} 75%{opacity:0.85} }
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }
input, textarea { font-family: inherit; }

/* === Variables === */
/*:root {
  --bg: #1D1D1E;
  --bg-light: #373739;
  --surface: #373739;
  --light: #D9D9D9;
  --light-muted: #A8A8A8;
  --accent: #7CC3FF;
  --accent-alt: #5AA3E0;
  --white: #ffffff;
  --radius: 12px;
  --max-w: 1400px;
}*/

/* Dark - cyan (saved) 
:root {
  --bg: #1D1D1E;
  --bg-light: #373739;
  --surface: #373739;
  --light: #00ffea;
  --light-muted: #00c0b0;
  --accent: #00ffea;
  --accent-alt: #00c0b0;
  --white: #F8F8F8;
  --white-dark: #8f8f8f;
  --radius: 12px;
  --max-w: 1400px;
}
*/

:root {
  --bg: #F8F8F6;
  --bg-light: #EDEDE9;
  --surface: #FFFFFF;
  --light: #1D1D1E;
  --light-muted: #6B7280;
  --accent: #00B8A6;
  --accent-alt: #FF2F92;
  --white: #1D1D1E;
  --white-dark: #6B6B6B;
  --radius: 10px;
  --max-w: 1400px;
}

/* === Header === */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 2px solid var(--light);
}
#work, #misc { scroll-margin-top: 80px; }
.project { scroll-margin-top: 80px; }

/* === Lightbox === */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.92); align-items: center; justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 10px; }
.lightbox-close {
  position: absolute; top: 16px; right: 24px; background: none; border: none;
  color: #fff; font-size: 36px; cursor: pointer; z-index: 101;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); background: none; border: none;
  color: #fff; font-size: 32px; cursor: pointer; padding: 16px; z-index: 101;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: #A8A8A8; font-size: 14px;
}
.lightbox-thumbs {
  position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; max-width: 90vw; overflow-x: auto; padding: 8px;
}
.lightbox-thumb {
  width: 56px; height: 40px; object-fit: cover; border-radius: 4px;
  cursor: pointer; opacity: 0.5; border: 2px solid transparent; transition: opacity 0.2s, border-color 0.2s;
}
.lightbox-thumb:hover { opacity: 0.8; }
.lightbox-thumb.active { opacity: 1; border-color: var(--accent); }
.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 16px 32px;
  display: flex; justify-content: space-between; align-items: center;
}
.logo-link { display: flex; align-items: center; }
.logo-link img { height: 36px; }
.nav { display: flex; gap: 32px; align-items: center; }
.nav-dropdown { display: flex; align-items: center; position: relative; }
.nav-dropdown::before {
  content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 8px;
  display: none;
}
.nav-dropdown:hover::before { display: block; }
.nav a {
  font-size: 14px; font-weight: 500; color: var(--white-dark);
  transition: color 0.2s;
  position: relative;
  padding: 12px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { color: var(--white); }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 12px; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 22px; height: 2px; background: #000; transition: transform 0.2s, opacity 0.2s; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--surface); border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius); padding: 8px 0; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08); z-index: 20;
}
.nav-dropdown:hover .dropdown-menu, .nav-dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: flex; align-items: center; padding: 12px 16px; min-height: 44px; font-size: 14px; font-weight: 500;
  color: var(--white-dark); transition: background 0.2s, color 0.2s;
}
.dropdown-menu a:hover { background: var(--bg-light); color: var(--white); }
.dropdown-menu a::after { display: none; }
.nav a::after {
  content: ''; position: absolute; bottom: 8px; left: 0; right: 0;
  height: 2px; background: #000; border-radius: 2px;
  opacity: 0; transition: opacity 0.2s;
}
.nav a:hover::after, .nav a.active::after { opacity: 1; }

/* === Hero === */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding: 128px 32px 64px; position: relative; overflow: hidden;
  max-width: var(--max-w); margin: 0 auto;
}
.hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; padding: 32px;
  image-rendering: pixelated;
}
.hero-content { width: 100%; position: relative; z-index: 10; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.hero-subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem; font-weight: 500; color: var(--white-dark);
  letter-spacing: 0; margin: 0; padding-bottom: 16px;
}
.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 7vw, 7rem); font-weight: 700;
  line-height: 1; letter-spacing: -2px; margin: 0;
  color: var(--white);
}
.hero-desc {
  font-size: 1.2rem; color: var(--white-dark);
  margin-bottom: 40px;
}
.btn {
  display: inline-block; padding: 14px 32px;
  background: transparent; color: #000; border: 2px solid #000;
  font-size: 14px; font-weight: 600; border-radius: 8px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: #000; color: #fff; border-color: #000; }
.hero .btn { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.hero .btn:hover img { filter: invert(1); }
.btn:hover img { filter: invert(1); }
.hero .btn:hover { background: #000; color: #fff; border-color: #000; }

/* === Work Section === */
.work { padding: 48px 32px 48px; max-width: var(--max-w); margin: 0 auto; }
.section-heading { margin-bottom: 64px; }
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem; font-weight: 700; letter-spacing: -1px; margin-bottom: 12px;
  color: var(--white);
}
.section-subtitle { font-size: 1.2rem; color: var(--white-dark); }

/* === Project Card === */
.project { margin-bottom: 80px; }
.project-images {
  display: flex; gap: 10px; margin-bottom: 24px; overflow: hidden;
}
.project-images.reversed { flex-direction: row-reverse; }
.project-img {
  flex: 1; min-width: 0; object-fit: cover; border-radius: 10px;
  cursor: pointer; transition: flex 0.33s ease-in-out, height 0.3s ease-in-out;
}
.project-info { padding: 8px 0; }
.project-meta { display: flex; gap: 16px; margin-bottom: 8px; }
.project-category {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 600; color: var(--accent-alt);
  text-transform: uppercase; letter-spacing: 1px;
}
.project-year { font-size: 12px; color: var(--light-muted); }
.project-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px;
  color: var(--white);
}
.project-desc {
  color: var(--white-dark); max-width: 700px; margin-bottom: 16px; font-size: 0.95rem;
}
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  padding: 6px 12px; background: transparent;
  border: 1px solid var(--white-dark); border-radius: 9999px;
  font-size: 12px; font-weight: 500; color: var(--white-dark);
}

/* === About === */
.about-section { padding: 160px 32px 48px; max-width: var(--max-w); margin: 0 auto; }
.about-desc { font-size: 1.1rem; color: var(--white-dark); max-width: 1400px; line-height: 1.6; }
.about-actions .btn { min-width: 180px; text-align: center; justify-content: center; }

/* === Skills === */
.skills-section { padding: 48px 32px 48px; max-width: var(--max-w); margin: 0 auto; }
.skills-group { margin-bottom: 32px; }
.skills-grid {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px;
  justify-content: flex-end;
}
.skill-item {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.05); transition: transform 0.2s;
}
.skill-item:hover { transform: translateY(-2px); }
.skill-item img { width: 24px; height: 24px; filter: brightness(0) invert(0.42); }
.skill-item span { font-size: 0.85rem; color: var(--white); text-align: center; }

/* === Experience === */
.timeline-section { padding: 48px 32px 96px; max-width: var(--max-w); margin: 0 auto; }
.experience-group {
  margin-bottom: 32px;
}
.experience-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 2px; color: var(--white-dark); margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.experience-items {
  display: flex; flex-direction: column; gap: 16px;
  margin-left: 50%;
}
.experience-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 12px 0;
}
.experience-info {
  display: flex; flex-direction: column;
}
.timeline-icon {
  width: 42px; height: 54px; margin-bottom: 12px;
  filter: brightness(0) invert(0.42);
}
.timeline-icon :is(path, polygon, rect, circle, ellipse, line, polyline) {
  fill: currentColor !important;
}
.timeline-year {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  color: var(--light); font-size: 1.5rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.timeline-text {
  font-weight: 600; color: var(--white); font-size: 1.0rem; margin-bottom: 2px;
}
.timeline-location {
  font-size: 1.0rem; color: var(--white-dark); margin-bottom: 4px;
}
.timeline-subtext {
  font-size: 0.8rem; color: var(--white); line-height: 1.4;
  max-width: 420px;
}
.ongoing-badge {
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--accent-alt); color: var(--bg); padding: 2px 6px; border-radius: 4px;
  vertical-align: middle; margin-left: 4px;
}
.about-inner { max-width: var(--max-w); margin: 0 auto; }
.stats { display: flex; gap: 64px; }
.stat { display: flex; flex-direction: column; }
.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem; font-weight: 700; letter-spacing: -1px; color: var(--accent-alt);
}
.stat-label {
  font-size: 14px; color: var(--light-muted);
  text-transform: uppercase; letter-spacing: 1px;
}

/* === Contact Page === */
.contact-page {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  padding: 160px 32px 96px;
}
.contact-inner {
  text-align: center; max-width: 600px;
}
.contact-email { margin: 32px 0; }
.contact-links { display: flex; justify-content: center; gap: 32px; margin-top: 48px; }
.contact-links a {
  font-size: 14px; font-weight: 500; color: var(--white-dark);
  transition: color 0.2s;
}
.contact-links a:hover { color: var(--accent); }

/* === Misc === */
.misc-section { padding: 48px 32px; max-width: var(--max-w); margin: 0 auto; }
.misc-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 32px; }
.misc-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: pointer; transition: transform 0.2s, opacity 0.2s; }
.misc-grid img:hover { transform: scale(1.02); opacity: 0.9; }
.blur-up { filter: blur(8px); transition: filter 0.4s; }
.blur-up.loaded { filter: blur(0); }
.project-img.blur-up { transition: flex 0.33s ease-in-out, height 0.3s ease-in-out, filter 0.4s; }
.misc-grid img.blur-up { transition: transform 0.2s, opacity 0.2s, filter 0.4s; }
@media (max-width: 1100px) { .misc-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px) { .misc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .misc-grid { grid-template-columns: repeat(2, 1fr); } }

/* === Footer === */
.footer { padding: 96px 32px; text-align: center; border-top: 2px solid var(--light); }
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 32px;
}
.footer-links { display: flex; justify-content: center; gap: 32px; margin: 32px 0; }
.footer-links a {
  font-size: 14px; font-weight: 500; color: var(--white-dark); transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 12px; color: var(--light-muted); margin-top: 32px; }

/* === Admin === */
.admin-header {
  background: var(--surface);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky; top: 0; z-index: 50;
}
.admin-header-inner {
  max-width: 1024px; margin: 0 auto;
  padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.admin-header-inner img { height: 32px; }
.admin-actions { display: flex; gap: 12px; }
.admin-actions a { font-size: 14px; color: var(--light-muted); transition: color 0.2s; }
.admin-actions a:hover { color: var(--accent-alt); }
.btn-add {
  padding: 8px 16px; background: var(--accent); color: var(--white);
  font-size: 14px; font-weight: 600; border-radius: 8px; transition: background 0.2s;
}
.btn-add:hover { background: var(--accent-alt); }
.btn-save {
  padding: 8px 16px; background: #16a34a; color: var(--white);
  font-size: 14px; font-weight: 600; border-radius: 8px; transition: background 0.2s;
}
.btn-save:hover { background: #15803d; }
.btn-download {
  padding: 8px 16px; background: var(--accent-alt); color: var(--bg);
  font-size: 14px; font-weight: 600; border-radius: 8px; transition: background 0.2s;
}
.btn-download:hover { background: rgba(81,156,171,0.8); }
.admin-main { max-width: 1024px; margin: 0 auto; padding: 32px 24px; }
.projects-list { display: flex; flex-direction: column; gap: 24px; }
.project-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.1); padding: 24px;
}
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.card-id { font-size: 12px; font-weight: 500; color: var(--light-muted); }
.btn-delete { color: #f87171; font-size: 12px; background: none; transition: color 0.2s; }
.btn-delete:hover { color: #fca5a5; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.field { margin-bottom: 16px; }
.field-block { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--light-muted); margin-bottom: 4px;
}
.field input, .field textarea {
  width: 100%; padding: 8px 12px;
  background: var(--bg); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; font-size: 14px; color: var(--light);
  transition: border-color 0.2s; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: none; }
.card-checkbox { display: flex; align-items: center; gap: 8px; }
.card-checkbox input { accent-color: var(--accent-alt); }
.card-checkbox label { font-size: 12px; font-weight: 500; color: var(--light-muted); }

/* === Toast === */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #16a34a; color: var(--white);
  padding: 8px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
}

/* === Responsive === */
@media (max-width: 768px) {
  .header-inner { padding: 12px 16px; position: relative; }
  .hamburger { display: flex; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); flex-direction: column; align-items: flex-start; padding: 16px; gap: 0; border-top: 1px solid rgba(0,0,0,0.08); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
  .nav-dropdown { flex-direction: column; align-items: flex-start; width: 100%; }
  .dropdown-menu { position: static; display: none; box-shadow: none; border: none; padding: 0; margin-left: 16px; background: transparent; min-width: auto; }
  .nav-dropdown.open .dropdown-menu { display: block; }
  .hamburger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .hamburger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
  .hero { padding: 80px 16px 32px; min-height: 100vh; flex-direction: column-reverse; justify-content: center; gap: 24px; overflow: visible; }
  .hero-canvas { position: relative; inset: auto; height: 50vh; min-height: 300px; padding: 0; flex-shrink: 0; }
  .hero-content { text-align: left; align-items: flex-start; margin-top: 300px; }
  .work, .misc-section, .about-section, .skills-section, .timeline-section, .contact-page { padding-left: 16px; padding-right: 16px; }
  .project-images { flex-direction: column; }
  .project-img { height: auto !important; flex: none !important; width: 100%; }
  .skills-grid { gap: 12px; }
  .skill-item { padding: 10px 12px; }
  .experience-items { margin-left: 0; }
  .about-actions { flex-direction: column; }
  .about-actions .btn { width: 100%; min-width: auto; }
  .footer { padding: 48px 16px; }
  .footer-links, .contact-links { flex-wrap: wrap; gap: 16px; }
}
@media (max-width: 480px) {
  .section-title { font-size: 2rem; }
  .nav { gap: 12px; }
  .nav a { font-size: 13px; }
}
