/* 업무 중 쉼표 · 2026-09-20 (옛 «명상 호흡법» + «눈 운동 휴식» 합침)
   재미 앱 표준 «법정 웹툰» 톤(헌법 §7)을 쓰되, 쉬는 앱이라 포인트 색을 세이지 초록으로 눕힌다(마음 법정이 분홍을 쓴 것과 같은 변주). */
:root {
    --cream: #FFF6E5;
    --paper: #FFFFFF;
    --ink: #1A1A1A;
    --ink-soft: #4A4A4A;
    --mute: #7A7266;
    --sage: #3E7D68;
    --sage-soft: #DDEFE6;
    --navy: #2E4374;
    --navy-soft: #E4E9F4;
    --yellow: #FFD13F;
    --yellow-soft: #FFF1B8;
    --warn: #E8332A;
    --gray-soft: #EEEDEA;
    --line: 3px solid var(--ink);
    --shadow: 5px 5px 0 var(--ink);
    --shadow-s: 3px 3px 0 var(--ink);
    --display: 'Black Han Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    --body: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--body); color: var(--ink); word-break: keep-all; line-height: 1.55; min-height: 100vh; -webkit-tap-highlight-color: transparent;
       background-color: var(--cream); background-image: repeating-linear-gradient(135deg, rgba(26,26,26,.025) 0 14px, transparent 14px 28px); }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.label { font-size: .74rem; font-weight: 900; color: var(--mute); letter-spacing: .02em; }

