:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --ink: #1c1b18;
  --ink-2: #5d5a52;
  --ink-3: #8f8b81;
  --line: #e4e0d6;
  --line-strong: #d6d1c4;
  --accent: #e8501c;
  --accent-ink: #ffffff;
  --accent-soft: #fde7de;
  --down: #4b55c9;
  --down-soft: #e5e7fb;
  --danger: #c62f2f;
  --gold: #d99a06;
  --silver: #8b94a3;
  --bronze: #b86b3c;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(28, 27, 24, .04), 0 6px 20px rgba(28, 27, 24, .05);
  --shadow-hover: 0 2px 4px rgba(28, 27, 24, .05), 0 12px 32px rgba(28, 27, 24, .09);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1d1c1a;
    --surface-2: #272623;
    --ink: #f1efe9;
    --ink-2: #b4b0a6;
    --ink-3: #85827a;
    --line: #2f2e2a;
    --line-strong: #3d3b36;
    --accent: #ff6a3a;
    --accent-ink: #1a0d07;
    --accent-soft: #3a2018;
    --down: #8d95ff;
    --down-soft: #23264a;
    --danger: #ff6b6b;
    --gold: #f0b429;
    --silver: #a9b1bd;
    --bronze: #d08a5b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-hover: 0 2px 6px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: inherit; }

button, input, textarea { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Üst çubuk ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 19px;
  letter-spacing: -.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding-bottom: 3px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--accent);
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}

.brand-tld { color: var(--accent); }

.brand-sm { font-size: 16px; gap: 8px; }
.brand-sm .brand-mark { width: 26px; height: 26px; font-size: 17px; border-radius: 7px; }

/* ---------- Giriş bölümü ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(640px 320px at 88% -12%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(520px 280px at -6% 112%, color-mix(in srgb, var(--down) 10%, transparent), transparent 70%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .7), transparent 85%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .7), transparent 85%);
  pointer-events: none;
}

.hero-inner { position: relative; padding-top: 64px; padding-bottom: 36px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 6.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 850;
  max-width: 14ch;
}

.hl {
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}
.hl::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .04em;
  height: .14em;
  border-radius: 99px;
  background: var(--accent);
  opacity: .22;
}

.lead {
  margin: 0;
  max-width: 560px;
  color: var(--ink-2);
  font-size: clamp(16px, 2.2vw, 18.5px);
  line-height: 1.6;
}

/* ---------- Butonlar ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }

.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  margin: -4px -6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
}
.link-btn:hover { color: var(--ink); background: var(--surface-2); }
.link-btn.danger { color: var(--danger); }

/* ---------- Araç çubuğu: sekmeler + arama ---------- */

.sites { scroll-margin-top: 64px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tabs {
  display: inline-flex;
  flex: none;
  padding: 4px;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 12px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.tab[aria-selected="true"] svg { color: var(--accent); }

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 300px;
  color: var(--ink-3);
}
.search svg { position: absolute; left: 12px; pointer-events: none; }
.search input {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search kbd {
  position: absolute;
  right: 10px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-3);
  font: 600 12px/1.4 var(--font);
  pointer-events: none;
}
.search input:focus ~ kbd,
.search input:not(:placeholder-shown) ~ kbd { display: none; }
@media (hover: none), (max-width: 560px) {
  .search kbd { display: none; }
  .search input { padding-right: 12px; }
}

/* ---------- Site kartları ---------- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.site {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  padding: 18px 20px 18px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.site:not(.skeleton):hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.site.flash { animation: flash 1.8s ease-out; }
@keyframes flash {
  0%, 30% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
  100% { border-color: var(--line); box-shadow: var(--shadow); }
}

/* Oy kutusu */
.vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  gap: 2px;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-2);
}

.vote-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .12s, color .12s, transform .1s;
}
.vote-btn:active { transform: scale(.9); }
.vote-btn.up:hover { background: var(--accent-soft); color: var(--accent); }
.vote-btn.down:hover { background: var(--down-soft); color: var(--down); }
.vote-btn.up[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.vote-btn.down[aria-pressed="true"] { background: var(--down); color: #fff; }

.score {
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  text-align: center;
  line-height: 1.6;
}
.site[data-vote="1"] .score { color: var(--accent); }
.site[data-vote="-1"] .score { color: var(--down); }
.score.bump { animation: bump .3s ease-out; }
@keyframes bump {
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.site-main { min-width: 0; }

.site-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 19px;
  color: #fff;
}

.site-titles { min-width: 0; flex: 1; }

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.site-title {
  font-weight: 750;
  font-size: 17.5px;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.site-title:hover { color: var(--accent); }

.badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .02em;
  line-height: 1.6;
}
.badge-new { background: var(--accent-soft); color: var(--accent); }

/* Popüler sıralamada ilk 3: altın / gümüş / bronz */
.badge-rank[data-rank="1"] { --medal: var(--gold); }
.badge-rank[data-rank="2"] { --medal: var(--silver); }
.badge-rank[data-rank="3"] { --medal: var(--bronze); }
.badge-rank {
  background: color-mix(in srgb, var(--medal) 18%, transparent);
  color: color-mix(in srgb, var(--medal) 72%, var(--ink));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--medal) 35%, transparent);
}

