:root {
  --yt-red: #FF0000;
  --yt-red-hover: #CC0000;
  --yt-red-light: #FF4444;
  --dark-1: #0F0F0F;
  --dark-2: #181818;
  --dark-3: #272727;
  --dark-4: #3F3F3F;
  --gray-1: #F2F2F2;
  --gray-2: #E5E5E5;
  --gray-3: #AAAAAA;
  --gray-4: #606060;
  --white: #FFFFFF;
  --green: #2BA640;
  --shadow: 0 2px 10px rgba(0,0,0,.12);
  --shadow-md: 0 6px 24px rgba(0,0,0,.16);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.24);
  --radius: 12px;
  --radius-sm: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--dark-1);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--yt-red); text-decoration: none; }
a:hover { color: var(--yt-red-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-2);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dark-1);
  font-weight: 600;
  font-size: 1.05rem;
}
.logo-icon {
  width: 36px;
  height: 26px;
  background: var(--yt-red);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.logo-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 9px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 2px;
}
.logo-text { line-height: 1.1; }
.logo-text .logo-fr { color: var(--gray-4); font-size: .7rem; font-weight: 400; display: block; margin-top: 1px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px;
  border-radius: 18px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--dark-1);
  transition: background .2s, color .2s;
}
.nav a:hover { background: var(--gray-1); text-decoration: none; }
.nav a.active { background: var(--dark-1); color: var(--white); }

.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--dark-1); margin: 5px 0; transition: .3s; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(180deg, var(--dark-1) 0%, var(--dark-2) 100%);
  color: var(--white);
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,0,0,.18) 0%, transparent 60%);
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -100px;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(255,0,0,.08) 0%, transparent 60%);
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,0,0,.15);
  border: 1px solid rgba(255,0,0,.35);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 500;
  margin-bottom: 18px;
}
.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--yt-red-light);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 14px;
  max-width: 800px;
}
.hero h1 .red { color: var(--yt-red-light); }
.hero-sub {
  font-size: 1.05rem;
  color: var(--gray-3);
  max-width: 640px;
  margin-bottom: 28px;
  line-height: 1.55;
}

/* ===== TOOL ===== */
.tool-card {
  background: var(--dark-3);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.06);
  max-width: 760px;
}
.tool-input-wrap {
  display: flex;
  gap: 10px;
  position: relative;
}
.tool-input {
  flex: 1;
  background: var(--dark-2);
  border: 2px solid var(--dark-4);
  border-radius: var(--radius-sm);
  color: var(--white);
  padding: 14px 50px 14px 18px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .2s, background .2s;
  min-width: 0;
}
.tool-input:focus {
  outline: none;
  border-color: var(--yt-red);
  background: var(--dark-1);
}
.tool-input::placeholder { color: var(--gray-4); }
.tool-clear {
  position: absolute;
  right: 130px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--dark-4);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--white);
  font-size: 1rem;
  font-weight: 400;
  line-height: 26px;
  text-align: center;
  display: none;
  padding: 0;
}
.tool-clear.show { display: block; }
.tool-clear:hover { background: var(--gray-4); }

.tool-btn {
  background: var(--yt-red);
  color: var(--white);
  border: none;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: .98rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-btn:hover { background: var(--yt-red-hover); }
.tool-btn:active { transform: scale(.97); }
.tool-btn:disabled { background: var(--dark-4); cursor: not-allowed; color: var(--gray-3); }
.tool-btn .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: none;
}
.tool-btn.loading .spinner { display: inline-block; }
.tool-btn.loading .btn-label { opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }

.tool-hint {
  color: var(--gray-3);
  font-size: .8rem;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== ERROR MESSAGE ===== */
.tool-error {
  background: rgba(255,0,0,.12);
  border: 1px solid rgba(255,0,0,.35);
  color: #FFD0D0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
  font-size: .9rem;
  display: none;
}
.tool-error.show { display: block; }

/* ===== PREVIEW CARD ===== */
.preview {
  margin-top: 22px;
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s ease, transform .35s ease;
}
.preview.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.preview-card {
  background: var(--dark-2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}
.preview-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 18px;
}
.preview-thumb-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--dark-3);
}
.preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.25);
  opacity: 0;
  transition: opacity .25s;
  cursor: pointer;
}
.preview-thumb-wrap:hover .preview-play { opacity: 1; }
.preview-play svg { width: 60px; height: 60px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); }

