/* Premium layer — loads after main.css, before responsive.css.
   Pure visual polish: no layout-breaking changes, no external fonts or images. */

:root {
  --accent-2: #2563eb;
  --grad-accent: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --radius-lg: 16px;
  --ring: 0 0 0 1px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 12px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.04), 0 24px 48px -12px rgba(15, 23, 42, 0.18);
  --code-bg-deep: #0b1220;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

body {
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(14, 165, 233, 0.25); }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: rgba(226, 232, 240, 0.9);
}
.brand-mark {
  background: var(--grad-accent);
  border: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}
.brand-mark svg { color: #fff; }
.brand-mark svg * { stroke: #fff; }
.nav-desktop a { transition: background 0.18s var(--ease), color 0.18s var(--ease); }
.nav-desktop a[aria-current="page"] {
  background: var(--accent-dim);
  color: var(--accent-hover);
  font-weight: 600;
}
.lang-btn { transition: border-color 0.15s, box-shadow 0.15s; }
.lang-btn:hover { border-color: #cbd5e1; box-shadow: var(--shadow-sm); }
.lang-menu { border-radius: 12px; box-shadow: var(--shadow-lg); }

/* ---------- Buttons ---------- */
.btn {
  border-radius: 8px;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease),
    box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: var(--grad-accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background: var(--grad-accent);
  filter: brightness(1.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}
.btn-secondary { box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: #f8fafc; box-shadow: var(--shadow-md); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 3rem 0 1.5rem;
  position: relative;
}
.hero .hero-sub { margin-inline: auto; font-size: 1.12rem; }
.hero-title {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #0284c7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2rem, 4.2vw, 3rem);
  letter-spacing: -0.035em;
}
.page-hero .hero-title { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
@media (forced-colors: active) {
  .hero-title { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
}

/* ---------- Converter card ---------- */
.converter {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-lg), var(--ring);
}
.converter-toolbar {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 0.85rem 1.1rem;
}
.editor-label {
  justify-content: flex-start;
  gap: 0.85rem;
  background: #f8fafc;
  padding: 0.6rem 1rem;
}
.editor-label::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 16px 0 0 #fbbf24, 32px 0 0 #34d399;
  margin-inline-end: 34px;
}
.editor-wrap, .tool-workspace textarea { background: var(--code-bg-deep); }
.line-numbers { border-right-color: #172033; color: #475569; }
.editor-wrap textarea, .tool-workspace textarea { caret-color: #38bdf8; }
.editor-wrap textarea::selection, .tool-workspace textarea::selection { background: rgba(56, 189, 248, 0.3); }
.editor-wrap textarea, .tool-workspace textarea, .notes-list {
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.editor-wrap textarea::-webkit-scrollbar, .tool-workspace textarea::-webkit-scrollbar { width: 10px; height: 10px; }
.editor-wrap textarea::-webkit-scrollbar-thumb, .tool-workspace textarea::-webkit-scrollbar-thumb {
  background: #334155; border-radius: 8px; border: 2px solid var(--code-bg-deep);
}
.meta-block h3 { color: var(--text-muted); }
.stats-list li { padding: 0.1rem 0; }
.status-bar { background: #f8fafc; }

/* ---------- Trust benefits ---------- */
.callout {
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(37, 99, 235, 0.06));
  border-color: rgba(14, 165, 233, 0.22);
}
.benefit {
  border-radius: 14px;
  padding: 1.1rem 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}
.benefit:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.benefit::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 0.65rem;
  border-radius: 12px;
  background-color: var(--accent-dim);
  background-image: var(--ico);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
}
.benefit:nth-child(1) { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); }
.benefit:nth-child(2) { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m0 0-4-4m4 4 4-4M5 21h14'/%3E%3C/svg%3E"); }
.benefit:nth-child(3) { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12 12 20 4 12V4h8z'/%3E%3Ccircle cx='8.5' cy='8.5' r='1'/%3E%3C/svg%3E"); }
.benefit:nth-child(4) { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 9h18'/%3E%3C/svg%3E"); }
.benefit:nth-child(5) { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v5c0 5 3 8 7 10 4-2 7-5 7-10V6z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }

/* ---------- Sections, steps, use cases ---------- */
.section-title { font-size: 1.65rem; letter-spacing: -0.025em; }
.step { border-radius: 14px; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.step:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.steps-numbered { list-style: none; margin: 0; padding: 0; }
.step-numbered { position: relative; padding: 1.35rem 1.2rem 1.2rem; }
.step-numbered::before { content: none; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 0.7rem;
  border-radius: 50%;
  background: var(--grad-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}
.use-cases li {
  position: relative;
  padding: 0.7rem 0.9rem 0.7rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.use-cases li:hover { border-color: rgba(14, 165, 233, 0.5); box-shadow: var(--shadow-md); }
.use-cases li::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
}
[dir="rtl"] .use-cases li { padding: 0.7rem 2.5rem 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: 12px; }
[dir="rtl"] .use-cases li::before { left: auto; right: 0.85rem; }
.example-btn {
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.example-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Tool & guide cards ---------- */
.tool-card {
  position: relative;
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity 0.22s;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tool-card:hover::before { opacity: 1; }
.tool-card .cat {
  align-self: flex-start;
  background: var(--accent-dim);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.tool-card .cta { transition: transform 0.2s var(--ease); }
.tool-card:hover .cta { transform: translateX(3px); }

/* ---------- Tool workspace: input and output side by side ---------- */
.tool-workspace {
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-lg), var(--ring);
}
.tool-workspace label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  display: block;
}
.tool-workspace textarea {
  border-radius: 10px;
  border-color: #172033;
  min-height: 280px;
  line-height: 1.55;
}
.tool-workspace #tool-output { background: #0a101d; }
.tool-actions { margin: 0.9rem 0; }
#tool-status {
  margin: 0;
  min-height: 1.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
#tool-status:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 0.5rem;
  border-radius: 50%;
  background: var(--success);
}
@media (min-width: 900px) {
  .tool-workspace:has(#tool-input):not(.tool-workspace-visual) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 1.1rem;
  }
  .tool-workspace:has(#tool-input) > * { grid-column: 1 / -1; order: 0; }
  .tool-workspace:has(#tool-input) > label[for="tool-input"] { grid-column: 1; order: 1; }
  .tool-workspace:has(#tool-input) > label[for="tool-output"] { grid-column: 2; order: 2; }
  .tool-workspace:has(#tool-input) > #tool-input { grid-column: 1; order: 3; min-height: 340px; }
  .tool-workspace:has(#tool-input) > #tool-output { grid-column: 2; order: 4; min-height: 340px; }
  .tool-workspace:has(#tool-input) > .tool-actions { order: 5; }
  .tool-workspace:has(#tool-input) > #tool-status { order: 6; }
  .tool-workspace:has(#tool-input) > #html-frame { order: 7; margin-top: 1rem; }
}

/* ---------- Article body ---------- */
.tool-article { max-width: 46rem; margin-top: 2rem; }
.prose { line-height: 1.75; }
.prose h2 { padding-top: 0.25rem; }
.prose p, .prose li { color: #334155; }
.prose a { text-underline-offset: 3px; text-decoration: underline; text-decoration-color: rgba(2, 132, 199, 0.35); }
.prose a:hover { text-decoration-color: currentColor; }
.prose pre { border-radius: 12px; background: var(--code-bg-deep); border-color: #172033; }

/* FAQ accordion */
.faq-list details {
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 0;
  transition: box-shadow 0.2s var(--ease), border-color 0.2s;
}
.faq-list details[open] { box-shadow: var(--shadow-md); border-color: rgba(14, 165, 233, 0.45); }
.faq-list summary {
  list-style: none;
  position: relative;
  padding: 0.95rem 2.75rem 0.95rem 1.1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.faq-list details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-list details p { margin: 0; padding: 0 1.1rem 1.1rem; }
[dir="rtl"] .faq-list summary { padding: 0.95rem 1.1rem 0.95rem 2.75rem; }
[dir="rtl"] .faq-list summary::after { right: auto; left: 1.1rem; }
.faq-list .faq-item { margin-bottom: 0.65rem; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  background: #0b1220;
  border-top: 0;
  color: #94a3b8;
}
.footer-col h3 { color: #e2e8f0; }
.footer-col a { color: #94a3b8; transition: color 0.15s; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top-color: #1e293b; color: #94a3b8; }
.site-footer a:focus-visible { box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.5); }

/* ---------- Chrome Extension highlight ---------- */
.btn-chrome {
  gap: 0.45rem;
  background: #0f172a;
  color: #fff;
  border: 1px solid #1e293b;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 4px 12px rgba(15, 23, 42, 0.2);
}
.btn-chrome:hover {
  background: #1e293b;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 8px 18px rgba(15, 23, 42, 0.28);
}
.btn-chrome .chrome-ico { flex: none; color: #38bdf8; }
.btn-chrome-header {
  padding: 0.42rem 0.75rem;
  font-size: 0.82rem;
  white-space: nowrap;
}
.btn-chrome-lg {
  padding: 0.8rem 1.2rem;
  font-size: 0.95rem;
  border-radius: 10px;
}
.chrome-ext-mobile {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding: 0.85rem 0.75rem;
  border-radius: 10px;
  background: #0f172a;
  color: #fff !important;
  font-weight: 600;
  text-decoration: none !important;
}
.chrome-ext-mobile .chrome-ico { color: #38bdf8; }
.chrome-promo {
  margin: 0.5rem 0 0;
  padding: 2rem 0;
  background:
    radial-gradient(700px 240px at 12% 0%, rgba(56, 189, 248, 0.16), transparent 55%),
    linear-gradient(135deg, #0b1220 0%, #132337 55%, #0f172a 100%);
  color: #e2e8f0;
  border-block: 1px solid #1e293b;
}
.chrome-promo-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}
.chrome-promo-copy { max-width: 40rem; }
.chrome-promo-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #38bdf8;
}
.chrome-promo h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  letter-spacing: -0.02em;
  color: #fff;
}
.chrome-promo p { margin: 0; color: #94a3b8; line-height: 1.6; }
.chrome-promo .btn-chrome {
  background: #fff;
  color: #0f172a;
  border-color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.chrome-promo .btn-chrome:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.chrome-promo .btn-chrome .chrome-ico { color: #0284c7; }
[dir="rtl"] .chrome-promo-inner { flex-direction: row-reverse; }

/* Right-edge sticky Chrome Extension tab (htmlcoderunner-style) */
.chrome-sticky-wrap {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 9999;
  transform: translateY(-50%);
}
.chrome-sticky-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 14px;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 55%, #22d3ee 100%);
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-decoration: none !important;
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: sideways;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-right: 0;
  box-shadow: -4px 8px 28px rgba(2, 132, 199, 0.4);
  transition: filter 0.18s var(--ease), padding 0.18s var(--ease), box-shadow 0.18s var(--ease);
  animation: chrome-sticky-pulse 2.4s ease-in-out infinite;
}
.chrome-sticky-btn:hover {
  filter: brightness(1.08);
  padding-left: 17px;
  padding-right: 16px;
  box-shadow: -6px 10px 32px rgba(2, 132, 199, 0.5);
  animation: none;
  color: #fff !important;
}
.chrome-sticky-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.chrome-sticky-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: currentColor;
  transform: rotate(90deg);
}
.chrome-sticky-label { display: block; white-space: nowrap; }
@keyframes chrome-sticky-pulse {
  0%, 100% { box-shadow: -4px 8px 24px rgba(2, 132, 199, 0.32); }
  50% { box-shadow: -6px 10px 30px rgba(14, 165, 233, 0.48); }
}
[dir="rtl"] .chrome-sticky-wrap {
  right: auto;
  left: 0;
}
[dir="rtl"] .chrome-sticky-btn {
  border-radius: 0 14px 14px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  border-left: 0;
  box-shadow: 4px 8px 28px rgba(2, 132, 199, 0.4);
}
[dir="rtl"] .chrome-sticky-btn:hover {
  box-shadow: 6px 10px 32px rgba(2, 132, 199, 0.5);
}

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn, .benefit, .step, .tool-card, .example-btn, .use-cases li, .btn-chrome, .chrome-sticky-btn { transition: none; }
  .btn:hover, .benefit:hover, .step:hover, .tool-card:hover, .example-btn:hover, .btn-chrome:hover { transform: none; }
  .chrome-sticky-btn { animation: none; }
}
