:root {
  --petal: #ffe1e8;
  --lotus: #f7abf6;
  --plum: #3d1245;
  --plum-soft: #6d4573;
  --pond: #0d6b5e;
  --paper: #fff;
  --display: 'Baloo 2', system-ui, sans-serif;
  --body: 'Mukta', system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 4rem);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--petal); color: var(--plum); font: 400 1.125rem/1.5 var(--body); }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.02; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pond); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.bar { display: flex; justify-content: space-between; align-items: center; padding: 1rem var(--gutter); }
.brand { font: 700 1.5rem var(--display); text-decoration: none; }
.barlink { font-weight: 600; }

/* Home: four people on one mat */
.hero { padding-top: clamp(1rem, 4vh, 3rem); }
.lede { padding: 0 var(--gutter); display: grid; grid-template-columns: 1.6fr 1fr; gap: 1rem 4rem; align-items: end; }
.lede h1 { font-size: clamp(2.6rem, 6.4vw, 5.5rem); letter-spacing: -0.02em; }
.lede p { max-width: 36ch; padding-bottom: .6rem; }
.mat {
  list-style: none; margin: clamp(1.5rem, 5vh, 3rem) 0 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: linear-gradient(transparent 0 min(17rem, 24vw), var(--lotus) min(17rem, 24vw));
}
.mat a { display: flex; flex-direction: column; height: 100%; padding: 0 .75rem 2rem; text-decoration: none; text-align: center; }
.mat svg { height: min(19rem, 27vw); width: 100%; }
.mat strong { font: 700 clamp(1.15rem, 2vw, 1.6rem)/1.2 var(--display); margin-top: .75rem; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .2em; transition: text-decoration-color .15s; }
.mat span { max-width: 26ch; margin: .25rem auto 0; line-height: 1.35; }
.mat a:hover strong, .mat a:focus-visible strong { text-decoration-color: currentColor; }
.mat a:hover svg, .mat a:focus-visible svg { color: var(--pond); }
svg { color: var(--plum); transition: color .15s; }
.torso { fill: currentColor; stroke: currentColor; stroke-width: 34; stroke-linejoin: round; }
.limb { fill: none; stroke: currentColor; stroke-width: 38; stroke-linecap: round; stroke-linejoin: round; }
.arm { stroke-width: 28; }
.head { fill: currentColor; }

/* Finder */
.finder { background: var(--paper); padding: clamp(3rem, 8vw, 6rem) var(--gutter); display: grid; grid-template-columns: 1fr 1.3fr; gap: 2rem 4rem; }
.finder h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); margin-bottom: .75rem; }
.finder p { max-width: 42ch; }
.chat { display: grid; gap: 1rem; min-width: 0; }
.log { display: flex; flex-direction: column; gap: .5rem; max-height: 20rem; overflow-y: auto; }
.msg { padding: .55rem 1rem; border-radius: 1.2rem; overflow-wrap: anywhere; }
.bot { align-self: start; background: var(--petal); border-bottom-left-radius: .2rem; }
.me { align-self: end; background: var(--plum); color: #fff; border-bottom-right-radius: .2rem; }
.msg a { display: block; font-weight: 600; }
.tries { display: flex; flex-wrap: wrap; gap: .5rem; }
.tries button { background: none; border: 2px solid var(--lotus); border-radius: 2rem; padding: .25rem .9rem; cursor: pointer; }
.tries button:hover { background: var(--lotus); }
#ask { display: flex; gap: .5rem; }
#ask input { flex: 1; min-width: 0; border: 2px solid var(--plum); border-radius: .6rem; padding: .6rem .9rem; background: #fff; }
#ask input::placeholder { color: var(--plum-soft); opacity: 1; }
#ask button, .veil button, .actions a { background: var(--plum); color: #fff; border: 0; border-radius: .6rem; padding: .65rem 1.2rem; font-weight: 600; cursor: pointer; text-decoration: none; }
#ask button:hover, .veil button:hover, .actions a:hover { background: var(--pond); }
button:disabled { opacity: .5; cursor: progress; }

footer { background: var(--plum); color: #fff; padding: 2rem var(--gutter); display: flex; flex-wrap: wrap; gap: 1rem 4rem; justify-content: space-between; font-size: 1rem; }
footer p { max-width: 72ch; }

/* Practice */
.practice { min-height: 100vh; display: flex; flex-direction: column; }
.room {
  --off-line: #ff4fa3; --good-line: #4be3c4;
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 24rem);
  gap: clamp(1rem, 3vw, 3rem); padding: 0 var(--gutter) 2rem; align-items: start;
}
.stage { position: relative; aspect-ratio: 4 / 3; max-height: calc(100vh - 7rem); width: 100%; justify-self: center; background: var(--plum); border-radius: 1.2rem; overflow: hidden; border: 8px solid var(--plum); transition: border-color .25s; }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; transform: scaleX(-1); }
.veil { position: absolute; inset: 0; background: var(--plum); color: #fff; display: grid; place-content: center; justify-items: center; gap: 1.25rem; text-align: center; padding: 1.5rem; }
.veil p { max-width: 34ch; }
.veil button { background: var(--lotus); color: var(--plum); }
.veil button:hover { background: #fff; }
.target svg { height: min(11rem, 22vh); width: auto; max-width: 100%; display: block; }
.guide h1 { font-size: clamp(2rem, 3.2vw, 2.8rem); margin: .75rem 0 .35rem; }
.timer { margin: 1.25rem 0 .75rem; }
#secs { font: 700 4.5rem/1 var(--display); font-variant-numeric: tabular-nums; margin-right: .6rem; }
.track { height: .9rem; border-radius: 1rem; background: #fff; overflow: hidden; margin-top: .5rem; }
.track i { display: block; height: 100%; background: var(--pond); transform: scaleX(0); transform-origin: left; }
.status { font-weight: 600; min-height: 3em; margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.actions button { background: none; border: 2px solid var(--plum); border-radius: .6rem; padding: .5rem 1.1rem; font-weight: 600; cursor: pointer; }
.actions button:hover { background: #fff; }
[data-state='holding'] .stage, [data-state='done'] .stage { border-color: var(--pond); }
[data-state='adjust'] .stage { border-color: var(--lotus); }
[data-state='holding'] .target svg, [data-state='done'] .target svg,
[data-state='holding'] .status, [data-state='done'] .status { color: var(--pond); }

@media (max-width: 800px) {
  .lede, .finder, .room { grid-template-columns: minmax(0, 1fr); }
  .mat { grid-template-columns: 1fr 1fr; background: var(--lotus); padding-top: 1.5rem; row-gap: 1rem; }
  .mat svg { height: 42vw; }
  .mat a { padding: 0 .25rem 1.5rem; }
  .target { display: none; }
  .guide h1 { margin-top: 0; }
}
@media (max-width: 480px) { #ask { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
