/* Havuz — Pookin panel
   Palet: sıcak mürekkep zemin, kemik beyazı metin, pirinç vurgu, kiremit uyarı. */
:root {
  --ink: #0f0e0c;
  --ink-2: #161512;
  --ink-3: #1d1b17;
  --line: #2b2822;
  --line-2: #3a362e;
  --bone: #ece5d6;
  --bone-2: #b9b1a1;
  --mute: #847c6d;
  --brass: #d8a24a;
  --brass-2: #f0c47a;
  --brass-ink: #1a1307;
  --clay: #c9573b;
  --sage: #8fa58a;

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--bone);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: -20vmax;
  background:
    radial-gradient(40vmax 30vmax at 85% -5%, rgba(216,162,74,.16), transparent 60%),
    radial-gradient(35vmax 30vmax at -10% 110%, rgba(201,87,59,.10), transparent 60%);
  pointer-events: none; z-index: 0;
  animation: drift 24s var(--ease) infinite alternate;
}
@keyframes drift { to { transform: translate3d(-3vmax, 2vmax, 0) rotate(4deg); } }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, header, .sheet, .toast { position: relative; z-index: 2; }

::selection { background: var(--brass); color: var(--brass-ink); }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.muted { color: var(--mute); }
.eyebrow {
  font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--brass); display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }

.display {
  font: 400 clamp(52px, 9vw, 112px)/.92 var(--serif);
  letter-spacing: -.02em; margin: 0;
}
.display em { font-style: italic; color: var(--brass-2); }
.display--sm { font-size: clamp(38px, 6.2vw, 72px); }
.display--xs { font-size: clamp(28px, 4vw, 40px); }

.mark { display: inline-flex; align-items: center; gap: 10px; font: 600 15px/1 var(--sans); letter-spacing: -.01em; }
.mark i { font: italic 400 17px/1 var(--serif); color: var(--mute); }
.mark__ring { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--brass); box-shadow: 0 0 18px rgba(216,162,74,.45); }

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--sm { --h: 36px; padding: 0 16px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--brass); color: var(--brass-ink); }
.btn--primary:hover { background: var(--brass-2); }
.btn--primary svg { transition: transform .3s var(--ease); }
.btn--primary:hover svg { transform: translateX(4px); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--bone); }
.btn--ghost:hover { border-color: var(--bone-2); }
.btn--danger { background: transparent; border-color: rgba(201,87,59,.45); color: #e58a72; }
.btn--danger:hover { background: rgba(201,87,59,.12); }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Fields ---------- */
.field { display: grid; gap: 8px; }
.field > span { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--bone-2); }
.field input, .field textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 14px 16px; font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 84px; font-size: 15px; }
.field input:focus, .field textarea:focus { border-color: var(--brass); box-shadow: 0 0 0 4px rgba(216,162,74,.12); }
.field input::placeholder, .field textarea::placeholder { color: #5b554a; }
.field__pw { position: relative; }
.field__pw input { padding-right: 82px; }
.pwtoggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: 8px 10px; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute);
}
.pwtoggle:hover { color: var(--bone); }

.card {
  background: linear-gradient(180deg, rgba(29,27,23,.85), rgba(22,21,18,.85));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 30px 80px -30px rgba(0,0,0,.6);
}

/* ---------- Login ---------- */
.login {
  min-height: 100dvh; display: grid; gap: 48px; align-content: center;
  padding: calc(var(--pad) + env(safe-area-inset-top)) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom));
  max-width: 1180px; margin: 0 auto;
}
.login__intro .mark { margin-bottom: clamp(32px, 7vh, 72px); }
.lede { max-width: 38ch; color: var(--bone-2); font-size: 16px; margin: 28px 0 0; }
.login__form { padding: clamp(24px, 4vw, 40px); display: grid; gap: 20px; width: 100%; max-width: 440px; }
.login__form h2 { font: 400 34px/1 var(--serif); margin: -6px 0 6px; }
.form__err { min-height: 1.2em; margin: -6px 0 0; color: #e58a72; font-size: 13px; }
.login__form.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
@media (min-width: 900px) {
  .login { grid-template-columns: 1.2fr 1fr; align-items: center; gap: 64px; }
  .login__form { justify-self: end; }
}
.login > * { animation: rise .9s var(--ease) both; }
.login > *:nth-child(2) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- App shell ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: calc(14px + env(safe-area-inset-top)) var(--pad) 14px;
  background: rgba(15,14,12,.72); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.top__stats { margin-left: auto; color: var(--mute); display: none; }
@media (min-width: 640px) { .top__stats { display: block; } }
.top .btn { margin-left: auto; }
@media (min-width: 640px) { .top .btn { margin-left: 0; } }

.app { max-width: 1240px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) var(--pad) calc(80px + env(safe-area-inset-bottom)); }
.hero { margin-bottom: clamp(24px, 4vw, 40px); animation: rise .8s var(--ease) both; }

