/* KT Karaoke — site styles.
   Palette: a karaoke room at night (plum), the brand pink as the lyric "wipe",
   amber reserved for focus and small data. */
:root {
  --night: #17122a;
  --room: #221a3a;
  --room-2: #2c2249;
  --line: #3a2f5c;
  --lyric: #fbf7ff;
  --muted: #a79bbf;
  --wipe: #e5265c;
  --amber: #ffc94a;
  --ink: #0b0812;

  --display: "Mitr", "Anuphan", system-ui, sans-serif;
  --body: "Anuphan", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 5vw, 56px);
  --max: 1160px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--lyric);
  font: 400 17px/1.65 var(--body);
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.site-head { padding: 20px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--display); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand b { color: var(--wipe); font-weight: 600; }
.site-head nav { display: flex; gap: 22px; font-size: 15px; }
.site-head nav a { text-decoration: none; color: var(--muted); }
.site-head nav a:hover { color: var(--lyric); }

/* ---------- hero ---------- */
.hero { padding: clamp(28px, 6vw, 72px) 0 clamp(48px, 8vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 0 clamp(32px, 5vw, 64px); align-items: center; }
.hero .lyrics { grid-column: 1 / -1; margin-bottom: clamp(28px, 4vw, 48px); }

/* The signature: headline set like on-screen karaoke lyrics.
   White outlined text, pink "sung" copy clipped over it and wiped left → right. */
/* Sized off the viewport so the longer line ("เลือกเพลงจากมือถือ") never wraps or overflows. */
.lyrics { margin: 0 0 22px; font: 600 min(96px, 8.6vw)/1.18 var(--display); letter-spacing: -0.01em; }
.lyrics .line { position: relative; display: block; width: max-content; max-width: 100%; white-space: nowrap; color: var(--lyric);
  text-shadow: 0 0 1px var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
               2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); }
.lyrics .line + .line { margin-left: clamp(18px, 6vw, 72px); }
.lyrics .line::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  color: var(--wipe);
  clip-path: inset(0 100% 0 0);
  animation: sing var(--dur, 1.8s) linear var(--delay, .4s) forwards;
}
.lyrics .line:nth-child(2) { --dur: 2.4s; --delay: 2.3s; }
@keyframes sing { to { clip-path: inset(0 0 0 0); } }

.lede { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 34ch; margin: 0 0 28px; }
.lede strong { color: var(--lyric); font-weight: 500; }

