/* ============================================================
   All colors / fonts / radii are CSS custom properties applied
   inline from config.js theme object — change the site's look
   there, not here.
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 .5em;
}

a { color: var(--color-primary-alt); text-decoration: none; }
img { max-width: 100%; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }
.section-alt { background: var(--color-bg-alt); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
  color: #fff;
  box-shadow: 0 8px 24px rgba(108, 92, 231, .35);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-primary-alt); color: var(--color-primary-alt); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Nav ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 14, 20, .8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
}
.logo-badge {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff;
}
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--color-text-muted); font-weight: 500; }
.nav-links a:hover { color: var(--color-text); }
.nav-toggle { display: none; background: none; border: none; color: var(--color-text); font-size: 1.5rem; cursor: pointer; }

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--color-bg-alt);
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 140px 0 100px;
  text-align: center;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(108,92,231,.25), transparent),
    var(--color-bg);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 820px; margin: 0 auto 20px; }
.hero p { color: var(--color-text-muted); max-width: 620px; margin: 0 auto 36px; font-size: 1.15rem; }
.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.about-body p { color: var(--color-text-muted); font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px 12px; text-align: center; }
.stat .number { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700; color: var(--color-accent); }
.stat .label { color: var(--color-text-muted); font-size: .85rem; margin-top: 4px; }

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

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--color-primary-alt); }
.card .icon { font-size: 2rem; margin-bottom: 16px; display: block; }
.card p { color: var(--color-text-muted); margin: 0; }

.portfolio-card {
  aspect-ratio: 4 / 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  text-align: center;
}
.portfolio-card .emoji { font-size: 2.6rem; }
.portfolio-card .tag { color: var(--color-accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }

.section-head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.section-head p { color: var(--color-text-muted); }

/* ---------- Contact ---------- */
.contact-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.contact-panel p { color: var(--color-text-muted); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay[hidden] { display: none !important; }
.modal {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 460px;
  position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--color-text-muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.field { margin-bottom: 16px; text-align: left; }
.field label { display: block; font-size: .85rem; color: var(--color-text-muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--color-primary-alt); }
.field textarea { resize: vertical; min-height: 100px; }
.form-status { margin-top: 12px; font-size: .9rem; min-height: 1.2em; }
.form-status.ok { color: var(--color-accent); }
.form-status.err { color: #ff6b6b; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: .9rem;
}
footer a { color: var(--color-text-muted); }

/* ============================================================
   Admin panel
   ============================================================ */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}
.admin-main { flex: 1; padding: 40px 24px; }
.lock-screen {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.lock-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.lock-box.shake { animation: shake .4s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}
.lock-icon { font-size: 2.4rem; margin-bottom: 12px; }
.admin-error {
  margin-top: 14px;
  color: #ff6b6b;
  font-weight: 600;
  font-size: .95rem;
  min-height: 1.2em;
}
.admin-hint {
  margin-top: 24px;
  font-size: .8rem;
  color: var(--color-text-muted);
}

.editor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 1000px; margin: 0 auto; }
@media (max-width: 800px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; }
.editor-card h3 { margin-bottom: 16px; }
.editor-actions { max-width: 1000px; margin: 32px auto 0; display: flex; gap: 12px; justify-content: flex-end; }
.save-status { text-align: right; max-width: 1000px; margin: 12px auto 0; font-size: .9rem; color: var(--color-text-muted); }
