:root {
  --bg: #f7f8fb;
  --bg-alt: #eef1f7;
  --surface: #ffffff;
  --text: #171a21;
  --text-muted: #5b6270;
  --border: #e2e5ec;
  --primary: #4f46e5;
  --primary-dark: #3f37c9;
  --primary-soft: #eceafd;
  --accent: #0ea5a4;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(23, 26, 33, 0.06);
  --shadow-lg: 0 12px 32px rgba(23, 26, 33, 0.12);
  --easy: #16a34a;
  --medium: #d97706;
  --hard: #dc2626;
}

:root[data-theme="dark"] {
  --bg: #0f1117;
  --bg-alt: #161923;
  --surface: #1a1e29;
  --text: #eef0f6;
  --text-muted: #9aa1b2;
  --border: #2a2f3d;
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-soft: #23253a;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --bg-alt: #161923;
    --surface: #1a1e29;
    --text: #eef0f6;
    --text-muted: #9aa1b2;
    --border: #2a2f3d;
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-soft: #23253a;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.2s ease, color 0.2s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 800; font-size: 1.3rem; text-decoration: none; color: var(--text); }
.logo span { color: var(--primary); }
.nav-links { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }
.theme-toggle {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  width: 38px; height: 38px; cursor: pointer; font-size: 1rem;
}
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

/* Hero */
.hero { padding: 72px 0 56px; position: relative; overflow: hidden; isolation: isolate; }
.hero::before, .hero::after {
  content: ''; position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: 0.35;
}
.hero::before { width: 420px; height: 420px; background: var(--primary); top: -160px; right: -120px; }
.hero::after { width: 320px; height: 320px; background: var(--accent); bottom: -140px; left: -80px; opacity: 0.25; }
:root[data-theme="dark"] .hero::before, :root[data-theme="dark"] .hero::after { opacity: 0.22; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero::before,
  :root:not([data-theme="light"]) .hero::after { opacity: 0.22; }
}
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.open-badge {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 16px; font-size: 0.85rem; font-weight: 700; color: var(--easy);
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.open-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--easy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--easy) 25%, transparent); }
.eyebrow { color: var(--primary); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.82rem; margin: 0 0 10px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 14px; line-height: 1.1; }
.headline-metric { font-weight: 700; font-size: 1.05rem; max-width: 560px; margin: 0 0 12px; color: var(--text); }
.hero-sub { color: var(--text-muted); font-size: 1.08rem; max-width: 560px; margin: 0 0 18px; }
.hero-meta { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.92rem; }
.hero-links a { text-decoration: none; color: var(--text-muted); }
.hero-links a:hover { color: var(--primary); }

.hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 28px; display: flex; flex-direction: column; gap: 22px;
  align-items: center;
}
.profile-photo {
  width: 148px; height: 148px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--primary-soft); box-shadow: var(--shadow);
}
.hero-card .stat { align-self: stretch; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--text-muted); font-size: 0.88rem; }

/* Icons */
.icon { flex-shrink: 0; vertical-align: -3px; }
.icon-label { display: inline-flex; align-items: center; gap: 6px; }
.btn .icon, .btn-primary .icon, .btn-outline .icon { vertical-align: -2px; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px; font-weight: 600; font-size: 0.95rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 1.9rem; margin: 0 0 8px; }
.section-sub { color: var(--text-muted); margin: 0 0 8px; }
.about-text { color: var(--text-muted); font-size: 1.05rem; max-width: 780px; }
.core-competencies { color: var(--text-muted); font-size: 0.95rem; max-width: 780px; margin-top: 14px; }
.core-competencies strong { color: var(--text); }

/* Skills */
.skills-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 24px; }
.skill-group h3 { margin: 0 0 12px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; color: var(--primary); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--primary-soft); color: var(--primary); border-radius: 999px;
  padding: 6px 14px; font-size: 0.85rem; font-weight: 600;
}

