/* ---------- 1. Colours (light & dark) ---------- */
:root {
  /* light theme */
  --bg-window: #ffffff;
  --bg-header: #f5f5f5;
  --text: #222222;
  --code-bg: #f0f0f0;
  --border: #e0e0e0;
  --control-close: #ff5f57;
  --control-min: #ffbd2e;
  --control-max: #28c840;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* dark theme */
    --bg-window: #1e1e1e;
    --bg-header: #2b2b2b;
    --text: #f5f5f5;
    --code-bg: #2d2d2d;
    --border: #444444;
  }
}

/* ---------- 2. Global reset & body ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; line-height: 1.6; color: var(--text); }
body { background: #fafafa; margin: 0; padding: 1rem; }
@media (prefers-color-scheme: dark) { body { background: #111111; } }

/* ---------- 3. Script‑Editor window ---------- */
.script-editor-window {
  max-width: 900px;
  margin: 2rem auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-window);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
}

.window-header {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  background-image: linear-gradient(to bottom, #fff, var(--bg-header));
}

.window-controls { display: flex; gap: 6px; margin-right: 12px; }
.window-controls span { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.window-controls .close { background: var(--control-close); }
.window-controls .minimize { background: var(--control_min); }
.window-controls .maximize { background: var(--control-max); }

.window-title { flex: 1; text-align: center; font-weight: 600; font-size: .95rem; color: var(--text); }

.window-content { padding: 20px 16px; overflow: auto; background: var(--bg-window); color: var(--text); }

/* ---------- 4. Typography inside the window ---------- */
.window-content h1, .window-content h2, .window-content h3 { margin: 1.4em 0 .6em; }
.window-content p { margin: .8em 0; }
.window-content blockquote { margin: 1em 0; padding-left: 1em; border-left: 4px solid var(--border); opacity: .8; }
.window-content code { font-family: Menlo, "SF Mono", Monaco, monospace; background: var(--code-bg); padding: .2em .4em; border-radius: 4px; }
.window-content pre { background: var(--code-bg); padding: 1em; overflow-x: auto; border-radius: 4px; }

/* ---------- 5. Post list (home page) ---------- */
.post-list { list-style: none; padding: 0; }
.post-list li { margin: .4em 0; }
.post-list a { color: var(--text); text-decoration: none; }
.post-list a:hover { text-decoration: underline; }
