/* ============================================================
   Jas Dev — main.css
   Theme: Light — white/off-white + deep navy + electric blue
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --navy:        #1a2744;
  --navy-dark:   #111b33;
  --navy-mid:    #243560;
  --blue:        #2563eb;
  --blue-hover:  #1d4ed8;
  --blue-light:  #eff6ff;
  --text:        #1f2937;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;
  --border:      #e5e7eb;
  --border-dark: #d1d5db;
  --bg:          #ffffff;
  --bg-soft:     #f9fafb;
  --bg-card:     #ffffff;
  --radius:      6px;
  --radius-lg:   12px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 12px rgba(0,0,0,.1);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --nav-h:       64px;
  --max-w:       1100px;
  --max-w-prose: 720px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--navy);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
code, kbd, pre {
  font-family: var(--font-mono);
  font-size: .875em;
}
pre {
  background: var(--navy-dark);
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}
code:not(pre code) {
  background: var(--bg-soft);
  color: var(--navy);
  padding: .1em .35em;
  border-radius: 3px;
  border: 1px solid var(--border);
}
blockquote {
  border-left: 4px solid var(--blue);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--blue-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--navy-mid);
}
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: .375rem; }

/* ---------- Layout utilities ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.prose     { max-width: var(--max-w-prose); }
.sr-only   { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.95);
}
.site-nav .container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--navy);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 900;
  letter-spacing: -.05em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  padding: 0;
  margin: 0 auto 0 0;
}
.nav-links a {
  padding: .375rem .75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .9375rem;
  font-weight: 500;
  transition: color .15s, background .15s;
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active { color: var(--navy); background: var(--bg-soft); }
.nav-lang {
  display: flex;
  gap: .25rem;
}
.nav-lang a {
  padding: .25rem .625rem;
  border-radius: 4px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all .15s;
  text-decoration: none;
}
.nav-lang a:hover,
.nav-lang a.active { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.nav-burger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .375rem .5rem;
  color: var(--text);
  line-height: 1;
  font-size: 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1;
  border: none;
  transition: all .15s;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary  { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); color: #fff; text-decoration: none; }
.btn-navy     { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); color: #fff; text-decoration: none; }
.btn-ghost    { background: transparent; color: var(--navy); border: 1.5px solid var(--border-dark); }
.btn-ghost:hover { border-color: var(--navy); background: var(--bg-soft); text-decoration: none; }
.btn-sm       { padding: .4rem .875rem; font-size: .875rem; }
.btn-lg       { padding: .875rem 1.75rem; font-size: 1.0625rem; }

/* ---------- Hero ---------- */
.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(160deg, #f0f4ff 0%, #fff 60%);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--blue);
  border-radius: 1px;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: .75rem;
  line-height: 1.15;
}
.hero h1 span { color: var(--blue); }
.hero-subtitle {
  font-size: 1.1875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 42ch;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-badge {
  width: 200px;
  height: 200px;
  background: var(--navy);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-badge-text {
  text-align: center;
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.4;
}
.hero-badge-num { font-size: 3rem; color: var(--blue); display: block; line-height: 1; }

/* ---------- Section ---------- */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-header { margin-bottom: 3rem; }
.section-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .5rem;
}
.section-title { font-size: 2rem; margin-bottom: .75rem; }
.section-subtitle { color: var(--text-muted); font-size: 1.0625rem; max-width: 56ch; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-soft);
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.03); }
.card-body { padding: 1.375rem; flex: 1; display: flex; flex-direction: column; }
.card-meta {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .625rem;
  flex-wrap: wrap;
}
.card-cat {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
  font-size: .75rem;
  padding: .1875rem .5rem;
  border-radius: 3px;
  text-decoration: none;
}
.card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .625rem;
  line-height: 1.3;
}
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--blue); }
.card-excerpt {
  color: var(--text-muted);
  font-size: .9rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  padding: .875rem 1.375rem;
  border-top: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--text-muted);
}

