/* Random Drawing Generator — randomdrawinggenerator.art
   Aesthetic: risograph print + art studio paper */

:root {
  --paper: #eff1ec;
  --paper-2: #e4e8e0;
  --card: #ffffff;
  --ink: #16213a;
  --ink-soft: #4a5570;
  --lime: #c8f03c;
  --pink: #ff5a8a;
  --sky: #7fd8e8;
  --line: #16213a;
  --line-soft: rgba(22, 33, 58, 0.16);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 14px;
  --maxw: 1080px;
  --read: 68ch;
}

:root:not([data-theme="light"]) {
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #11172b;
  --paper-2: #0c1122;
  --card: #1b2440;
  --ink: #eff1ec;
  --ink-soft: #a7b0c6;
  --line: #55628a;
  --line-soft: rgba(239, 241, 236, 0.18);
  --shadow: 5px 5px 0 #55628a;
  --shadow-sm: 3px 3px 0 #55628a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: "Karla", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: "Bricolage Grotesque", "Karla", system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 3.4vw, 2.05rem); margin-top: 2em; }
h3 { font-size: clamp(1.15rem, 2.4vw, 1.35rem); margin-top: 1.6em; }

p, li { max-width: var(--read); }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--pink); }

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--lime); color: #16213a;
  padding: 10px 16px; z-index: 99; font-weight: 700;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.site-head {
  border-bottom: 2px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 40;
}
.head-row {
  display: flex; align-items: center; gap: 14px;
  min-height: 62px; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800;
  font-size: 1.02rem; text-decoration: none; letter-spacing: -0.02em;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; padding: 7px 11px; border-radius: 9px;
  font-weight: 600; font-size: 0.95rem;
}
.nav a:hover { background: var(--lime); color: #16213a; }
.nav-toggle, .theme-btn {
  background: var(--card); border: 2px solid var(--line); border-radius: 10px;
  color: var(--ink); cursor: pointer; font-size: 1rem; padding: 6px 10px;
  font-family: inherit; font-weight: 700;
}
.nav-toggle { display: none; }
@media (max-width: 830px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: var(--paper); border-bottom: 2px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 14px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 8px; border-bottom: 1px solid var(--line-soft); }
}

/* ---------- tool ---------- */
.tool-section { padding: 30px 0 10px; }
.kicker {
  display: inline-block; background: var(--lime); color: #16213a;
  font-weight: 700; font-size: 0.85rem; padding: 4px 10px;
  border: 2px solid #16213a; border-radius: 30px; margin-bottom: 14px;
}
.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 62ch; }

.machine {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin: 26px 0 0;
  overflow: hidden;
}

