/* BespokeAI: one stylesheet, no frameworks, light and dark. */
:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --surface-2: #f0ebe2;
  --text: #1d2420;
  --muted: #5d6762;
  --border: #e2dbcf;
  --brand: #1f5c4a;
  --brand-contrast: #ffffff;
  --accent: #c8643b;
  --ok: #2e7d4f;
  --warn: #9a6a00;
  --focus: #2f6fdb;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 16px rgb(0 0 0 / 0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --surface: #1c211f;
    --surface-2: #242a27;
    --text: #ecefe9;
    --muted: #a3ada7;
    --border: #2f3633;
    --brand: #7fc4a8;
    --brand-contrast: #10201a;
    --accent: #e8926c;
    --ok: #6fcf97;
    --warn: #e7c065;
    --focus: #8ab4ff;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
code, pre, textarea.prompt { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
.skip { position: absolute; left: -999px; top: 0; }
.vh { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }

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

/* Header / footer */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.logo img { width: 28px; height: 28px; }
.nav { display: flex; gap: 1.1rem; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--brand); }
.site-footer { margin-top: 4rem; padding: 2rem 0 3rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between; }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

main { padding: 2rem 0; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 42rem; margin: 0 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 0 0 0.4rem; }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0.6rem 1.2rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--brand); }
.btn-primary { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

label { font-weight: 600; display: block; margin: 1.1rem 0 0.35rem; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; display: block; }
input[type=text], input[type=url], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 0.7rem 0.85rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 6.5rem; resize: vertical; }
textarea.prompt { min-height: 16rem; background: var(--surface-2); }
.search { display: flex; gap: 0.5rem; max-width: 38rem; }
.search input { border-radius: 999px; padding-left: 1.1rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: 1.15rem; margin-bottom: 0.5rem; }

/* Cards and grids */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.project-card { position: relative; display: flex; flex-direction: column; gap: 0.4rem; }
.project-card:hover { border-color: var(--brand); }
.project-card .shot { aspect-ratio: 16 / 9; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); width: 100%; }
.project-card .shot.placeholder { display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 1.4rem; }
.meta { display: flex; gap: 0.5rem; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; }
.pill { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.pill.easy { color: var(--ok); }
.pill.moderate { color: var(--warn); }
.pill.advanced { color: var(--accent); }
.cat-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cat { display: block; padding: 0.9rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.cat strong { display: block; }
.cat span { color: var(--muted); font-size: 0.88rem; }
.cat:hover { border-color: var(--brand); }

/* Home */
.hero { padding: 2.5rem 0 1rem; }
.steps { counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding: 0; list-style: none; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: var(--brand-contrast); font-weight: 700; margin-bottom: 0.5rem; }

/* Project page */
.project-hero { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 820px) { .project-hero { grid-template-columns: 1fr; } }
.gallery { display: grid; gap: 0.6rem; }
.gallery img { border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.panels { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 0.4rem 0; border-bottom: 1px dashed var(--border); }
.facts li:last-child { border-bottom: 0; }
.ideas { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.ideas a { display: block; padding: 0.8rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.ideas a:hover { border-color: var(--brand); }
.ideas small { color: var(--muted); display: block; }
.level { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand); }
.review { border-left: 3px solid var(--brand); padding: 0.3rem 0 0.3rem 0.9rem; margin: 0 0 1rem; }

/* Tell my AI */
.targets { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.target input { position: absolute; opacity: 0; }
.target label {
  margin: 0; height: 100%; padding: 0.9rem 1rem; border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--surface); cursor: pointer; font-weight: 400;
}
.target label strong { display: block; font-size: 1.05rem; }
.target label span { color: var(--muted); font-size: 0.85rem; }
.target input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.target input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); margin: 0.5rem 0 1.2rem; }
.tabs input { position: absolute; opacity: 0; }
.tabs label { margin: 0; padding: 0.5rem 1.2rem; border-radius: 999px; cursor: pointer; color: var(--muted); }
#tab-ai:checked ~ .tabs label[for=tab-ai], #tab-manual:checked ~ .tabs label[for=tab-manual] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
#tab-ai:focus-visible ~ .tabs label[for=tab-ai], #tab-manual:focus-visible ~ .tabs label[for=tab-manual] { outline: 3px solid var(--focus); }
.panel-manual, .panel-ai { display: none; }
#tab-ai:checked ~ .panel-ai, #tab-manual:checked ~ .panel-manual { display: block; }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; }
.box ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.privacy { color: var(--muted); font-size: 0.92rem; }
.copied { color: var(--ok); font-weight: 600; }
details summary { cursor: pointer; font-weight: 600; }
.notice { padding: 0.9rem 1.1rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.notice.ok { border-color: var(--ok); }
.notice.err { border-color: var(--accent); }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.inline-form { display: inline; }
.inline-form button { min-height: 34px; padding: 0.2rem 0.8rem; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .card, .cat, .ideas a { transition: border-color 0.15s, filter 0.15s; }
}
