/* ============================================================
   makeshif.tma.tt — dark, electric, maker-flavoured
   ============================================================ */

:root {
  --bg: #0a0e14;
  --bg-2: #0d1320;
  --panel: #121a28;
  --panel-2: #17202f;
  --line: rgba(148, 170, 200, 0.14);
  --text: #e6edf6;
  --muted: #92a0b5;
  --cyan: #2de2ff;
  --lime: #b8f34a;
  --pink: #ff5fa8;
  --danger: #ff5f6b;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  /* blueprint grid */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(45, 226, 255, 0.09), transparent),
    linear-gradient(rgba(148, 170, 200, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 170, 200, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); font-size: 0.85em; letter-spacing: 0.02em; }

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

img { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; }

.skip {
  position: absolute; left: -999px; top: 0; background: var(--cyan); color: #000;
  padding: 8px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; gap: 16px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  background: linear-gradient(135deg, rgba(45,226,255,.18), rgba(184,243,74,.18));
  border: 1px solid var(--line); border-radius: 9px; font-size: 1rem;
}
.brand-name b { color: var(--cyan); font-weight: 800; }
.brand-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(45, 226, 255, 0.55);
}

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); padding: 7px 13px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 500;
}
.site-nav a:hover { color: var(--text); text-decoration: none; background: rgba(148,170,200,0.08); }
.site-nav a.active { color: var(--bg); background: var(--cyan); font-weight: 700; }

.nav-toggle { display: none; }

@media (max-width: 700px) {
  .nav-toggle {
    display: flex; flex-direction: column; gap: 4px; justify-content: center;
    background: none; border: 1px solid var(--line); border-radius: 8px;
    width: 40px; height: 36px; align-items: center; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; }
  .site-nav {
    display: none; width: 100%; flex-direction: column; padding-bottom: 12px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 13px; }
  /* Admin nav has no hamburger — keep it visible and wrapping */
  .site-nav.admin-nav {
    display: flex; flex-direction: row; flex-wrap: wrap; padding-bottom: 10px;
  }
  .site-nav.admin-nav a { padding: 6px 10px; font-size: 0.88rem; }
}

/* ---------- hero ---------- */

.hero { padding: 88px 0 56px; text-align: center; }
.avatar-ring {
  display: inline-grid; place-items: center; padding: 4px; border-radius: 50%;
  margin-bottom: 22px;
  background: conic-gradient(from 210deg, var(--cyan), var(--lime), var(--pink), var(--cyan));
  box-shadow: 0 10px 44px rgba(45, 226, 255, 0.28);
}
.avatar-ring img {
  display: block; width: 128px; height: 128px; border-radius: 50%;
  object-fit: cover; border: 5px solid var(--bg);
}
.hero-hello { color: var(--lime); margin: 0 0 14px; opacity: 0.9; }
.hero-title {
  margin: 0; font-size: clamp(2.6rem, 9vw, 5.2rem); font-weight: 900;
  letter-spacing: -0.04em; line-height: 1.02;
}
.hero-title .accent {
  background: linear-gradient(100deg, var(--cyan), var(--lime));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tagline { color: var(--muted); font-size: clamp(1.05rem, 2.6vw, 1.35rem); margin: 14px 0 30px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; font-family: var(--font); line-height: 1.4;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover {
  text-decoration: none; transform: translateY(-1px);
  border-color: rgba(45, 226, 255, 0.5); box-shadow: 0 4px 20px rgba(45, 226, 255, 0.12);
}
.btn-primary {
  background: var(--cyan); border-color: var(--cyan); color: #04151a; font-weight: 700;
}
.btn-primary:hover { box-shadow: 0 4px 24px rgba(45, 226, 255, 0.35); }
.btn-ghost { background: transparent; }
.btn-small { padding: 7px 15px; font-size: 0.85rem; }
.btn-tiny { padding: 3px 9px; font-size: 0.78rem; border-radius: 7px; }
.btn-danger { border-color: rgba(255, 95, 107, 0.4); color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); box-shadow: 0 4px 16px rgba(255, 95, 107, 0.15); }

/* ---------- sections ---------- */

.section { padding: 40px 0; }
.page-head { padding-top: 56px; padding-bottom: 8px; }
.page-head h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 900; letter-spacing: -0.03em; margin: 6px 0 10px; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 640px; }
.page-head .lede { margin-top: 0; }

.eyebrow {
  font-family: var(--mono); color: var(--lime); font-size: 0.8rem;
  letter-spacing: 0.14em; margin-bottom: 14px;
}
.section-more { margin-top: 22px; }
.section-more a { font-weight: 600; }
.crumb a { color: var(--muted); }
.meta-line { color: var(--muted); }
.empty { color: var(--muted); }

