/* Lyrical website. Plain CSS, no frameworks, no external requests.
   Palette follows the extension itself: paper, ink, amber from the
   icon and popup, dark glass from the lyrics panel. */
:root {
  color-scheme: light;
  --paper: #FAFAF8;
  --surface: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #6B6B66;
  --line: #E5E5E0;
  --soft: #F1EFE8;
  --amber: #FFBF3C;
  --amber-soft: #FFF3D6;
  --amber-deep: #8A5A00;
  --leaf: #3FA97A;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 26, 26, .06), 0 8px 28px rgba(26, 26, 26, .08);
  --shadow-lg: 0 2px 4px rgba(26, 26, 26, .06), 0 20px 50px rgba(26, 26, 26, .14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1A1A1A;
  --surface: #262626;
  --ink: #FAFAF8;
  --muted: #A8A8A3;
  --line: #444444;
  --soft: #2E2E2E;
  --amber-soft: #3A2E0A;
  --amber-deep: #FFBF3C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 28px rgba(0, 0, 0, .4);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 20px 50px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--amber); color: var(--ink); }
a { color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 750; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 16px; }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 640px; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--amber-deep);
  margin-bottom: 14px;
}
.hl-amber {
  background: linear-gradient(transparent 62%, var(--amber) 62%, var(--amber) 96%, transparent 96%);
  padding: 0 .06em;
}
/* Hero sweep: the amber draws itself across the words, left to right. */
.mark-sweep {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='60' preserveAspectRatio='none' viewBox='0 0 300 60'%3E%3Cpath d='M4 12 Q 40 6 80 10 T 160 9 T 240 11 T 296 9 L 296 48 Q 250 54 200 50 T 110 51 T 4 49 Z' fill='%23FFBF3C'/%3E%3C/svg%3E");
  background-size: 0% 100%;
  background-position: left center;
  background-repeat: no-repeat;
  padding: 0 .12em;
  animation: sweep 1.1s cubic-bezier(.6, 0, .2, 1) .5s forwards;
}
@keyframes sweep { to { background-size: 100% 100%; } }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  text-decoration: none; font-size: 15px; font-weight: 600; color: var(--muted);
  padding: 8px 12px; border-radius: 999px;
}
.site-nav a:hover { color: var(--ink); background: var(--soft); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 38px; height: 38px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--soft); }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font: inherit; font-size: 16px; font-weight: 700;
  padding: 13px 22px; border-radius: 999px; cursor: pointer;
  text-decoration: none; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: var(--shadow-lg); }
[data-theme="dark"] .btn-primary { background: var(--paper); color: var(--ink); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--soft); }
.btn-sm { padding: 9px 16px; font-size: 15px; }
.store-note { font-size: 14px; color: var(--muted); margin-top: 12px; }
.store-note.centered { text-align: center; margin-top: 18px; }
.link-btn {
  background: none; border: none; padding: 0; font: inherit; font-size: inherit;
  color: var(--amber-deep); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}

