/* ── Dark theme (default) ── */
:root,
[data-theme="dark"] {
  --bg-base: #141416;
  --text: #f0f0f2;
  --text-muted: #9a9a9e;
  --accent: #c8c8cc;
  --accent-strong: #e4e4e8;
  --glass-bg: rgba(42, 42, 46, 0.55);
  --glass-bg-strong: rgba(52, 52, 56, 0.72);
  --glass-inset: rgba(0, 0, 0, 0.28);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-strong: rgba(255, 255, 255, 0.16);
  --glass-highlight: rgba(255, 255, 255, 0.06);
  --btn-bg: rgba(220, 220, 224, 0.92);
  --btn-text: #1a1a1c;
  --btn-hover: #ffffff;
  --fade-top: rgba(20, 20, 22, 0.55);
  --fade-mid: rgba(20, 20, 22, 0.72);
  --fade-bottom: rgba(14, 14, 16, 0.94);
  --fade-side: rgba(16, 16, 18, 0.45);
  --photo-opacity: 0.42;
  --photo-blur: 0px;
  --photo-saturate: 0.85;
  --liquid-opacity: 0.18;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --err: #e8a0a0;
}

/* ── Light / bright theme ── */
[data-theme="light"] {
  --bg-base: #f4f4f6;
  --text: #0a0a0c;
  --text-muted: #1e1e22;
  --accent: #1a1a1e;
  --accent-strong: #000000;
  --glass-bg: rgba(255, 255, 255, 0.94);
  --glass-bg-strong: rgba(255, 255, 255, 0.98);
  --glass-inset: rgba(236, 236, 240, 0.95);
  --glass-border: rgba(0, 0, 0, 0.12);
  --glass-border-strong: rgba(0, 0, 0, 0.18);
  --glass-highlight: rgba(255, 255, 255, 1);
  --btn-bg: #121214;
  --btn-text: #ffffff;
  --btn-hover: #000000;
  --fade-top: rgba(255, 255, 255, 0.35);
  --fade-mid: rgba(255, 255, 255, 0.2);
  --fade-bottom: rgba(255, 255, 255, 0.5);
  --fade-side: rgba(255, 255, 255, 0.3);
  --photo-opacity: 0.92;
  --photo-blur: 0px;
  --photo-saturate: 1;
  --liquid-opacity: 0;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  --err: #b32d2d;
}

:root {
  --font: "DM Sans", system-ui, sans-serif;
  --max: 920px;
  --max-wide: 1040px;
  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 17px;
  background: var(--bg-base);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

a { color: var(--accent-strong); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.8; }

/* ── Background scene ── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-photo {
  position: absolute;
  inset: -4%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: var(--photo-opacity);
  filter: blur(var(--photo-blur)) saturate(var(--photo-saturate, 0.85));
  transform: scale(1.06);
}

.bg-photo-dark {
  background-image: url("assets/bg.jpg");
  display: block;
}

.bg-photo-light {
  background-image: url("assets/bg-light.jpg");
  display: none;
}

[data-theme="light"] .bg-photo-dark {
  display: none;
}

[data-theme="light"] .bg-photo-light {
  display: block;
  opacity: var(--photo-opacity);
  filter: blur(var(--photo-blur)) saturate(var(--photo-saturate, 1.05));
  transform: scale(1.05);
}

.bg-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--fade-top) 0%, transparent 22%),
    linear-gradient(0deg, var(--fade-bottom) 0%, transparent 35%),
    linear-gradient(90deg, var(--fade-side) 0%, transparent 18%, transparent 82%, var(--fade-side) 100%),
    radial-gradient(ellipse 90% 70% at 50% 45%, transparent 20%, var(--fade-mid) 100%);
}

[data-theme="light"] .bg-fade {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.15) 30%, transparent 55%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.1) 35%, transparent 60%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, transparent 12%, transparent 88%, rgba(255, 255, 255, 0.25) 100%),
    radial-gradient(ellipse 90% 75% at 50% 40%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.28) 100%);
}

/* Liquidity texture — soft morphing blobs */
.liquid-texture {
  position: absolute;
  inset: 0;
  opacity: var(--liquid-opacity);
  mix-blend-mode: soft-light;
}

.liquid-blob {
  position: absolute;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  filter: blur(60px);
  animation: liquid-morph 22s ease-in-out infinite;
}

.liquid-blob-1 {
  width: 55vw; height: 55vw;
  max-width: 700px; max-height: 700px;
  background: rgba(180, 180, 190, 0.5);
  top: -10%; left: -8%;
}

.liquid-blob-2 {
  width: 45vw; height: 45vw;
  max-width: 560px; max-height: 560px;
  background: rgba(140, 140, 150, 0.45);
  bottom: -5%; right: -6%;
  animation-delay: -8s;
  animation-duration: 26s;
}

.liquid-blob-3 {
  width: 35vw; height: 35vw;
  max-width: 420px; max-height: 420px;
  background: rgba(200, 200, 210, 0.35);
  top: 40%; left: 35%;
  animation-delay: -14s;
  animation-duration: 20s;
}

@keyframes liquid-morph {
  0%, 100% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: translate(2%, -3%) rotate(8deg);
  }
  66% {
    border-radius: 30% 70% 50% 50% / 50% 60% 40% 60%;
    transform: translate(-2%, 2%) rotate(-6deg);
  }
}