/* ---------- home tiles ---------- */

.tile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px;
}
.tile {
  display: block; padding: 26px 22px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.tile:hover {
  text-decoration: none; transform: translateY(-3px);
  border-color: rgba(45, 226, 255, 0.45); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
}
.tile-icon { font-size: 1.6rem; display: block; margin-bottom: 10px; }
.tile h2 { margin: 0 0 6px; font-size: 1.2rem; letter-spacing: -0.01em; }
.tile p { margin: 0 0 14px; color: var(--muted); font-size: 0.93rem; }
.tile-go { color: var(--cyan); font-weight: 600; font-size: 0.9rem; }

/* ---------- video cards ---------- */

.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.feed-head h2 { margin: 0; font-size: 1.4rem; letter-spacing: -0.02em; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.video-card { display: block; color: var(--text); }
.video-card:hover { text-decoration: none; }
.video-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.video-card:hover .video-thumb img { transform: scale(1.04); }
.play {
  position: absolute; inset: auto auto 8px 8px; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(4, 21, 26, 0.8); color: var(--cyan); font-size: 0.8rem;
  border: 1px solid rgba(45, 226, 255, 0.35);
}
.video-title { display: block; margin: 10px 0 2px; font-weight: 600; font-size: 0.97rem; line-height: 1.35; }
.video-meta { color: var(--muted); }

/* featured/pinned videos */
.video-grid-lg { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.feed-head .star { color: var(--lime); }
.pin {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 50%; font-size: 0.7rem;
  background: rgba(4, 21, 26, 0.8); color: var(--lime);
  border: 1px solid rgba(184, 243, 74, 0.35);
}

/* ---------- instagram grid ---------- */

.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ig-card {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
}
.ig-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.ig-card:hover img { transform: scale(1.05); }
.ig-badge {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(4, 21, 26, 0.8); color: var(--lime); font-size: 0.65rem;
}

/* ---------- links page ---------- */

.link-group { margin-bottom: 36px; }
.link-group-title {
  font-size: 1.15rem; letter-spacing: -0.01em; margin: 0 0 12px;
  padding-bottom: 8px; border-bottom: 1px dashed var(--line);
}
.link-list { display: flex; flex-direction: column; gap: 10px; }
.link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.link-row:hover { text-decoration: none; transform: translateX(4px); border-color: rgba(184, 243, 74, 0.5); }
.link-title { font-weight: 600; display: block; }
.link-note { color: var(--muted); font-size: 0.85rem; display: block; }
.link-arrow { color: var(--lime); font-weight: 700; }

/* ---------- projects ---------- */

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.project-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: transform 0.14s ease, border-color 0.14s ease;
}
.project-card:hover { text-decoration: none; transform: translateY(-3px); border-color: rgba(255, 95, 168, 0.5); }
.project-cover {
  display: block; aspect-ratio: 16 / 9; background-size: cover; background-position: center;
  background-image: linear-gradient(120deg, rgba(45,226,255,.16), rgba(255,95,168,.14) 60%, rgba(184,243,74,.16));
  border-bottom: 1px solid var(--line);
}
.project-body { padding: 16px 18px 18px; }
.project-body h2 { margin: 0 0 6px; font-size: 1.15rem; letter-spacing: -0.01em; }
.project-body p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.project-files { display: inline-block; margin-top: 10px; color: var(--lime); }

.project-hero { border-radius: var(--radius); border: 1px solid var(--line); display: block; }

/* ---------- prose (markdown output) ---------- */

.prose { font-size: 1.03rem; }
.prose h2 { margin: 1.6em 0 0.5em; letter-spacing: -0.02em; }
.prose h3 { margin: 1.4em 0 0.4em; }
.prose p { margin: 0 0 1em; }
.prose ul { margin: 0 0 1em; padding-left: 1.3em; }
.prose code {
  font-family: var(--mono); font-size: 0.88em; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
}
.prose pre {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; overflow-x: auto;
}
.prose pre code { background: none; border: none; padding: 0; }

/* callout panels (!!! info / tip / warning / danger) */
.callout {
  margin: 0 0 1.2em; padding: 14px 18px; border-radius: 12px;
  border: 1px solid var(--line); border-left-width: 4px;
  background: var(--panel);
}
.callout p { margin: 0; }
.callout-title { font-weight: 700; margin-bottom: 4px !important; }
.callout-info    { border-left-color: var(--cyan);  background: rgba(45, 226, 255, 0.07); }
.callout-info    .callout-title { color: var(--cyan); }
.callout-tip     { border-left-color: var(--lime);  background: rgba(184, 243, 74, 0.07); }
.callout-tip     .callout-title { color: var(--lime); }
.callout-warning { border-left-color: #ffb648;      background: rgba(255, 182, 72, 0.08); }
.callout-warning .callout-title { color: #ffb648; }
.callout-danger  { border-left-color: var(--danger); background: rgba(255, 95, 107, 0.08); }
.callout-danger  .callout-title { color: var(--danger); }

/* ---------- video embeds on project pages ---------- */

.embed-list { display: flex; flex-direction: column; gap: 18px; }
.embed-frame {
  aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2);
}
.embed-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- file downloads ---------- */

.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-row {
  display: flex; align-items: center; gap: 16px; padding: 15px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); transition: border-color 0.12s ease, transform 0.12s ease;
}
.file-row:hover { text-decoration: none; border-color: rgba(45, 226, 255, 0.5); transform: translateX(4px); }
.file-icon {
  width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0;
  border-radius: 10px; font-size: 1.15rem; color: var(--cyan);
  background: rgba(45, 226, 255, 0.1); border: 1px solid rgba(45, 226, 255, 0.25);
}
.file-title { font-weight: 600; display: block; }
.file-meta { color: var(--muted); display: block; }

/* ---------- forms ---------- */

label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
input[type="text"], input[type="url"], input[type="email"], input[type="password"],
textarea, select {
  width: 100%; padding: 10px 14px; margin-top: 5px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--font); font-size: 0.97rem;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(45, 226, 255, 0.15);
}
textarea { resize: vertical; }
input[type="file"] { margin-top: 6px; color: var(--muted); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.contact-form { max-width: 640px; display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.contact-form .hp { position: absolute; left: -9999px; }
.contact-form button { align-self: flex-start; }

.notice { padding: 13px 18px; border-radius: 12px; margin: 14px 0; font-weight: 500; }
.notice-ok { background: rgba(184, 243, 74, 0.1); border: 1px solid rgba(184, 243, 74, 0.4); color: var(--lime); }
.notice-err { background: rgba(255, 95, 107, 0.1); border: 1px solid rgba(255, 95, 107, 0.4); color: var(--danger); }
.hint { color: var(--muted); font-size: 0.87rem; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 32px 0; text-align: center; }
.footer-socials { display: flex; gap: 20px; justify-content: center; margin-bottom: 10px; }
.footer-socials a { color: var(--muted); font-weight: 600; }
.footer-socials a:hover { color: var(--cyan); }
.footer-note { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ---------- admin ---------- */

.admin-main { padding: 32px 0 64px; }
.admin h1 { letter-spacing: -0.02em; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 22px;
}
.panel h2 { margin-top: 0; font-size: 1.15rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: inline-flex; gap: 4px; align-items: center; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input-small { width: 180px !important; margin-top: 0 !important; padding: 5px 10px !important; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table td { padding: 11px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:first-child td { border-top: none; }
.cell-url { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; }
.cell-actions { text-align: right; white-space: nowrap; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.badge-ok { background: rgba(184, 243, 74, 0.12); color: var(--lime); border: 1px solid rgba(184, 243, 74, 0.35); }
.badge-muted { background: rgba(148, 170, 200, 0.1); color: var(--muted); border: 1px solid var(--line); }
.badge-prev { background: rgba(45, 226, 255, 0.1); color: var(--cyan); border: 1px solid rgba(45, 226, 255, 0.35); }

.preview-banner {
  text-align: center; padding: 9px 16px; font-size: 0.8rem;
  background: rgba(255, 182, 72, 0.1); color: #ffb648;
  border-bottom: 1px solid rgba(255, 182, 72, 0.3);
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 20px 0 30px; }
.stat {
  display: flex; flex-direction: column; padding: 18px 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text);
}
a.stat:hover { text-decoration: none; border-color: rgba(45, 226, 255, 0.45); }
.stat-num { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; color: var(--cyan); }
.stat-sub { font-size: 1rem; color: var(--muted); font-weight: 600; }
.stat-label { color: var(--muted); font-size: 0.85rem; }

.check-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }

.login-box { max-width: 380px; margin: 60px auto; }
.login-box form { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }

.file-manage { border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; }
.file-manage legend { padding: 0 8px; font-weight: 700; font-size: 0.9rem; }
.file-manage-row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.file-manage-row:last-child { border-bottom: none; }
.file-manage-row input[type="text"] { margin-top: 0; }
.inline-check { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; white-space: nowrap; }

@media (max-width: 640px) {
  .file-manage-row { grid-template-columns: 1fr; gap: 6px; }
  .cell-url { display: none; }
}
