/* ------------------------------------------------------------------
   오늘 몇 퍼센트 — 밝은 종이 바탕, 시간표에서 뽑아온 파스텔 한 가지.
   화면 정중앙 한 덩어리. 라이트 테마로 고정.
------------------------------------------------------------------ */

:root {
  --ground: #faf9f6;
  --panel: #eceae4;
  --panel-2: #e3e0d8;
  --ink: #1a1917;
  --ink-2: #57554e;
  --muted: #8c8a82;
  --faint: #b3b0a7;
  --rule: rgba(26, 25, 23, 0.12);
  --sleep-ink: #7f95c4;
  --accent: #7f95c4;

  --sans: "IBM Plex Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.005em;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.micro {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

:where(button, [tabindex]):focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* ---------------- 무대: 화면 정중앙 ---------------- */

.stage {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vh, 34px);
  padding: 40px clamp(20px, 5vw, 48px);
  text-align: center;
}

/* ---------------- 이미지 ---------------- */

.figure {
  position: relative;
  width: clamp(200px, 28vh, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.figure__glow {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: 0.3;
  filter: blur(30px);
  transition: background 0.6s ease;
  animation: pulse 7s ease-in-out infinite;
}

.figure__stack { position: absolute; inset: 0; animation: bob 5.4s ease-in-out infinite; }

.figure__stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.figure__stack img.is-on { opacity: 1; transform: scale(1); }

.figure.is-hard .figure__stack { animation: tremble 2.1s ease-in-out infinite; }
.figure.is-sleep .figure__stack { animation: breathe 7s ease-in-out infinite; }

.zzz {
  position: absolute;
  top: 12%;
  right: 4%;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--sleep-ink);
  opacity: 0;
}
.zzz i { font-style: normal; font-size: 0.78em; opacity: 0.7; }
.figure.is-sleep .zzz { animation: zzz 4.4s ease-in-out infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-13px) rotate(0.8deg); }
}
@keyframes tremble {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-2px, -9px) rotate(-1.3deg); }
  45% { transform: translate(2px, -13px) rotate(1.2deg); }
  70% { transform: translate(-1px, -6px) rotate(-0.7deg); }
  85% { transform: translate(1px, -2px) rotate(0.5deg); }
}
@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-9px) scale(1.03); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.26; }
  50% { opacity: 0.42; }
}
@keyframes zzz {
  0% { opacity: 0; transform: translate(0, 0) scale(0.8); }
  30% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(12px, -30px) scale(1.2); }
}

/* ---------------- 지금 뭐 하는 중 ---------------- */

.now { display: flex; flex-direction: column; align-items: center; gap: 7px; max-width: 30em; }
.now__title {
  margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.now__title.is-empty { color: var(--faint); font-weight: 400; }
/* 가운뎃점 대신 간격으로 끊는다 */
.now__meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 20px;
  row-gap: 2px;
  color: var(--ink-2);
  font-size: 14px;
}
.now [hidden] { display: none; }

/* ---------------- 진행바 ---------------- */

.progress {
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: clamp(4px, 1.6vh, 14px);
}

.progress__num {
  display: flex;
  align-items: baseline;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: clamp(2.4rem, 6.4vw, 3.9rem);
  line-height: 1;
  letter-spacing: -0.05em;
}
.progress__sign { font-size: 0.34em; letter-spacing: 0; color: var(--muted); padding-left: 0.4em; }

.track { width: 100%; }

.bar {
  position: relative;
  height: 30px;
  border-radius: 999px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(26, 25, 23, 0.07);
  overflow: hidden;
  cursor: ew-resize;
  touch-action: pan-y;
}

.bar__layer { position: absolute; inset: 0; }
.bar__layer--fill {
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0 round 999px);
  transition: clip-path 0.4s linear;
}
/* 채워진 구간의 바닥색. 오른쪽 끝(=지금)으로 갈수록 현재 수업 색이 진해진다 */
.bar__layer--fill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(26, 25, 23, 0.06), var(--accent));
  opacity: 0.42;
  transition: background 0.6s ease;
}

.seg { position: absolute; top: 0; bottom: 0; background: var(--tone); }
.bar__layer--base .seg { opacity: 0.45; }
.bar__layer--fill .seg { box-shadow: inset 0 0 0 1px rgba(26, 25, 23, 0.06); }

.seg--class { cursor: pointer; }

.edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  box-shadow: 0 0 10px 1px rgba(26, 25, 23, 0.28);
  z-index: 3;
  transition: left 0.4s linear;
  pointer-events: none;
}
.edge.is-scrub { background: var(--accent); box-shadow: 0 0 10px 1px var(--accent); }

/* 눈금 */

.ruler { position: relative; height: 22px; margin-top: 9px; }
.tick { position: absolute; top: 0; width: 1px; height: 4px; background: var(--rule); }
.tick__label {
  position: absolute;
  top: 8px;
  left: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
  white-space: nowrap;
}
.tick:first-child .tick__label { transform: translateX(0); }
.tick:last-child .tick__label { transform: translateX(-100%); }

.progress__foot {
  margin: 2px 0 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: center;
}
.progress__foot .sep { color: var(--faint); }


/* ---------------- 툴팁 ---------------- */

.tip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  background: var(--ink);
  color: var(--ground);
  padding: 8px 11px;
  border-radius: 4px;
  max-width: 240px;
  text-align: left;
  transform: translate(-50%, -100%);
}
.tip[hidden] { display: none; }
.tip__name { font-size: 13px; font-weight: 500; letter-spacing: -0.01em; }
.tip__meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.03em; opacity: 0.72; margin-top: 2px; }

@media (max-width: 480px) {
  .bar { height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .figure__stack, .figure__glow, .zzz { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}
