/* ==========================================================
   Prism Idea Forge · Styles
   (c) 2026 Prism Protocol · MIT License
   ========================================================== */

:root {
    --bg: #07060f;
    --panel: rgba(18, 16, 36, 0.72);
    --panel-solid: #121024;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(108, 99, 255, 0.45);
    --text: #ece9ff;
    --muted: #9a96b8;
    --violet: #6c63ff;
    --cyan: #00d2ff;
    --pink: #ff5ea8;
    --green: #00ffaa;
    --radius: 18px;
    --grad: linear-gradient(135deg, var(--violet), var(--cyan));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }

/* ---------- ambient background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.aurora span {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45;
    animation: drift 18s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { width: 520px; height: 520px; background: var(--violet); top: -160px; left: -120px; }
.aurora span:nth-child(2) { width: 420px; height: 420px; background: var(--cyan); top: 30%; right: -160px; animation-delay: -6s; opacity: 0.3; }
.aurora span:nth-child(3) { width: 380px; height: 380px; background: var(--pink); bottom: -180px; left: 30%; animation-delay: -12s; opacity: 0.22; }
@keyframes drift { to { transform: translate(80px, 60px) scale(1.15); } }
#stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 14px clamp(16px, 4vw, 40px);
    background: rgba(7, 6, 15, 0.6);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.05rem; }
.logo:hover { text-decoration: none; }
.logo-mark {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--grad); color: #fff; font-size: 1rem;
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.6);
    animation: spinSlow 10s linear infinite;
}
@keyframes spinSlow { to { filter: hue-rotate(360deg); } }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.mode-pill {
    font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; letter-spacing: 0.5px;
    padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line);
    color: var(--muted); background: rgba(255, 255, 255, 0.03);
}
.mode-pill.live { color: var(--green); border-color: rgba(0, 255, 170, 0.35); }
.mode-pill.live::before { content: '● '; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.ghost-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
    transition: 0.2s ease; font-size: 0.88rem;
}
.ghost-btn:hover { border-color: var(--line-strong); background: rgba(108, 99, 255, 0.12); transform: translateY(-1px); }
.icon-btn { border: none; background: transparent; cursor: pointer; font-size: 1.1rem; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); }

/* ---------- layout ---------- */
.wrap { width: min(1120px, 92vw); margin: 0 auto; padding: 56px 0 40px; }

.hero { text-align: center; max-width: 760px; margin: 0 auto 36px; animation: rise 0.8s cubic-bezier(.2, .8, .2, 1) both; }
.eyebrow {
    display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--cyan); padding: 6px 12px; border: 1px solid rgba(0, 210, 255, 0.3); border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.6rem); line-height: 1.08; letter-spacing: -1.5px; font-weight: 700; }
.gradient-text {
    background: linear-gradient(90deg, var(--violet), var(--cyan), var(--pink), var(--violet));
    background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: sheen 6s linear infinite;
    display: inline-block;
}
.gradient-text.swap { animation: sheen 6s linear infinite, wordIn 0.5s ease; }
@keyframes sheen { to { background-position: 300% 0; } }
@keyframes wordIn { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } }
.sub { color: var(--muted); margin-top: 16px; font-size: 1.08rem; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* ---------- form card ---------- */
.forge-card {
    position: relative;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
    padding: clamp(18px, 3vw, 30px);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    animation: rise 0.9s 0.1s cubic-bezier(.2, .8, .2, 1) both;
}
.forge-card::before {
    content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: conic-gradient(from var(--a), transparent 55%, var(--violet), var(--cyan), transparent 85%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    animation: rotate 7s linear infinite;
}
@property --a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes rotate { to { --a: 360deg; } }

.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.hint { opacity: 0.7; }
input, select {
    width: 100%; padding: 12px 14px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select option { background: var(--panel-solid); }
input:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.18); }
#theme { font-size: 1.05rem; padding: 15px 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font-size: 0.78rem; padding: 6px 11px; border-radius: 999px; cursor: pointer;
    background: rgba(108, 99, 255, 0.1); border: 1px solid rgba(108, 99, 255, 0.25); color: #cfcaff;
    transition: 0.2s;
}
.chip:hover { background: rgba(108, 99, 255, 0.25); transform: translateY(-1px); }

.stepper { display: grid; grid-template-columns: 44px 1fr 44px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { border: none; background: rgba(255, 255, 255, 0.04); cursor: pointer; font-size: 1.1rem; }
.stepper button:hover { background: rgba(108, 99, 255, 0.2); }
.stepper input { border: none; border-radius: 0; text-align: center; background: transparent; }

.segmented { display: inline-flex; gap: 6px; padding: 5px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); width: fit-content; }
.segmented button { width: 52px; padding: 8px 0; border-radius: 10px; border: none; background: transparent; cursor: pointer; color: var(--muted); font-weight: 600; transition: 0.2s; }
.segmented button.active { background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4); }

.forge-btn {
    grid-column: 1 / -1; position: relative; overflow: hidden;
    padding: 16px; border: none; border-radius: 14px; cursor: pointer;
    background: var(--grad); color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.3px;
    box-shadow: 0 12px 40px rgba(108, 99, 255, 0.45);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.forge-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 50px rgba(0, 210, 255, 0.45); }
