:root {
  --accent:        #b4151d;
  --accent-hover:  #9c1119;
  --accent-ring:   rgba(180, 21, 29, .22);

  --page:          #ffffff;
  --shell:         #f4f4f6;
  --surface:       #ffffff;
  --surface-2:     #f6f6f7;
  --surface-3:     #ececed;

  --text:          #16161a;
  --text-muted:    #6c6c76;
  --text-faint:    #747480;

  --border:        #e2e2e6;
  --border-strong: #d2d2d8;

  --shadow-card:   0 1px 2px rgba(16,16,24,.04), 0 12px 40px rgba(16,16,24,.07);
  --shadow-btn:    0 1px 2px rgba(180,21,29,.25);

  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --maxw: 980px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

:root[data-theme="dark"] {
  --accent:        #d7232c;
  --accent-hover:  #c9222b;
  --accent-ring:   rgba(215, 35, 44, .3);

  --page:          #0a0a0c;
  --shell:         #131316;
  --surface:       #131316;
  --surface-2:     #1a1a1e;
  --surface-3:     #212126;

  --text:          #f2f2f4;
  --text-muted:    #a0a0ab;
  --text-faint:    #868690;

  --border:        #26262c;
  --border-strong: #33333b;

  --shadow-card:   0 1px 2px rgba(0,0,0,.4), 0 18px 50px rgba(0,0,0,.5);
  --shadow-btn:    0 1px 2px rgba(0,0,0,.4);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 40px 16px;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

h1, h2, h3 { margin: 0; line-height: 1.18; letter-spacing: -.022em; font-weight: 700; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

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

.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--shell);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

main { padding: 0 clamp(18px, 5vw, 56px); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.brand__mark svg { width: 20px; height: 20px; }

.brand__name { font-weight: 650; font-size: 15px; letter-spacing: -.015em; }

.topbar__actions { display: flex; align-items: center; gap: 8px; }

.langswitch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.langswitch__btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.langswitch__btn:hover { color: var(--text); }
.langswitch__btn.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
:root[data-theme="dark"] .langswitch__btn.is-active { background: var(--surface-3); }

.iconbtn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease);
}
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); }
.iconbtn svg { width: 15px; height: 15px; }

.icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun  { display: block; }

.hero { padding: clamp(36px, 7vw, 68px) 0 clamp(26px, 4vw, 40px); text-align: center; }

.hero h1 {
  font-size: clamp(28px, 5.2vw, 40px);
  letter-spacing: -.035em;
}

.hero__sub {
  margin: 14px auto 0;
  max-width: 44ch;
  color: var(--text-muted);
  font-size: 14px;
}

.searchbar {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  margin-top: 26px;
  flex-wrap: wrap;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 340px;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0 8px 0 14px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.field.is-invalid {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
  animation: shake .32s var(--ease);
}
@keyframes shake {
  25%  { transform: translateX(-5px); }
  75%  { transform: translateX(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .field.is-invalid { animation: none; }
}

.field__icon { width: 15px; height: 15px; color: var(--text-faint); flex: none; }

.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  padding: 11px 8px;
}
.field input::placeholder { color: var(--text-faint); }

.field__clear {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}
.field__clear:hover { background: var(--surface-3); color: var(--text); }
.field__clear svg { width: 13px; height: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .12s var(--ease), opacity .18s var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; pointer-events: none; }

.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-btn); }
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(180, 21, 29, .32);
}
:root[data-theme="dark"] .btn--primary:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }

.btn--lg { padding: 11px 20px; font-size: 13px; }

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

.hint {
  margin-top: 16px;
  min-height: 18px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.hint[data-tone="error"] { color: var(--accent); }

.results { padding-bottom: clamp(28px, 5vw, 44px); }

.results__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.results__head h2 { font-size: 17px; }
.results__meta { margin-top: 3px; font-size: 12px; color: var(--text-muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
  animation: rise .35s var(--ease) both;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(16,16,24,.08);
}
:root[data-theme="dark"] .card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.45); }

.card--featured { border-color: rgba(180, 21, 29, .35); }
.card--featured:hover { box-shadow: 0 10px 28px rgba(180, 21, 29, .16); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .card, .btn { animation: none !important; transition: none !important; }
}

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-3);
  padding: 12px 12px 0;
  overflow: hidden;
}
.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  transition: transform .35s var(--ease);
}
.card:hover .card__thumb img { transform: scale(1.035); }

.card__badge {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(10, 10, 14, .62);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.card__badge--accent { background: var(--accent); }

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}
.card__title { font-size: 13px; font-weight: 650; }
.card__dims { margin-top: 2px; font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.card__btn { padding: 6px 12px; font-size: 11.5px; }

.card.is-loading .card__badge { display: none; }

.card.is-loading .card__thumb::after {
  content: "";
  position: absolute;
  inset: 12px 12px 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, var(--surface-3) 30%, var(--surface-2) 50%, var(--surface-3) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -40% 0; } }

.legal { padding: clamp(28px, 5vw, 48px) 0 clamp(26px, 5vw, 44px); }
.legal__back {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
}
.legal__back:hover { color: var(--text); }
.legal h1 { font-size: clamp(22px, 4vw, 28px); letter-spacing: -.03em; }
.legal__updated { margin-top: 8px; font-size: 12px; color: var(--text-faint); }
.legal > p:not(.legal__updated) { margin-top: 18px; color: var(--text-muted); font-size: 13.5px; line-height: 1.65; }
.legal h2 { margin-top: 32px; margin-bottom: 10px; font-size: 15px; }
.legal code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: .92em;
}
.legal__list {
  margin: 10px 0 18px;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.8;
}
.legal__list a { color: var(--accent); text-decoration: none; }
.legal__list a:hover { text-decoration: underline; }

.seo {
  padding: clamp(26px, 5vw, 44px) 0;
  border-top: 1px solid var(--border);
}
.seo h2 { font-size: 15px; margin-bottom: 12px; }
.seo p { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.seo p:last-child { margin-bottom: 0; }

.faq {
  padding: 0 0 clamp(26px, 5vw, 44px);
}
.faq h2 { font-size: 15px; margin-bottom: 14px; }

.faq__item {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.faq__item:last-child { border-bottom: 1px solid var(--border); }

.faq__item summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-faint);
  transition: transform .18s var(--ease);
}
.faq__item[open] summary::after { content: "–"; }

.faq__item p {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer {
  padding: 20px clamp(18px, 5vw, 56px);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.footer__text { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; }
.footer__privacy {
  display: inline-block;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.footer__privacy:hover { color: var(--text); }

@media (max-width: 680px) {
  body { padding: 16px 12px; }
  .shell { border-radius: var(--radius-lg); }
  .hero { text-align: left; padding-top: 28px; }
  .hero__sub { margin-left: 0; }
  .searchbar { flex-direction: column; }
  .field { flex: 1 1 auto; }
  .btn--lg { width: 100%; }
  .results__head { flex-direction: column; align-items: stretch; }
  .results__head .btn { width: 100%; }
  .grid { grid-template-columns: 1fr; }
}