/* ---------- Drop zone ---------- */
.drop {
  position: relative; display: flex; align-items: center; gap: 20px;
  padding: clamp(22px, 4vw, 36px); border-radius: var(--r-lg); cursor: pointer;
  background: rgba(22,21,18,.6); border: 1px dashed var(--line-2);
  transition: border-color .3s, background .3s, transform .3s var(--ease);
  animation: rise .8s .08s var(--ease) both;
  -webkit-tap-highlight-color: transparent;
}
.drop:hover { border-color: var(--mute); }
.drop.is-over { border-color: var(--brass); border-style: solid; background: rgba(216,162,74,.07); transform: scale(1.01); }
.drop__orb {
  flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  color: var(--brass-ink); background: radial-gradient(circle at 30% 30%, var(--brass-2), var(--brass) 60%, #a5762c);
  box-shadow: 0 10px 40px -8px rgba(216,162,74,.55);
  transition: transform .4s var(--ease);
}
.drop:hover .drop__orb, .drop.is-over .drop__orb { transform: translateY(-3px) rotate(-6deg); }
.drop__txt { display: grid; gap: 4px; }
.drop__txt strong { font-size: 17px; font-weight: 600; }
.drop__txt .muted { font-size: 13px; }
.only-touch { display: none; }
@media (hover: none) { .only-touch { display: inline; } .only-mouse { display: none; } }

/* ---------- Upload queue ---------- */
.queue { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.queue:empty { display: none; }
.q {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center;
  padding: 14px 16px; border-radius: var(--r-md); background: var(--ink-2); border: 1px solid var(--line);
  animation: rise .4s var(--ease) both;
}
.q__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; }
.q__pct { font: 500 12px/1 var(--mono); color: var(--bone-2); }
.q__bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.q__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brass), var(--brass-2)); transition: width .25s linear; }
.q.is-done .q__bar i { background: var(--sage); }
.q.is-done .q__pct { color: var(--sage); }
.q.is-err .q__bar i { background: var(--clay); width: 100% !important; }
.q.is-err .q__pct { color: #e58a72; }

/* ---------- Library ---------- */
.lib { margin-top: clamp(40px, 7vw, 72px); }
.lib__bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.chips {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--pad) * -1); padding: 2px var(--pad); max-width: calc(100% + var(--pad) * 2);
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 760px) { .chips { margin: 0; padding: 2px; max-width: none; } }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--bone-2); font-size: 13px; font-weight: 500; transition: all .2s;
}
.chip:hover { color: var(--bone); border-color: var(--mute); }
.chip.is-on { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.chip sup { font: 500 10px/1 var(--mono); margin-left: 4px; opacity: .6; }
.search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--mute); width: 100%;
}
@media (min-width: 760px) { .search { width: 240px; } }
.search:focus-within { border-color: var(--brass); color: var(--bone); }
.search input { border: 0; background: none; outline: none; width: 100%; font-size: 16px; }
@media (min-width: 760px) { .search input { font-size: 14px; } }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.tile {
  text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--ink-2); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .35s var(--ease), border-color .25s, box-shadow .35s var(--ease);
  animation: rise .5s var(--ease) both;
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 20px 40px -20px rgba(0,0,0,.7); }
.tile:active { transform: scale(.98); }
.tile__art {
  aspect-ratio: 4 / 3; display: grid; place-items: center; position: relative; overflow: hidden;
  background:
    linear-gradient(45deg, #1a1915 25%, transparent 25%, transparent 75%, #1a1915 75%) 0 0 / 16px 16px,
    linear-gradient(45deg, #1a1915 25%, transparent 25%, transparent 75%, #1a1915 75%) 8px 8px / 16px 16px,
    #14130f;
}
.tile__art img { width: 100%; height: 100%; object-fit: contain; padding: 10%; transition: transform .5s var(--ease); }
.tile:hover .tile__art img { transform: scale(1.05); }
.tile__ext {
  font: italic 400 clamp(34px, 5vw, 48px)/1 var(--serif); color: var(--bone); letter-spacing: -.02em;
  text-transform: lowercase;
}
.tile__art[data-k="archive"] { background: radial-gradient(circle at 70% 20%, rgba(216,162,74,.18), transparent 60%), #15130f; }
.tile__art[data-k="archive"] .tile__ext { color: var(--brass-2); }
.tile__art[data-k="design"] { background: radial-gradient(circle at 30% 80%, rgba(201,87,59,.2), transparent 60%), #15130f; }
.tile__art[data-k="font"] { background: radial-gradient(circle at 50% 50%, rgba(143,165,138,.18), transparent 60%), #15130f; }
.tile__art[data-k="font"] .tile__ext { font-style: normal; }
.tile__kind {
  position: absolute; left: 10px; top: 10px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  padding: 5px 7px; border-radius: 6px; background: rgba(15,14,12,.75); color: var(--bone-2); backdrop-filter: blur(6px);
}
.tile__meta { padding: 12px 14px 14px; display: grid; gap: 4px; border-top: 1px solid var(--line); }
.tile__name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile__sub { font: 400 11px/1.3 var(--mono); color: var(--mute); display: flex; gap: 8px; }
.tile__note { font-size: 12px; color: var(--bone-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 64px 16px; border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty p { margin: 0 0 8px; }

/* ---------- Sheet (mobil: alttan, masaüstü: ortada) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; }
.sheet[hidden] { display: none; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(8,7,6,.66); backdrop-filter: blur(4px); animation: fade .3s both; }
.sheet__panel {
  position: relative; background: var(--ink-2); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0; max-height: 92dvh; overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
  animation: up .45s var(--ease) both;
}
.sheet__grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 10px auto 0; }
.sheet__preview {
  margin: 14px 14px 0; border-radius: var(--r-md); min-height: 180px; max-height: 42dvh; display: grid; place-items: center; overflow: hidden;
  background:
    linear-gradient(45deg, #1d1b17 25%, transparent 25%, transparent 75%, #1d1b17 75%) 0 0 / 20px 20px,
    linear-gradient(45deg, #1d1b17 25%, transparent 25%, transparent 75%, #1d1b17 75%) 10px 10px / 20px 20px,
    #171512;
}
.sheet__preview img { max-width: 100%; max-height: 42dvh; object-fit: contain; padding: 16px; }
.sheet__preview .tile__ext { font-size: 72px; }
.sheet__body { padding: 20px 20px 24px; display: grid; gap: 16px; }
.sheet__name {
  font: 400 30px/1.1 var(--serif); background: none; border: 0; border-bottom: 1px solid transparent;
  padding: 2px 0; width: 100%; outline: none; transition: border-color .2s;
}
.sheet__name:hover { border-color: var(--line-2); }
.sheet__name:focus { border-color: var(--brass); }
.sheet__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet__actions .btn { flex: 1 1 auto; }
.sheet__x {
  position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(15,14,12,.8); font-size: 20px; line-height: 1; display: none;
}
@media (min-width: 760px) {
  .sheet { place-items: center; }
  .sheet__panel { width: min(560px, 92vw); border-radius: var(--r-lg); border-bottom: 1px solid var(--line); animation: pop .4s var(--ease) both; }
  .sheet__grip { display: none; }
  .sheet__x { display: block; }
}
@keyframes up { from { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--bone); color: var(--ink); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: all .35s var(--ease); box-shadow: 0 20px 40px -10px rgba(0,0,0,.6); white-space: nowrap;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* drag overlay tüm sayfa */
body.is-dragging .drop { border-color: var(--brass); border-style: solid; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
