/* Modern UI (no frameworks) */

:root{
  --bg0:#070A14;
  --bg1:#0B1227;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.10);
  --stroke: rgba(255,255,255,.14);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --radius: 18px;
  --primary: #7C5CFF;
  --primary2:#4BE7C8;
}

*{box-sizing:border-box}
button,input,select,textarea{font:inherit;color:inherit}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  /* Project typography */
  font: 16px/1.55 "Lora", ui-serif, Georgia, "Times New Roman", serif;
  background: radial-gradient(1200px 600px at 15% 10%, rgba(124,92,255,.18), transparent 60%),
              radial-gradient(900px 450px at 80% 15%, rgba(75,231,200,.12), transparent 55%),
              linear-gradient(180deg,var(--bg0),var(--bg1));
}

a{color:inherit}
.muted{color:var(--muted)}
hr{border:none;border-top:1px solid var(--stroke);margin:24px 0}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px;
  background: rgba(7,10,20,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
}

.brand{display:flex; gap:12px; align-items:center}
.brand__icon{width:38px;height:38px;border-radius:10px;box-shadow:var(--shadow)}
.brand__title{font-weight:700; letter-spacing:.2px}
.brand__subtitle{font-size:13px; color:var(--muted)}

.topbar__actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.btn{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:600;
  font-size: 15px;
}
.btn:hover{background: rgba(255,255,255,.10)}
.btn--primary{
  border-color: rgba(124,92,255,.55);
  background: linear-gradient(90deg, rgba(124,92,255,.92), rgba(75,231,200,.78));
  color:#061018;
}
.btn--ghost{
  background: rgba(255,255,255,.03);
}

.layout{max-width: 1240px; margin: 0 auto; padding: 18px 16px 40px}
.hero{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
  align-items: stretch;
  margin-top: 10px;
}
.hero__copy, .hero__art{
  border: 1px solid var(--stroke);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.hero h1{margin: 6px 0 10px; font-size: 30px; line-height:1.15}
.hero p{margin:0 0 14px}
.details summary{cursor:pointer; color: var(--muted); font-weight:600; margin-bottom:8px}
.details ul{margin:10px 0 0; padding-left: 18px; color: var(--muted)}
.hero__art{position:relative; overflow:hidden}
.hero__img{width:70%; max-width: 980px; height:auto; display:block; margin: 0 auto; border-radius: 14px; border:1px solid rgba(255,255,255,.10)}
.hero__badge{
  position:absolute; top:14px; left:14px;
  padding:8px 10px;
  background: rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  font-weight:700;
  font-size: 12px;
}

.loader{margin-top: 12px}
.loader__label{font-weight:700; margin-bottom: 10px}
.progress{height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); overflow:hidden}
.progress__bar{height:100%; background: linear-gradient(90deg, rgba(124,92,255,.92), rgba(75,231,200,.78)); width:0%}
.loader__hint{margin-top: 8px; font-size: 13px; color: var(--muted)}

.grid{
  margin-top: 18px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.panel{
  border: 1px solid var(--stroke);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel__header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255,255,255,.03);
}
.panel__header h2{margin:0; font-size: 18px}
.panel__headerActions{display:flex; gap:8px; flex-wrap:wrap}
.panel__footerActions{display:flex; gap:8px; justify-content:center; padding-top: 10px; flex-wrap:wrap}
.panel__content{padding: 14px 16px 16px}

.controls{display:flex; flex-direction:column; gap: 12px; margin-bottom: 12px}
.controls__row{display:flex; flex-direction:column; gap: 10px}
.controls__row--sliders{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items:end;
}
.label{font-weight:700; color: var(--muted)}
.chips{display:flex; flex-wrap:wrap; gap: 8px}
.chip{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 999px;
  cursor:pointer;
  font-weight:600;
}
.chip:hover{background: rgba(255,255,255,.10)}

.slider label{display:flex; justify-content:space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 6px}
input[type="range"]{width:100%}

.toggle{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-weight:700;
  white-space:nowrap;
}
.toggle input{width:18px;height:18px}

canvas{
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
}
.oscilloscope{margin-bottom: 10px}
.imageCanvas{
  display:block;
  width:100%;
  height:auto;
  background: #000;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: var(--shadow);
  image-rendering: auto;
}

.footer{
  margin-top: 18px;
  padding: 14px 4px 0;
  border-top: 1px solid var(--stroke);
}


/* Intro overlay */
.introOverlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.70);
}
.introOverlay__card{
  width: min(1000px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  background: rgba(10,16,40,.92);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0,0,0,.65);
  padding: 18px 18px 14px;
}
.introOverlay__text p{
  font-size: 18px;
  margin:0 0 24px;
  margin-top: 14px;
  padding: 0px 18px 0px;
}

.introOverlay__actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding-top: 6px;
}

/* Responsive */
@media (max-width: 980px){
  .hero{grid-template-columns: 1fr}
  .grid{grid-template-columns: 1fr}
  .controls__row--sliders{grid-template-columns: 1fr 1fr; }
  .toggle{grid-column: 1 / -1; justify-content:flex-start}
}
