/* 전역 색상, 글꼴과 타이머 진행 링의 기본 치수를 정의합니다. */
:root {
  font-family: "DM Sans", "Noto Sans KR", sans-serif;
  color: #282c29;
  background: #f5f4ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --green: #617b60;
  --green-dark: #4e694d;
  --muted: #92968e;
  --ring-circumference: 804.25;
}

/* 요소 크기 계산과 페이지 바탕 스타일을 통일합니다. */
* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 8%, rgba(226, 229, 215, .5), transparent 34rem),
    #f5f4ef;
}

/* 버튼과 링크가 페이지 글꼴을 사용하도록 맞춥니다. */
button, a { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

/* 콘텐츠를 화면 가운데에 배치하고 상단 여백을 설정합니다. */
.app-shell {
  width: min(100% - 48px, 1016px);
  margin: 0 auto;
  padding: 30px 0 22px;
}

/* 브랜드와 상단 안내 문구를 양쪽에 배치합니다. */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  margin-bottom: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #343a34;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.05em;
  text-decoration: none;
}

.brand-mark { color: var(--green); font-size: 24px; line-height: 1; }
.topbar-note { display: flex; align-items: center; gap: 8px; color: #969991; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a8b79b; }

/* 타이머 전체를 감싸는 카드와 장식 배경을 구성합니다. */
.timer-card {
  position: relative;
  overflow: hidden;
  min-height: 615px;
  padding: 40px 24px 32px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 28px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 22px 60px rgba(69, 74, 60, .07), 0 2px 7px rgba(69, 74, 60, .025);
  text-align: center;
}

.card-decoration { position: absolute; pointer-events: none; border-radius: 50%; }
.decoration-one {
  top: -158px;
  left: calc(50% - 220px);
  width: 440px;
  height: 280px;
  background: radial-gradient(ellipse, rgba(230, 235, 222, .6), transparent 70%);
}
.decoration-two {
  right: -145px;
  bottom: -195px;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(236, 228, 208, .28), transparent 68%);
}
/* 타이머 카드 안에서 제목과 조작 요소를 장식보다 위에 표시합니다. */
.timer-content { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; color: #303630; font-size: clamp(23px, 3.1vw, 29px); font-weight: 700; letter-spacing: -.065em; }
.subtitle { margin: 8px 0 23px; color: #969991; font-size: 13px; }

/* 집중·휴식 모드 버튼의 선택 상태를 표시합니다. */
.mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #efefe9;
  border-radius: 99px;
  background: #f7f7f3;
}
.mode-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 99px;
  padding: 9px 15px;
  color: #94978f;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: color .2s, background .2s, box-shadow .2s;
}
.mode-button.active { color: var(--green-dark); background: white; box-shadow: 0 2px 7px rgba(51, 62, 44, .08); }
.mode-icon { font-size: 13px; }
.mode-length { opacity: .68; font-size: 10px; }

