:root {
  --accent: #f0a0a0;
  --accent2: #d48080;
  --bg: #191717;
  --bg2: #1e1c1c;
  --bg3: #242222;
  --text: #f0eded;
  --text-dim: #888;
  --border: #2a2828;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 85% -10%, rgba(240,160,160,.10), transparent 70%),
    radial-gradient(500px 380px at -10% 100%, rgba(240,160,160,.06), transparent 70%);
}

/* ---------- Topbar ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 44px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .04em; }
.brand svg { width: 22px; height: 22px; }
.brand b { color: var(--accent); font-weight: 800; }
.brand i { font-style: normal; font-weight: 300; }
.eyebrow {
  color: var(--text-dim); font-size: 12px; text-transform: uppercase;
  letter-spacing: .12em; font-weight: 500;
}

/* ---------- Hero (gate) ---------- */
.hero {
  position: relative; z-index: 1; flex: 1;
  display: grid; place-items: center;
  padding: clamp(28px, 6vh, 70px) 20px;
}
.hero-inner { max-width: 660px; width: 100%; }
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1.05;
  letter-spacing: .02em;
  font-weight: 400;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub {
  margin-top: 18px; color: #c9c4c4; font-size: 16px; line-height: 1.65;
  font-weight: 300; max-width: 56ch;
}

.access-form {
  margin-top: 30px; display: flex; gap: 10px; flex-wrap: wrap;
}
.access-form input {
  flex: 1 1 240px; padding: 15px 18px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font: inherit; font-size: 15px;
  outline: none; transition: border-color .2s;
}
.access-form input:focus { border-color: var(--accent); }
.access-form button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 26px; border: 0; border-radius: 12px;
  background: var(--accent); color: #1a1212;
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: background .2s, transform .15s;
}
.access-form button:hover { background: var(--accent2); transform: translateY(-1px); }
.access-form button:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-arrow { font-weight: 400; }

.form-msg { margin-top: 12px; min-height: 20px; font-size: 14px; color: var(--text-dim); }
.form-msg[data-state="error"] { color: #e88; }
.form-msg[data-state="ok"] { color: var(--accent); }

.hero-bullets { margin-top: 34px; list-style: none; display: grid; gap: 12px; }
.hero-bullets li {
  position: relative; padding-left: 24px;
  color: #b5b0b0; font-size: 14.5px; line-height: 1.55; font-weight: 300;
}
.hero-bullets li::before {
  content: ""; position: absolute; left: 2px; top: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

/* ---------- Library ---------- */
.library {
  position: relative; z-index: 1; flex: 1;
  width: 100%; max-width: 820px; margin: 0 auto;
  padding: clamp(16px, 4vh, 40px) 20px 60px;
}
.library-head h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(38px, 7vw, 60px);
  line-height: 1.05; letter-spacing: .02em; font-weight: 400;
}
.library-head p { margin-top: 10px; color: #c9c4c4; font-weight: 300; }
.library-head strong { color: var(--accent); font-weight: 600; }

.searchbox { margin-top: 22px; }
.searchbox input {
  width: 100%; padding: 16px 20px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 14px;
  color: var(--text); font: inherit; font-size: 16px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.searchbox input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240,160,160,.12);
}

.cards { margin-top: 26px; display: grid; gap: 14px; }

.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; transition: border-color .2s;
}
.card.open { border-color: rgba(240,160,160,.45); }
.card-head {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 18px; background: none; border: 0; cursor: pointer;
  color: inherit; font: inherit; text-align: left;
}
.chip {
  flex-shrink: 0;
  font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: .12em;
  color: var(--accent); background: rgba(240,160,160,.10);
  border: 1px solid rgba(240,160,160,.35);
  padding: 5px 12px 3px; border-radius: 8px;
}
.card-titles { display: grid; gap: 4px; flex: 1; }
.card-title { font-weight: 600; font-size: 15.5px; }
.card-desc { color: var(--text-dim); font-size: 13.5px; line-height: 1.5; font-weight: 300; }
.card-caret { color: var(--text-dim); transition: transform .2s; }
.card.open .card-caret { transform: rotate(180deg); }

.card-body { padding: 0 18px 18px; }
.prompt-text {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; font-size: 13px; line-height: 1.6;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  white-space: pre-wrap; word-break: break-word;
  color: #d9d4d4;
  max-height: 340px; overflow-y: auto;
}
.card-actions { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.copy-btn {
  padding: 11px 20px; border: 0; border-radius: 10px;
  background: var(--accent); color: #1a1212;
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background .2s;
}
.copy-btn:hover { background: var(--accent2); }
.copy-hint { color: var(--text-dim); font-size: 12.5px; }

.no-results {
  margin-top: 30px; color: var(--text-dim); text-align: center;
  font-size: 14.5px; line-height: 1.6;
}

.cta-strip {
  margin-top: 44px; padding: 26px;
  background: linear-gradient(135deg, rgba(240,160,160,.10), rgba(240,160,160,.03));
  border: 1px solid rgba(240,160,160,.25); border-radius: 18px;
  text-align: center;
}
.cta-strip h2 {
  font-family: 'Bebas Neue', sans-serif; font-weight: 400;
  font-size: 26px; letter-spacing: .03em;
}
.cta-strip p { margin-top: 6px; color: #c9c4c4; font-size: 14.5px; font-weight: 300; }
.cta-btn {
  display: inline-block; margin-top: 16px; padding: 13px 26px;
  background: var(--accent); color: #1a1212; text-decoration: none;
  border-radius: 12px; font-weight: 700; font-size: 14.5px;
  transition: background .2s, transform .15s;
}
.cta-btn:hover { background: var(--accent2); transform: translateY(-1px); }

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 22px clamp(18px, 4vw, 44px);
  border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 13px;
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-dim); text-decoration: none; transition: color .2s;
}
.footer-brand:hover { color: var(--text); }
.footer-brand b { color: var(--accent); font-weight: 800; }
.footer-brand i { font-style: normal; font-weight: 300; }

@media (max-width: 560px) {
  .topbar .eyebrow { display: none; }
  .card-head { padding: 15px; gap: 10px; }
  .footer { flex-direction: column; align-items: flex-start; }
}