/* 머리 (헌법 §5) */
.shin-header { position: sticky; top: 0; z-index: 40; height: 56px; display: flex; align-items: center; background: var(--cream); border-bottom: var(--line); }
.shin-header-inner { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--sage); color: #fff; border: 2px solid var(--ink); border-radius: 8px; font-family: serif; font-weight: 700; font-size: 18px; }
.brand-name { font-weight: 800; font-size: .95rem; white-space: nowrap; }
.head-tools { display: flex; gap: 6px; flex: none; }
.tool-btn { width: 38px; height: 38px; display: grid; place-items: center; font-size: 18px; line-height: 1; background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); text-decoration: none; transition: transform .1s, box-shadow .1s; }
.tool-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.tool-btn.off { background: #EDE6D8; opacity: .75; }

/* 공통 */
.card { background: var(--paper); border: var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 16px; border: var(--line); border-radius: 14px; background: var(--paper); font-weight: 800; box-shadow: var(--shadow-s); text-decoration: none; color: var(--ink); text-align: center; transition: transform .1s, box-shadow .1s; }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.primary { background: var(--sage); color: #fff; }
.btn.ghost { box-shadow: none; border-width: 2px; }
.btn.big { min-height: 58px; font-family: var(--display); font-weight: 400; font-size: 1.28rem; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .86rem; box-shadow: 2px 2px 0 var(--ink); }
.btn.wide { width: 100%; }
.btn:focus-visible, .tool-btn:focus-visible, .course:focus-visible, .mode:focus-visible, .linkbtn:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }
.screen { padding: 16px 0 34px; }
.kicker { display: inline-block; font-size: .78rem; font-weight: 800; background: var(--sage-soft); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 12px; box-shadow: 2px 2px 0 var(--ink); }
.sec { font-family: var(--display); font-weight: 400; font-size: 1.1rem; margin: 22px 0 8px; }
.linkbtn { background: none; border: none; font-size: .86rem; font-weight: 800; color: var(--ink-soft); padding: 4px; }

/* 첫 화면 */
.title-block { text-align: center; }
.logo { font-family: var(--display); font-weight: 400; font-size: clamp(2.3rem, 11vw, 3rem); line-height: 1.08; margin-top: 10px; }
.logo span { color: var(--sage); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.sub { font-size: .92rem; font-weight: 700; color: var(--ink-soft); margin-top: 8px; }
.hero { position: relative; height: 230px; margin: 16px 0 14px; overflow: hidden; background: var(--sage-soft); }
.hero-jo { position: absolute; left: 6px; bottom: -14px; height: 104%; width: auto; }
.bubble { position: absolute; right: 12px; top: 18px; max-width: 54%; background: var(--paper); border: var(--line); border-radius: 14px; padding: 9px 12px; box-shadow: var(--shadow-s); font-weight: 800; font-size: .86rem; line-height: 1.4; }
.bubble small { display: block; margin-top: 3px; font-size: .72rem; font-weight: 700; color: var(--mute); }
.courses { display: grid; gap: 10px; }
.course { display: flex; align-items: stretch; gap: 0; padding: 0; overflow: hidden; text-align: left; background: var(--paper); border: var(--line); border-radius: 16px; box-shadow: var(--shadow-s); transition: transform .1s, box-shadow .1s; }
.course:active { transform: translate(3px, 3px); box-shadow: none; }
.course .ph { position: relative; width: 92px; flex: none; background: var(--sage-soft); border-right: var(--line); overflow: hidden; }
.course .ph img { position: absolute; left: 50%; bottom: -6px; height: 112%; width: auto; transform: translateX(-50%); }
.course .tx { padding: 12px 12px 12px 14px; display: flex; flex-direction: column; justify-content: center; }
.course .tx b { font-family: var(--display); font-weight: 400; font-size: 1.22rem; }
.course .tx span { font-size: .86rem; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.course .tx em { font-style: normal; font-size: .76rem; font-weight: 800; color: var(--sage); margin-top: 5px; }

.timer { margin-top: 18px; padding: 12px 14px; }
.timer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timer-head b { display: block; font-size: .92rem; margin-top: 2px; }
.timer-bar { height: 10px; background: var(--gray-soft); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.timer-bar i { display: block; height: 100%; width: 0; background: var(--sage); transition: width .9s linear; }
.timer.rest .timer-bar i { background: var(--warn); }
.timer small { font-size: .76rem; color: var(--mute); font-weight: 700; }
.record { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 16px; padding: 12px 8px; }
.record.inline { box-shadow: none; border-width: 2px; margin-top: 14px; }
.record b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--sage); }
.record span { font-size: .76rem; font-weight: 800; color: var(--mute); }
.tip { margin-top: 14px; font-size: .84rem; font-weight: 700; color: var(--ink-soft); background: var(--yellow-soft); border: 2px solid var(--ink); border-radius: 12px; padding: 9px 12px; }
.notice-line { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; background: rgba(0,0,0,.035); border: 1px solid rgba(0,0,0,.09); border-radius: 10px; padding: 9px 12px; font-size: .82rem; line-height: 1.55; }
.notice-line svg { flex: none; margin-top: 3px; opacity: .5; }
.care { margin-top: 10px; font-size: .78rem; color: var(--mute); }

/* 진행 */
.run-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.run-name { font-family: var(--display); font-weight: 400; font-size: 1.1rem; }
.run-step { font-size: .8rem; font-weight: 800; color: var(--mute); }
.progress { height: 10px; background: var(--gray-soft); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; width: 0; background: var(--sage); transition: width .4s linear; }
.stage { padding: 18px 16px 16px; text-align: center; }
.orb-wrap { height: 250px; display: grid; place-items: center; }
.orb { width: 120px; height: 120px; border-radius: 50%; background: var(--sage-soft); border: var(--line); display: grid; place-items: center;
       font-family: var(--display); font-size: 2rem; color: var(--sage); transform: scale(var(--scale, 1)); transition: transform var(--dur, .6s) ease-in-out; }
.track { position: relative; height: 210px; margin: 6px 0 4px; border: var(--line); border-radius: 14px; background: var(--sage-soft); overflow: hidden; }
.dot { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--sage); border: 3px solid var(--ink);
       transform: translate(var(--dx, 0), var(--dy, 0)); transition: transform 1.5s ease-in-out; }
.pose { position: relative; height: 250px; overflow: hidden; }
.pose img { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; transform: translateX(-50%); }
.pose img.flip { transform: translateX(-50%) scaleX(-1); }
/* 전용 컷이 아직 없는 동작: 그림 대신 표시 하나 (엉뚱한 그림을 붙이지 않는다) */
.pose.empty { display: grid; place-items: center; background: var(--sage-soft); border: 2px solid var(--ink); border-radius: 14px; }
.pose.empty::after { content: attr(data-mark); font-size: 5.5rem; line-height: 1; }
.phase { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin-top: 10px; }
.phase-sub { font-size: .88rem; font-weight: 700; color: var(--ink-soft); margin-top: 4px; min-height: 2.6em; }
.count-ring { margin-top: 6px; }
.count-ring b { display: inline-grid; place-items: center; min-width: 54px; height: 34px; padding: 0 12px; font-family: var(--display); font-weight: 400; font-size: 1.1rem;
                background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 2px 2px 0 var(--ink); }
.count-ring b:empty { display: none; }
.controls { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.mode { padding: 9px 10px; text-align: left; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; }
.mode[aria-pressed="true"] { background: var(--sage-soft); box-shadow: 2px 2px 0 var(--ink); }
.mode b { display: block; font-size: .92rem; font-weight: 800; }
.mode span { display: block; font-size: .74rem; color: var(--mute); font-weight: 700; }
.guide { margin-top: 14px; font-size: .88rem; color: var(--ink-soft); background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 11px 13px; }

/* 완료 */
.done-card { position: relative; text-align: center; padding: 16px 16px 18px; overflow: hidden; }
.stamp { position: absolute; top: 12px; right: 10px; z-index: 2; transform: rotate(11deg); font-family: var(--display); font-size: 1rem; color: var(--sage); border: 3px solid var(--sage); border-radius: 8px; padding: 2px 8px; background: rgba(255,255,255,.85); }
.done-pic { position: relative; height: 230px; margin: 4px -16px 0; overflow: hidden; border-bottom: var(--line); }
.done-sun { position: absolute; left: 50%; bottom: -110px; width: 300px; height: 300px; transform: translateX(-50%); border-radius: 50%; background: var(--sage-soft); border: var(--line); }
.done-pic img { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; transform: translateX(-50%); }
.done-title { font-family: var(--display); font-weight: 400; font-size: 2rem; margin-top: 14px; outline: none; }
.done-line { font-weight: 800; color: var(--ink-soft); margin-top: 6px; }
.actions { display: grid; gap: 9px; margin-top: 16px; }
.jo-cta { display: flex; gap: 12px; align-items: flex-end; margin-top: 18px; padding: 14px 14px 14px 4px; overflow: hidden; background: var(--navy-soft); }
.jo-cta img { width: 92px; height: auto; flex: none; margin-bottom: -14px; }
.jo-cta b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.05rem; line-height: 1.3; }
.jo-cta p { font-size: .85rem; color: var(--ink-soft); margin: 5px 0 10px; }
.foot { text-align: center; font-size: .76rem; color: var(--mute); padding: 6px 0 28px; }
.foot a { color: var(--mute); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 12px); max-width: min(88vw, 420px); background: var(--ink); color: #fff; font-weight: 700; font-size: .86rem; text-align: center; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 움직임 (헌법 §7 · 반복·흔들림·번쩍임만 끄고 한 번짜리 연출은 남긴다) */
.hero-jo { animation: sway 5s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } }
.bubble.pop, .phase.pop { animation: pop .35s cubic-bezier(.3,1.7,.5,1); }
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }
.orb.breathe-in { box-shadow: 0 0 0 0 rgba(62,125,104,.5); animation: ripple 1.2s ease-out; }
@keyframes ripple { 0% { box-shadow: 0 0 0 0 rgba(62,125,104,.45); } 100% { box-shadow: 0 0 0 40px rgba(62,125,104,0); } }
.course.go { animation: pop .3s cubic-bezier(.3,1.6,.5,1); }
.done-card.reveal .done-pic img { animation: rise .55s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes rise { 0% { transform: translate(-50%, 70%); } 100% { transform: translate(-50%, 0); } }
.done-card.reveal .done-sun { animation: sun .5s cubic-bezier(.2,.9,.3,1.15) both; }
@keyframes sun { 0% { transform: translateX(-50%) scale(0); } 100% { transform: translateX(-50%) scale(1); } }
.done-card.stamped .stamp { animation: slam .36s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes slam { 0% { transform: rotate(11deg) scale(2.8); opacity: 0; } 70% { transform: rotate(11deg) scale(.94); opacity: 1; } 100% { transform: rotate(11deg) scale(1); opacity: 1; } }
.timer.ringing { animation: blink 1s ease-in-out 3; }
@keyframes blink { 0%, 100% { background: var(--paper); } 50% { background: var(--yellow-soft); } }

@media (max-width: 360px) {
    .modes { grid-template-columns: 1fr; }
    .bubble { max-width: 58%; font-size: .8rem; }
    .course .ph { width: 80px; }
}
@media (min-width: 520px) {
    .hero { height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-jo, .timer.ringing, .orb.breathe-in { animation: none !important; }
    .orb { transition-duration: .25s !important; }
    .dot { transition-duration: .3s !important; }
    .done-card.reveal .done-pic img { animation-duration: .3s; }
    .done-card.stamped .stamp { animation-duration: .2s; }
}