.modes {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 3px solid var(--line); background: var(--paper-2);
}
.mode {
  flex: 1 1 auto; min-width: 104px; padding: 13px 10px; border: 0;
  border-right: 2px solid var(--line-soft);
  background: transparent; color: var(--ink); cursor: pointer;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 0.97rem;
}
.mode[aria-selected="true"] { background: var(--pink); color: #fff; }
.mode:last-child { border-right: 0; }

.screen { padding: clamp(20px, 4vw, 34px); }

.prompt-card { position: relative; }
.prompt-text {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800; letter-spacing: -0.025em;
  font-size: clamp(1.5rem, 4.6vw, 2.5rem); line-height: 1.12;
  margin: 0 0 6px; max-width: 26ch;
}
.prompt-text .hl { background: var(--lime); color: #16213a; padding: 0 4px; border-radius: 4px; }
.prompt-sub { color: var(--ink-soft); font-size: 1rem; margin: 0 0 4px; }
.rolling .prompt-text { opacity: 0.35; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; }
.chip-meta {
  border: 2px solid var(--line); border-radius: 30px; padding: 3px 11px;
  font-size: 0.85rem; font-weight: 600; background: var(--paper);
}
.chip-meta.d1 { background: var(--sky); color: #16213a; }
.chip-meta.d2 { background: var(--lime); color: #16213a; }
.chip-meta.d3 { background: var(--pink); color: #fff; }

.lockable { display: flex; align-items: flex-start; gap: 8px; }
.lock {
  background: transparent; border: 2px solid var(--line-soft); border-radius: 8px;
  cursor: pointer; font-size: 0.8rem; padding: 2px 6px; color: var(--ink-soft);
  flex: none; margin-top: 4px;
}
.lock[aria-pressed="true"] { background: var(--lime); color: #16213a; border-color: #16213a; }

.parts { display: grid; gap: 12px; margin: 0 0 4px; }
.part-label {
  font-size: 0.78rem; font-weight: 700; color: var(--ink-soft);
  letter-spacing: 0.03em; margin-bottom: 1px;
}
.part-value { font-weight: 600; font-size: 1.06rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; align-items: center; }
.btn {
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 700;
  border: 3px solid var(--line); border-radius: 12px; cursor: pointer;
  padding: 12px 18px; font-size: 1rem; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn-go { background: var(--pink); color: #fff; font-size: 1.15rem; padding: 15px 30px; }
.btn-ghost { box-shadow: none; border-width: 2px; padding: 9px 13px; font-size: 0.93rem; }
.btn-ghost:hover { background: var(--lime); color: #16213a; }
.kbd-hint { font-size: 0.85rem; color: var(--ink-soft); }
kbd {
  border: 2px solid var(--line-soft); border-bottom-width: 3px; border-radius: 6px;
  padding: 1px 6px; font-size: 0.8rem; font-family: inherit; font-weight: 700;
}

/* controls */
.controls {
  border-top: 3px solid var(--line); background: var(--paper-2);
  padding: clamp(16px, 3vw, 24px);
}
.ctl-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; cursor: pointer; width: 100%; background: none; border: 0;
  color: var(--ink); font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700; font-size: 1.05rem; padding: 0;
}
.ctl-body { display: grid; gap: 20px; margin-top: 18px; }
.ctl-body[hidden] { display: none; }
.field-title { font-weight: 700; font-size: 0.95rem; margin: 0 0 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 30px; padding: 6px 13px; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 0.9rem;
}
.chip[aria-pressed="true"] { background: var(--sky); color: #16213a; border-color: #16213a; }
.chip.small { font-size: 0.85rem; padding: 5px 11px; }
.inline-row { display: flex; flex-wrap: wrap; gap: 18px; }
.inline-row > div { flex: 1 1 210px; }
input[type="text"], select, textarea {
  width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font-family: inherit; font-size: 1rem;
}
.switch-row { display: flex; align-items: center; gap: 10px; font-weight: 600; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: #ff5a8a; }

/* timer */
.timer-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  border-top: 3px solid var(--line); padding: 14px clamp(16px, 3vw, 24px);
  background: var(--card);
}
.clock {
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800;
  font-size: 1.9rem; letter-spacing: -0.02em; min-width: 104px;
}
.clock.low { color: var(--pink); }
.timer-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.progress {
  height: 10px; border: 2px solid var(--line); border-radius: 20px;
  background: var(--paper-2); overflow: hidden; flex: 1 1 140px; min-width: 120px;
}
.progress i { display: block; height: 100%; width: 0; background: var(--lime); }

/* palette */
.pal { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.swatch {
  width: 56px; height: 56px; border: 3px solid var(--line); border-radius: 12px;
  cursor: pointer; position: relative; padding: 0;
}
.swatch span {
  position: absolute; bottom: -22px; left: 0; right: 0; text-align: center;
  font-size: 0.68rem; font-weight: 700; color: var(--ink-soft);
}
.pal-wrap { padding-bottom: 26px; }

/* saved / history */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.panel {
  background: var(--card); border: 3px solid var(--line); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow-sm);
}
.panel h3 { margin-top: 0; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; max-height: 260px; overflow: auto; }
.list li {
  display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid var(--line-soft); padding-bottom: 8px; font-size: 0.95rem;
  max-width: none;
}
.list button {
  background: none; border: 0; cursor: pointer; color: var(--ink-soft);
  font-size: 1rem; padding: 2px 4px;
}
.list button:hover { color: var(--pink); }
.empty { color: var(--ink-soft); font-size: 0.95rem; font-style: italic; }
.stat-line { font-weight: 700; margin: 0 0 12px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(140%);
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 30px;
  font-weight: 700; z-index: 80; transition: transform .25s ease; max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* content */
.content { padding: 40px 0; }
.content h2 { border-bottom: 3px solid var(--lime); display: inline-block; padding-bottom: 4px; }
.article-meta { color: var(--ink-soft); font-size: 0.93rem; margin-bottom: 26px; }
blockquote {
  border-left: 5px solid var(--pink); margin: 22px 0; padding: 4px 0 4px 18px;
  font-size: 1.1rem; color: var(--ink-soft);
}
table { border-collapse: collapse; width: 100%; max-width: 100%; margin: 20px 0; font-size: 0.97rem; }
th, td { border: 2px solid var(--line); padding: 9px 11px; text-align: left; }
th { background: var(--lime); color: #16213a; }
[data-theme="dark"] th { color: #16213a; }
code {
  background: var(--paper-2); border: 1px solid var(--line-soft);
  padding: 1px 5px; border-radius: 5px; font-size: 0.92em;
}

details.faq {
  border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; background: var(--card);
}
details.faq summary { font-weight: 700; cursor: pointer; font-family: "Bricolage Grotesque", sans-serif; }
details.faq p { margin: 10px 0 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 18px; margin: 24px 0; }
.cards article {
  border: 3px solid var(--line); border-radius: 16px; background: var(--card);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.cards h3 { margin-top: 0; font-size: 1.12rem; }
.cards p { font-size: 0.95rem; color: var(--ink-soft); max-width: none; }
.cards a { font-weight: 700; }
.tag {
  font-size: 0.76rem; font-weight: 700; background: var(--sky); color: #16213a;
  border-radius: 20px; padding: 2px 9px; display: inline-block; margin-bottom: 10px;
}

.ad-slot {
  margin: 34px auto; padding: 10px; border: 2px dashed var(--line-soft);
  border-radius: 12px; text-align: center; color: var(--ink-soft);
  font-size: 0.8rem; min-height: 90px; max-width: 760px;
}

.cta-band {
  background: var(--ink); color: var(--paper); border-radius: 20px;
  padding: clamp(24px, 4vw, 36px); margin: 40px 0;
}
[data-theme="dark"] .cta-band { border: 3px solid var(--line); }
.cta-band h2 { color: var(--paper); border-color: var(--pink); margin-top: 0; }
.cta-band p { color: #c6cbdd; }
.cta-band .btn { background: var(--lime); color: #16213a; border-color: #16213a; }

.site-foot {
  border-top: 3px solid var(--line); margin-top: 40px; padding: 30px 0 40px;
  background: var(--paper-2);
}
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; }
.foot-grid h4 { font-size: 1rem; margin-bottom: 10px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.foot-grid a { font-size: 0.95rem; }
.copy { margin-top: 26px; font-size: 0.9rem; color: var(--ink-soft); }
.crumbs { font-size: 0.88rem; color: var(--ink-soft); padding-top: 18px; }
.crumbs a { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- blog additions ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 22px 0 30px; }
.post-grid article {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px; display: flex; flex-direction: column;
}
.post-grid h3 { margin: 6px 0 8px; font-size: 1.1rem; line-height: 1.25; }
.post-grid h3 a { color: var(--ink); text-decoration: none; }
.post-grid h3 a:hover { color: var(--pink); text-decoration: underline; }
.post-grid p { font-size: 0.95rem; color: var(--ink-soft); max-width: none; margin: 0 0 14px; }
.post-grid .meta { font-size: 0.8rem; color: var(--ink-soft); font-family: "Bricolage Grotesque", sans-serif; margin-top: auto; }
.post-grid .read-link { font-weight: 700; font-size: 0.95rem; margin-top: 8px; }

.toc { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 30px; max-width: var(--read); }
.toc h2 { font-size: 1rem !important; border: 0 !important; margin: 0 0 8px !important; padding: 0 !important; }
.toc ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: 0.95rem; }

.callout { border-left: 5px solid var(--pink); background: var(--card); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 26px 0; max-width: var(--read); }
.callout p:last-child { margin-bottom: 0; }
.callout strong { font-family: "Bricolage Grotesque", sans-serif; }

.prompt-box { background: var(--paper-2); border: 2px dashed var(--line-soft); border-radius: var(--radius); padding: 14px 18px; margin: 22px 0; max-width: var(--read); font-size: 1rem; }
.prompt-box ul, .prompt-box ol { margin: 8px 0 0; }

ol.steps { counter-reset: st; list-style: none; padding: 0; max-width: var(--read); }
ol.steps li { counter-increment: st; position: relative; padding-left: 44px; margin-bottom: 14px; }
ol.steps li::before {
  content: counter(st); position: absolute; left: 0; top: 1px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-family: "Bricolage Grotesque", sans-serif; font-weight: 700;
  display: grid; place-items: center; font-size: 0.92rem;
}
.day-table td:first-child { white-space: nowrap; font-weight: 700; }

/* Unfilled ad containers stay invisible. Remove the "empty-ad" class from a
   .ad-slot div once you paste a real AdSense unit into it. */
.ad-slot.empty-ad { display: none; }

/* ---------- cookie notice ---------- */
.cookie-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 300;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: 760px; margin: 0 auto;
}
.cookie-bar p { margin: 0; font-size: 0.9rem; flex: 1 1 260px; max-width: none; }
.cookie-bar .btn { flex: none; }
@media (max-width: 480px) { .cookie-bar { gap: 10px; } .cookie-bar .btn { width: 100%; } }
