:root {
  --bg: #0f1115;
  --bg-alt: #151922;
  --panel: #1b2029;
  --text: #e9ecf1;
  --muted: #9aa4b5;
  --accent: #6ea8fe;
  --accent-strong: #3b82f6;
  --danger: #f87171;
  --border: #272d3a;
  --radius: 14px;
  --max: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 720px; }

h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { margin: 0 0 6px; font-size: 1.15rem; }

.muted { color: var(--muted); }
.optional { color: var(--muted); font-weight: 400; font-size: 0.85em; }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: 0.95rem; }
.nav a:hover, .nav a.active { color: var(--text); text-decoration: none; }
.nav a.pill { border: 1px solid var(--border); padding: 4px 12px; border-radius: 999px; }

/* hero */
.hero { padding: 96px 0 64px; background: radial-gradient(1000px 420px at 15% -10%, rgba(110, 168, 254, 0.18), transparent 70%); }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; margin: 0 0 12px; font-weight: 600; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { display: flex; align-items: center; gap: 12px; margin: 0 0 28px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.15s ease, border-color 0.15s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-link, .card-link:hover { color: inherit; text-decoration: none; display: block; }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: #10131a; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media-empty { display: grid; place-items: center; background: linear-gradient(135deg, #1d2430, #263146); }
.card-media-empty span { font-size: 2.6rem; font-weight: 700; color: var(--accent); }
.card-body { padding: 18px 20px 22px; }
.card-meta { color: var(--muted); font-size: 0.82rem; margin: 0 0 8px; }
.card-summary { color: var(--muted); font-size: 0.95rem; margin: 0 0 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--border); color: var(--muted); padding: 3px 9px; border-radius: 999px; }

/* project page */
.breadcrumb { margin: 0 0 18px; font-size: 0.9rem; }
.project-meta { display: flex; gap: 14px; color: var(--muted); font-size: 0.9rem; margin: 0 0 24px; flex-wrap: wrap; }
.project-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 28px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

/* buttons */
.btn {
  display: inline-block;
  background: var(--accent-strong);
  color: #fff;
  border: 1px solid var(--accent-strong);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: #2f74e0; text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--panel); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.btn-small { padding: 5px 12px; font-size: 0.82rem; border-radius: 8px; }

/* forms */
.form { max-width: 640px; margin-top: 24px; }
.field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-size: 0.9rem; font-weight: 600; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  background: #11141b;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
  font: inherit;
  font-size: 0.95rem;
}
input:focus, textarea:focus { outline: 2px solid rgba(110, 168, 254, 0.45); outline-offset: 1px; border-color: var(--accent); }
textarea { resize: vertical; }
.checkbox label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* alerts */
.alert { border-radius: 10px; padding: 14px 16px; margin: 20px 0; border: 1px solid var(--border); }
.alert ul { margin: 0; padding-left: 20px; }
.alert-success { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.4); }
.alert-error { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.4); }

/* admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.badge { background: var(--accent-strong); color: #fff; font-size: 0.72rem; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.messages { display: flex; flex-direction: column; gap: 14px; margin-bottom: 44px; }
.message { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.message.unread { border-left-color: var(--accent); }
.message.read { opacity: 0.72; }
.message-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.message-head .muted { font-size: 0.82rem; margin-left: 8px; }
.message-head a { margin-left: 8px; font-size: 0.9rem; }
.message-actions { display: flex; gap: 8px; }
.message-subject { font-weight: 600; margin: 10px 0 2px; }
.message-body { white-space: pre-wrap; margin: 6px 0 0; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; margin-bottom: 44px; font-size: 0.93rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-links a { margin-left: 16px; color: var(--muted); }
.footer-links a:first-child { margin-left: 0; }

@media (max-width: 640px) {
  .hero { padding: 64px 0 44px; }
  .field-row { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
}