.liquid-filter { position: absolute; width: 0; height: 0; }

/* ── Glass morphism ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
}

.glass-sm {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid var(--glass-border);
}

.glass-inset {
  background: var(--glass-inset);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Liquid glass — subtle refractive edge */
.liquid-glass {
  position: relative;
  overflow: visible;
}

.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14) 0%,
    transparent 42%,
    transparent 58%,
    rgba(255, 255, 255, 0.06) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.liquid-glass > * { position: relative; z-index: 1; }

.glass-btn {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}

.glass-btn:hover {
  background: var(--btn-hover);
  color: var(--btn-text);
  text-decoration: none;
  transform: translateY(-1px);
}

.glass-btn:active { transform: translateY(0); }

.glass-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

[data-theme="dark"] .brand-logo-light {
  display: none;
}

[data-theme="light"] .brand-logo-dark {
  display: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-link:hover { color: var(--text); text-decoration: none; opacity: 1; }

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text);
  transition: transform 0.15s;
}

.theme-toggle:hover { transform: scale(1.05); }

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }

/* Language picker */
.lang-wrap {
  position: relative;
  flex-shrink: 0;
}

.lang-wrap.is-open {
  z-index: 300;
}

.lang-sel {
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.95rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  min-width: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.lang-chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1;
  transition: transform 0.2s ease;
}

.lang-wrap.is-open .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu.q-menu {
  right: 0;
  left: auto;
  min-width: 168px;
  max-height: min(22rem, calc(100vh - 6rem));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 180, 190, 0.45) transparent;
  padding-right: 0.15rem;
}

.lang-menu.q-menu::-webkit-scrollbar {
  width: 5px;
}

.lang-menu.q-menu::-webkit-scrollbar-track {
  background: transparent;
  margin: 0.35rem 0;
}

.lang-menu.q-menu::-webkit-scrollbar-thumb {
  background: rgba(180, 180, 190, 0.4);
  border-radius: 99px;
}

.lang-menu.q-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 200, 210, 0.55);
}

[data-theme="light"] .lang-menu.q-menu {
  scrollbar-color: rgba(80, 80, 90, 0.35) transparent;
}

[data-theme="light"] .lang-menu.q-menu::-webkit-scrollbar-thumb {
  background: rgba(80, 80, 90, 0.28);
}

[data-theme="light"] .lang-menu.q-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(60, 60, 70, 0.42);
}

.lang-menu .lang-opt {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  margin: 0.06rem 0;
  font-size: 0.92rem;
  cursor: pointer;
  border-radius: 10px;
  color: var(--text);
}

.lang-menu .lang-opt:hover,
.lang-menu .lang-opt.q-on {
  background: var(--glass-highlight);
  color: var(--text);
}

.lang-menu .lang-opt.q-on .q-check {
  visibility: visible;
}

.lang-menu .lang-opt .q-star {
  display: none;
}

[dir="rtl"] .header-inner {
  flex-direction: row-reverse;
}

[dir="rtl"] .header-nav {
  flex-direction: row-reverse;
}

[dir="rtl"] .brand {
  flex-direction: row-reverse;
}

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

/* Main */
.page-main {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 2rem 4.5rem;
}

.hero-intro { margin-bottom: 2.25rem; }

.page-title {
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 520px;
  line-height: 1.55;
}

.page-subtitle .plat {
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.page-subtitle .plat-yt:hover {
  color: #ff0000;
}

.page-subtitle .plat-tt:hover {
  color: #4caf50;
}

.page-subtitle .plat-ig:hover {
  color: #c13584;
}

/* Converter */
.converter-card,
.yt-hero {
  border-radius: var(--radius);
  padding: 2rem;
}

.url-field {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.15rem;
}

.url-field:focus-within {
  outline: 1px solid var(--glass-border-strong);
  outline-offset: 2px;
}

.url-field input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 1.1rem 1.25rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  outline: none;
}

.url-field input::placeholder { color: var(--text-muted); }

.input-action-btn {
  background: transparent;
  border: none;
  border-left: 1px solid var(--glass-border);
  padding: 0 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.15s;
}

.input-action-btn:hover { color: var(--text); }

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  margin-bottom: 1.15rem;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
}

