/* SORA kimliği: şarap bordosu + krem, dar yüksek kontrastlı serif */
:root {
  --wine: #4e1420;
  --wine-deep: #340c15;
  --cream: #f1ebe1;
  --paper: #f1ebe1;
  --paper-2: #e6ddcf;
  --ink: #2b1317;
  --muted: #7b6a66;
  --accent: #4e1420;
  --accent-ink: #f1ebe1;
  --line: rgba(78, 20, 32, .16);
  --card: #f7f2ea;
  --display: "Instrument Serif", "Didot", Georgia, serif;
  --italic: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #170a0d;
    --paper-2: #24111a;
    --ink: #f1ebe1;
    --muted: #b7a69f;
    --accent: #e9d9c8;
    --accent-ink: #340c15;
    --line: rgba(241, 235, 225, .14);
    --card: #1f0e13;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Hero — bordo panel + fular fotoğrafı */
.hero { display: grid; background: var(--wine); color: var(--cream); }
@media (min-width: 900px) { .hero { grid-template-columns: 1.15fr 1fr; min-height: 640px; } }
.hero-img {
  min-height: 300px; order: -1;
  background: url("/hero.jpg") center 40% / cover no-repeat;
  box-shadow: inset 0 -80px 80px -40px var(--wine);
}
@media (min-width: 900px) { .hero-img { order: 0; min-height: 0; box-shadow: inset 120px 0 120px -60px var(--wine); } }
.hero-text { padding: 32px 16px 40px; display: flex; flex-direction: column; justify-content: center; }
@media (min-width: 720px) { .hero-text { padding: 56px 48px 56px max(32px, calc((100vw - 1280px) / 2 + 32px)); } }

.brandline { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; }
.mark {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--cream); flex: none;
}
.mark img { width: 62%; height: auto; display: block; }
.foot-logo { width: 54px; height: auto; display: block; margin: 0 auto 14px; }
@media (prefers-color-scheme: dark) { .foot-logo { content: url("/logo-cream.png"); } }
.club { font-size: 11px; letter-spacing: .42em; text-transform: uppercase; opacity: .85; }

.hero h1 {
  margin: 0; font: 400 clamp(46px, 8.5vw, 96px)/.92 var(--display);
  text-transform: uppercase; letter-spacing: -.01em;
}
.sub { margin: 18px 0 4px; font: italic 500 clamp(20px, 2.4vw, 26px)/1.2 var(--italic); }
.meta { margin: 0; font-size: 11px; letter-spacing: .28em; text-transform: uppercase; opacity: .72; }
.lede { margin: 26px 0 28px; max-width: 42ch; font-size: 15px; opacity: .85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Buttons — editoryal, köşeli */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: 2px;
  border: 1px solid var(--line); background: transparent;
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.12); }
.hero .btn.primary { background: var(--cream); color: var(--wine); }
.hero .btn.outline { border-color: rgba(241, 235, 225, .5); color: var(--cream); }
.hero .btn.outline:hover { background: rgba(241, 235, 225, .1); }
.btn.ghost { background: transparent; }
.btn.small { padding: 9px 14px; font-size: 11px; }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: progress; }

/* Toolbar */
.toolbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.toolbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; border: 0; border-bottom: 1px solid transparent; background: none; padding: 10px 12px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.count { opacity: .6; font-variant-numeric: tabular-nums; margin-left: 2px; }

/* Grid */
.status { padding: 40px 0; color: var(--muted); text-align: center; }
.status:empty { display: none; }
.grid { columns: 2 160px; column-gap: 8px; padding: 16px 0 40px; }
@media (min-width: 720px) { .grid { columns: 4 220px; column-gap: 12px; } }
.tile {
  position: relative; display: block; width: 100%;
  margin: 0 0 8px; padding: 0; border: 0; border-radius: 2px; overflow: hidden;
  background: var(--paper-2); cursor: zoom-in; break-inside: avoid;
}
@media (min-width: 720px) { .tile { margin-bottom: 12px; } }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s ease, transform .4s ease; }
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.02); }
.tile .badge {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 6px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 500;
}
.tile .badge svg { width: 14px; height: 14px; fill: #fff; stroke: none; }
.tile .who { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .noprev { display: grid; place-items: center; aspect-ratio: 1; color: var(--muted); font-size: 13px; padding: 12px; text-align: center; }
.tile .check {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.25); display: none; place-items: center;
}
.tile .check svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 3; opacity: 0; }
body.selecting .tile { cursor: pointer; }
body.selecting .tile .check { display: grid; }
.tile.selected .check { background: var(--wine); border-color: #fff; }
.tile.selected .check svg { opacity: 1; }
.tile.selected img { transform: scale(.94); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.foot { padding: 40px 16px 120px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); text-align: center; }
.foot-brand { font: 400 13px var(--sans); letter-spacing: .5em; text-transform: uppercase; color: var(--ink); margin: 0 0 8px; }

/* Selection bar */
.selbar {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  width: calc(100% - 32px); max-width: 560px; padding: 10px 10px 10px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.18);
}
#selCount { font-weight: 600; margin-right: auto; }
.selbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Viewer */
.viewer { position: fixed; inset: 0; z-index: 20; background: #0d0e10; color: #fff; display: flex; flex-direction: column; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 12px 10px 18px; font-size: 13px; color: rgba(255,255,255,.75); }
#viewerInfo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 4px; }
.viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 0 max(12px, env(safe-area-inset-bottom)); touch-action: pan-y pinch-zoom; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(127,127,127,.18); }
.icon-btn.danger { color: #ff8a7a; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; display: grid; place-items: center; }
.nav:hover { background: rgba(255,255,255,.22); }
.nav.prev { left: 12px; } .nav.next { right: 12px; }
@media (hover: none) { .nav { display: none; } }

/* Upload modal */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(10,10,12,.5); display: grid; place-items: end center; }
@media (min-width: 640px) { .modal { place-items: center; } }
.modal-card { width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; background: var(--card); border-radius: 4px 4px 0 0; padding: 20px 20px max(24px, env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .modal-card { border-radius: 4px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font: 400 30px/1.1 var(--display); }
.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.field input { font: inherit; font-size: 16px; color: var(--ink); padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 28px 16px; border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 2px; text-align: center; cursor: pointer; color: var(--muted); font-size: 13px; }
.drop.over { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.drop svg { width: 28px; height: 28px; color: var(--accent); }
.drop strong { color: var(--ink); font-size: 16px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.queue { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.queue li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--paper); }
.queue .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .state { color: var(--muted); }
.queue .state.ok { color: #3d8a5a; } .queue .state.err { color: #c43d2c; }
.queue progress { grid-column: 1 / -1; width: 100%; height: 4px; appearance: none; border: 0; border-radius: 4px; overflow: hidden; background: var(--line); }
.queue progress::-webkit-progress-bar { background: var(--line); }
.queue progress::-webkit-progress-value { background: var(--accent); }
.queue progress::-moz-progress-bar { background: var(--accent); }

.toast { position: fixed; left: 50%; top: 16px; transform: translate(-50%, calc(-100% - 32px)); visibility: hidden; z-index: 40; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 14px; transition: transform .25s ease; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

.savesheet {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); max-width: 480px; padding: 10px 8px 10px 18px;
  background: var(--wine); color: var(--cream); border-radius: 4px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
#saveText { margin-right: auto; font-size: 14px; }
.savesheet .btn.primary { background: var(--cream); color: var(--wine); }