/* Certifications */
.cert-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 24px; }
.cert-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.cert-card h3 { margin: 0; font-size: 1.02rem; }
.edu-org { margin: -4px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.cert-status {
  align-self: flex-start; background: color-mix(in srgb, var(--medium) 16%, transparent); color: var(--medium);
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: 999px;
}
.cert-status-progress, .cert-status-done { text-transform: none; }
.cert-status-done { background: color-mix(in srgb, var(--easy) 16%, transparent); color: var(--easy); }

/* Timeline */
.timeline { margin-top: 28px; display: flex; flex-direction: column; gap: 28px; }
.timeline-item { display: grid; grid-template-columns: 180px 1fr; gap: 24px; border-left: 2px solid var(--border); padding-left: 24px; position: relative; }
.timeline-item::before {
  content: ''; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--primary);
}
.timeline-date { color: var(--text-muted); font-size: 0.88rem; font-weight: 600; padding-top: 3px; }
.timeline-content h3 { margin: 0 0 4px; font-size: 1.1rem; }
.timeline-org { color: var(--primary); font-weight: 600; margin: 0 0 10px; font-size: 0.92rem; }
.timeline-content ul { margin: 0; padding-left: 20px; color: var(--text-muted); }
.timeline-content li { margin-bottom: 4px; font-size: 0.94rem; }

/* Projects head + filters */
.projects-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.owner-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field-hint { color: var(--text-muted); font-size: 0.8rem; margin: -8px 0 0; }
.filters { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 20px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.filter-label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 999px; padding: 6px 13px; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.search-group input {
  width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-alt); color: var(--text); font-size: 0.9rem;
}
.results-count { color: var(--text-muted); font-size: 0.88rem; margin: 0 0 16px; }

/* Project cards */
.projects-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-title { font-size: 1.08rem; font-weight: 700; margin: 0; }
.difficulty-badge { font-size: 0.72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.03em; }
.difficulty-Easy { background: color-mix(in srgb, var(--easy) 16%, transparent); color: var(--easy); }
.difficulty-Medium { background: color-mix(in srgb, var(--medium) 16%, transparent); color: var(--medium); }
.difficulty-Hard { background: color-mix(in srgb, var(--hard) 16%, transparent); color: var(--hard); }
.card-desc { color: var(--text-muted); font-size: 0.92rem; margin: 0; flex-grow: 1; }
.card-meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.75rem; padding: 3px 9px; border-radius: 6px; }
.tag-tool { background: var(--primary-soft); color: var(--primary); border-color: transparent; font-weight: 600; }
.tag-business { font-weight: 600; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.card-link { font-size: 0.85rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.card-badge-custom { font-size: 0.72rem; color: var(--accent); font-weight: 700; }
.draft-badge { font-size: 0.72rem; color: var(--medium); font-weight: 700; }
.dashboard-btn {
  background: var(--primary-soft); color: var(--primary); border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.dashboard-btn:hover { background: var(--primary); color: #fff; }
.card-publish-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.copy-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
  font-size: 0.78rem; font-weight: 600; padding: 5px 10px; border-radius: 6px;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.delete-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.78rem;
  text-decoration: underline; padding: 0;
}
.delete-btn:hover { color: var(--hard); }
.delete-confirm { font-size: 0.78rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.delete-yes, .delete-no {
  background: none; border: none; cursor: pointer; font-size: 0.78rem; font-weight: 700;
  text-decoration: underline; padding: 0;
}
.delete-yes { color: var(--hard); }
.delete-no { color: var(--text-muted); }
.empty-state { color: var(--text-muted); text-align: center; padding: 40px 0; }

/* Contact */
.contact-grid { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--text-muted); font-size: 0.88rem; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 12, 18, 0.55); display: none;
  align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.modal.embed-modal { max-width: 960px; }
.embed-body { padding: 16px; }
.embed-body iframe {
  width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-alt);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.project-form { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.project-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.project-form input[type="text"], .project-form input[type="url"], .project-form textarea, .project-form select {
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-alt);
  color: var(--text); font-size: 0.92rem; font-family: inherit; font-weight: 400;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tools-fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 12px; }
.tools-fieldset legend { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); padding: 0 4px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 6px !important; font-weight: 500 !important; }
.form-error { color: var(--hard); font-size: 0.85rem; margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 22px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .nav-links { position: fixed; top: 64px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 16px 24px; border-bottom: 1px solid var(--border); display: none; gap: 16px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .timeline-item { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
