/* style.css — FLEX POMO (2207) 뽀모도로 타이머
   커스텀 "focus" 디자인 (Clay/SoftUI 무드 변형 · apple.com 여백 무드)
   대형 원형 링 타이머 중심. 팔레트는 _tokens.css. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root { --maxw: 940px; --radius: 22px; --radius-sm: 14px; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color .4s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code { font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }

/* ── 헤더 ── */
.site-header { position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(1.2) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--border); }
.site-header__inner { max-width: var(--maxw); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.site-header__logo { display: inline-flex; align-items: center; gap: 11px; }
.logo-badge { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-sm); flex: none; }
.logo-badge svg { width: 20px; height: 20px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-main { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.logo-main .accent { color: var(--accent); }
.logo-sub { font-size: .62rem; font-weight: 600; letter-spacing: .22em; color: var(--ink-faint); text-transform: uppercase; }
.site-header__nav { display: flex; align-items: center; gap: 4px; }
.site-header__nav > a { padding: 8px 12px; border-radius: 10px; font-size: .9rem; font-weight: 600; color: var(--ink-soft); transition: .18s; }
.site-header__nav > a:hover { color: var(--ink); background: var(--surface-2); }
.lang-select { appearance: none; -webkit-appearance: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-soft);
  padding: 7px 26px 7px 12px; border-radius: 10px; font-size: .82rem; font-weight: 600; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239C9088' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.theme-btn, .icon-btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-soft); width: 38px; height: 38px;
  border-radius: 10px; display: grid; place-items: center; cursor: pointer; transition: .18s; }
.theme-btn:hover, .icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg, .icon-btn svg { width: 18px; height: 18px; }

/* ── 메인 래퍼 ── */
main, .wrap { max-width: var(--maxw); margin: 0 auto; padding: 22px 20px 60px; }

/* ── 히어로 ── */
.hero { text-align: center; padding: 26px 0 8px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  color: var(--accent); background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 14px; }
.eyebrow svg { width: 14px; height: 14px; }
.hero h1 { font-size: clamp(1.7rem, 4.6vw, 2.7rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
.hero h1 .grad { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { max-width: 620px; margin: 14px auto 0; color: var(--ink-soft); font-size: 1.02rem; }

/* ── 타이머 카드 (메인 도구) ── */
.timer-card { background: var(--surface); border-radius: 30px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  padding: 34px 28px 30px; margin: 26px auto 0; max-width: 560px; text-align: center; }

.mode-tabs { display: inline-flex; gap: 5px; padding: 5px; border-radius: 999px; background: var(--surface-2); box-shadow: var(--shadow-inset); margin-bottom: 26px; }
.mode-tab { border: none; background: transparent; color: var(--ink-soft); font-weight: 700; font-size: .88rem; padding: 9px 18px; border-radius: 999px; cursor: pointer; transition: .2s; display: inline-flex; align-items: center; gap: 7px; }
.mode-tab svg { width: 15px; height: 15px; }
.mode-tab.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.mode-tab:not(.active):hover { color: var(--ink); }

/* 링 */
.ring-wrap { position: relative; width: 300px; height: 300px; margin: 0 auto; max-width: 78vw; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--track); stroke-width: 14; }
.ring-progress { fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round;
  transition: stroke-dashoffset .95s linear, stroke .4s ease; filter: drop-shadow(0 0 6px var(--accent-soft)); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring-label { font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.ring-time { font-size: clamp(3rem, 15vw, 4.6rem); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--ink); }
.ring-round { font-size: .82rem; color: var(--ink-faint); font-weight: 600; margin-top: 4px; }
body.is-running .ring-label { animation: softpulse 2.6s ease-in-out infinite; }
@keyframes softpulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* 세션 도트 */
.session-dots { display: flex; justify-content: center; gap: 9px; margin: 22px 0 4px; min-height: 14px; }
.sdot { width: 11px; height: 11px; border-radius: 50%; background: var(--track); transition: .3s; }
.sdot.done { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 컨트롤 */
.controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.btn-primary { border: none; cursor: pointer; font-weight: 800; font-size: 1.05rem; letter-spacing: .01em; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); padding: 15px 44px; border-radius: 16px; box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; gap: 10px; transition: transform .12s ease, box-shadow .2s ease; min-width: 168px; justify-content: center; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 20px; height: 20px; }
.start-ic { display: inline-flex; }
.start-ic .ic-pause { display: none; }
body.is-running .start-ic .ic-play { display: none; }
body.is-running .start-ic .ic-pause { display: inline-flex; }
.btn-round { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-soft); width: 50px; height: 50px; border-radius: 14px;
  display: grid; place-items: center; cursor: pointer; transition: .18s; box-shadow: var(--shadow-sm); }
.btn-round:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.btn-round svg { width: 20px; height: 20px; }

/* 작업 라벨 바 */
.task-bar { margin-top: 26px; display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 4px 6px 4px 14px; box-shadow: var(--shadow-inset); }
.task-bar svg { width: 17px; height: 17px; color: var(--ink-faint); flex: none; }
.task-input { flex: 1; border: none; background: transparent; color: var(--ink); font-family: inherit; font-size: .95rem; font-weight: 600; padding: 10px 0; outline: none; }
.task-input::placeholder { color: var(--ink-faint); font-weight: 500; }
.today-count { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--accent); background: var(--surface); padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.today-count svg { width: 14px; height: 14px; color: var(--accent); }

/* 프리셋 칩 */
.presets-row { margin-top: 22px; }
.presets-label { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.preset-chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-soft); font-family: inherit; font-weight: 700; font-size: .82rem;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: .16s; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; gap: 1px; }
.preset-chip small { font-weight: 500; font-size: .68rem; color: var(--ink-faint); }
.preset-chip:hover, .preset-chip.active { color: var(--accent); border-color: var(--accent); }
.preset-chip.active small { color: var(--accent); }
.preset-more { margin-top: 12px; }
.preset-more a { font-size: .82rem; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.preset-more svg { width: 14px; height: 14px; }

/* 툴 하단 액션 (설정·소리) */
.tool-foot { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 24px; }
.tool-foot .ghost-btn { border: 1px solid var(--border); background: transparent; color: var(--ink-soft); font-family: inherit; font-weight: 600; font-size: .84rem;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: .16s; }
.tool-foot .ghost-btn:hover { color: var(--accent); border-color: var(--accent); }
.tool-foot .ghost-btn svg { width: 15px; height: 15px; }

/* ── 설정 모달 ── */
.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20,15,10,.5); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; padding: 26px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 1.15rem; font-weight: 800; display: inline-flex; align-items: center; gap: 9px; }
.modal-head h3 svg { width: 19px; height: 19px; color: var(--accent); }
.set-group { margin-bottom: 20px; }
.set-group h4 { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row label { font-size: .92rem; font-weight: 600; color: var(--ink); }
.set-row .hint { display: block; font-size: .76rem; font-weight: 500; color: var(--ink-faint); margin-top: 1px; }
.num-input { width: 78px; }
.set-input { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink); font-family: inherit; font-weight: 700; font-size: .95rem;
  padding: 9px 12px; border-radius: 10px; text-align: center; outline: none; }
.set-input:focus { border-color: var(--accent); }
/* 토글 스위치 */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--track); border-radius: 999px; cursor: pointer; transition: .2s; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--surface); border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions button { flex: 1; font-family: inherit; font-weight: 700; font-size: .9rem; padding: 12px; border-radius: 12px; cursor: pointer; transition: .16s; }
.btn-reset-set { border: 1px solid var(--border-strong); background: transparent; color: var(--ink-soft); }
.btn-reset-set:hover { color: var(--accent); border-color: var(--accent); }
.btn-done-set { border: none; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }

