/* Studio Web — gece atölyesi konsolu
   is-mürekkebi zemin + bakır/amber aksan · Fraunces serif + Inter + JetBrains Mono */

:root {
  --ink: #0c0b09;
  --ink-2: #14120e;
  --ink-3: #1d1a14;
  --line: rgba(214, 168, 96, .14);
  --copper: #d6a860;
  --copper-hi: #f0c887;
  --amber: #e8b15c;
  --text: #ece5d8;
  --text-dim: #9a917f;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --r: 14px;
}

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

html, body { height: 100%; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
}

/* ambient canvas — tüm zeminde partikül alanı */
#ambient {
  position: fixed; inset: 0;
  z-index: 0;
  opacity: .55;
}

.frame {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100dvh;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px 14px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  color: var(--copper);
  font-size: 20px;
  display: inline-block;
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.brand-name {
  font-family: var(--serif);
  font-size: 21px; font-weight: 600;
  letter-spacing: .01em;
}
.brand-dot { color: var(--copper); }
.brand-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.meta { display: flex; align-items: center; gap: 12px; }
.budget {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--copper-hi);
  background: rgba(214, 168, 96, .08);
  border: 1px solid var(--line);
  padding: 4px 11px;
  border-radius: 99px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #57d98a;
  box-shadow: 0 0 0 0 rgba(87, 217, 138, .6);
  animation: pulse 2.4s ease-out infinite;
}
.pulse.err { background: #e05252; animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(87, 217, 138, .5); }
  70% { box-shadow: 0 0 0 9px rgba(87, 217, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(87, 217, 138, 0); }
}

/* ---- chat alanı ---- */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 26px 4px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214,168,96,.25) transparent;
  scroll-behavior: smooth;
}
.chat::-webkit-scrollbar { width: 5px; }
.chat::-webkit-scrollbar-thumb { background: rgba(214,168,96,.22); border-radius: 99px; }

/* boş durum */
.hello {
  min-height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  gap: 14px;
  animation: rise .8s cubic-bezier(.2,.8,.2,1) both;
}
.hello-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--copper);
}
.hello-title {
  font-family: var(--serif);
  font-size: clamp(38px, 7vw, 60px);
  font-weight: 400;
  line-height: 1.05;
}
.hello-title em { font-style: italic; color: var(--copper-hi); }
.hello-sub { color: var(--text-dim); max-width: 420px; }
.hello-chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 10px; }
.chip {
  font-family: var(--mono); font-size: 12px;
  color: var(--text);
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 15px;
  cursor: pointer;
  transition: border-color .2s, transform .2s, background .2s;
}
.chip:hover { border-color: var(--copper); transform: translateY(-2px); background: var(--ink-2); }

/* mesaj balonları */
.msg {
  display: flex; flex-direction: column;
  max-width: 78%;
  margin-bottom: 18px;
  animation: rise .45s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; margin-left: auto; align-items: flex-end; }
