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

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --border:    #2a2d3a;
  --text:      #e2e8f0;
  --muted:     #8892a4;
  --accent:    #6c8ef5;
  --accent-dk: #4f6ee0;
  --danger:    #e05050;
  --success:   #4caf6e;
  --radius:    8px;
  --font:      'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 2rem;
}
.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
nav ul { list-style: none; display: flex; gap: 1.5rem; margin-left: auto; }
nav ul a { color: var(--muted); font-size: 0.95rem; text-decoration: none; transition: color 0.2s; }
nav ul a:hover, nav ul a.active { color: var(--text); }

/* ── Main layout ──────────────────────────────────────────────────────────── */
main { flex: 1; }
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
.hero {
  max-width: 700px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  text-align: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -1px; }
.hero-sub { color: var(--muted); font-size: 1.2rem; margin-top: 0.5rem; }
.hero-links { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.page h1 { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn:hover { background: var(--accent-dk); text-decoration: none; }
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #c03a3a; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-full { width: 100%; text-align: center; }

/* ── Filter bar ───────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ── Project grid ─────────────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card-thumb { width: 100%; height: 160px; object-fit: cover; }
.card-thumb--placeholder { width: 100%; height: 160px; background: var(--border); }
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.card-body h2 { font-size: 1.1rem; font-weight: 600; }
.card-body p { color: var(--muted); font-size: 0.875rem; }

/* ── Project detail ───────────────────────────────────────────────────────── */
.project-detail { max-width: 760px; }
.back-link { color: var(--muted); font-size: 0.9rem; display: inline-block; margin-bottom: 1.5rem; }
.back-link:hover { color: var(--text); }
.detail-thumb { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); margin-bottom: 1.5rem; }
.detail-header { margin-bottom: 0.75rem; }
.detail-header h1 { font-size: 2rem; font-weight: 700; margin-top: 0.4rem; }
.detail-desc { margin: 1.5rem 0; }
.detail-links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Badge & tags ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.tag {
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Prose ────────────────────────────────────────────────────────────────── */
.prose { line-height: 1.8; color: var(--muted); }

/* ── Misc ─────────────────────────────────────────────────────────────────── */
.empty { color: var(--muted); }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash--success { background: rgba(76, 175, 110, 0.15); border: 1px solid var(--success); color: var(--success); }
.flash--error   { background: rgba(224, 80, 80, 0.15);  border: 1px solid var(--danger);  color: var(--danger); }

/* ── Admin layout ─────────────────────────────────────────────────────────── */
.admin-body { display: block; }
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  flex-shrink: 0;
}
.sidebar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0 1.25rem 1.5rem;
  color: var(--text);
}
.sidebar-nav { display: flex; flex-direction: column; flex: 1; }
.sidebar-nav a {
  padding: 0.6rem 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--border);
  color: var(--text);
}
.sidebar-bottom { padding: 1rem 1.25rem 0; border-top: 1px solid var(--border); margin-top: auto; }
.sidebar-link { display: block; color: var(--muted); font-size: 0.85rem; text-decoration: none; padding: 0.3rem 0; }
.sidebar-link:hover { color: var(--text); }
.sidebar-logout { color: var(--danger); }

.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.admin-content { flex: 1; padding: 2rem; max-width: 900px; }
.admin-content h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; }
.admin-footer { padding: 1rem 2rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8rem; }

/* ── Admin login ──────────────────────────────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 360px;
}
.login-box h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1rem; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
label small { font-size: 0.78rem; }
input[type="text"], input[type="url"], input[type="email"], input[type="password"], select, textarea {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  width: 100%;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }
.checkbox-label { flex-direction: row; align-items: center; gap: 0.5rem; color: var(--text); }
.checkbox-label input { width: auto; }

/* ── Admin table ──────────────────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--surface); }
.action-cell { display: flex; gap: 0.5rem; align-items: center; }

/* ── Toggle button ────────────────────────────────────────────────────────── */
.toggle-btn {
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.toggle-btn--on { border-color: var(--success); color: var(--success); }
.toggle-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Featured projects ────────────────────────────────────────────────────── */
.featured-section {
  max-width: 900px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
}
.featured-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.25rem;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.featured-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s, transform 0.15s;
}
.featured-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.featured-cat { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.featured-name { font-size: 1rem; font-weight: 600; color: var(--text); }
.featured-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.5; flex: 1; }
.featured-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.25rem; }
.featured-star { color: var(--accent); font-size: 1rem; }
.featured-section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.card-body .badge { align-self: flex-start; width: fit-content; }

/* ── Contact form ─────────────────────────────────────────────────────────── */
.contact-intro { margin-bottom: 2rem; }
.contact-form { max-width: 540px; }
.required-mark { color: var(--danger); }

/* ── Upload & thumbnail preview ───────────────────────────────────────────── */
.thumb-preview {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}
.thumb-preview img {
  max-width: 200px;
  max-height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.thumb-preview small { color: var(--muted); font-size: 0.78rem; }
.upload-input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  width: 100%;
  cursor: pointer;
}
.upload-input:hover { border-color: var(--accent); }

/* ── Settings sections ────────────────────────────────────────────────────── */
.settings-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
}
.settings-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.settings-form { max-width: 420px; }
.settings-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.settings-status--on { color: var(--success); }
.settings-status--on::before { content: "●"; }
.qr-wrapper { margin-bottom: 1rem; }
.qr-img { border: 6px solid #fff; border-radius: 4px; display: block; max-width: 180px; }
.totp-key {
  font-family: monospace;
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  word-break: break-all;
}
.backup-codes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.backup-code {
  font-family: monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  text-align: center;
  letter-spacing: 1px;
}

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { margin-bottom: 0; }

/* ── Dashboard stats ──────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-num { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.dashboard-actions { display: flex; gap: 1rem; }

/* ── Fiverr nav link ──────────────────────────────────────────────────────── */
.nav-fiverr {
  color: #1dbf73 !important;
  font-weight: 600;
  border: 1.5px solid #1dbf73;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}
.nav-fiverr:hover {
  background: #1dbf73;
  color: #fff !important;
  text-decoration: none;
}

/* ── Hero desc ────────────────────────────────────────────────────────────── */
.hero-desc {
  color: var(--muted);
  max-width: 520px;
  margin: 1rem auto 0;
  font-size: 1rem;
  line-height: 1.7;
}

/* ── About prose & CTA ────────────────────────────────────────────────────── */
.about-prose { max-width: 680px; margin-bottom: 2rem; }
.about-cta   { margin-bottom: 2.5rem; }

/* ── Socials ──────────────────────────────────────────────────────────────── */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.social-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.social-link--text { cursor: default; }
.social-link--text:hover { border-color: var(--border); color: var(--muted); }
.social-icon { font-size: 0.85rem; font-weight: 700; }
.social-icon--svg { width: 1em; height: 1em; vertical-align: middle; flex-shrink: 0; }

/* ── Autofill override ────────────────────────────────────────────────────── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}
