:root {
  --night: #090d12;
  --surface: #111821;
  --surface-hover: #17212c;
  --line: #27313d;
  --text: #f5f7f8;
  --muted: #8f9ba8;
  --accent: #b7f34a;
  --accent-ink: #101608;
  --blue: #72c7ff;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { background: var(--night); color-scheme: dark; }
body { margin: 0; min-width: 300px; min-height: 100vh; background: radial-gradient(circle at 50% -20%, #172433 0, var(--night) 42%); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

.site-shell { width: min(1180px, calc(100% - 34px)); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
.masthead { height: 74px; display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-word { font: 700 27px/1 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.brand-word > span { color: var(--accent); }
.brand-divider { width: 1px; height: 20px; background: var(--line); }
.brand-caption { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .12em; }

main { flex: 1; }
.search-section { max-width: 760px; margin: 0 auto; padding: clamp(58px, 10vh, 108px) 0 48px; text-align: center; }
.search-section h1 { margin: 0; font: 400 clamp(42px, 7vw, 76px)/.95 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.search-section h1 span { color: var(--accent); }
.search-section > p { margin: 18px 0 29px; color: var(--muted); font-size: 15px; }
.search-form { height: 65px; display: flex; align-items: center; gap: 12px; padding: 7px 7px 7px 18px; border: 1px solid #334152; border-radius: 16px; background: rgba(17,24,33,.92); box-shadow: 0 20px 55px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.035); text-align: left; transition: border-color .18s ease, box-shadow .18s ease; }
.search-form:focus-within { border-color: #7fab3d; box-shadow: 0 20px 55px rgba(0,0,0,.34), 0 0 0 3px rgba(183,243,74,.09); }
.search-icon { color: var(--muted); font-size: 24px; }
.search-form input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 18px; }
.search-form input::placeholder { color: #697684; }
.search-form button { height: 49px; display: flex; align-items: center; gap: 13px; padding: 0 18px; border: 0; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-weight: 800; cursor: pointer; }
.search-form button:hover { filter: brightness(1.07); }
.search-form button:active { transform: translateY(1px); }
.search-form button b { font-size: 19px; }
.turkish-keyboard { display: flex; justify-content: center; margin-top: 13px; }
.character-keys { display: flex; gap: 4px; }
.character-keys button { width: 27px; height: 27px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: rgba(17,24,33,.72); color: #cbd4dc; font: 500 14px Georgia, "Times New Roman", serif; cursor: pointer; }
.character-keys button:hover, .character-keys button:focus-visible { border-color: #718441; color: var(--accent); outline: 0; }
.character-keys button:active { transform: translateY(1px); }

.results-section { padding-bottom: 70px; }
.welcome { display: flex; align-items: center; justify-content: center; gap: 13px; color: var(--muted); font-size: 12px; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.suggestions a { padding: 6px 9px; border: 1px solid var(--line); border-radius: 99px; color: #c5cdd5; text-decoration: none; }
.suggestions a:hover { border-color: #637244; color: var(--accent); }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 0 0 14px; }
.results-heading h2 { margin: 0; font: 400 22px Georgia, "Times New Roman", serif; }
.results-heading h1 { margin: 0; font: 400 26px Georgia, "Times New Roman", serif; }
.results-heading h1 strong { color: var(--accent); font-weight: 400; }
.results-heading h2 strong { color: var(--accent); font-weight: 400; }
.results-heading span { color: var(--muted); font-size: 11px; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.translation-card { min-width: 0; min-height: 142px; display: flex; flex-direction: column; padding: 15px 16px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #141c26, var(--surface)); box-shadow: 0 8px 25px rgba(0,0,0,.13); overflow: hidden; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.translation-card:hover { transform: translateY(-2px); border-color: #445466; background: var(--surface-hover); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.language-mark { display: inline-flex; align-items: center; gap: 6px; }
.flag { font-size: 17px; line-height: 1; }
.language-tag { padding: 3px 6px; border: 1px solid #364453; border-radius: 5px; color: #aeb9c3; font-size: 9px; font-weight: 850; letter-spacing: .11em; }
.copy-button { width: 27px; height: 25px; display: grid; place-items: center; padding: 0; border: 1px solid #364453; border-radius: 6px; background: transparent; color: #8f9ba8; font-size: 15px; line-height: 1; cursor: pointer; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.copy-button:hover, .copy-button:focus-visible { border-color: #718441; color: var(--accent); outline: 0; }
.copy-button:active { transform: translateY(1px); }
.copy-button.copied { border-color: #718441; background: rgba(183,243,74,.08); color: var(--accent); }
.copy-button.copy-failed { border-color: #9a5656; color: #ff9c9c; }
.word-link { display: block; margin: 11px 0 0; color: var(--text); font: 500 clamp(19px, 2vw, 24px)/1.05 Georgia, "Times New Roman", serif; letter-spacing: -.025em; text-decoration-color: transparent; text-underline-offset: 4px; overflow-wrap: anywhere; }
.word-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.example { display: -webkit-box; margin: auto 0 0; padding-top: 12px; color: #aeb9c3; font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.example::before { content: "“"; color: var(--blue); font: 700 17px Georgia, serif; }
.example::after { content: "”"; color: var(--blue); font: 700 17px Georgia, serif; }
.translation-card.no-example { min-height: 105px; }
.translation-card.no-example .word-link { margin-top: 16px; }

.word-search { max-width: 760px; margin: 0 auto; padding: 34px 0 32px; }
.word-page .results-section { padding-bottom: 70px; }
.word-page .results-heading { margin-bottom: 18px; }

.loading-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.skeleton { height: 142px; border: 1px solid #1f2934; border-radius: var(--radius); background: linear-gradient(100deg, #111821 20%, #1a2430 40%, #111821 60%); background-size: 300% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.empty-results { grid-column: 1 / -1; padding: 66px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.empty-results strong { display: block; margin-bottom: 8px; font: 400 24px Georgia, serif; }
.empty-results span { color: var(--muted); }

footer { min-height: 70px; display: flex; align-items: center; justify-content: flex-end; gap: 20px; border-top: 1px solid rgba(255,255,255,.07); color: #6f7c88; font-size: 10px; }
footer a { color: #8e9aa5; text-underline-offset: 3px; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }

.legal-shell { width: min(760px, calc(100% - 34px)); margin: 0 auto; padding-bottom: 70px; }
.legal-header { height: 74px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.07); }
.back-link { color: var(--accent); font-size: 12px; text-decoration: none; }
.legal-content { padding-top: 58px; }
.legal-content h1 { margin: 0 0 12px; font: 400 clamp(38px, 7vw, 58px)/1 Georgia, serif; letter-spacing: -.04em; }
.legal-content > p { color: var(--muted); line-height: 1.7; }
.legal-group { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.legal-group h2 { margin: 0 0 15px; font: 400 23px Georgia, serif; }
.legal-group ul { margin: 0; padding-left: 20px; }
.legal-group li { margin: 10px 0; color: #b2bdc7; line-height: 1.6; }
.legal-group a { color: var(--blue); }
.browse-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 18px; margin: 30px 0; padding: 0; list-style: none; }
.browse-list a { color: #c8d1da; text-decoration-color: #435263; text-underline-offset: 3px; overflow-wrap: anywhere; }
.browse-list a:hover { color: var(--accent); }
.browse-groups { grid-template-columns: repeat(8, minmax(0, 1fr)); font: 500 22px Georgia, serif; text-align: center; }
.browse-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.browse-pagination a { color: var(--accent); text-decoration: none; }

@media (max-width: 900px) {
  .card-grid, .loading-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-shell { width: min(100% - 22px, 1180px); }
  .masthead { height: 60px; }
  .search-section { padding: 45px 0 33px; }
  .word-search { padding: 24px 0; }
  .search-section h1 { font-size: clamp(39px, 12vw, 58px); }
  .search-section > p { margin: 14px 0 21px; font-size: 13px; }
  .search-form { height: 58px; padding-left: 14px; }
  .search-form input { font-size: 16px; }
  .search-form button { width: 45px; height: 44px; justify-content: center; padding: 0; }
  .search-form button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .turkish-keyboard { margin-top: 11px; }
  .welcome { align-items: flex-start; flex-direction: column; }
  .suggestions { justify-content: flex-start; }
  .results-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .card-grid, .loading-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .translation-card { min-height: 132px; padding: 12px; border-radius: 11px; }
  .translation-card.no-example { min-height: 94px; }
  .word-link { margin-top: 9px; font-size: clamp(17px, 5vw, 21px); }
  .example { padding-top: 9px; font-size: 11px; -webkit-line-clamp: 3; }
  .flag { font-size: 15px; }
  .language-tag { font-size: 8px; }
  .skeleton { height: 132px; }
  footer { justify-content: flex-end; }
  .footer-links { gap: 10px; }
  .browse-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .browse-groups { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

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