/* Nes & Aes: the language choice (English / اردو) and the Urdu reading of the site. Loaded by index.html beside the
   site's own stylesheet; lang.js does the work. The Urdu font only downloads when Urdu text is on screen. */

@font-face {
  font-family: 'Nes Urdu';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/noto-nastaliq-urdu-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Nes Urdu';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url('fonts/noto-nastaliq-urdu-arabic-700-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --ur-font: 'Nes Urdu', 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', var(--display-font, 'Figtree Variable'), sans-serif;
  --lang-mint: #2fe0a8;
  --lang-cream: #ffedd7;
  --lang-line: #ffedd724;
}

/* ───────────── the choice ───────────── */
#lang-pop {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(80% 60% at 50% 40%, #0b2a1ccc, #040c08e6 70%);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s;
}
#lang-pop.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
@media (max-width: 767.98px), (pointer: coarse) {
  /* a live blur is costly on phones: a deeper tint does the same job */
  #lang-pop { background: radial-gradient(90% 60% at 50% 40%, #0d2c1ef0, #040c08f5 70%); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.lang-pop__card {
  position: relative; overflow: hidden; width: min(460px, 100%); padding: 2.1em 2em 1.7em; text-align: center;
  font-family: var(--display-font, 'Figtree Variable', sans-serif); color: var(--lang-cream);
  border: 1px solid var(--lang-line); border-radius: 22px;
  background: linear-gradient(180deg, #143826 0%, #0d241a 55%, #0a1b13 100%);
  box-shadow: 0 50px 100px -40px #000, inset 0 1px 0 #ffedd714;
  transform: translateY(26px) scale(.97); opacity: 0;
  transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .6s ease;
}
#lang-pop.is-open .lang-pop__card { transform: none; opacity: 1; transition-delay: .08s; }
.lang-pop__card::before {
  /* the mint glow the board gives off, above the logo */
  content: ''; position: absolute; left: 50%; top: -120px; width: 360px; height: 220px; transform: translateX(-50%);
  background: radial-gradient(closest-side, #2fe0a840, transparent); pointer-events: none;
}
.lang-pop__logo { position: relative; display: block; width: min(210px, 62%); height: auto; margin: 0 auto 1.3em; color: var(--lang-cream); }
.lang-pop__eyebrow {
  display: inline-flex; align-items: center; gap: .6em; margin: 0 0 1em; padding: .35em .9em;
  border: 1px solid var(--lang-line); border-radius: 2em;
  font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #ffedd7b3;
}
.lang-pop__eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--lang-mint); box-shadow: 0 0 10px var(--lang-mint); }
.lang-pop__eyebrow span { font-family: var(--ur-font); letter-spacing: 0; text-transform: none; font-size: 13px; line-height: 1; }
.lang-pop__q { margin: 0; font-size: clamp(19px, 5.2vw, 23px); font-weight: 650; line-height: 1.3; letter-spacing: -.01em; text-transform: none; }
.lang-pop__q-ur { margin: .55em 0 0; font-family: var(--ur-font); font-size: clamp(19px, 5.4vw, 23px); line-height: 2.05; color: #ffedd7d9; }
.lang-pop__choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 1.5em 0 1.1em; }
.lang-pop__choices button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15em;
  min-height: 84px; padding: .7em .6em; border: 1px solid var(--lang-line); border-radius: 16px;
  background: #ffedd70a; color: var(--lang-cream); font: inherit; cursor: pointer;
  transition: background-color .3s, border-color .3s, transform .4s cubic-bezier(.2, .8, .2, 1), color .3s;
  -webkit-tap-highlight-color: transparent;
}
.lang-pop__choices button small { font-family: var(--mono-font, monospace); font-size: 11px; font-weight: 400; letter-spacing: .14em; color: #ffedd780; }
.lang-pop__choices button b { font-size: 20px; font-weight: 700; line-height: 1.2; }
.lang-pop__choices button[data-lang='ur'] b { font-family: var(--ur-font); font-size: 22px; line-height: 1.6; font-weight: 700; }
.lang-pop__choices button:hover, .lang-pop__choices button:focus-visible { border-color: #2fe0a8aa; background: #2fe0a81a; transform: translateY(-2px); }
.lang-pop__choices button:focus-visible { outline: 2px solid var(--lang-mint); outline-offset: 3px; }
.lang-pop__choices button.is-picked { background: var(--lang-mint); border-color: var(--lang-mint); color: #062015; }
.lang-pop__choices button.is-picked small { color: #062015b3; }
.lang-pop__hint { margin: 0; font-size: 12px; line-height: 1.6; color: #ffedd780; }
.lang-pop__hint span { font-family: var(--ur-font); font-size: 13px; line-height: 2; }
@media (hover: none) {
  .lang-pop__choices button:hover { transform: none; border-color: var(--lang-line); background: #ffedd70a; }
  .lang-pop__choices button:active { transform: scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
  #lang-pop, .lang-pop__card, .lang-pop__choices button { transition: none; }
}

/* ───────────── the switch in the header ───────────── */
.lang-toggle {
  display: inline-flex; align-items: center; gap: .5em; margin: 0; padding: 0 .85em; min-height: 30px;
  border: 1px solid #ffedd740; border-radius: 2em; background: #10090466; color: var(--color-white, #ffedd7);
  font: inherit; font-size: inherit; font-weight: 650; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .3s, background-color .3s;
}
.lang-toggle::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--lang-mint); box-shadow: 0 0 8px var(--lang-mint); }
.lang-toggle:hover, .lang-toggle:focus-visible { border-color: #2fe0a8aa; background: #2fe0a81f; }
.lang-toggle:focus-visible { outline: 2px solid var(--lang-mint); outline-offset: 2px; }
.lang-toggle [lang='ur'] { font-family: var(--ur-font); font-size: 1.15em; line-height: 1; padding-bottom: .15em; }
#site-header-nav li.lang-li { display: flex; align-items: center; margin-top: -.45em; }
/* phones and tablets: beside the Menu button */
#lang-toggle-m { display: none; position: absolute; top: -.55em; right: 0; z-index: 12; min-height: 40px; padding: 0 1em; font-size: calc(var(--sub2, 12px) * 1.05); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 1023.98px) {
  #lang-toggle-m { display: inline-flex; }
}

/* ───────────── the site in Urdu ───────────── */
html.is-ur [lang='ur'] {
  font-family: var(--ur-font);
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-style: normal;
}
html.is-ur [lang='ur'] em, html.is-ur [lang='ur'] i:not(.brand i) { font-style: normal; }
/* Nastaliq stands tall: more room between lines, a touch smaller where the English was set tight and large */
html.is-ur .products-title[lang='ur'] { line-height: 1.55; font-size: calc(var(--h1) * .6 * .8); padding-top: .1em; }
@media (max-width: 767.98px) { html.is-ur .products-title[lang='ur'] { font-size: calc(var(--h1) * .78 * .8); } }
html.is-ur .products-lede[lang='ur'], html.is-ur .products-lists[lang='ur'] { line-height: 2.05; }
html.is-ur .products-eyebrow[lang='ur'], html.is-ur dt[lang='ur'] { line-height: 1.9; }
html.is-ur .cat-card__name[lang='ur'] { line-height: 1.7; }
html.is-ur .cat-card__desc[lang='ur'] { line-height: 2; }
html.is-ur #catalog-title[lang='ur'] { line-height: 1.6; }
html.is-ur #catalog-desc[lang='ur'], html.is-ur #catalog-foot p[lang='ur'] { line-height: 2.05; }
html.is-ur #zoom-name[lang='ur'], html.is-ur #zoom-desc[lang='ur'] { line-height: 1.9; }
html.is-ur #menu li a[lang='ur'] { line-height: 1.7; padding: .35em 0; }
html.is-ur .menu-chat[lang='ur'] { line-height: 1; padding-bottom: .2em; }
html.is-ur #site-header-nav a[lang='ur'] { line-height: 1.1; font-size: 1.15em; font-weight: 600; }
html.is-ur #site-footer-scroll span[lang='ur'], html.is-ur #scroll-indicator__bar-inner[lang='ur'] { line-height: 1.6; }

/* the story's sweeping lines: Urdu words that follow the English letters' fade (lang.js) */
.sweep > .ur-twin { display: none; }
html.is-ur .sweep.has-ur > .en-orig { display: none; }
html.is-ur .sweep.has-ur > .ur-twin { display: inline; }
html.is-ur .sweep.has-ur { font-family: var(--ur-font); text-transform: none; letter-spacing: 0; }
html.is-ur #ai-pre h2.has-ur { line-height: 1.6; font-size: calc(var(--h2) * .82); }
html.is-ur #ai-pre .body1.has-ur, html.is-ur #ai-desc.has-ur { line-height: 1.95; }
.ur-twin .ur-w { display: inline; will-change: opacity; }
.ur-twin .ur-brand { font-family: var(--display-font, 'Figtree Variable'); font-weight: 700; }
.ur-twin .ur-amp { font-family: var(--serif-font, Georgia); font-style: italic; font-weight: 400; color: var(--brand-amp, #2fe0a8); }

/* ───────────── Urdu reads right to left: the catalogue sections mirror ───────────── */
html.is-ur .products-head,
html.is-ur .products-stats,
html.is-ur .cat-grid,
html.is-ur .products-foot { direction: rtl; }
html.is-ur .cat-card__go svg { transform: scaleX(-1); }
html.is-ur .cat-card__top, html.is-ur .cat-card__foot { direction: rtl; }
html.is-ur .cat-card__makers { direction: ltr; unicode-bidi: isolate; }
/* the header's links read from the right */
html.is-ur #site-header-nav ul { flex-direction: row-reverse; }
/* the sheet's heading sits to the right; its line of codes keeps its own order */
html.is-ur #catalog-heading { text-align: right; }
html.is-ur #catalog-kicker { direction: ltr; unicode-bidi: isolate; }
html.is-ur .cat-card__std { unicode-bidi: plaintext; }
html.is-ur #catalog-kicker[lang='ur'], html.is-ur .cat-card__std[lang='ur'] { font-family: 'Nes Urdu', var(--mono-font, monospace); text-transform: uppercase !important; }
html.is-ur #catalog-search input::placeholder { font-family: var(--ur-font); }
html.is-ur .ct th[lang='ur'], html.is-ur .ct td[lang='ur'] { line-height: 1.7; }
html.is-ur .buy [lang='ur'], html.is-ur .buy span[lang='ur'] { line-height: 1; padding-bottom: .12em; }
html.is-ur .chip[lang='ur'] { line-height: 1.4; }

/* the question's card takes focus when it opens (so neither answer looks chosen): no ring on it */
.lang-pop__card:focus { outline: none; }
html.is-ur #zoom-desc bdi[dir='ltr'] { font-family: var(--display-font, 'Figtree Variable'); }
html.is-ur #ai-disclaimer[lang='ur'] { line-height: 2.1; font-size: calc(var(--sub2) * .95); }
/* on a return visit the language chosen last time is marked */
.lang-pop__choices button.is-current { border-color: #2fe0a8aa; background: #2fe0a814; }
.lang-pop__choices button.is-current::after { content: ''; position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--lang-mint); box-shadow: 0 0 8px var(--lang-mint); }
/* even line breaks in the question and the note (no word left alone on a line) */
.lang-pop__q, .lang-pop__hint { text-wrap: balance; }