.get { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 12px;
  background: var(--wipe); color: #fff; text-decoration: none;
  font: 500 17px/1.2 var(--display);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: #f03a6e; transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-meta { font: 400 13px/1.4 var(--mono); color: var(--muted); }
.btn-meta span { color: var(--amber); }
.soon { margin-top: 18px; font-size: 14px; color: var(--muted); }

.typed { margin-top: 22px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; max-width: 460px; }
.typed small { display: block; color: var(--muted); font-size: 13px; }
.typed code { font: 500 clamp(15px, 2.2vw, 18px)/1.5 var(--mono); color: var(--lyric); word-break: break-all; }

/* ---------- hero illustration: TV + phone, drawn in CSS ---------- */
.stage { position: relative; padding-bottom: 26%; }
.tv { border-radius: 14px; background: var(--ink); padding: 10px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.7); }
.tv-screen {
  position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 10%, #5b2a6e 0%, transparent 55%),
    radial-gradient(90% 80% at 85% 90%, #8a1f4a 0%, transparent 60%),
    #1a1030;
}
/* Upper third of the screen so the phone mock never covers the line. */
.tv-screen .sung { position: absolute; left: 0; right: 0; top: 24%; text-align: center; font: 600 clamp(11px, 2.2vw, 26px)/1.2 var(--display); }
.tv-screen .sung .line { margin: 0 auto; }
.tv-screen .sung .line::after { --dur: 3.2s; --delay: 1s; animation-iteration-count: infinite; }
.tv-mark { position: absolute; left: 3%; bottom: 5%; display: flex; align-items: center; gap: 6px; opacity: .6; font: 600 clamp(9px, 1.2vw, 13px)/1 var(--display); }
.tv-mark img { width: 1.6em; height: 1.6em; border-radius: 4px; }
.tv-mark b { color: var(--wipe); font-weight: 600; }
.tv-qr { position: absolute; right: 3%; bottom: 5%; width: 11%; padding: 3px; background: #fff; border-radius: 4px; opacity: .7; }
.tv-foot { width: 22%; height: 10px; margin: 0 auto; background: var(--ink); border-radius: 0 0 8px 8px; }

.phone {
  position: absolute; right: 0; top: 30%; width: 38%;
  border-radius: 22px; background: var(--ink); padding: 7px;
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.8);
}
.phone-screen { border-radius: 16px; background: #0f0f14; padding: 12px 10px; font-size: clamp(9px, 1.15vw, 12px); line-height: 1.35; }
.phone-screen .ph-title { font: 600 1.15em/1.2 var(--display); margin-bottom: 8px; }
.phone-screen .ph-tabs { display: flex; gap: 10px; color: var(--muted); border-bottom: 1px solid #2a2a36; margin-bottom: 6px; }
.phone-screen .ph-tabs span:last-child { color: var(--lyric); border-bottom: 2px solid var(--wipe); padding-bottom: 3px; }
.ph-row { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid #22222c; }
.ph-row i { width: 2.6em; height: 1.6em; border-radius: 3px; flex: none; background: linear-gradient(135deg, #3a2a5a, #7a2048); }
.ph-row div { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-row small { display: block; color: var(--muted); font-size: .85em; }
.ph-row em { font-style: normal; color: var(--muted); letter-spacing: 2px; }

/* ---------- sections ---------- */
section.block { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
.eyebrow { font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); margin: 0 0 14px; }
h2 { font: 600 clamp(28px, 4vw, 44px)/1.2 var(--display); margin: 0 0 18px; letter-spacing: -0.01em; }
h3 { font: 500 20px/1.35 var(--display); margin: 0 0 6px; }
.section-lede { color: var(--muted); max-width: 52ch; margin: 0 0 40px; }

/* steps: a real sequence, so it is numbered */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 18px; border-top: 3px solid var(--room-2); }
.steps li::before { content: counter(step); display: block; font: 600 44px/1 var(--display); color: var(--wipe); margin-bottom: 14px; }
.steps p { margin: 0; color: var(--muted); }

/* two control surfaces */
.remotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.remote { background: var(--room); border-radius: 18px; padding: clamp(22px, 3vw, 34px); }
.remote h3 { display: flex; align-items: center; gap: 10px; font-size: 22px; margin-bottom: 16px; }
.remote h3 svg { width: 26px; height: 26px; color: var(--wipe); }
.remote ul { margin: 0; padding: 0; list-style: none; }
.remote li { padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); }
.remote li b { color: var(--lyric); font-weight: 500; }

.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.mode { border: 1px solid var(--line); border-radius: 18px; padding: 22px 26px; }
.mode p { margin: 0; color: var(--muted); }
.mode .tag { display: inline-block; font: 500 12px/1 var(--mono); padding: 5px 8px; border-radius: 6px; background: var(--room-2); color: var(--amber); margin-bottom: 10px; }

/* install */
.install { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.install ol { margin: 0; padding-left: 1.3em; }
.install li { margin: 0 0 14px; color: var(--muted); }
.install li b { color: var(--lyric); font-weight: 500; }
.install code, .faq code, .legal code { font: 500 .95em var(--mono); color: var(--lyric); background: var(--room-2); padding: 1px 6px; border-radius: 5px; }
.note { background: var(--room); border-radius: 18px; padding: 24px 26px; }
.note p { margin: 0 0 10px; color: var(--muted); }
.note p:last-child { margin: 0; }

/* faq */
.faq { max-width: 780px; }
.faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font: 500 18px/1.4 var(--display); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--wipe); font-size: 22px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 14px; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.site-foot nav { display: flex; gap: 20px; }
.site-foot p { margin: 0; max-width: 60ch; }

/* ---------- legal pages ---------- */
.legal { padding: 24px 0 80px; }
.legal article { max-width: 760px; }
.legal h1 { font: 600 clamp(32px, 5vw, 48px)/1.15 var(--display); margin: 12px 0 8px; }
.legal .updated { font: 400 14px var(--mono); color: var(--muted); margin: 0 0 36px; }
.legal h2 { font-size: 24px; margin: 40px 0 10px; }
.legal p, .legal li { color: #d9d0ea; }
.legal ul { padding-left: 1.2em; }
.legal .lang-switch { display: flex; gap: 10px; font: 500 14px var(--mono); }
.legal .lang-switch a { color: var(--muted); }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 56px 0; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .hero .wrap, .install { grid-template-columns: 1fr; }
  .stage { max-width: 560px; margin-top: 40px; }
  .phone-screen { font-size: clamp(9px, 2.4vw, 12px); }
  .steps, .remotes, .modes { grid-template-columns: 1fr; }
  .site-head nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lyrics .line::after, .tv-screen .sung .line::after { animation: none; clip-path: none; }
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