/* ---------- Post grid ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }

/* ---------- Skills grid ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.skill-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: border-color .2s, box-shadow .2s;
}
.skill-card:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.skill-icon {
  font-size: 2rem;
  margin-bottom: .75rem;
  display: block;
}
.skill-name { font-size: .9375rem; font-weight: 700; color: var(--navy); margin-bottom: .25rem; }
.skill-desc { font-size: .8125rem; color: var(--text-muted); }

/* ---------- Tag + Category chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: .25rem .75rem;
  border-radius: 50px;
  font-size: .8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.chip-active { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Article / post detail ---------- */
.article-header { padding: 3.5rem 0 2.5rem; background: linear-gradient(to bottom, #f0f4ff, #fff); border-bottom: 1px solid var(--border); }
.article-hero-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  border: 1px solid var(--border);
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.article-title { font-size: 2.25rem; margin-bottom: 1.25rem; }
.article-body { padding: 3rem 0; }
.article-body .prose { margin: 0 auto; }
.article-body img { border-radius: var(--radius); margin: 1.5rem 0; border: 1px solid var(--border); }
.article-body h2 { margin: 2rem 0 1rem; }
.article-body h3 { margin: 1.5rem 0 .75rem; }
.article-body a { color: var(--blue); }
.article-body a:hover { color: var(--blue-hover); }
.version-badge {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .625rem;
  border-radius: 4px;
  letter-spacing: .03em;
  margin-bottom: 1rem;
}
.related-posts { padding: 3rem 0; background: var(--bg-soft); border-top: 1px solid var(--border); }

/* ---------- Sidebar ---------- */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}
.sidebar { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
.sidebar-widget { margin-bottom: 2rem; }
.sidebar-title { font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 1rem; }

/* ---------- Contact form ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .875rem; font-weight: 600; color: var(--navy); margin-bottom: .375rem; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: .9375rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:focus, .form-textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-textarea { resize: vertical; min-height: 140px; }
.form-error { color: #dc2626; font-size: .8125rem; margin-top: .25rem; }
.alert {
  padding: .875rem 1.125rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9375rem;
}
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ---------- Admin panel ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--navy);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  font-size: 1.0625rem;
  font-weight: 800;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .625rem;
}
.admin-sidebar-logo span { color: var(--blue); }
.admin-nav { padding: 1rem 0; flex: 1; }
.admin-nav-section { padding: .5rem 1rem .25rem; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.35); }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5625rem 1.25rem;
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
  border-radius: 0;
}
.admin-nav a:hover, .admin-nav a.active { color: #fff; background: rgba(255,255,255,.08); }
.admin-nav a.active { border-left: 3px solid var(--blue); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.admin-page-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.admin-content { padding: 2rem; flex: 1; }

/* Admin cards / stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-label { font-size: .8125rem; color: var(--text-muted); margin-top: .375rem; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th {
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .625rem 1rem;
  border-bottom: 2px solid var(--border);
  background: var(--bg-soft);
}
.admin-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg-soft); }
.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 3px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-gray { background: var(--bg-soft); color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.55);
  padding: 3rem 0 2rem;
  font-size: .875rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand { color: #fff; font-weight: 800; font-size: 1.125rem; margin-bottom: .75rem; }
.footer-about { line-height: 1.7; max-width: 32ch; }
.footer-heading { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.35); margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: rgba(255,255,255,.55); transition: color .15s; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-legal { font-size: .8125rem; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: .375rem; margin: 2.5rem 0; }
.pagination a, .pagination span {
  padding: .4375rem .875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .15s;
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .current { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- 404 / error ---------- */
.error-page { padding: 6rem 0; text-align: center; }
.error-code { font-size: 6rem; font-weight: 900; color: var(--border-dark); line-height: 1; margin-bottom: 1rem; }
.error-msg { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .content-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-badge { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .section { padding: 3.5rem 0; }
  .post-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-lang { display: none; }
  .nav-burger { display: flex; }
  .nav-mobile-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: .25rem;
    box-shadow: var(--shadow-md);
  }
  .nav-mobile-open .nav-lang { display: flex; justify-content: flex-start; padding: .5rem 1.5rem 1rem; }
  .admin-sidebar { display: none; }
  .admin-sidebar.open { display: flex; position: fixed; z-index: 200; top: 0; left: 0; bottom: 0; }
  .article-title { font-size: 1.625rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.625rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
