/*!
 * Copyright (c) 2026 Daki.cc — Niclas Specht. All rights reserved.
 *
 * Proprietary and confidential. Unauthorized copying, distribution,
 * modification, or use of this file or its contents, in whole or in
 * part, via any medium, is strictly prohibited.
 */

/* Language menu in the navbar (home pages), the "also in your language" hint,
   and the few fixes the translated pages need. */

/* ── Language menu ───────────────────────────────────────────── */
.daki-nav-lang { position: relative; }
.daki-flag { display: block; flex-shrink: 0; width: 21px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 1px 3px rgba(0, 0, 0, 0.35); }
.daki-nav-lang-btn { gap: 8px; padding: 0 11px; }
.daki-nav-lang-btn .daki-lang-name { display: none; }
.daki-nav-lang-btn .daki-lang-code { font-size: 13px; letter-spacing: .04em; }
.daki-nav-lang-btn .daki-lang-chevron { width: 14px; height: 14px; color: #a99eb0; transition: transform .2s ease; }
.daki-nav-lang-btn[aria-expanded="true"] { border-color: #855493; background: #241b29; }
.daki-nav-lang-btn[aria-expanded="true"] .daki-lang-chevron { transform: rotate(180deg); }

.daki-lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 316px;
  padding: 6px;
  border: 1px solid #3a3140;
  border-radius: 12px;
  background: #151317;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.daki-lang-menu.is-open { display: grid; animation: daki-nav-menu-in .16s ease-out; }
.daki-lang-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; color: #e8deed; font-size: 14px; text-decoration: none; transition: background .15s ease; }
.daki-lang-menu a span { flex: 1; min-width: 0; }
.daki-lang-menu a:hover { background: #221c27; color: #fff; }
.daki-lang-menu a[aria-current="page"] { background: #241b29; box-shadow: inset 0 0 0 1px #4a3553; color: #fff; }
.daki-lang-menu small { color: #8f8197; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
.daki-lang-menu a[aria-current="page"] small { color: #d48ae6; }

[dir="rtl"] .daki-lang-menu, [dir="rtl"] .daki-nav-menu { right: auto; left: 0; }

@media (max-width: 991.98px) {
  .daki-nav-lang { grid-column: 1 / -1; order: 3; }
  .daki-nav-lang-btn { width: 100%; justify-content: center; }
  .daki-nav-lang-btn .daki-lang-name { display: inline; }
  .daki-nav-lang-btn .daki-lang-code { display: none; }
  .daki-lang-menu { position: static; width: auto; margin-top: 8px; box-shadow: none; }
}

/* ── "Also available in …" hint ──────────────────────────────── */
.daki-lang-offer {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px;
  border: 1px solid #3a3140;
  border-radius: 14px;
  background: rgba(21, 19, 23, 0.96);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  color: #ddd6e1;
  font: 14px/1.4 'Work Sans', sans-serif;
  transform: translate(-50%, 0);
  animation: daki-lang-offer-in .35s ease-out;
}
@keyframes daki-lang-offer-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.daki-lang-offer .daki-flag { width: 24px; height: 16px; }
.daki-lang-offer span { max-width: 440px; }
.daki-lang-offer small { display: block; margin-top: 2px; color: #a99eb0; font-size: 12.5px; line-height: 1.4; }
.daki-lang-offer a {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 9px;
  background: #a432c0;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease;
}
.daki-lang-offer a:hover { background: #b542d1; color: #fff; }
.daki-lang-offer button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #a99eb0;
  cursor: pointer;
}
.daki-lang-offer button:hover { background: #221c27; color: #fff; }
.daki-lang-offer button svg { width: 16px; height: 16px; color: inherit; }
@media (max-width: 575px) {
  .daki-lang-offer { flex-wrap: wrap; bottom: 12px; width: calc(100vw - 24px); max-width: none; gap: 10px; }
  .daki-lang-offer span { flex: 1 1 calc(100% - 80px); max-width: none; }
  .daki-lang-offer a { flex: 1; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .daki-lang-offer { animation: none; }
}

/* ── Scripts without Latin letters ───────────────────────────── */
/* Letter-spacing tears joined Arabic letters apart and breaks the Devanagari
   headline; the page's tracked uppercase labels only make sense in Latin. */
:lang(ar) *, :lang(hi) * { letter-spacing: normal !important; }
/* Korean breaks between words, Chinese and Japanese between characters. */
:lang(ko) { word-break: keep-all; }
:lang(ja), :lang(zh) { line-break: strict; }

/* ── Right-to-left (Arabic) ──────────────────────────────────── */
/* Arrows point the way the text runs. `scale` composes with the hover nudges. */
[dir="rtl"] .btn-arrow,
[dir="rtl"] .hero-announce .hero-icon,
[dir="rtl"] .product-card-btn svg,
[dir="rtl"] .card-bottom-link .icon,
[dir="rtl"] .stack-more .icon,
[dir="rtl"] .feature-card h3 a .icon,
[dir="rtl"] .heading-link .icon,
[dir="rtl"] .daki-option-arrow { scale: -1 1; }
/* Code, terminals and the panel mock-up read left to right in every language. */
[dir="rtl"] .dashboard-art,
[dir="rtl"] .ide-art,
[dir="rtl"] .files-art,
[dir="rtl"] .chip-art,
[dir="rtl"] .shield-art,
[dir="rtl"] .network-art,
[dir="rtl"] .stack-logos { direction: ltr; }
[dir="rtl"] .feature-checklist .icon { margin-right: 0; margin-left: 5px; }
[dir="rtl"] .daki-nav-paid { margin: -2px 0 0 7px; }
[dir="rtl"] .daki-lang-offer { padding: 10px 16px 10px 10px; }

/* ── Narrow desktops ─────────────────────────────────────────── */
/* With a language menu and longer translated labels the bar runs out of room
   below 1200px: Discord and the language button shrink to their icons. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .daki-nav-paid { display: none; }
  .daki-nav-lang-btn .daki-lang-code { display: none; }
  .daki-nav-actions > .daki-nav-pill:first-child { padding: 0 11px; }
  .daki-nav-actions > .daki-nav-pill:first-child span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}

/* Arabic and Devanagari have no monospace face here; the fallback spaces
   every letter apart, so the mono labels use the text font instead. */
:lang(ar) .hero-announce, :lang(ar) .hero-rating, :lang(ar) .hero-chip-label, :lang(ar) .art-caption,
:lang(ar) .free-price span, :lang(ar) .hardware-specs span, :lang(ar) .users-pin, :lang(ar) .discord-typing,
:lang(ar) .orders-art span, :lang(ar) .shield-label,
:lang(hi) .hero-announce, :lang(hi) .hero-rating, :lang(hi) .hero-chip-label, :lang(hi) .art-caption,
:lang(hi) .free-price span, :lang(hi) .hardware-specs span, :lang(hi) .users-pin, :lang(hi) .discord-typing,
:lang(hi) .orders-art span, :lang(hi) .shield-label { font-family: 'Work Sans', sans-serif; }

/* Japanese headlines break between phrases where the browser can tell them. */
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { word-break: auto-phrase; }

/* Translated checklist lines wrap before they reach the panel mock-up. */
@media (min-width: 768px) {
  html:not([lang="en"]) .why-section .panel-tools { max-width: calc(34% - 30px); }
}

/* ── Right-to-left: decorations swap sides with the text ─────── */
[dir="rtl"] .why-section .free-price { right: auto; left: 24px; }
[dir="rtl"] .users-art { right: auto; left: 0; }
[dir="rtl"] .years-now .status-dot { right: auto; left: -2px; }
/* Numbers keep their written order ("135,000+", not "+135,000"). */
[dir="rtl"] .metric-number { direction: ltr; text-align: right; }
@media (min-width: 992px) {
  [dir="rtl"] .why-section .ide-art { left: 24px; right: 50%; }
}
@media (min-width: 768px) {
  [dir="rtl"] .discord-art { right: auto; left: 24px; }
}
@media (min-width: 768px) and (max-width: 991px) {
  [dir="rtl"] .why-section .chip-art { left: 8px; right: 50%; }
  [dir="rtl"] .why-section .hardware-specs { left: 54%; right: 24px; }
}
@media (max-width: 767.98px) {
  [dir="rtl"] .users-pin { right: auto; left: 22px; }
}

/* Product pages */
[dir="rtl"] .fh-table th, [dir="rtl"] .fh-table td { text-align: right; }
[dir="rtl"] .plan-cta .pl-ico, [dir="rtl"] .fh-hero-link + .pl-ico { scale: -1 1; }
/* Specs written only in Latin ("1 vCore, AMD Ryzen 9 9900X") keep their own
   left-to-right order inside right-to-left pages. */
[dir="rtl"] .fh-table td, [dir="rtl"] .plan-list li, [dir="rtl"] .product-card-specs li,
[dir="rtl"] .free-specs span, [dir="rtl"] .hardware-specs span { unicode-bidi: plaintext; }

/* ── Legal pages ─────────────────────────────────────────────── */
/* "Only the English version is legally binding", under a translated title. */
.legal-note { max-width: 640px; margin: 18px auto 0; padding: 10px 16px; border: 1px solid rgba(181, 83, 208, 0.35); border-radius: 10px; background: rgba(118, 9, 145, 0.14); color: #d9cde0; font-size: 14px; line-height: 1.5; }
.legal-note a { color: #e3b6f0; }
[dir="rtl"] :is(.terms-section, .privacy-section, .imprint-section) :is(ul, ol) { padding-right: 2rem; padding-left: 0; }
/* The withdrawal form's off-screen honeypot goes off the start edge, which is the right in RTL. */
[dir="rtl"] .withdraw-hp { left: auto; right: -9999px; }

/* Wiki, right to left */
[dir="rtl"] .wk-skip { left: auto; right: 12px; }
[dir="rtl"] .wk-search-trigger { padding: 0 12px 0 8px; text-align: right; }
[dir="rtl"] .wk-hero-search { padding: 0 18px 0 12px; text-align: right; }
[dir="rtl"] .wk-side-group ul { margin: 0 16px 0 0; border-left: 0; border-right: 1px solid var(--wk-border); }
[dir="rtl"] .wk-side-group li a { margin-left: 0; margin-right: -1px; padding: 6.5px 14px 6.5px 10px; border-left: 0; border-right: 1px solid transparent; border-radius: 8px 0 0 8px; }
[dir="rtl"] .wk-side-group li a:hover { border-right-color: #5a4663; }
[dir="rtl"] .wk-side-group li a[aria-current="page"] { border-right-color: #d48ae6; }
[dir="rtl"] .wk-side-ext, [dir="rtl"] .wk-search-foot a, [dir="rtl"] .wk-mock-live { margin-left: 0; margin-right: auto; }
[dir="rtl"] .wk-pagemenu-main { border-radius: 0 9px 9px 0; }
[dir="rtl"] .wk-pagemenu-toggle { border-left: 1px solid var(--wk-border-2); border-right: 0; border-radius: 9px 0 0 9px; }
[dir="rtl"] .wk-pagemenu-list { right: auto; left: 0; }
[dir="rtl"] .wk-pagemenu-list > a, [dir="rtl"] .wk-pagemenu-list > button,
[dir="rtl"] .wk-toc-tools > a, [dir="rtl"] .wk-toc-tools > button,
[dir="rtl"] .wk-table th { text-align: right; }
[dir="rtl"] .wk-content a.wk-ext::after { margin-left: 0; margin-right: 2px; }
[dir="rtl"] .wk-anchor { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .wk-content ul, [dir="rtl"] .wk-content ol { padding-left: 0; padding-right: 1.4em; }
[dir="rtl"] .wk-content li { padding-left: 0; padding-right: 0.2em; }
[dir="rtl"] .wk-content blockquote { padding: 2px 16px 2px 0; border-left: 0; border-right: 3px solid var(--wk-border-hi); }
[dir="rtl"] .wk-step::before { left: auto; right: 14.5px; }
[dir="rtl"] .wk-content .wk-card { padding: 18px 18px 16px 44px; }
[dir="rtl"] .wk-card-arrow { right: auto; left: 18px; }
[dir="rtl"] .wk-pager-next { text-align: left; }
[dir="rtl"] .wk-toc-list { border-left: 0; border-right: 1px solid var(--wk-border); }
[dir="rtl"] .wk-toc-list a { margin-left: 0; margin-right: -1px; padding: 5px 14px 5px 0; border-left: 0; border-right: 1px solid transparent; }
[dir="rtl"] .wk-toc-l3 a { padding-left: 0; padding-right: 26px; }
[dir="rtl"] .wk-toc-list a.is-active { border-right-color: #d48ae6; }
[dir="rtl"] .wk-topic li a:hover { padding-left: 0; padding-right: 6px; }
[dir="rtl"] .wk-crumbs .wk-icon,
[dir="rtl"] .wk-pager-link small .wk-icon,
[dir="rtl"] .wk-card-arrow,
[dir="rtl"] .wk-start-more .wk-icon,
[dir="rtl"] .wk-topic li a .wk-icon { scale: -1 1; }
/* Code stays left to right */
[dir="rtl"] .wk-code pre { direction: ltr; text-align: left; }
@media (max-width: 991.98px) {
  [dir="rtl"] .wk-mobilebar-nav { text-align: right; }
  [dir="rtl"] .wk-sidebar { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--wk-border-2); box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5); transform: translateX(102%); }
  [dir="rtl"] .wk-sidebar.is-open { transform: none; }
}
@media (max-width: 640px) {
  [dir="rtl"] .wk-pagemenu-list { left: auto; right: 0; }
}