/* 집중 시간을 입력하고 범위 안내나 오류를 표시합니다. */
.duration-setting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 15px auto 0;
}
.duration-setting label { color: #7e847a; font-size: 11px; font-weight: 600; }
.duration-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #767d72;
  font-size: 12px;
}
.duration-input-wrap input {
  width: 82px;
  height: 35px;
  padding: 0 9px;
  border: 1px solid #e7eae2;
  border-radius: 10px;
  color: #3c443a;
  background: #fbfcf9;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.duration-input-wrap input:focus-visible { outline: 3px solid rgba(97,123,96,.24); border-color: #aab9a1; }
.duration-input-wrap input:disabled { color: #a1a69d; background: #f3f4f0; }
.duration-input-wrap input[aria-invalid="true"] { border-color: #cf8b83; }
.duration-help, .duration-error { min-height: 14px; margin: 0; font-size: 10px; }
.duration-help { color: #a0a49c; }
.duration-error { color: #a24b42; }

/* 남은 시간을 원형 진행 링과 함께 중앙에 배치합니다. */
.timer-wrap {
  position: relative;
  display: grid;
  width: min(280px, 72vw);
  aspect-ratio: 1;
  margin: 16px auto 14px;
  place-items: center;
}
.progress-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 5; }
.progress-track { stroke: #eef0e9; }
.progress-value {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: var(--ring-circumference);
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .3s linear, stroke .25s;
}
.timer-face { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.timer-label { color: #a2a69d; font-size: 10px; font-weight: 700; letter-spacing: .19em; }
.time { color: #343a33; font-size: clamp(64px, 11vw, 82px); font-weight: 500; letter-spacing: -.075em; line-height: 1.03; font-variant-numeric: tabular-nums; }
.timer-caption { color: #989b93; font-size: 12px; }

/* 초기화, 시작·일시정지와 건너뛰기 버튼을 한 줄로 배치합니다. */
.controls { display: flex; justify-content: center; align-items: center; gap: 15px; }
.control-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  cursor: pointer;
  transition: transform .16s, background .2s, box-shadow .2s;
}
.control-button:hover { transform: translateY(-2px); }
.control-button:active { transform: translateY(0) scale(.97); }
.control-button:focus-visible, .mode-button:focus-visible { outline: 3px solid rgba(97,123,96,.35); outline-offset: 3px; }
.control-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.secondary { width: 43px; height: 43px; border: 1px solid #e9ebe4; border-radius: 50%; color: #81877d; background: #fff; }
.secondary:hover { background: #f7f8f4; }
.primary {
  gap: 9px;
  min-width: 148px;
  height: 48px;
  padding: 0 22px;
  border-radius: 99px;
  color: white;
  background: var(--green);
  box-shadow: 0 7px 15px rgba(83, 112, 80, .19);
  font-size: 13px;
  font-weight: 700;
}
.primary:hover { background: var(--green-dark); box-shadow: 0 9px 18px rgba(83, 112, 80, .23); }
.primary svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.pause-icon { display: none; }
.is-running .play-icon { display: none; }
.is-running .pause-icon { display: block; fill: none; stroke: currentColor; }
.completion-message { min-height: 17px; margin: 12px 0 0; color: var(--green-dark); font-size: 12px; }

/* 완료 세션 요약과 오늘의 한마디를 카드로 표시합니다. */
.bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.info-card {
  display: flex;
  min-height: 103px;
  align-items: center;
  gap: 13px;
  padding: 18px 21px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 19px;
  background: rgba(255,255,255,.7);
  box-shadow: 0 7px 20px rgba(69, 74, 60, .035);
}
.info-icon { display: grid; flex: 0 0 37px; width: 37px; height: 37px; place-items: center; border-radius: 12px; font-size: 17px; }
.session-icon { color: #71866a; background: #edf1e8; }
.tip-icon { color: #b48c53; background: #f7f0e3; }
.info-label { margin: 0 0 4px; color: #999d94; font-size: 10px; font-weight: 600; }
.info-value { margin: 0; color: #3a4038; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.info-unit { padding-left: 5px; color: #8f948a; font-size: 11px; font-weight: 500; }
.session-dots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-left: auto; max-width: 100px; }
.session-dot { width: 8px; height: 8px; border-radius: 50%; background: #e5e9df; }
.session-dot.completed { background: #81967b; }
.tip-text { margin: 0; color: #696f65; font-size: 11px; line-height: 1.7; }
.footer { padding-top: 18px; color: #a0a39b; text-align: center; font-size: 10px; }
.footer span { padding: 0 5px; color: #c7c9c1; }

/* 좁은 화면에서는 여백을 줄이고 요약 카드를 세로로 쌓습니다. */
@media (max-width: 600px) {
  .app-shell { width: min(100% - 28px, 430px); padding-top: 19px; }
  .topbar { margin-bottom: 16px; }
  .topbar-note { font-size: 0; gap: 0; }
  .timer-card { min-height: 0; padding: 31px 16px 20px; border-radius: 23px; }
  .subtitle { margin-bottom: 20px; font-size: 12px; }
  .timer-wrap { margin-top: 16px; margin-bottom: 16px; }
  .bottom-row { grid-template-columns: 1fr; gap: 9px; margin-top: 11px; }
  .info-card { min-height: 83px; padding: 14px 17px; }
  .tip-card { min-height: 78px; }
  .footer { padding-top: 14px; }
}

/* 사용자가 모션 감소를 요청한 경우 전환 효과를 최소화합니다. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