/* ── 콘텐츠 페이지 공통 ── */
.title-bar { max-width: var(--maxw); margin: 0 auto; padding: 18px 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crumb { font-size: .82rem; color: var(--ink-faint); font-weight: 600; }
.crumb a { color: var(--ink-soft); } .crumb a:hover { color: var(--accent); }
.title-bar__cat { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 11px; border-radius: 999px; }
.page-container { max-width: 760px; margin: 0 auto; padding: 20px; }
.page-header { text-align: center; margin: 12px 0 26px; }
.page-title { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; }
.page-sub { color: var(--ink-soft); margin-top: 10px; font-size: 1.02rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.calc-note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow-sm); }
.calc-note p { color: var(--ink-soft); } .calc-note b { color: var(--ink); }
.trust-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 20px 0; padding-top: 18px; border-top: 1px solid var(--border); }
.trust-item { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.trust-item svg { width: 16px; height: 16px; color: var(--accent); }

.info-block { margin-top: 30px; }
.block-title, .faq-title { font-size: 1.28rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 16px; }
.info-grid { display: grid; gap: 14px; }
.info-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.info-item h4 { font-size: 1rem; font-weight: 700; margin-bottom: 7px; }
.info-item .faq-q { position: relative; padding-left: 20px; }
.info-item .faq-q::before { content: "Q"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.info-item p { color: var(--ink-soft); font-size: .94rem; }

/* 허브 카드 그리드 */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.hub-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .2s ease; display: flex; flex-direction: column; }
.hub-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.hc-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin-bottom: 14px; }
.hc-icon svg { width: 21px; height: 21px; }
.hub-card h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.hub-card p { color: var(--ink-soft); font-size: .9rem; margin-top: 7px; flex: 1; }
.hc-meta { display: inline-flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hc-tag { font-size: .72rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; }
.hc-go { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; font-size: .84rem; font-weight: 700; color: var(--accent); }
.hc-go svg { width: 15px; height: 15px; }

/* 프리셋 상세 통계 타일 */
.preset-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 22px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 12px; text-align: center; box-shadow: var(--shadow-sm); }
.st-k { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.st-v { font-size: 1.6rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; margin-top: 4px; }
.st-u { font-size: .7rem; color: var(--ink-faint); font-weight: 600; }

/* 아티클 */
.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow-sm); }
.article p { color: var(--ink-soft); margin: 0 0 15px; }
.article h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; margin: 26px 0 12px; }
.article h3 { font-size: 1.05rem; font-weight: 700; margin: 20px 0 10px; }
.article ul, .article ol { margin: 0 0 15px; padding-left: 22px; color: var(--ink-soft); }
.article li { margin-bottom: 7px; }
.article b { color: var(--ink); }
.article table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: .9rem; }
.article th, .article td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.article th { font-weight: 700; color: var(--ink); background: var(--surface-2); }
.article td { color: var(--ink-soft); }
.article blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 0 0 15px; color: var(--ink-soft); font-style: italic; }

