/* ============================================================
   PERSONAL WEBSITE — STYLESHEET
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #ffffff;
  --bg-alt:       #f8fafc;
  --bg-card:      #ffffff;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-light:   #94a3b8;
  --accent:       #0d9488;
  --accent-hover: #0f766e;
  --accent-soft:  #f0fdfa;
  --border:       #e2e8f0;
  --border-hover: #cbd5e1;
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    18px;
  --shadow:       0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 12px 32px rgba(0,0,0,0.10);
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif:   'Lora', Georgia, serif;
  --nav-height:   68px;
  --max-width:    1200px;
  --transition:   0.2s ease;
}

/* ── Dark Mode Variables ────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #111827;
  --bg-alt:       #1f2937;
  --bg-card:      #1f2937;
  --text:         #f9fafb;
  --text-muted:   #9ca3af;
  --text-light:   #6b7280;
  --accent:       #14b8a6;
  --accent-hover: #0d9488;
  --accent-soft:  rgba(20, 184, 166, 0.12);
  --border:       #374151;
  --border-hover: #4b5563;
  --shadow:       0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:    0 12px 32px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
[data-theme="dark"] .nav { background: rgba(17,24,39,0.90); }

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

.nav-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.nav-links a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: none;
}
/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg-alt); color: var(--text); }

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: var(--bg);
  z-index: 99;
  padding: 24px 32px;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.nav-drawer a {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}
.nav-drawer a.active { color: var(--accent); background: var(--accent-soft); }

/* ── Page Layout ────────────────────────────────────────────── */
.page { padding: 64px 32px; max-width: var(--max-width); margin: 0 auto; }
.page-wide { padding: 64px 32px; max-width: 1200px; margin: 0 auto; }

/* ── Typography ─────────────────────────────────────────────── */
.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 60px 0;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

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

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); border-color: var(--border-hover); }

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

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-icon { padding: 8px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

/* ── Tags ───────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== ABOUT PAGE ========================================== */

.hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}

.hero-greeting {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-role {
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 20px;
}

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

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.hero-avatar-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-light);
  font-size: 0.8rem;
  text-align: center;
  padding: 16px;
}

/* About section */
.about-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.about-text p + p { margin-top: 16px; }

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}
.skill-pill:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.photo-item {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  position: relative;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.photo-item:hover img { transform: scale(1.04); }

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
  gap: 8px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  min-height: 180px;
}

.photo-placeholder svg { opacity: 0.4; }

/* Interests grid */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.interest-card {
  padding: 24px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.interest-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.interest-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
  line-height: 1;
}

.interest-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--text);
}

.interest-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ===== PROFESSIONAL PAGE ================================== */

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.doc-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.doc-card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.doc-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.doc-card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text);
}

.doc-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.doc-card-actions {
  padding: 16px 24px 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-preview-panel {
  display: none;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 0;
}
.doc-preview-panel.open { display: block; }

.doc-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.doc-preview-bar .preview-title { font-weight: 500; color: var(--text); }

.doc-iframe-wrap {
  position: relative;
  width: 100%;
  height: 520px;
  background: #f1f5f9;
}

.doc-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.doc-no-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 32px;
}

/* Letters of rec section */
.rec-list { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

.rec-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.rec-item-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background var(--transition);
}
.rec-item-header:hover { background: var(--bg-alt); }

.rec-item-info { display: flex; flex-direction: column; gap: 3px; }
.rec-item-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.rec-item-role { font-size: 0.85rem; color: var(--text-muted); }

.rec-item-actions { display: flex; align-items: center; gap: 8px; }

.rec-preview-panel {
  display: none;
  border-top: 1px solid var(--border);
}
.rec-preview-panel.open { display: block; }

.rec-iframe-wrap {
  width: 100%;
  height: 480px;
  background: #f1f5f9;
}
.rec-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== PROJECTS PAGE ====================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.project-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-alt);
}

.project-card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
}

.project-card-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.project-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Project Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 780px;
  margin: auto;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-close {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  font-size: 1.2rem;
  color: var(--text-muted);
}
.modal-close:hover { background: var(--bg); border-color: var(--border-hover); color: var(--text); }

.modal-body { padding: 28px 32px 32px; }

/* Modal image gallery */
.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.modal-gallery figure {
  margin: 0;
}

.modal-gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform var(--transition);
  display: block;
}
.modal-gallery img:hover { transform: scale(1.04); }

.modal-gallery figcaption {
  font-size: 0.68rem;
  color: var(--text-light);
  margin-top: 5px;
  text-align: center;
  line-height: 1.3;
  width: 100%;
}

.modal-gallery-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
  margin-bottom: 24px;
}

.modal-desc {
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 24px;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-bottom: 0;
}


/* ── Lightbox ───────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  opacity: 0.7;
}
.lightbox-close:hover { opacity: 1; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 40px 32px;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 80px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .page { padding: 40px 20px; }
  .page-wide { padding: 40px 20px; }

  .hero { padding: 48px 0 40px; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-grid > :last-child { order: -1; }
  .hero-avatar, .hero-avatar-placeholder {
    width: 100px;
    height: 100px;
  }

  .photo-grid { grid-template-columns: repeat(2, 1fr); }

  .doc-grid { grid-template-columns: 1fr; }
  .doc-iframe-wrap { height: 360px; }

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

  .modal { margin: 0; border-radius: var(--radius-sm); }
  .modal-header { padding: 20px 20px 16px; }
  .modal-body { padding: 20px; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 2rem; }
  .photo-grid { grid-template-columns: 1fr; }
}