.seg-group {
  display: flex;
  border-radius: var(--radius-pill);
  padding: 4px;
}

.seg-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.seg-btn.is-on {
  background: var(--glass-bg-strong);
  color: var(--text);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
  border: 1px solid var(--glass-border);
}

.q-wrap {
  position: relative;
  flex-shrink: 0;
}

.q-wrap:has(#conv-q-list:not([hidden])),
.q-wrap.is-open {
  z-index: 400;
}

.converter-card:has(.q-wrap.is-open),
.converter-card:has(#conv-q-list:not([hidden])) {
  position: relative;
  z-index: 200;
}

.q-sel {
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  min-width: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.q-chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: inline-block;
  transition: transform 0.2s ease;
  line-height: 1;
}

.q-wrap.is-open .q-chevron {
  transform: rotate(180deg);
}

.q-menu {
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  list-style: none;
  min-width: 200px;
  width: max-content;
  height: auto;
  z-index: 401;
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  margin: 0;
  overflow: hidden;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .q-menu {
  background: rgba(48, 48, 52, 0.97);
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .q-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
}

.q-menu[hidden] {
  display: none !important;
}

.converter-card,
.conv-form {
  overflow: visible;
}

.q-menu li {
  display: grid;
  grid-template-columns: 1.1rem 1fr auto;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0.75rem;
  margin: 0.08rem 0;
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  border-radius: 10px;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
  line-height: 1.3;
}

.q-check {
  visibility: hidden;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.q-label {
  text-align: center;
  white-space: nowrap;
}

.q-star {
  color: #c9a227;
  font-size: 0.78rem;
  width: 1rem;
  text-align: center;
  line-height: 1;
}

.q-menu li:hover,
.q-menu li.q-act {
  background: var(--glass-highlight);
  color: var(--text);
}

.q-menu li.q-on {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-weight: 600;
}

[data-theme="light"] .q-menu li.q-on {
  background: rgba(0, 0, 0, 0.06);
}

.q-menu li.q-on .q-check {
  visibility: visible;
}

.go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.75rem;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}

.controls-row .go {
  margin-right: 0.3rem;
}

#conv-go.glass-btn {
  transition:
    transform 0.15s ease,
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

@keyframes go-rainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 400% 50%; }
}

[data-theme="dark"] #conv-go.glass-btn:hover:not(:disabled),
[data-theme="dark"] #conv-go.glass-btn:focus-visible:not(:disabled) {
  background: #d4c8f0;
  color: #1a1428;
  border-color: rgba(196, 176, 232, 0.65);
  box-shadow: 0 8px 28px rgba(180, 160, 220, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

[data-theme="light"] #conv-go.glass-btn:hover:not(:disabled),
[data-theme="light"] #conv-go.glass-btn:focus-visible:not(:disabled) {
  background: linear-gradient(
    90deg,
    #ff3b30,
    #ff9500,
    #ffcc00,
    #34c759,
    #007aff,
    #5856d6,
    #af52de,
    #ff2d55,
    #ff3b30
  );
  background-size: 400% 100%;
  animation: go-rainbow 2.8s linear infinite;
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
}

.terms-row input {
  margin-top: 3px;
  accent-color: var(--accent);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.terms-row.invalid { outline: 1px solid var(--err); }

.terms-alert { color: var(--err); font-size: 0.88rem; margin-top: 0.4rem; }

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
  margin-top: 2.75rem;
  position: relative;
  z-index: 0;
}

.feature-card {
  border-radius: var(--radius);
  padding: 1.5rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* How */
.how-block {
  margin-top: 2.75rem;
  padding: 1.75rem 2rem;
  border-radius: var(--radius);
}

.how-block h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1.25rem;
}

