/* 소각로 — "정지된 밤" 팔레트 (1분 리셋 앱 자산 재사용) + 잉걸불 액센트 */

:root {
  --night-0: #07080c;
  --night-1: #0d1018;
  --night-2: #141926;
  --line: #232b3d;
  --text: #e8ebf2;
  --text-dim: #7c8598;

  --ember-1: #ffd79a;
  --ember-2: #ff9d4d;
  --ember-3: #f2622b;
  --ember-4: #c8341c;

  --shadow-deep: 0 24px 60px -20px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(120% 80% at 50% 118%, rgba(242, 98, 43, 0.16) 0%, rgba(242, 98, 43, 0) 58%),
    radial-gradient(90% 60% at 50% -10%, rgba(70, 90, 140, 0.12) 0%, rgba(70, 90, 140, 0) 60%),
    var(--night-0);
  color: var(--text);
  font-family: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  padding: 6vh 20px 40px;
}

.stage {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 흔들림 — 소각 중에만 */
.stage.shaking { animation: shake 90ms infinite; }

@keyframes shake {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-1.5px, 1px); }
  50%  { transform: translate(1px, -1.5px); }
  75%  { transform: translate(1.5px, 1px); }
  100% { transform: translate(-1px, -1px); }
}

/* ── 헤더 ── */
.head { text-align: center; margin-bottom: 34px; }

.title {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.22em;
  padding-left: 0.22em; /* letter-spacing 보정 */
  background: linear-gradient(180deg, var(--text) 0%, #9aa3b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

/* ── 화로 ── */
.furnace {
  position: relative;
  width: 100%;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--night-2) 0%, var(--night-1) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 260ms ease, box-shadow 260ms ease;
}

.furnace:focus-within {
  border-color: rgba(255, 157, 77, 0.34);
  box-shadow: var(--shadow-deep), 0 0 0 4px rgba(242, 98, 43, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.furnace.burning { border-color: rgba(255, 157, 77, 0.55); }

.input {
  display: block;
  width: 100%;
  height: 260px;
  padding: 26px 24px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  resize: none;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  line-height: 1.75;
  caret-color: var(--ember-2);
}

.input::placeholder { color: #4b5568; }
.input.hidden-text { color: transparent; caret-color: transparent; }

/* 텍스트 위에 정확히 겹치는 소각 레이어 */
.canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 16px;
}

/* 화로 바닥의 불씨 */
.grate {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    rgba(242, 98, 43, 0) 0%,
    rgba(255, 157, 77, 0.5) 30%,
    rgba(255, 215, 154, 0.75) 50%,
    rgba(255, 157, 77, 0.5) 70%,
    rgba(242, 98, 43, 0) 100%);
  opacity: 0.18;
  transition: opacity 400ms ease, box-shadow 400ms ease;
}

.furnace.burning .grate {
  opacity: 1;
  box-shadow: 0 0 26px 5px rgba(242, 98, 43, 0.45);
}

/* ── 버튼 ── */
.controls { margin-top: 28px; }

.burn {
  position: relative;
  padding: 15px 46px;
  border: 1px solid rgba(255, 157, 77, 0.28);
  border-radius: 999px;
  background: linear-gradient(180deg, #1c2231 0%, #141926 100%);
  color: var(--text-dim);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding-left: calc(46px + 0.14em);
  cursor: not-allowed;
  transition: color 220ms ease, border-color 220ms ease, box-shadow 260ms ease,
    transform 120ms ease, background 260ms ease;
}

.burn:not(:disabled) {
  cursor: pointer;
  color: var(--ember-1);
  border-color: rgba(255, 157, 77, 0.55);
  background: linear-gradient(180deg, #2a1d17 0%, #1a1218 100%);
  box-shadow: 0 0 22px -4px rgba(242, 98, 43, 0.4),
    inset 0 1px 0 rgba(255, 215, 154, 0.12);
}

.burn:not(:disabled):hover {
  color: #fff2dd;
  border-color: rgba(255, 215, 154, 0.8);
  box-shadow: 0 0 34px -2px rgba(242, 98, 43, 0.62),
    inset 0 1px 0 rgba(255, 215, 154, 0.2);
}

.burn:not(:disabled):active { transform: translateY(1px) scale(0.985); }

.burn:disabled { opacity: 0.55; }

/* ── 사라졌습니다 ── */
.vanished {
  height: 22px;
  margin: 26px 0 0;
  font-size: 14px;
  letter-spacing: 0.16em;
  padding-left: 0.16em;
  color: var(--ember-2);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.vanished.show { animation: vanish-in 2600ms ease forwards; }

@keyframes vanish-in {
  0%   { opacity: 0; transform: translateY(6px); }
  14%  { opacity: 1; transform: translateY(0); }
  62%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-5px); }
}

/* ── 푸터 ── */
.foot {
  margin-top: auto;
  padding-top: 56px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
}

.foot p { margin: 0; }
.foot strong { color: #aab3c4; font-weight: 600; }
.foot-dim { margin-top: 4px !important; color: #525b6e; }

/* ── 설명 (검색엔진이 읽을 본문 겸 첫 방문자용) ── */
.about {
  width: 100%;
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  color: #97a0b2;
  font-size: 14.5px;
  line-height: 1.85;
}

.about h2 {
  margin: 34px 0 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #cfd5e0;
}

.about h2:first-child { margin-top: 0; }

.about p { margin: 0 0 14px; }
.about strong { color: #dfe4ec; font-weight: 600; }
.about em { color: var(--ember-1); font-style: normal; }

.about ul {
  margin: 0 0 14px;
  padding-left: 18px;
}

.about li { margin-bottom: 6px; }
.about li::marker { color: var(--ember-3); }

.about-note {
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13.5px;
  color: var(--text-dim);
}

@media (max-width: 520px) {
  body { padding-top: 4vh; }
  .input { height: 220px; padding: 20px 18px; font-size: 16px; }
  .title { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage.shaking { animation: none; }
}