.site-host {
  display: block;
  color: var(--ink-3);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visit { flex: none; align-self: flex-start; }

.purpose {
  margin: 12px 0 0;
  color: var(--ink-2);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.purpose.clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.more-text { margin-top: 2px; color: var(--accent); font-weight: 600; }
.more-text:hover { color: var(--accent); }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 13.5px;
}

/* ---------- Yorumlar ---------- */

.comments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.comment-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 12px;
}
.comment-list:empty { display: none; }

.comment { display: flex; gap: 10px; }

.comment-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 750;
  color: #fff;
}

.comment-main {
  flex: 1;
  min-width: 0;
  padding: 8px 12px 10px;
  background: var(--surface-2);
  border-radius: 4px 12px 12px 12px;
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
}
.comment-name { font-weight: 700; }
.comment-time { color: var(--ink-3); }
.comment-head .del-comment { margin-left: auto; }

.comment-body {
  margin: 2px 0 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.comment-form { display: grid; gap: 8px; }
.comment-actions { display: flex; justify-content: flex-end; }

/* ---------- Form alanları ---------- */

input[type="text"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 44px; }
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
::placeholder { color: var(--ink-3); }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 650; font-size: 14px; }
.field small { color: var(--ink-3); font-weight: 400; font-size: 12.5px; }
.counter { justify-self: end; font-variant-numeric: tabular-nums; }

.form-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
  font-size: 14px;
}

/* Bot tuzağı: ekranda görünmez */
.hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

/* ---------- Pencere ---------- */

.dialog {
  width: min(540px, calc(100% - 24px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.dialog[open] { animation: pop .18s ease-out; }
.dialog::backdrop { background: rgba(20, 18, 14, .5); backdrop-filter: blur(2px); }
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
}

.dialog-body { padding: 22px 24px 24px; }

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.dialog-head h2 { margin: 0; font-size: 21px; letter-spacing: -.015em; }
.dialog-sub { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* ---------- Yükleniyor iskeleti ---------- */

.skeleton { pointer-events: none; }
.sk {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.sk-vote { width: 48px; height: 96px; border-radius: 13px; }
.sk-title { width: 45%; height: 20px; margin: 4px 0 16px; }
.sk-line { width: 92%; height: 13px; margin-bottom: 9px; }
.sk-line.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Boş durumlar ---------- */

.empty {
  padding: 48px 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}
.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; }
.empty p { margin: 0 0 18px; color: var(--ink-2); }

.more-wrap { display: flex; justify-content: center; padding: 20px 0 8px; }

/* ---------- Alt bilgi ---------- */

.footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  min-height: 72px;
  padding-top: 16px;
  padding-bottom: 16px;
  color: var(--ink-2);
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 14.5px;
  text-decoration: none;
}
.contact:hover { color: var(--accent); }
.contact:hover span { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Bildirim ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14.5px;
  font-weight: 550;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  animation: pop .18s ease-out;
}

.admin-only { display: none; }
body.is-admin .admin-only { display: inline-flex; }

/* ---------- Mobil ---------- */

@media (max-width: 720px) {
  .toolbar { flex-wrap: wrap; }
  .search { max-width: none; order: -1; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { height: 58px; }
  .topbar .btn span { display: none; }
  .topbar .btn { width: 40px; padding: 0; }
  .hero-inner { padding-top: 40px; padding-bottom: 28px; }
  .sites { scroll-margin-top: 58px; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; }
  .site { grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 14px 14px 10px; }
  .vote { padding: 3px; }
  .vote-btn { width: 36px; height: 32px; }
  .avatar { width: 38px; height: 38px; font-size: 16px; border-radius: 10px; }
  .site-title { font-size: 16.5px; }
  .visit { width: 34px; padding: 0; }
  .visit span { display: none; }
}

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