.forge-btn:active { transform: scale(0.99); }
.forge-btn:disabled { filter: grayscale(0.5) brightness(0.8); cursor: progress; }
.forge-btn.small { grid-column: auto; padding: 11px 22px; font-size: 0.95rem; }
.forge-btn-glow {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(-100%); animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.kbd-hint { grid-column: 1 / -1; text-align: center; font-size: 0.75rem; color: var(--muted); margin-top: -6px; }
kbd { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); }

/* ---------- loading ---------- */
.loading { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 48px 0; }
.orb { position: relative; width: 88px; height: 88px; }
.orb span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; }
.orb span:nth-child(1) { border-top-color: var(--violet); animation: spin 1.1s linear infinite; }
.orb span:nth-child(2) { inset: 12px; border-right-color: var(--cyan); animation: spin 0.8s linear infinite reverse; }
.orb span:nth-child(3) { inset: 26px; background: var(--grad); filter: blur(8px); animation: pulse 1.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(0.7); opacity: 0.6; } }
.log { list-style: none; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--muted); min-height: 110px; text-align: left; }
.log li { animation: rise 0.35s ease both; }
.log li::before { content: '› '; color: var(--cyan); }
.log li.done::after { content: ' ✓'; color: var(--green); }

.error-box {
    margin-top: 24px; padding: 16px 18px; border-radius: 14px;
    background: rgba(255, 51, 102, 0.08); border: 1px solid rgba(255, 51, 102, 0.35); color: #ffc2d1;
    animation: rise 0.3s ease both;
}

/* ---------- results ---------- */
.results { margin-top: 44px; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.results-head h2 { font-size: 1.6rem; letter-spacing: -0.5px; }
.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.idea-grid { display: grid; gap: 22px; }

.idea {
    position: relative; overflow: hidden;
    background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: clamp(18px, 3vw, 28px);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    animation: cardIn 0.6s cubic-bezier(.2, .8, .2, 1) both;
    transition: border-color 0.25s, transform 0.25s;
}
.idea:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.idea::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(0.98); } }

.idea-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.idea-index { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--cyan); letter-spacing: 1px; }
.idea h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.6px; margin: 4px 0 2px; }
.tagline { color: #cfcaff; font-size: 1.02rem; }
.idea-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 0.74rem; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); white-space: nowrap; }
.badge.diff-Easy { color: var(--green); border-color: rgba(0, 255, 170, 0.3); }
.badge.diff-Medium { color: #ffd166; border-color: rgba(255, 209, 102, 0.3); }
.badge.diff-Hard { color: var(--pink); border-color: rgba(255, 94, 168, 0.3); }

.idea-body { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.block { background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.block.full { grid-column: 1 / -1; }
.block h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.block p { color: #dcd8f5; }
.block ul { padding-left: 18px; display: grid; gap: 6px; color: #dcd8f5; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.stack span { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; padding: 6px 10px; border-radius: 9px; background: rgba(0, 210, 255, 0.08); border: 1px solid rgba(0, 210, 255, 0.22); color: #a8ecff; }

.timeline { list-style: none; padding: 0 !important; position: relative; }
.timeline li { position: relative; padding: 0 0 14px 26px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px var(--violet); }
.timeline li::after { content: ''; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline b { color: var(--cyan); font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; display: block; }

.pitch { font-size: 1.02rem; font-style: normal; border-left: 3px solid var(--violet); padding-left: 14px; color: #ece9ff; }
.wow { display: flex; gap: 10px; align-items: flex-start; }
.wow::before { content: '⚡'; }

.idea-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- drawers ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.3s; }
.drawer.open { pointer-events: auto; }
.drawer.open::before { opacity: 1; }
.drawer-panel {
    position: absolute; top: 0; right: 0; height: 100%; width: min(420px, 92vw);
    background: #0d0b1c; border-left: 1px solid var(--line); padding: 24px;
    display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
    transform: translateX(100%); transition: transform 0.35s cubic-bezier(.2, .8, .2, 1);
}
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.drawer-panel label { margin-top: 8px; }
.provider-note { font-size: 0.78rem; color: var(--muted); }
.key-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.drawer-actions { display: flex; gap: 10px; margin-top: 12px; }
.privacy { font-size: 0.76rem; color: var(--muted); margin-top: 8px; }
.history-list { list-style: none; display: grid; gap: 10px; margin-bottom: 12px; }
.history-list li { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; transition: 0.2s; }
.history-list li:hover { border-color: var(--line-strong); background: rgba(108, 99, 255, 0.08); }
.history-list small { color: var(--muted); display: block; }
.history-list .empty { cursor: default; color: var(--muted); }

/* ---------- toast + footer ---------- */
.toast {
    position: fixed; left: 50%; bottom: 28px; z-index: 60;
    transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
    padding: 12px 18px; border-radius: 12px; background: #19163a; border: 1px solid var(--line-strong);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); transition: 0.3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.site-footer {
    width: min(1120px, 92vw); margin: 0 auto; padding: 28px 0 40px;
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem;
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
    .forge-card { grid-template-columns: 1fr 1fr; }
    .idea-body { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .forge-card { grid-template-columns: 1fr; }
    .topbar-actions .ghost-btn span { display: none; }
    .mode-pill { display: none; }
    .wrap { padding-top: 34px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