/* ---- hero ---- */
.hero { padding: 84px 0 40px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6vw, 68px); font-weight: 800; letter-spacing: -0.03em; }
.hero .lede { margin: 18px 0 28px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-points { list-style: none; margin: 30px 0 0; padding: 0; display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.hero-points li { display: flex; align-items: center; gap: 7px; }
.hero-points svg { color: var(--leaf); flex: none; }

/* browser mockup */
.browser {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  transform: rotate(1.2deg);
  animation: float-in .9s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes float-in { from { opacity: 0; transform: rotate(1.2deg) translateY(18px); } to { opacity: 1; transform: rotate(1.2deg) translateY(0); } }
.browser-bar { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--soft); }
.browser-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.browser-bar .dot:first-child { background: #F28C8C; }
.browser-bar .dot:nth-child(2) { background: #F5C86B; }
.browser-bar .dot:nth-child(3) { background: #7BC8A4; }
.browser-url { flex: 1; margin-left: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.browser-url svg { flex: none; }
.hero-player { padding: 18px 18px 20px; }
.hero-video {
  position: relative; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #2b2b33 0%, #141417 55%, #3a2e0a 130%);
  aspect-ratio: 16 / 9;
}
.hero-video-label {
  position: absolute; top: 12px; left: 14px; font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .65);
}
.hero-eq { position: absolute; left: 50%; top: 26%; transform: translateX(-50%); display: flex; gap: 5px; align-items: flex-end; height: 34px; }
.hero-eq span { width: 5px; background: var(--amber); border-radius: 3px; animation: eq 1.1s ease-in-out infinite; }
.hero-eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.hero-eq span:nth-child(2) { height: 80%; animation-delay: .18s; }
.hero-eq span:nth-child(3) { height: 55%; animation-delay: .36s; }
.hero-eq span:nth-child(4) { height: 95%; animation-delay: .1s; }
.hero-eq span:nth-child(5) { height: 45%; animation-delay: .28s; }
@keyframes eq { 0%, 100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }
.hero-panel { position: absolute; left: 12px; right: 12px; bottom: 44px; }
.hero-controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.hero-play { width: 0; height: 0; border-left: 12px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; flex: none; }
.hero-seek { flex: 1; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.hero-seek-fill { display: block; width: 26%; height: 100%; background: var(--amber); }
.hero-time { font-size: 12px; color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; }
.mock-caption { font-size: 13px; color: var(--muted); margin: 12px 2px 0; }

/* ---- marquee strip ---- */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; overflow: hidden; background: var(--surface); }
.strip-track { display: flex; gap: 44px; width: max-content; animation: marquee 36s linear infinite; font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.strip-track span { display: inline-flex; align-items: center; gap: 8px; }
.strip-track .sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
@keyframes marquee { to { transform: translateX(-50%); } }
.strip:hover .strip-track { animation-play-state: paused; }

/* ---- sections ---- */
section { padding: 88px 0; }
section.tight { padding: 56px 0; }
.pt-20 { padding-top: 20px; }
.pt-40 { padding-top: 40px; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .lede { margin-left: auto; margin-right: auto; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }

/* ============================================================
   The lyrics panel. These rules follow the extension's own
   overlay.css: dark glass scrim, 18px radius, sung words pure
   white, unsung active words 0.72, inactive lines 0.60, furigana
   full white, romaji under its own word, gap dots, hidden
   scrollbar, edge fade. The panel is one surface, no inner box.
   ============================================================ */
.lyr-panel {
  position: relative;
  margin: 0 auto;
  max-width: 860px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.80) 55%, rgba(0, 0, 0, 0.74) 100%);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  border-radius: 18px;
  padding: 10px 20px 14px;
  color: #fff;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, "SF Pro Display", "Segoe UI", Roboto, "Noto Sans JP", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}
.lyr-panel-btns { position: absolute; top: 8px; right: 10px; display: flex; gap: 6px; z-index: 1; }
.lyr-panel-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.45); color: rgba(255, 255, 255, 0.9);
  font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.lyr-panel-btn:hover { background: rgba(0, 0, 0, 0.65); color: #fff; }
.lyr-panel-handle { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); width: 56px; height: 12px; cursor: ns-resize; z-index: 1; touch-action: none; }
.lyr-panel-handle::after { content: ''; display: block; width: 32px; height: 4px; margin: 4px auto 0; border-radius: 999px; background: rgba(255, 255, 255, 0.35); }
.lyr-panel-handle:hover::after { background: rgba(255, 255, 255, 0.6); }
.lyr-lines {
  max-height: 132px;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.85));
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  position: relative;
  padding: 16px 0 2px;
}
.lyr-lines::-webkit-scrollbar { display: none; }
.lyr-line { padding: 3px 0; }
.lyr-original { font-size: 30px; line-height: 1.4; font-weight: 700; letter-spacing: -0.01em; }
.lyr-line.lyr-active .lyr-original { font-size: 32px; }
.lyr-line:not(.lyr-active) .lyr-original { font-size: 20px; font-weight: 600; }
.lyr-wgroup { display: inline-flex; flex-direction: column; vertical-align: baseline; }
.lyr-word {
  display: block;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.72) 0%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lyr-roman-word {
  display: block; font-size: 16px; line-height: 1.4; font-weight: 500; letter-spacing: 0.01em;
  margin-right: 0.3em;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.72) 0%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lyr-line:not(.lyr-active) .lyr-word {
  background: none; -webkit-background-clip: unset; background-clip: unset; color: rgba(255, 255, 255, 0.60);
}
.lyr-line:not(.lyr-active) .lyr-roman-word {
  font-size: 14px; background: none; -webkit-background-clip: unset; background-clip: unset; color: rgba(255, 255, 255, 0.60);
}
.lyr-word ruby { ruby-position: over; }
.lyr-word rt { font-size: 0.45em; line-height: 1; color: rgba(255, 255, 255, 1.0); }
.lyr-roman {
  font-size: 16px; line-height: 1.4; font-weight: 500; letter-spacing: 0.01em; margin-top: 2px;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.72) 0%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lyr-line:not(.lyr-active) .lyr-roman {
  font-size: 14px; background: none; -webkit-background-clip: unset; background-clip: unset; color: rgba(255, 255, 255, 0.60);
}
/* Display modes. Both shows the original with romaji under each word.
   Original hides every romaji span. Romanized hides the original row
   and shows the romaji row at lyric size. */
.lyr-panel[data-mode="both"] .lyr-roman { display: none; }
.lyr-panel[data-mode="original"] .lyr-roman,
.lyr-panel[data-mode="original"] .lyr-roman-word { display: none; }
.lyr-panel[data-mode="romanized"] .lyr-original { display: none; }
.lyr-roman .lyr-word { display: inline; }
/* Romanized-only mode: the romaji is the main line, at lyric size. */
.lyr-panel[data-mode="romanized"] .lyr-roman { font-size: 30px; font-weight: 700; }
.lyr-panel[data-mode="romanized"] .lyr-line.lyr-active .lyr-roman { font-size: 32px; }
.lyr-panel[data-mode="romanized"] .lyr-line:not(.lyr-active) .lyr-roman { font-size: 20px; font-weight: 600; }
.lyr-status { font-size: 12px; opacity: 0.72; min-height: 0; padding-top: 2px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 0, 0, 0.75); }
.lyr-status:not(:empty) { min-height: 16px; }
.lyr-gap-line { padding: 6px 0; }
.lyr-gap-dots { display: flex; gap: 5px; align-items: center; line-height: 0; }
.lyr-gap-dots span { width: 10px; height: 10px; border-radius: 50%; background: #ffffff; opacity: 0.3; }
.lyr-gap-dots span.lyr-lit { opacity: 1; }
/* Hero preview: static fill, same colours as the live panel. */
.lyr-word.lyr-sung, .lyr-roman-word.lyr-sung {
  background: linear-gradient(90deg, #ffffff 100%, rgba(255, 255, 255, 0.72) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lyr-line.lyr-dim .lyr-original, .lyr-line.lyr-dim .lyr-roman {
  font-size: 20px; font-weight: 600;
  background: none; -webkit-background-clip: unset; background-clip: unset; color: rgba(255, 255, 255, 0.60);
}
.lyr-line.lyr-dim .lyr-roman { font-size: 14px; }

/* ---- live demo ---- */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--soft); }
.demo-bar .demo-title { font-weight: 750; font-size: 15px; margin-right: auto; }
.song-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.song-picker button {
  font: inherit; font-size: 14px; font-weight: 700; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
.song-picker button:hover { color: var(--ink); }
.song-picker button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
[data-theme="dark"] .song-picker button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.player { background: #0c0c0e; }
.video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #26262e 0%, #141417 55%, #3a2e0a 130%); }
.video-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; z-index: 2; }
.video-song { font-size: 15px; font-weight: 700; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.video-site { font-size: 13px; color: rgba(255, 255, 255, .65); }
.video-eq { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); display: flex; gap: 6px; align-items: flex-end; height: 44px; opacity: .35; }
.video-eq span { width: 6px; background: var(--amber); border-radius: 3px; height: 40%; }
.video.playing .video-eq { opacity: 1; }
.video.playing .video-eq span { animation: eq 1.1s ease-in-out infinite; }
.video.playing .video-eq span:nth-child(2) { animation-delay: .15s; }
.video.playing .video-eq span:nth-child(3) { animation-delay: .3s; }
.video.playing .video-eq span:nth-child(4) { animation-delay: .08s; }
.video.playing .video-eq span:nth-child(5) { animation-delay: .22s; }
.video.playing .video-eq span:nth-child(6) { animation-delay: .38s; }
.video.playing .video-eq span:nth-child(7) { animation-delay: .12s; }
.video-hint {
  position: absolute; left: 50%; top: 52%; transform: translateX(-50%);
  font-size: 13.5px; color: rgba(255, 255, 255, .6); text-align: center; max-width: 420px; padding: 0 16px;
}
.video.playing .video-hint { display: none; }
.video .lyr-panel { position: absolute; left: 16px; right: 16px; bottom: 64px; z-index: 3; }
.lyr-hidden {
  position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; z-index: 3;
  background: rgba(0, 0, 0, .72); color: #fff; font-size: 14px;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: 8px 8px 8px 16px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lyr-hidden button {
  font: inherit; font-size: 13px; font-weight: 700; background: var(--amber); color: #231a00;
  border: none; border-radius: 999px; padding: 6px 14px; cursor: pointer;
}
.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, .65), transparent);
}
.play-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: #17171a; display: flex; align-items: center; justify-content: center;
}
.play-btn svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.play-btn .ic-play { margin-left: 2px; }
.play-btn .ic-pause { display: none; }
.video.playing .play-btn .ic-play { display: none; }
.video.playing .play-btn .ic-pause { display: block; }
.time { font-size: 13px; color: rgba(255, 255, 255, .9); font-variant-numeric: tabular-nums; flex: none; }
.seek { flex: 1; min-width: 0; accent-color: var(--amber); cursor: pointer; height: 4px; }
.fs-btn { flex: none; background: none; border: none; color: rgba(255, 255, 255, .9); cursor: pointer; padding: 6px; border-radius: 8px; display: flex; }
.fs-btn:hover { background: rgba(255, 255, 255, .15); }
.demo-under { padding: 22px 24px 26px; border-top: 1px solid var(--line); }
.demo-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.demo-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.offset-read { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-note { font-size: 14px; color: var(--muted); margin: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .seg { background: rgba(255, 255, 255, 0.1); }
.seg button { border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 4px; border-radius: 9px; cursor: pointer; font-family: inherit; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
[data-theme="dark"] .seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); }

/* ---- popup mock ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 56px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.panel p { color: var(--muted); font-size: 15.5px; }
.popup-wrap { display: flex; justify-content: center; }
.popup {
  width: 340px; max-width: 100%;
  background: linear-gradient(180deg, #25252b 0%, #141417 100%);
  color: #fff; border-radius: 20px; padding: 14px;
  font-family: -apple-system, "SF Pro Display", "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.pop-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.pop-head img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.pop-head h3 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.09); color: rgba(255, 255, 255, 0.66); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.popup[data-on="true"] .chip { color: #fff; }
.popup[data-on="true"] .chip i { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); }
.pop-card { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 16px; padding: 12px 14px; margin: 0 0 10px; }
.pop-card-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.46); }
.pop-player { display: flex; align-items: center; gap: 14px; }
#popToggle {
  flex: none; width: 54px; height: 54px; padding: 0; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--amber); color: #231a00;
  box-shadow: 0 6px 18px rgba(255, 191, 60, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s ease, background 0.12s ease;
}
#popToggle:hover { transform: scale(1.05); }
#popToggle:active { transform: scale(0.96); }
#popToggle svg { width: 26px; height: 26px; fill: currentColor; display: block; }
#popToggle .ic-play { margin-left: 3px; }
#popToggle .ic-stop { display: none; }
#popToggle[data-on="true"] { background: #ffffff; color: #17171a; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
#popToggle[data-on="true"] .ic-play { display: none; }
#popToggle[data-on="true"] .ic-stop { display: block; }
.pop-player-title { font-size: 16px; font-weight: 700; line-height: 1.25; color: #fff; }
.pop-player-sub { font-size: 12px; color: rgba(255, 255, 255, 0.66); margin-top: 3px; line-height: 1.4; }
.pop-offset { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; margin: 2px 0 6px; color: #fff; }
.pop-offset small { font-size: 22px; font-weight: 600; margin-left: 2px; color: rgba(255, 255, 255, 0.66); }
#popTiming[data-sign="pos"] .pop-offset, #popTiming[data-sign="neg"] .pop-offset { color: var(--amber); }
#popTiming[data-sign="pos"] .pop-offset small, #popTiming[data-sign="neg"] .pop-offset small { color: rgba(255, 191, 60, 0.7); }
.pop-offset-cap { text-align: center; font-size: 13px; font-weight: 600; margin: 0; color: #fff; }
.pop-scale { margin: 12px 2px 0; }
.pop-track { position: relative; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); }
.pop-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--amber); left: 50%; width: 0; }
.pop-zero { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: rgba(255, 255, 255, 0.4); }
.pop-dot { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); transition: left 0.18s ease; }
#popTiming[data-sign="pos"] .pop-dot, #popTiming[data-sign="neg"] .pop-dot { background: var(--amber); }
.pop-scale-labels { display: flex; justify-content: space-between; margin-top: 9px; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.46); }
.pop-song { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.09); font-size: 11px; color: rgba(255, 255, 255, 0.46); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-song b { font-weight: 600; color: rgba(255, 255, 255, 0.66); }
.seg-dark { background: rgba(0, 0, 0, 0.3); }
.seg-dark button { color: rgba(255, 255, 255, 0.66); }
.seg-dark button:hover { color: #fff; }
.seg-dark button[aria-checked="true"] { background: rgba(255, 255, 255, 0.95); color: #17171a; }
details.pop-card { padding: 0; }
details.pop-card summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; border-radius: 16px; color: #fff; }
details.pop-card summary::-webkit-details-marker { display: none; }
details.pop-card summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid rgba(255, 255, 255, 0.46); border-bottom: 2px solid rgba(255, 255, 255, 0.46); transform: rotate(45deg); margin: -3px 2px 0 0; transition: transform 0.15s ease; }
details.pop-card[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.pop-search-body { padding: 0 14px 14px; }
.pop-search-body p { margin: 0 0 10px; font-size: 12px; color: rgba(255, 255, 255, 0.66); line-height: 1.45; }
.pop-field { display: block; margin: 0 0 8px; }
.pop-field span { display: block; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.46); margin: 0 0 4px; }
.pop-field input { width: 100%; font-size: 13px; padding: 9px 11px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; background: rgba(0, 0, 0, 0.25); color: #fff; font-family: inherit; }
.pop-field input:focus { outline: none; border-color: var(--amber); }
.pop-field input::placeholder { color: rgba(255, 255, 255, 0.35); }
.pop-btn { font-size: 12px; font-weight: 700; padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.1); color: #fff; cursor: pointer; font-family: inherit; }
.pop-btn:hover { background: rgba(255, 255, 255, 0.18); }
.pop-btn.primary { width: 100%; margin-top: 4px; background: var(--amber); border-color: transparent; color: #231a00; }
.pop-btn.primary:hover { background: #ffcb62; }
.pop-find-note { font-size: 12px; color: rgba(255, 255, 255, 0.66); margin: 10px 0 0; line-height: 1.45; }
.pop-foot { display: flex; align-items: center; margin-top: 2px; }
.pop-foot span { font-size: 11px; line-height: 1.45; color: rgba(255, 255, 255, 0.46); }

/* ---- feature cards ---- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--amber-soft); margin-bottom: 16px;
}
.card .icon svg { width: 24px; height: 24px; }
.card p { color: var(--muted); font-size: 15.5px; margin-bottom: 0; }
.card .tag { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--amber-deep); margin-top: 12px; }

/* ---- how it works ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { position: relative; padding: 28px 24px 24px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.step .num {
  display: inline-flex; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-weight: 800; font-size: 15px;
  align-items: center; justify-content: center; margin-bottom: 14px;
}
[data-theme="dark"] .step .num { background: var(--paper); color: var(--ink); }
.step p { color: var(--muted); font-size: 15.5px; margin-bottom: 0; }
.step code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--soft); padding: 1px 6px; border-radius: 5px; }

/* ---- language table ---- */
.lang-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.lang-table { width: 100%; border-collapse: collapse; font-size: 15.5px; text-align: left; }
.lang-table th, .lang-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.lang-table tr:last-child th, .lang-table tr:last-child td { border-bottom: none; }
.lang-table th { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lang-table td:first-child { font-weight: 700; white-space: nowrap; }

/* ---- privacy strip ---- */
.privacy-strip {
  background: var(--ink); color: var(--paper); border-radius: 20px;
  padding: 44px 40px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center;
}
[data-theme="dark"] .privacy-strip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.privacy-strip h2 { color: inherit; }
.privacy-strip p { color: inherit; opacity: .78; margin-bottom: 0; }
.privacy-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.privacy-facts li { display: flex; gap: 10px; align-items: baseline; font-weight: 600; font-size: 15.5px; }
.privacy-facts svg { flex: none; transform: translateY(2px); }
.privacy-strip .btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: var(--paper); margin-top: 20px; }
[data-theme="dark"] .privacy-strip .btn-ghost { border-color: var(--line); color: var(--ink); }

/* ---- FAQ ---- */
.faq { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: none; border: none; font: inherit; font-size: 18px; font-weight: 700; text-align: left;
  padding: 20px 4px; cursor: pointer; color: var(--ink);
}
.faq-q .plus { font-size: 24px; font-weight: 400; color: var(--muted); transition: transform .25s ease; flex: none; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { color: var(--muted); padding: 0 4px 22px; margin: 0; }
.faq-a a { color: var(--ink); }

/* ---- final CTA ---- */
.cta { text-align: center; }
.cta .lede { margin: 0 auto 26px; }
.cta .browser-note { margin-top: 14px; font-size: 14.5px; color: var(--muted); }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 44px 0 36px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-size: 14px; margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; color: var(--muted); font-size: 15px; }
.site-footer a:hover { color: var(--ink); }
.footer-brand p { color: var(--muted); font-size: 14.5px; max-width: 340px; }

/* ---- privacy page ---- */
.prose { max-width: 720px; margin: 0 auto; padding: 64px 24px 90px; }
.prose h1 { font-size: clamp(32px, 4.5vw, 44px); font-weight: 800; margin-bottom: 8px; }
.prose .updated { color: var(--muted); font-size: 14.5px; margin-bottom: 32px; }
.prose h2 { font-size: 21px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--ink); }
.prose p { margin-bottom: 14px; }
.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--amber-deep); }
.back-link { display: inline-block; margin-bottom: 28px; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--ink); }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0 32px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .demo-controls { grid-template-columns: 1fr; gap: 18px; }
  .split { grid-template-columns: 1fr; }
  .privacy-strip { grid-template-columns: 1fr; padding: 32px 26px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 4px; }
  .header-actions { margin-left: auto; }
  .site-nav { display: flex; order: 3; flex-basis: 100%; margin-left: -12px; margin-right: -12px; padding: 2px 12px 0; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: none; }
  .video .lyr-panel { left: 8px; right: 8px; bottom: 56px; padding: 8px 12px 10px; }
  .lyr-original { font-size: 22px; }
  .lyr-line.lyr-active .lyr-original { font-size: 24px; }
  .lyr-line:not(.lyr-active) .lyr-original { font-size: 16px; }
  .lyr-panel[data-mode="romanized"] .lyr-roman { font-size: 22px; }
  .lyr-panel[data-mode="romanized"] .lyr-line.lyr-active .lyr-roman { font-size: 24px; }
  .lyr-panel[data-mode="romanized"] .lyr-line:not(.lyr-active) .lyr-roman { font-size: 16px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  section { padding: 64px 0; }
  .cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .video-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .strip-track { animation: none; }
  .mark-sweep { background-size: 100% 100%; animation: none; }
}