.how-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.how-steps li {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 1.75rem 2rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-links {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  opacity: 1;
}

.footer-credit {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.footer-credit:hover {
  color: var(--text);
  text-decoration: underline;
}

.textbtn {
  background: none;
  border: none;
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.textbtn:hover { opacity: 0.75; }

@media (max-width: 768px) {
  :root,
  [data-theme="dark"] {
    --photo-opacity: 0.38;
    --photo-blur: 0px;
    --photo-saturate: 0.82;
    --liquid-opacity: 0;
    --glass-bg: rgba(40, 40, 44, 0.9);
    --glass-bg-strong: rgba(46, 46, 50, 0.93);
    --glass-inset: rgba(34, 34, 38, 0.9);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  [data-theme="light"] {
    --photo-opacity: 0.62;
    --photo-saturate: 0.95;
    --glass-bg: rgba(255, 255, 255, 0.93);
    --glass-bg-strong: rgba(255, 255, 255, 0.96);
    --glass-inset: rgba(248, 248, 252, 0.95);
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  }

  html { scroll-behavior: auto; }

  .liquid-texture,
  .liquid-filter {
    display: none;
  }

  .bg-photo {
    inset: 0;
    transform: none;
    filter: saturate(var(--photo-saturate, 0.85));
  }

  .bg-photo-dark {
    background-image: url("assets/bg-mobile.jpg");
  }

  .bg-photo-light {
    background-image: url("assets/bg-light-mobile.jpg");
  }

  .bg-fade {
    background:
      linear-gradient(180deg, var(--fade-top) 0%, transparent 28%),
      linear-gradient(0deg, var(--fade-bottom) 0%, transparent 40%),
      radial-gradient(ellipse 100% 80% at 50% 50%, transparent 10%, var(--fade-mid) 100%);
  }

  .glass,
  .glass-sm,
  .site-header.glass,
  .site-footer.glass {
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
  }

  .glass-inset,
  .glass-btn,
  .q-menu,
  .converter-card.glass,
  .feature-card.glass,
  .how-block.glass {
    backdrop-filter: blur(6px) saturate(1.05);
    -webkit-backdrop-filter: blur(6px) saturate(1.05);
  }

  .liquid-glass::before {
    opacity: 0.45;
  }

  .features-grid,
  .how-block {
    content-visibility: auto;
    contain-intrinsic-size: auto 280px;
  }

  .features-grid { grid-template-columns: 1fr; }
  .header-inner,
  .page-main {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .header-inner {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .header-nav a.nav-link { display: none; }

  .header-nav {
    gap: 0.55rem;
    flex-shrink: 0;
  }

  .lang-sel {
    min-width: 0;
    min-height: 44px;
    padding: 0.5rem 0.8rem;
    font-size: 0.88rem;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .brand {
    font-size: 1.05rem;
    min-width: 0;
  }

  .page-title {
    font-size: clamp(1.65rem, 7.5vw, 2.2rem);
    line-height: 1.15;
  }

  .page-subtitle {
    font-size: 0.95rem;
  }

  .converter-card {
    padding: 1.35rem;
  }

  .url-field {
    min-height: 48px;
    padding: 0.35rem 0.4rem 0.35rem 0.85rem;
  }

  .url-field input {
    font-size: 16px;
    min-width: 0;
  }

  .input-action-btn {
    min-height: 40px;
    padding: 0 0.85rem;
    flex-shrink: 0;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .controls-left {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    min-width: 0;
  }

  .seg-group {
    width: 100%;
    min-width: 0;
  }

  .seg-btn {
    flex: 1;
    min-height: 44px;
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
  }

  .q-wrap {
    width: 100%;
    min-width: 0;
  }

  .q-sel {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
  }

  .controls-row .go,
  .conv-dl.go {
    width: 100%;
    min-height: 48px;
    margin-right: 0;
    padding: 0.85rem 1.15rem;
    font-size: 1rem;
    justify-content: center;
  }

  .terms-row {
    padding: 0.85rem 0.95rem;
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .terms-row input {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
  }

  .status-actions {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .status-actions .textbtn,
  #conv-again {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (max-width: 600px) {
  .controls-left {
    grid-template-columns: 1fr;
  }

  .seg-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body { font-size: 16px; }
}

/* ── Light mode refinements ── */
[data-theme="light"] .page-title {
  color: var(--text);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.95), 0 1px 2px rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .page-subtitle {
  color: #1a1a1e;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .converter-card.glass {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

[data-theme="light"] .liquid-glass::before {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.6) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.03) 100%
  );
}

[data-theme="light"] .glass-inset {
  background: rgba(242, 242, 246, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .url-field input {
  color: var(--text);
}

[data-theme="light"] .url-field input::placeholder {
  color: #4a4a52;
  opacity: 1;
}

[data-theme="light"] .input-action-btn {
  color: #2a2a30;
  border-left-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .input-action-btn:hover {
  color: var(--text);
}

[data-theme="light"] .seg-group {
  background: rgba(236, 236, 240, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .seg-btn {
  color: #3a3a42;
}

[data-theme="light"] .seg-btn.is-on {
  color: var(--text);
  font-weight: 600;
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 1);
}

[data-theme="light"] .q-sel {
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .terms-row {
  color: #1a1a1e;
  background: rgba(248, 248, 252, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .terms-row a {
  color: var(--text);
  font-weight: 600;
}

[data-theme="light"] .feature-card.glass {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .feature-card p,
[data-theme="light"] .how-steps li {
  color: #2a2a30;
}

[data-theme="light"] .how-block.glass {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .how-block h2 {
  color: #3a3a42;
}

[data-theme="light"] .glass-btn {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .site-header.glass {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .header-nav .nav-link {
  color: #1a1a1e;
  font-weight: 500;
}

[data-theme="light"] .site-footer.glass {
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: #2a2a30;
}