.msg .who {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 5px; padding: 0 4px;
}
.msg.user .who { color: rgba(214,168,96,.7); }
.bubble {
  padding: 12px 16px;
  border-radius: var(--r);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user .bubble {
  background: linear-gradient(135deg, rgba(214,168,96,.16), rgba(214,168,96,.07));
  border: 1px solid rgba(214,168,96,.28);
  border-bottom-right-radius: 4px;
}
.msg.bot .bubble {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.bubble.error { border-color: rgba(224,82,82,.45); color: #f0a0a0; }
.bubble strong { color: var(--copper-hi); }
.bubble code {
  font-family: var(--mono); font-size: 12.5px;
  background: rgba(214,168,96,.09);
  padding: 1px 6px; border-radius: 5px;
}
.bubble pre {
  background: #090806; border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; overflow-x: auto;
  margin: 8px 0; font-size: 12.5px;
}
.bubble pre code { background: none; padding: 0; }

/* üretim kartları */
.media { display: grid; gap: 8px; margin-top: 4px; }
.media img, .media video {
  width: 100%; max-width: 460px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
  animation: reveal .9s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes reveal {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}
.media a.file {
  font-family: var(--mono); font-size: 12.5px;
  color: var(--copper-hi);
  border: 1px dashed rgba(214,168,96,.4);
  border-radius: 8px; padding: 9px 13px;
  text-decoration: none;
}
.media a.file:hover { background: rgba(214,168,96,.08); }
.cost {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--text-dim); margin-top: 6px; padding: 0 4px;
}

/* çalışıyor göstergesi */
.working { display: flex; align-items: center; gap: 10px; color: var(--text-dim); }
.working .dots { display: inline-flex; gap: 4px; }
.working .dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--copper);
  animation: blink 1.2s ease-in-out infinite;
}
.working .dots i:nth-child(2) { animation-delay: .18s; }
.working .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.working .note { font-family: var(--mono); font-size: 11.5px; }

/* imleç (stream) */
.caret {
  display: inline-block; width: 8px; height: 15px;
  background: var(--copper);
  vertical-align: -2px; margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}

/* ---- composer ---- */
.composer-wrap { padding: 8px 0 18px; }
.modes {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.mode {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 99px;
  padding: 6px 13px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.mode:hover { color: var(--text); }
.mode.active {
  color: var(--copper-hi);
  border-color: rgba(214,168,96,.35);
  background: rgba(214,168,96,.08);
}
.mode-spacer { flex: 1; }
.model-select {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--text);
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  max-width: 220px;
  outline: none;
}

.gw-warn {
  font-family: var(--mono); font-size: 11px; line-height: 1.6;
  color: #f0c887;
  background: rgba(214, 168, 96, .07);
  border: 1px solid rgba(214, 168, 96, .3);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.gw-warn[hidden] { display: none; }

.opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.opts:empty { display: none; }
.opt { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.opt select, .opt input {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--text); background: var(--ink-3);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 8px; outline: none; width: auto;
  max-width: 100%;
}
.opt input[type="url"] { width: 240px; }

/* 3D kaynak seçimi */
.opt3d-source {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  width: 100%;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
}
.opt3d-source input[type="url"] {
  flex: 1; min-width: 140px;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--text); background: var(--ink-3);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 9px; outline: none;
}
.opt3d-hint { flex-basis: 100%; opacity: .75; line-height: 1.5; }
.opt3d-hint strong { color: var(--copper-hi); font-weight: 500; }
.upload-btn {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--copper-hi);
  background: rgba(214,168,96,.09);
  border: 1px dashed rgba(214,168,96,.45);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.upload-btn:hover { background: rgba(214,168,96,.16); border-color: var(--copper); }
.upload-btn:disabled { opacity: .5; cursor: default; }
.thumb {
  position: relative; display: inline-block;
}
.thumb[hidden] { display: none; }
.thumb img {
  height: 58px; width: 58px; object-fit: cover;
  border-radius: 8px; border: 1px solid rgba(214,168,96,.4);
  display: block;
}
.thumb-x {
  position: absolute; top: -7px; right: -7px;
  width: 19px; height: 19px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--copper); color: #14100a;
  font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}

/* 3D görüntüleyici */
.viewer3d {
  width: 100%; max-width: 460px; height: 320px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 40%, #171410, #0a0908);
  --poster-color: transparent;
  animation: reveal .9s cubic-bezier(.2,.8,.2,1) both;
}
.ref-thumb { max-width: 130px !important; opacity: .85; }
.ref-media { margin-bottom: 10px; }
.ref-media img { max-width: 200px; }

.composer {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 10px 10px 18px;
  transition: border-color .25s, box-shadow .25s;
}
.composer:focus-within {
  border-color: rgba(214,168,96,.5);
  box-shadow: 0 0 0 4px rgba(214,168,96,.06), 0 18px 50px -22px rgba(214,168,96,.25);
}
#input {
  flex: 1;
  background: none; border: none; outline: none; resize: none;
  color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  max-height: 160px;
}
#input::placeholder { color: rgba(154,145,127,.55); }
.send {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--copper), #a97b38);
  color: #14100a;
  display: grid; place-items: center;
  transition: transform .18s, filter .18s;
}
.send:hover { transform: translateY(-2px); filter: brightness(1.1); }
.send:active { transform: scale(.94); }
.send:disabled { opacity: .4; cursor: default; transform: none; }

/* ---- responsive ---- */
@media (max-width: 720px) {
  .frame { padding: 0 12px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 18px; }
  .topbar { padding: 12px 2px 10px; }
  .budget { font-size: 11px; padding: 3px 9px; }

  .chat { padding: 18px 2px 12px; }
  .hello-title { font-size: clamp(32px, 11vw, 44px); }
  .hello-sub { font-size: 14px; padding: 0 8px; }
  .chip { font-size: 11px; padding: 7px 12px; }

  .msg { max-width: 94%; }
  .bubble { padding: 10px 13px; font-size: 14px; }
  .media img, .media video, .viewer3d { max-width: 100%; }
  .viewer3d { height: 240px; }

  /* mod satırı: sekmeler kayar, model seçici kendi satırına tam genişlik iner */
  .modes { flex-wrap: wrap; gap: 4px; }
  .mode { font-size: 11px; padding: 6px 10px; }
  .mode-spacer { display: none; }
  .model-select { flex-basis: 100%; max-width: none; order: 10; }

  .opt { font-size: 10.5px; }
  .opt select { font-size: 11px; }
  .opt3d-source input[type="url"] { min-width: 0; flex-basis: 100%; }

  .composer { padding: 8px 8px 8px 14px; border-radius: 15px; }
  /* iOS focus zoom'unu önlemek için 16px */
  #input { font-size: 16px; }
  .send { width: 38px; height: 38px; }
  .composer-wrap { padding: 6px 0 12px; }
}

@media (max-width: 380px) {
  .hello-chips { gap: 6px; }
  .mode { padding: 5px 8px; }
}