.preview-info { display: flex; flex-direction: column; }
.preview-title {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.preview-author {
  color: var(--gray-3);
  font-size: .85rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-author::before {
  content: '';
  width: 18px;
  height: 18px;
  background: var(--yt-red);
  border-radius: 50%;
  flex-shrink: 0;
}

.qualities-title {
  color: var(--gray-3);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.qualities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.quality-btn {
  background: var(--dark-3);
  border: 1px solid var(--dark-4);
  color: var(--white);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.quality-btn:hover {
  background: var(--dark-4);
  border-color: var(--yt-red);
  text-decoration: none;
  color: var(--white);
  transform: translateY(-1px);
}
.quality-btn .quality-label {
  font-weight: 600;
  color: var(--white);
}
.quality-btn .quality-format {
  color: var(--gray-3);
  font-size: .72rem;
  margin-left: auto;
}
.quality-btn.audio { border-left: 3px solid #4FC3F7; }
.quality-btn.video-4k { border-left: 3px solid #FFD600; position: relative; }
.quality-btn.video-4k .quality-label::after {
  content: 'UHD';
  background: #FFD600;
  color: #000;
  font-size: .55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 6px;
  letter-spacing: .04em;
  vertical-align: middle;
}
.quality-btn.video-hd { border-left: 3px solid var(--yt-red); }
.quality-btn.video-sd { border-left: 3px solid var(--gray-4); }

/* ===== CONTENT ===== */
.content-section { padding: 56px 0; }
.content-section:nth-child(even) { background: var(--gray-1); }
.content-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--dark-1);
  letter-spacing: -.01em;
}
.content-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--dark-1);
}
.content-section p { color: var(--gray-4); margin-bottom: 14px; }
.content-section p strong { color: var(--dark-1); }
.content-section ul, .content-section ol { padding-left: 24px; margin-bottom: 16px; color: var(--gray-4); }
.content-section li { margin-bottom: 6px; }

.info-box {
  background: rgba(255,0,0,.06);
  border-left: 3px solid var(--yt-red);
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--dark-1);
}
.warn-box {
  background: #FFF8E1;
  border-left: 3px solid #FFB300;
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--dark-1);
}

/* ===== STEPS ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}
.step {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 24px 22px;
  position: relative;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.step:hover { border-color: var(--yt-red); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.step-num {
  width: 36px; height: 36px;
  background: var(--yt-red);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--dark-1); }
.step p { font-size: .9rem; color: var(--gray-4); margin: 0; }

/* ===== FAQ ===== */
.faq-list { list-style: none; padding: 0; }
.faq-item { border: 1px solid var(--gray-2); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; background: var(--white); }
.faq-question {
  width: 100%; background: none; border: none; padding: 14px 18px;
  font-size: .95rem; font-weight: 500; text-align: left; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-family: inherit; color: var(--dark-1);
}
.faq-question:hover { background: var(--gray-1); }
.faq-question::after { content: '+'; font-size: 1.3rem; font-weight: 300; color: var(--yt-red); transition: transform .25s; }
.faq-item.open .faq-question::after { content: '\2212'; }
.faq-item.open .faq-question { background: rgba(255,0,0,.05); color: var(--yt-red); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-item.open .faq-answer { max-height: 800px; }
.faq-answer-inner { padding: 0 18px 14px; color: var(--gray-4); font-size: .9rem; line-height: 1.65; }

/* ===== FOOTER ===== */
.footer {
  background: var(--dark-1);
  color: var(--gray-3);
  padding: 48px 0 24px;
  margin-top: 48px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
.footer h4 { color: var(--white); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.footer p { font-size: .82rem; line-height: 1.6; color: var(--gray-3); }
.footer a { color: var(--gray-3); font-size: .85rem; display: block; margin-bottom: 7px; text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 36px; padding-top: 18px; font-size: .75rem; text-align: center; color: var(--gray-4); }

/* ===== BREADCRUMB ===== */
.breadcrumb { padding: 12px 0; font-size: .82rem; color: var(--gray-4); }
.breadcrumb a { color: var(--gray-4); }
.breadcrumb a:hover { color: var(--yt-red); }
.breadcrumb span { margin: 0 6px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 36px 0 44px; }
  .hero h1 { font-size: 1.75rem; }
  .hero-sub { font-size: .95rem; }
  .tool-card { padding: 16px; }
  .tool-input-wrap { flex-direction: column; }
  .tool-clear { right: 14px; top: 17px; transform: none; }
  .tool-btn { width: 100%; justify-content: center; }
  .preview-grid { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .qualities { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .hamburger { display: block; }
  .nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--gray-2);
    padding: 12px; box-shadow: var(--shadow); z-index: 50;
  }
  .nav.open a { border-radius: var(--radius-sm); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .steps { grid-template-columns: 1fr; }
  .content-section { padding: 40px 0; }
  .content-section h2 { font-size: 1.35rem; }
}
@media (max-width: 480px) {
  .qualities { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