.sect-label { display: flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin: 30px 0 16px; }
.sect-label svg { width: 16px; height: 16px; color: var(--accent); }
.sect-label .line { flex: 1; height: 1px; background: var(--border); }

.cta { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 13px 26px; border-radius: 14px; box-shadow: var(--shadow-sm); transition: transform .12s ease; }
.cta:hover { transform: translateY(-2px); }
.cta svg { width: 18px; height: 18px; }
.mini-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-soft);
  font-family: inherit; font-weight: 700; font-size: .86rem; padding: 10px 16px; border-radius: 12px; cursor: pointer; transition: .16s; }
.mini-btn:hover { color: var(--accent); border-color: var(--accent); }
.mini-btn svg { width: 15px; height: 15px; }

/* ── 광고 (룰 §4-2 · 래퍼 border-radius/overflow 금지) ── */
.ad-grid { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 672px; margin: 30px auto 0; }
.ad-grid[data-ad-layout="mixed"] { max-width: 760px; }
.ad-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.ad-cell { min-height: 50px; }

/* ── 푸터 ── */
.site-footer { border-top: 1px solid var(--border); margin-top: 50px; background: color-mix(in srgb, var(--bg) 70%, var(--surface)); }
.footer-cols { max-width: var(--maxw); margin: 0 auto; padding: 36px 20px 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; }
.footer-col h5 { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--ink-soft); font-size: .9rem; font-weight: 500; padding: 4px 0; transition: .14s; }
.footer-col a:hover { color: var(--accent); }
.footer-base { max-width: var(--maxw); margin: 0 auto; padding: 16px 20px 30px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.footer-copy { font-size: .82rem; color: var(--ink-faint); }
.footer-proj { font-size: .72rem; font-weight: 700; letter-spacing: .1em; color: var(--ink-faint); font-family: 'JetBrains Mono', monospace; }

/* ── 토스트 ── */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg);
  padding: 12px 22px; border-radius: 12px; font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 애니메이션 ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.animate-fade-in { animation: fadeIn .5s ease both; }
.animate-slide-up { animation: fadeIn .55s ease both; }
@media (prefers-reduced-motion: reduce) { *, .ring-progress { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ── 반응형 ── */
@media (max-width: 720px) {
  .site-header__nav > a:not(.always) { display: none; }
  .site-header__inner { padding: 10px 16px; }
  .timer-card { padding: 26px 18px 24px; border-radius: 24px; }
  .preset-stats { grid-template-columns: repeat(2, 1fr); }
  .btn-primary { min-width: 150px; padding: 14px 34px; }
  .footer-base { justify-content: center; }
}
@media (max-width: 420px) {
  .controls { gap: 10px; }
  .btn-round { width: 46px; height: 46px; }
}

/* RTL */
[dir="rtl"] .ring-svg { transform: rotate(-90deg) scaleX(-1); }
[dir="rtl"] .info-item .faq-q { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .info-item .faq-q::before { left: auto; right: 0; }
