/* ===== MemeForge — Manga / Comic Lab theme ===== */

:root{
  --bg: #0c0c0c;            /* near-black */
  --ink: #0c0c0c;
  --paper: #ffffff;         /* page white */
  --muted: #9aa0a6;
  --line: #2b2b2b;
  --accent: #ffd400;        /* shonen yellow */
  --accent-ink: #111;
  --radius: 12px;
  --border: 2px;
  --ctl-h: 38px;
  --shadow: 0 10px 24px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.25);
  --focus: 0 0 0 3px rgba(255,212,0,.35);
}

*{box-sizing:border-box}
html, body { height:100%; }
body{
  font-family: system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin:0; color:#e7e7ea; background: var(--bg);
  display:flex; flex-direction:column;
  /* subtle halftone vignette */
  background-image:
    radial-gradient(circle at 10% -10%, rgba(255,212,0,.08) 0%, rgba(255,212,0,0) 40%),
    radial-gradient(circle at 110% 10%, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 45%);
}

/* ===== Header ===== */
.header{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 16px; background:#121316; border-bottom:1px solid #1f2024;
}
.header a{ color:#f8e27a; text-decoration:none; }
.header a:hover{ text-decoration:underline; }
.banner{
  font-weight:700;
  padding:6px 10px;
  border: var(--border) solid var(--accent);
  color:#111; background:var(--accent);
  border-radius:10px;
  box-shadow: 4px 4px 0 #00000050;
}
/* Ensure high contrast on the yellow badge */
.header .banner a{
  color: #111 !important;        /* readable on yellow */
  text-decoration: underline;
  font-weight: 800;
}
.header .banner a:hover{
  text-decoration: none;
  filter: brightness(.9);
}

/* ===== Layout ===== */
.container{ max-width:1180px; margin:20px auto; padding:0 16px; flex:1; }
.small{ font-size:12px; color:#9aa0a6; }
.lede{ color:#c9ccd1; margin-top:6px; }

.app-grid{
  display:grid;
  grid-template-columns: 1fr 360px;   /* canvas | inspector */
  gap:22px; align-items:start;
}

/* ===== Canvas frame (comic board) ===== */
.panel--canvas{
  background: #0f1014;
  border: var(--border) solid #2a2a2a;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:12px; position:relative;
}

/* “panel edges” tick marks */
.panel--canvas::before,
.panel--canvas::after{
  content:""; position:absolute; height:14px; width:80px; background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.15) 0 8px, transparent 8px 16px);
  top:-8px; left:18px; transform:skew(-8deg);
}
.panel--canvas::after{ top:auto; bottom:-8px; left:auto; right:18px; transform:skew(8deg); }

canvas{
  max-width:100%; width:100%; display:block;
  background:#0a0b0e;
  border:1px dashed #2a2c33;
  border-radius:8px;
}

/* ===== Right inspector ===== */
.sidebar{ position:sticky; top:16px; align-self:start; }

.panel{
  background:#111215;
  border: var(--border) solid #2a2a2a;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
}
.panel + .panel{ margin-top:14px; }

.panel h3{
  margin:0 0 10px 0; font-size:1rem; letter-spacing:.25px;
  color:#fff; display:flex; align-items:center; gap:8px;
}
.panel h3::before{
  content:""; width:14px; height:14px; border-radius:50%;
  background:var(--accent);
  box-shadow: 2px 2px 0 #00000060;
}

.toolbar{ display:flex; flex-direction:column; gap:10px; margin:0; }

/* Controls */
.input,
.toolbar select,
.toolbar input[type="text"],
.toolbar input[type="number"],
.toolbar input[type="file"],
.toolbar button.btn{
  height: var(--ctl-h);
  line-height: calc(var(--ctl-h) - 2px);
  padding: 8px 10px; border-radius:10px; width:100%;
}

.input, .toolbar select, .toolbar input[type="text"], .toolbar input[type="number"]{
  background:#0f1116; color:#e7e7ea; border:1px solid #2a2c33;
}
.input:focus, .toolbar select:focus, .toolbar input[type="text"]:focus, .toolbar input[type="number"]:focus{
  outline:none; box-shadow: var(--focus); border-color:#3a3d44;
}

.toolbar input[type="color"]{
  width:100%; height:var(--ctl-h); padding:0; border:1px solid #2a2c33; border-radius:10px;
}
.toolbar input[type="range"]{ margin:0; }

.form-row{ display:flex; gap:10px; }
.form-row > *{ flex:1; }

/* Buttons */
.btn{
  background: var(--accent);
  color:#111;
  border: var(--border) solid #000;
  cursor:pointer;
  font-weight:900;
  letter-spacing:.25px;
  height: var(--ctl-h);          /* fixed control height */
  padding: 0 14px;               /* no vertical padding */
  border-radius:10px;
  text-transform:uppercase;
  box-shadow: 3px 3px 0 #00000060;

  /* center the label perfectly */
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;                 /* prevent baseline drift */
}
.btn:hover{ filter:brightness(1.05); }
.btn.secondary{
  background:#0e0e0e; color:#fff; border-color:#2a2a2a;
}

/* Danger variants still available */
.btn.danger{ background:#7f1d1d; border-color:#b91c1c; color:#fff; }
.btn.danger:hover{ background:#991b1b; }

/* CTA row sticks to bottom of inspector */
.actions{
  display:flex; gap:10px; margin-top:8px;
  position:sticky; bottom:0; background:#111215; padding-top:10px;
  border-top:1px dashed #2b2b2b;
}

/* Grid / cards (templates) */
.grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px }
.card{ background:#111215; border:var(--border) solid #2a2a2a; border-radius:10px; padding:12px; box-shadow:var(--shadow) }

/* Footer */
footer.site-footer{
  margin-top:40px; padding:16px 12px; border-top:1px solid #222;
  color: var(--muted); font-size:.9rem;
}
footer.site-footer .links{
  list-style:none; display:flex; justify-content:center; align-items:center; gap:20px;
  flex-wrap:wrap; margin:0; padding:0;
}
footer.site-footer .links a{ color:#f8e27a; text-decoration:none; padding:4px 6px; border-radius:6px; opacity:.9; }
footer.site-footer .links a:hover{ text-decoration:underline; opacity:1; }
footer.site-footer .links a:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
footer.site-footer .smallprint{ margin-top:8px; text-align:center; font-size:.8rem; opacity:.7; }

/* Optional bundled fonts (already in repo) */
@font-face{
  font-family: "Anton LF";
  src: url("/assets/fonts/Anton-Regular.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family: "Oswald LF";
  src: url("/assets/fonts/OswaldLF.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family: "Inter LF";
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .app-grid{ grid-template-columns:1fr; }
  .sidebar{ position:static; }
  .actions{ position:static; }
}
