/* =========================================================
   Theme
   ========================================================= */
:root {
  --ink: #12132b;
  --ink-2: #3c3f5c;
  --muted: #6b6f8c;
  --bg: #f6f5fb;
  --card: #ffffff;
  --line: #e6e4f2;
  --violet: #6b4cff;
  --violet-2: #5236e8;
  --mint: #16c79a;
  --hero: #0d0e24;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(18, 19, 43, .04), 0 8px 28px rgba(18, 19, 43, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", "Noto Sans Thai", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: var(--violet-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 800; }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1em; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--violet); color: #fff; font-weight: 700;
  padding: 13px 22px; border-radius: 999px; border: 0;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--violet-2); text-decoration: none; transform: translateY(-1px); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: #eeeaff; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--violet-2); background: #ece8ff; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
.lead { font-size: 1.075rem; color: var(--muted); max-width: 720px; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 14, 36, .86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark svg { border-radius: 9px; }
.header-nav { display: flex; gap: 6px; margin-left: auto; }
.header-nav a { color: #c9c8e6; font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 10px; }
.header-nav a:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }

.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  padding: 8px 12px; border-radius: 999px; font-size: .9rem; font-weight: 600;
}
.lang-btn:hover { background: rgba(255,255,255,.14); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  list-style: none; margin: 0; padding: 8px;
  background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(13,14,36,.25);
  display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 2px;
  min-width: 300px;
}
.lang-menu[hidden] { display: none; }
.lang-menu a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ink); font-size: .93rem; }
.lang-menu a:hover { background: var(--bg); text-decoration: none; }
.lang-menu a[aria-current] { background: #ece8ff; color: var(--violet-2); font-weight: 700; }

/* =========================================================
   Hero / converter
   ========================================================= */
.hero { position: relative; background: var(--hero); color: #d9d8f0; overflow: hidden; padding: 64px 0 56px; }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 340px at 12% 10%, rgba(107, 76, 255, .45), transparent 70%),
    radial-gradient(520px 320px at 92% 30%, rgba(22, 199, 154, .28), transparent 70%),
    radial-gradient(700px 300px at 50% 120%, rgba(107, 76, 255, .35), transparent 70%);
}
.hero-bg::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; opacity: .22;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 3px, transparent 3px 14px);
  -webkit-mask: linear-gradient(to top, #000, transparent);
          mask: linear-gradient(to top, #000, transparent);
  clip-path: polygon(0 70%, 5% 40%, 10% 62%, 15% 25%, 20% 55%, 25% 35%, 30% 65%, 35% 20%, 40% 50%, 45% 30%, 50% 60%, 55% 15%, 60% 45%, 65% 28%, 70% 58%, 75% 22%, 80% 52%, 85% 34%, 90% 62%, 95% 38%, 100% 55%, 100% 100%, 0 100%);
}
.hero-inner { position: relative; text-align: center; max-width: 880px; }
.hero h1 { color: #fff; margin-bottom: 14px; }
.hero-sub { font-size: 1.1rem; color: #b9b8d8; max-width: 640px; margin: 0 auto 30px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  font-size: .85rem; font-weight: 700; color: #cfe9e1;
  background: rgba(22,199,154,.12); border: 1px solid rgba(22,199,154,.35);
  padding: 5px 12px; border-radius: 999px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(22,199,154,.25); }

.converter { position: relative; max-width: 760px; margin: 0 auto; }
.converter-field {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 18px; padding: 8px;
  box-shadow: 0 0 0 6px rgba(107,76,255,.18), 0 24px 60px rgba(0,0,0,.35);
  transition: box-shadow .2s;
}
.converter-field:focus-within { box-shadow: 0 0 0 6px rgba(22,199,154,.35), 0 24px 60px rgba(0,0,0,.35); }
.converter-icon { color: #9a9cb8; margin-left: 10px; flex: none; }
.converter input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1.05rem; color: var(--ink); padding: 14px 6px;
}
.converter input::placeholder { color: #9a9cb8; }
.paste-btn {
  flex: none; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
  font-weight: 600; font-size: .88rem; padding: 9px 12px; border-radius: 10px;
}
.paste-btn:hover { background: #ece8ff; }
.convert-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 13px; padding: 15px 24px;
  background: linear-gradient(135deg, var(--violet), #8f5bff 55%, #7a4dff);
  color: #fff; font-weight: 800; font-size: 1.02rem;
  transition: transform .15s, filter .2s;
}
.convert-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.convert-btn[disabled] { opacity: .7; cursor: progress; }
.converter-hint { font-size: .9rem; color: #9998bd; margin: 14px 0 12px; }
.format-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 0; }
.format-chips li { font-size: .8rem; font-weight: 700; color: #cfcde8; border: 1px solid rgba(255,255,255,.14); padding: 4px 10px; border-radius: 999px; }

.suggest {
  position: absolute; left: 0; right: 0; top: 74px; z-index: 20; text-align: left;
  list-style: none; margin: 0; padding: 6px; background: #fff; border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.3);
}
.suggest[hidden] { display: none; }
.suggest li { padding: 10px 12px; border-radius: 10px; color: var(--ink); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.suggest li::before { content: ""; width: 14px; height: 14px; flex: none; opacity: .45;
  background: no-repeat center/14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312132b' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.suggest li.active, .suggest li:hover { background: var(--bg); }

.terms-note { font-size: .82rem; color: #8382a6; margin: 22px 0 0; }
.terms-note a { color: #c8bfff; }

/* result (widget iframe) */
.result {
  max-width: 820px; margin: 28px auto 0; text-align: left;
  background: #fff; border-radius: var(--radius); padding: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  animation: rise .35s ease;
}
.result[hidden] { display: none; }
.result, .search-results, .block { scroll-margin-top: 80px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 4px 12px; }
.result-title { margin: 0; color: var(--ink); font-weight: 800; font-size: 1.05rem; }
.link-btn { border: 0; background: none; color: var(--violet-2); font-weight: 700; padding: 6px 8px; border-radius: 8px; }
.link-btn:hover { background: #ece8ff; }
.result-frame { position: relative; border-radius: 14px; overflow: hidden; background: #f3f2f9; min-height: 200px; }
.result-frame iframe { width: 100%; min-width: 100%; height: var(--h, 420px); border: 0; background: #fff; display: block; }
.frame-loader {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); font-weight: 600; background: #f3f2f9; transition: opacity .3s;
}
.frame-loader.done { opacity: 0; pointer-events: none; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #d9d5f5; border-top-color: var(--violet); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* convert page */
.hero--compact { padding: 32px 0 44px; }
.is-convert .result { margin-top: 24px; padding: 20px; }
.video-head { display: flex; gap: 16px; align-items: center; padding: 0 2px 16px; }
.video-thumb { width: 160px; height: 90px; object-fit: cover; border-radius: 12px; flex: none; background: #222; }
.video-meta { min-width: 0; }
.eyebrow--sm { font-size: .7rem; padding: 3px 8px; margin-bottom: 6px; }
.hero .video-title { font-size: 1.2rem; margin: 0 0 4px; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-sub { margin: 0; font-size: .92rem; color: var(--muted); }
.convert-tip { font-size: .86rem; color: var(--muted); margin: 14px 4px 0; }
.convert-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.convert-error { text-align: center; padding: 24px 12px; }
.hero .convert-error h1 { font-size: 1.5rem; color: var(--ink); }
.convert-error p { color: var(--muted); }
.block--tight { padding-top: 8px; }

/* search results */
.search-results { max-width: 820px; margin: 28px auto 0; text-align: left; }
.search-results[hidden] { display: none; }
.sr-head { color: #fff; font-weight: 700; margin-bottom: 12px; }
.sr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.sr-card {
  display: flex; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,.25); animation: rise .3s ease;
}
.sr-thumb { position: relative; aspect-ratio: 16/9; background: #222; }
.sr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sr-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.78); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.sr-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sr-title { color: var(--ink); font-weight: 700; font-size: .95rem; line-height: 1.35; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-channel { color: var(--muted); font-size: .82rem; margin: 0; }
.sr-btn { margin-top: auto; align-self: flex-start; border: 0; background: var(--violet); color: #fff; font-weight: 700; font-size: .9rem; padding: 9px 16px; border-radius: 10px; }
.sr-btn:hover { background: var(--violet-2); }
.notice {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); color: #e5e4f7;
  border-radius: 16px; padding: 18px 20px; text-align: center;
}
.notice p { margin: 0 0 12px; }
.notice p:last-child { margin: 0; }
.notice--error { border-color: rgba(255,120,120,.45); background: rgba(255,90,90,.1); }

/* =========================================================
   Content
   ========================================================= */
.content { padding-top: 56px; padding-bottom: 40px; }
.intro {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 36px; box-shadow: var(--shadow); font-size: 1.06rem;
}
.intro p:last-child { margin-bottom: 0; }
.block { padding: 64px 0 0; }

.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; counter-reset: s; }
.step {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px 20px; box-shadow: var(--shadow);
}
.step-num {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; margin-bottom: 16px;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--violet), var(--mint));
}
.step h3 { font-size: 1.05rem; }
.step p { font-size: .95rem; margin: 0; color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 28px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d6d0fb; }
.feature-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #ece8ff; color: var(--violet-2); margin-bottom: 16px; }
.feature:nth-child(even) .feature-icon { background: #dcf7ee; color: #0e9b77; }
.feature p { margin: 0; color: var(--muted); font-size: .97rem; }

.why-card {
  position: relative; overflow: hidden; border-radius: 28px; padding: 48px clamp(24px, 5vw, 56px);
  background: radial-gradient(500px 260px at 100% 0%, rgba(22,199,154,.35), transparent 70%), linear-gradient(135deg, #1a1b44, var(--hero));
  color: #cfcde8;
}
.why-card h2 { color: #fff; max-width: 680px; }
.why-card p { max-width: 760px; }
.why-card .btn { margin-top: 10px; }

.faq { margin-top: 24px; display: grid; gap: 12px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; transition: border-color .2s, box-shadow .2s; }
.faq-item[open] { border-color: #d6d0fb; box-shadow: var(--shadow); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { margin: 0; font-size: 1.04rem; }
.faq-plus { position: relative; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--bg); }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; background: var(--violet-2); transform: translate(-50%, -50%); transition: transform .2s; }
.faq-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] .faq-plus::after { transform: translate(-50%, -50%) rotate(0); }
.faq-a { padding: 0 22px 18px; color: var(--muted); }
.faq-a p { margin: 0; }

/* =========================================================
   Static pages
   ========================================================= */
.page { padding: 56px 0 72px; }
.page-hero { background: var(--hero); color: #cfcde8; padding: 52px 0 44px; position: relative; overflow: hidden; }
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 8px; }
.page-hero p { margin: 0; color: #a9a8c9; }
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.contact-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; background: var(--bg); border-radius: 16px; padding: 20px 22px; margin: 18px 0; }
.contact-card strong { color: var(--ink); font-size: 1.1rem; }
.page-404 { text-align: center; padding: 40px 0; }
.page-404 h1 { font-size: 2.4rem; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer { background: var(--hero); color: #9e9dc0; margin-top: 72px; padding: 52px 0 34px; font-size: .93rem; }
.footer-inner { display: grid; gap: 26px; }
.footer-brand p { margin: 8px 0 0; max-width: 520px; }
.brand--light { font-size: 1.4rem; }
.footer-links, .footer-langs { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: #e5e4f7; font-weight: 600; }
.footer-langs { padding-top: 22px; border-top: 1px solid rgba(255,255,255,.08); }
.footer-langs a { color: #9e9dc0; }
.footer-note { font-size: .84rem; max-width: 860px; margin: 0; }
.footer-copy { margin: 0; font-size: .85rem; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .header-nav { display: none; }
  .lang { margin-left: auto; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 40px; }
  .hero-sub { font-size: 1rem; margin-bottom: 22px; }
  .converter-field { flex-wrap: wrap; padding: 6px; border-radius: 16px; }
  .converter input { padding: 12px 4px; font-size: 1rem; }
  .convert-btn { width: 100%; justify-content: center; padding: 14px; }
  .suggest { top: 64px; }
  .lang-btn span { display: none; }
  .lang-menu { min-width: 260px; right: -8px; }
  .intro { padding: 24px 22px; }
  .block { padding-top: 48px; }
  .result { padding: 10px; border-radius: 16px; }
  .is-convert .result { padding: 12px; }
  .video-head { gap: 12px; }
  .video-thumb { width: 112px; height: 63px; border-radius: 10px; }
  .hero .video-title { font-size: 1rem; }
  .video-sub { display: none; }
  .result-frame iframe { height: var(--hm, 480px); }
  .features { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
