:root {
  --ink: #1d3350;
  --ink-deep: #142440;
  --sage: #5f7290;
  --mist: #dde3ec;
  --paper: #f6f4ec;
  --paper-deep: #ece8db;
  --gold: #b58644;
  --line: rgba(29, 51, 80, .15);
  --white: #fffdf8;
  --shadow: 0 18px 50px rgba(20, 36, 64, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink-deep); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
code { background: var(--paper-deep); padding: 2px 6px; border-radius: 3px; font-size: 11px; }

/* ---- Üst bant ---- */
.site-header { height: 84px; padding: 0 clamp(22px, 5vw, 80px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(246, 244, 236, .92); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50% 50% 45% 55%; color: var(--gold); font-size: 22px; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.brand small { color: var(--sage); letter-spacing: .18em; text-transform: uppercase; font-size: 9px; margin-top: 5px; }
.site-header nav { display: flex; gap: 24px; align-items: center; }

.text-button { border: 0; border-bottom: 1px solid var(--gold); background: none; color: var(--gold); cursor: pointer; padding: 4px 0; font-weight: 600; }
.text-button:hover { color: #8b622c; }

/* ---- Hero ---- */
.hero { padding: clamp(56px, 8vw, 92px) max(24px, calc((100vw - 1120px) / 2)) 64px; position: relative; overflow: hidden; background: radial-gradient(circle at 83% 35%, rgba(181, 134, 68, .12), transparent 34%), linear-gradient(145deg, #f7f5ee, #efece1); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .22; pointer-events: none; background-image: linear-gradient(rgba(29,51,80,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(29,51,80,.08) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to right, transparent, black); }
.hero > *:not(.manuscript) { position: relative; z-index: 2; }
.eyebrow, .kicker { color: var(--gold); letter-spacing: .2em; font-weight: 700; font-size: 11px; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 12px; }
.eyebrow span { width: 34px; height: 1px; background: var(--gold); }
.hero h1 { max-width: 720px; margin: 20px 0 16px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5.6vw, 66px); line-height: 1.05; font-weight: 400; letter-spacing: -.03em; }
.hero h1 em { color: var(--gold); font-style: italic; }
.hero > p { color: #5c6a80; font-size: 17px; max-width: 560px; }
.search-box { max-width: 720px; height: 70px; margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid rgba(29,51,80,.22); border-radius: 4px; background: var(--white); box-shadow: var(--shadow); }
.search-box:focus-within { border-color: rgba(181,134,68,.78); box-shadow: 0 18px 50px rgba(20,36,64,.1), 0 0 0 3px rgba(181,134,68,.14); }
.search-field { position: relative; min-width: 0; height: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 12px; padding: 0 8px 0 13px; }
.search-field svg { width: 21px; fill: none; stroke: var(--sage); stroke-width: 1.7; }
.search-field input { min-width: 0; height: 100%; padding: 0 38px 0 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; box-shadow: none; }
.search-field input::placeholder { color: #98a3b3; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-submit { height: 52px; border: 0; border-radius: 3px; padding: 0 30px; background: var(--ink); color: var(--white); font-weight: 700; cursor: pointer; }
.search-submit:hover { background: var(--ink-deep); }
.clear-search { position: absolute; top: 50%; right: 2px; width: 32px; height: 32px; margin-top: -16px; border: 0; border-radius: 50%; background: var(--paper-deep); color: var(--sage); font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.clear-search:hover { color: var(--ink); }
.hero-meta { display: flex; gap: 32px; margin-top: 22px; color: var(--sage); font-size: 13px; }
.hero-meta span + span { padding-left: 32px; border-left: 1px solid var(--line); }
.hero-meta strong { color: var(--ink); font-family: Georgia, serif; font-size: 17px; margin-right: 4px; }
.manuscript { position: absolute; right: max(-40px, calc((100vw - 1300px) / 2)); top: 60px; width: 330px; height: 400px; border: 1px solid rgba(181,134,68,.25); transform: rotate(-5deg); color: rgba(181,134,68,.22); font-size: 62px; display: grid; place-items: center; letter-spacing: .3em; text-indent: .3em; }
.manuscript::after { content: ""; position: absolute; inset: 17px; border: 1px solid rgba(181,134,68,.16); }

/* ---- Gövde ---- */
.browse-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 100px; }
.section-heading, .results-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h2, .results-header h2 { margin: 7px 0 0; font-family: Georgia, serif; font-weight: 400; font-size: 32px; }

/* Harf dizini — yalnızca kayıtlı harfler görünür */
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 26px; }
.letter { min-height: 66px; padding: 9px 5px 9px 12px; border: 1px solid var(--line); background: rgba(255,253,248,.56); color: var(--ink); cursor: pointer; transition: .18s ease; text-align: left; }
.letter strong, .letter span { display: block; }
.letter strong { font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.letter span { color: #8a94a6; font-size: 10px; margin-top: 2px; }
.letter:hover, .letter.active { transform: translateY(-2px); border-color: var(--gold); background: var(--ink); color: var(--white); }
.letter:hover span, .letter.active span { color: #c2cbd9; }

.results-header { margin-top: 66px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.results-header h2 { font-size: 27px; }
.results-header > span { color: var(--sage); font-size: 13px; }
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-top: 18px; }
.result-card { min-height: 210px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); background: rgba(255,253,248,.67); transition: .2s ease; overflow: hidden; cursor: pointer; text-align: left; }
.result-card:hover { transform: translateY(-4px); border-color: rgba(181,134,68,.6); box-shadow: var(--shadow); background: var(--white); }
.result-letter, .entry-letter { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(181,134,68,.45); color: var(--gold); border-radius: 50%; font-family: Georgia, serif; flex: 0 0 auto; }
.result-card h3 { margin: 16px 0 8px; font-family: Georgia, serif; font-size: 21px; font-weight: 400; color: var(--ink); overflow-wrap: anywhere; }
.result-card p { margin: 0 0 16px; color: #5c6a80; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.view-link { margin-top: auto; color: var(--ink); font-size: 12px; font-weight: 700; }
.view-link b { color: var(--gold); margin-left: 4px; }

.empty-state { text-align: center; padding: 70px 20px; }
.empty-state > span { color: var(--gold); font-size: 46px; }
.empty-state h3 { font-family: Georgia, serif; font-weight: 400; font-size: 24px; margin: 10px 0 6px; }
.empty-state p { color: var(--sage); margin: 0; }
.pagination { display: flex; justify-content: center; margin-top: 34px; }
.pagination button { border: 1px solid var(--line); background: var(--white); color: var(--ink); padding: 11px 22px; cursor: pointer; font-weight: 600; }
.pagination button:hover { border-color: var(--gold); color: var(--gold); }

/* ---- Kelime detayı ---- */
.back-link { display: inline-block; color: var(--sage); font-size: 14px; margin-bottom: 25px; cursor: pointer; }
.back-link:hover { color: var(--gold); }
.entry-card { border: 1px solid var(--line); background: var(--white); }
.entry-card-large { padding: clamp(26px, 5vw, 60px); box-shadow: var(--shadow); }
.entry-topline { display: flex; justify-content: space-between; align-items: center; }
.label { display: block; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 10px; }
.entry-title-row { padding: 10px 0 38px; border-bottom: 1px solid var(--line); }
.entry-title-row h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(32px, 5vw, 54px); font-weight: 400; line-height: 1.12; overflow-wrap: anywhere; }
.meaning-block { padding: 36px 0 20px; }
.meaning-list { max-width: 850px; margin: 0; padding: 0; list-style: none; counter-reset: meanings; }
.meaning-list li { position: relative; counter-increment: meanings; padding: 12px 0 12px 46px; border-bottom: 1px solid var(--line); font-family: Georgia, serif; font-size: 19px; line-height: 1.65; }
.meaning-list li:last-child { border-bottom: 0; }
.meaning-list li::before { content: counter(meanings) "."; position: absolute; left: 0; top: 12px; color: var(--gold); font-family: Georgia, serif; font-size: 18px; font-weight: 700; }
.xref { color: var(--gold); border-bottom: 1px dotted rgba(181,134,68,.6); cursor: pointer; }
.xref:hover { color: #8b622c; border-bottom-style: solid; }
.reference-block { padding: 26px 0; border-top: 1px solid var(--line); }
.reference-links { display: flex; flex-wrap: wrap; gap: 9px; }
.reference-links a { min-width: 130px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; border: 1px solid var(--line); background: #fbf8f0; color: var(--ink); transition: .15s; cursor: pointer; }
.reference-links a:hover { border-color: var(--gold); transform: translateY(-2px); }
.reference-links a b { color: var(--gold); font-weight: 400; }
.entry-actions { display: flex; gap: 10px; padding-top: 25px; border-top: 1px solid var(--line); }
.list-button { min-height: 42px; padding: 0 17px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-weight: 700; }
.list-button:hover { border-color: var(--gold); color: var(--gold); }
.danger-button { border-color: rgba(155,78,64,.35); color: #9b4e40; }
.danger-button:hover { border-color: #9b4e40; background: #fff6f2; color: #9b4e40; }
.source-note { margin: 22px 0 0; color: #8a94a6; font-size: 11px; }

/* ---- Form ---- */
.panel { border: 1px solid var(--line); background: var(--white); box-shadow: 0 9px 30px rgba(20,36,64,.05); }
.form-panel { max-width: 720px; padding: 34px; }
.form-panel h2 { margin: 0 0 24px; font-family: Georgia, serif; font-size: 30px; font-weight: 400; }
.form-panel label { display: grid; gap: 7px; margin-bottom: 17px; color: #4a5c78; font-size: 12px; font-weight: 700; }
.form-panel label small { color: var(--sage); font-size: 10px; font-weight: 400; }
input, textarea { width: 100%; border: 1px solid rgba(29,51,80,.2); border-radius: 3px; background: #fdfbf5; color: var(--ink-deep); outline: 0; }
input { height: 46px; padding: 0 13px; }
textarea { padding: 11px 13px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(181,134,68,.1); }
.form-actions { display: flex; gap: 8px; margin-top: 6px; }
.primary-button { min-height: 48px; border: 0; border-radius: 3px; padding: 0 30px; background: var(--ink); color: var(--white); font-weight: 700; cursor: pointer; }
.primary-button:hover { background: var(--ink-deep); }
.secondary-button { border: 1px solid var(--line); background: transparent; color: var(--ink); padding: 10px 18px; cursor: pointer; }
.secondary-button:hover { border-color: var(--gold); }
.form-error { color: #a53e36; font-size: 12px; }

/* ---- Alt bant ---- */
.site-footer { min-height: 96px; padding: 26px clamp(22px, 5vw, 80px); display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); color: var(--sage); font-size: 12px; }
.site-footer span:first-child { color: var(--ink); font-family: Georgia, serif; font-size: 16px; }

@media (max-width: 940px) {
  .manuscript { opacity: .4; right: -160px; }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 660px) {
  .site-header { height: 70px; padding: 0 18px; }
  .brand-mark { width: 38px; height: 38px; font-size: 18px; }
  .brand strong { font-size: 16px; }
  .hero { padding: 48px 20px 48px; }
  .hero h1 { font-size: 37px; }
  .hero > p { font-size: 15px; }
  .search-box { height: auto; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; }
  .search-field { min-height: 48px; }
  .search-field input { height: 48px; }
  .search-box .search-submit { width: 100%; height: 46px; }
  .hero-meta { gap: 13px; }
  .hero-meta span + span { padding-left: 13px; }
  .browse-shell { width: min(100% - 28px, 1120px); padding-top: 46px; }
  .letters { grid-template-columns: repeat(4, 1fr); }
  .results-grid { grid-template-columns: 1fr; }
  .result-card { min-height: 0; }
  .meaning-list li { font-size: 17px; }
  .form-panel { padding: 24px; }
  .site-footer { align-items: start; flex-direction: column; }
}
