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

/* ========================================
   iOS-Inspired Modern UI
   ======================================== */

:root {
  /* Light Mode — soft, warm, readable */
  --bg: #f2f2f7;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --text: #1c1c1e;
  --text-secondary: #636366;
  --text-muted: #aeaeb2;
  --accent: #007aff;
  --accent-hover: #0066d6;
  --border: rgba(0, 0, 0, 0.06);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-lg: 16px;
  --max-width: 800px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', sans-serif;
  --gradient-accent: linear-gradient(135deg, #007aff, #5856d6);
  --gradient-warm: linear-gradient(135deg, #ff6b6b, #ff8e53);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --separator: rgba(60, 60, 67, 0.08);
}

[data-theme="dark"] {
  /* Dark Mode — soft dark like iOS, not pure black */
  --bg: #000000;
  --bg-card: #1c1c1e;
  --bg-elevated: #2c2c2e;
  --text: #f2f2f7;
  --text-secondary: #98989d;
  --text-muted: #636366;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --gradient-accent: linear-gradient(135deg, #0a84ff, #5e5ce6);
  --gradient-warm: linear-gradient(135deg, #ff453a, #ff9f0a);
  --glass-bg: rgba(28, 28, 30, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --separator: rgba(84, 84, 88, 0.36);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.4s ease;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   Header — Frosted Glass
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 44px;
}

.nav {
  display: flex;
  gap: 28px;
  flex: 1;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

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

/* ========================================
   Nav Controls
   ======================================== */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.toggle-btn:hover {
  color: var(--accent);
  transform: scale(1.05);
}

.toggle-btn:active {
  transform: scale(0.95);
}

.lang-btn {
  width: auto;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 16px;
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ========================================
   Hero
   ======================================== */
.hero {
  padding: 100px 0 60px;
  text-align: center;
}

.hero-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  border: 3px solid var(--bg-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-name {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.hero-location {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.hero-links {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: #ffffff;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

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

/* ========================================
   Sections
   ======================================== */
.section {
  padding: 60px 0;
}

.section-alt {
  background: var(--bg-elevated);
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 28px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: -18px;
  margin-bottom: 28px;
}

/* About */
.about-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ========================================
   Experience
   ======================================== */
.exp-item {
  padding: 24px 0;
  border-bottom: 0.5px solid var(--separator);
}

.exp-item:first-of-type {
  padding-top: 0;
}

.exp-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.exp-role {
  font-size: 16px;
  font-weight: 600;
}

.exp-company {
  font-size: 14px;
  color: var(--accent);
  margin-top: 2px;
}

.exp-date {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.exp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exp-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}

.exp-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ========================================
   Demos
   ======================================== */
.demos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.demo-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s ease;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.demo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.demo-card-empty {
  border: 2px dashed var(--border);
  box-shadow: none;
  background: transparent;
  cursor: default;
}

.demo-card-empty:hover {
  transform: none;
  box-shadow: none;
}

.demo-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.demo-placeholder {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 12px;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.demo-card-empty .demo-placeholder {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.demo-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 0;
}

.demo-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.demo-tech {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}

.demo-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  background: var(--gradient-accent);
  padding: 4px 10px;
  border-radius: 12px;
  text-decoration: none;
  width: fit-content;
}

.demo-tag:hover {
  opacity: 0.9;
}

.demo-hint {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: center;
}

.demo-card-empty .demo-tag {
  color: var(--text-muted);
  background: var(--bg-elevated);
}

/* ========================================
   Gallery Filter
   ======================================== */
.gallery-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border: none;
  border-radius: 20px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

/* ========================================
   Gallery Grid
   ======================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.gallery-item.hidden {
  display: none;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.gallery-img {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-elevated);
}

.gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-caption {
  padding: 14px 16px;
}

.gallery-caption h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.gallery-caption p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.gallery-tools {
  display: block;
  margin-top: 4px;
  font-style: italic;
  color: var(--accent);
}

/* ========================================
   Gallery Pagination
   ======================================== */
.gallery-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
}

.page-btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.page-btn:hover:not(:disabled) {
  color: var(--accent);
  transform: scale(1.05);
}

.page-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 32px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--accent);
  transform: scale(1.05);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  white-space: pre-line;
}

.modal-link {
  display: inline-flex;
  align-items: center;
}

/* ========================================
   Lightbox
   ======================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 210;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.lightbox-img {
  max-width: 85vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-caption {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  max-width: 85vw;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.3s ease 0.1s;
}

.lightbox.active .lightbox-caption {
  transform: translateY(0);
  opacity: 1;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
  .nav {
    gap: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-link {
    font-size: 12px;
  }

  .hero {
    padding: 80px 0 48px;
  }

  .hero-avatar {
    width: 110px;
    height: 110px;
  }

  .hero-label {
    font-size: 11px;
    letter-spacing: 1.5px;
    line-height: 1.8;
  }

  .hero-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .exp-header {
    flex-direction: column;
    gap: 4px;
  }


  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

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

  .nav-controls {
    gap: 6px;
  }
}

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

/* ========================================
   Print styles for ATS
   ======================================== */
@media print {
  .header {
    display: none;
  }

  .hero {
    padding: 20px 0;
  }

  .section {
    padding: 20px 0;
  }

  .section-alt {
    background: transparent;
  }

  body {
    font-size: 12px;
  }
}
