/* ===== База ===== */
:root {
  --cream: #fbf3e7;
  --card: #fffdf8;
  --ink: #2e2823;
  --ink-soft: #6f645a;
  --muted: #9a8d80;
  --line: #ecdfcb;
  --line-soft: #f4ebdd;

  --amber: #e08a2e;
  --amber-light: #f0b25a;
  --amber-deep: #c26f14;
  --green: #5f9e6b;

  --water: #bfe0dd;

  --radius: 30px;
  --shadow-card: 0 40px 80px -50px rgba(90, 60, 20, .45), 0 18px 40px -30px rgba(90, 60, 20, .25);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  padding: 0 20px 40px;
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 12% -5%, #fff7e9 0%, rgba(255, 247, 233, 0) 60%),
    radial-gradient(800px 480px at 92% 0%, #fce8cd 0%, rgba(252, 232, 205, 0) 55%),
    radial-gradient(700px 600px at 50% 110%, #f6e7d2 0%, rgba(246, 231, 210, 0) 60%),
    linear-gradient(165deg, #fdf8ef 0%, #f8eddd 55%, #f4e6d2 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

button, input { font: inherit; color: inherit; }

/* ===== Шапка ===== */
.top {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 8px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand em { color: var(--amber); font-style: normal; }

.brand__egg {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 19px;
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 8px 18px -12px rgba(150, 100, 40, .9), inset 0 0 0 1px #fff;
}

.top__note {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}

/* ===== Карточка ===== */
.app {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 34px 40px 38px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 26px 46px;
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(255, 255, 255, .9);
  position: relative;
  overflow: hidden;
}

.card::after {
  /* мягкий блик в углу */
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  top: -190px;
  right: -150px;
  background: radial-gradient(circle, rgba(240, 178, 90, .16), transparent 65%);
  pointer-events: none;
}

.card__head {
  grid-column: 1 / -1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: -10px;
}

.card__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.title {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.03em;
  text-align: center;
}

.subtitle {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  max-width: 420px;
}

/* ===== Циферблат ===== */
.dial {
  position: relative;
  width: 322px;
  height: 322px;
  flex: none;
  margin: 2px 0 2px;
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.ring__track {
  fill: none;
  stroke: #f3e7d5;
  stroke-width: 12;
}

.ring__progress {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 917.35;
  stroke-dashoffset: 917.35;
  filter: drop-shadow(0 8px 14px rgba(224, 138, 46, .35));
  transition: stroke-dashoffset .18s linear;
  will-change: stroke-dashoffset;
}

.dial.is-running .ring__progress {
  transition: stroke-dashoffset .1s linear;
}

.dial.is-done .ring__progress {
  stroke: url(#doneGrad);
  filter: drop-shadow(0 8px 14px rgba(95, 158, 107, .35));
}

.dial__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 4px;
}

.dial__time {
  font-size: clamp(34px, 4.4vw, 46px);
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--ink);
  margin-top: 2px;
}

.dial__status {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .25s;
}

.dial.is-running .dial__status { color: var(--amber-deep); }
.dial.is-paused .dial__status { color: var(--ink-soft); }
.dial.is-done .dial__status { color: var(--green); }

/* ===== Кастрюля ===== */
.pot {
  position: relative;
  width: 144px;
  height: 102px;
  flex: none;
}

.pot__steam {
  position: absolute;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  width: 64px;
  height: 40px;
  opacity: 0;
  transition: opacity .5s var(--ease);
  pointer-events: none;
}

.pot__steam span {
  position: absolute;
  bottom: 0;
  width: 9px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(210, 190, 165, 0), rgba(210, 190, 165, .55));
  filter: blur(4px);
  animation: steam 2.8s ease-in-out infinite;
}

.pot__steam span:nth-child(1) { left: 2px; animation-delay: 0s; }
.pot__steam span:nth-child(2) { left: 27px; animation-delay: .9s; height: 30px; }
.pot__steam span:nth-child(3) { left: 52px; animation-delay: 1.7s; }

@keyframes steam {
  0%   { transform: translateY(6px) scaleX(.8); opacity: 0; }
  30%  { opacity: .8; }
  100% { transform: translateY(-22px) scaleX(1.25); opacity: 0; }
}

.pot__handle {
  position: absolute;
  top: 20px;
  width: 16px;
  height: 15px;
  border: 3px solid #e3d2b9;
  background: linear-gradient(180deg, #fdf7ec, #f1e3cf);
  z-index: 0;
}

.pot__handle--l { left: 0; border-right: 0; border-radius: 8px 0 0 8px; }
.pot__handle--r { right: 0; border-left: 0; border-radius: 0 8px 8px 0; }

.pot__body {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 0;
  height: 84px;
  background: linear-gradient(180deg, #fffdfa, #f2e5d2);
  border: 3px solid #e8d9c3;
  border-radius: 9px 9px 26px 26px;
  overflow: hidden;
  box-shadow:
    inset 0 -8px 16px rgba(150, 110, 60, .1),
    inset 0 2px 0 rgba(255, 255, 255, .9),
    0 12px 22px -16px rgba(120, 80, 30, .8);
  z-index: 1;
}

.pot__body::after {
  /* блик на ободе */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
  z-index: 3;
  pointer-events: none;
}

.pot__water {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  height: 70%;
  background: linear-gradient(180deg, #d9f0ed, #a9d8d5);
  opacity: .9;
  border-radius: 50% 50% 0 0 / 14px 14px 0 0;
  overflow: hidden;
  z-index: 1;
}

.pot__bubbles { position: absolute; inset: 0; }

.pot__bubbles i {
  position: absolute;
  bottom: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 4px rgba(255, 255, 255, .7);
  opacity: 0;
}

.pot__bubbles i:nth-child(1) { left: 12%; animation-delay: 0s; }
.pot__bubbles i:nth-child(2) { left: 30%; animation-delay: .7s; width: 4px; height: 4px; }
.pot__bubbles i:nth-child(3) { left: 48%; animation-delay: 1.4s; }
.pot__bubbles i:nth-child(4) { left: 66%; animation-delay: .35s; width: 7px; height: 7px; }
.pot__bubbles i:nth-child(5) { left: 82%; animation-delay: 1.05s; width: 4px; height: 4px; }
.pot__bubbles i:nth-child(6) { left: 90%; animation-delay: 1.75s; }

.is-boiling .pot__bubbles i {
  animation: rise 2.2s linear infinite;
}

.is-boiling .pot__steam { opacity: 1; }

@keyframes rise {
  0%   { transform: translateY(0) scale(.55); opacity: 0; }
  15%  { opacity: .95; }
  85%  { opacity: .7; }
  100% { transform: translateY(-44px) scale(1.15); opacity: 0; }
}

.pot__egg {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 38px;
  height: 50px;
  margin-left: -19px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 34% 26%, #fffefb 0%, #f8eddc 45%, #ead8bd 100%);
  box-shadow:
    inset -5px -7px 10px rgba(190, 158, 115, .35),
    inset 2px 2px 0 rgba(255, 255, 255, .8),
    0 5px 10px rgba(70, 120, 120, .3);
  z-index: 2;
  animation: bob 3.4s ease-in-out infinite;
  transform-origin: 50% 90%;
}

.pot__egg span {
  position: absolute;
  top: 9px;
  left: 10px;
  width: 9px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  filter: blur(1px);
  transform: rotate(-18deg);
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-4px) rotate(3deg); }
}

.dial.is-done .pot__egg { animation: none; }
.dial.is-done .pot__egg { transform: translateY(-2px) scale(1.02); }

/* ===== Кнопки ===== */
.actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 322px;
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  padding: 15px 22px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s, color .18s;
  -webkit-tap-highlight-color: transparent;
}

.btn:focus-visible {
  outline: 3px solid rgba(224, 138, 46, .45);
  outline-offset: 3px;
}

.btn--primary {
  flex: 1;
  color: #fff;
  background: linear-gradient(180deg, #f2a447, #e08a2e 55%, #d47f23);
  box-shadow:
    0 16px 26px -14px rgba(200, 116, 20, .95),
    inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -2px 0 rgba(140, 70, 0, .18);
}

.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 20px 30px -14px rgba(200, 116, 20, .95), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn--primary:active { transform: translateY(0) scale(.99); }

.btn--primary.is-pause {
  background: linear-gradient(180deg, #8f8578, #756b5f);
  box-shadow: 0 16px 26px -14px rgba(90, 75, 55, .8), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.btn--ghost {
  background: #f7eee0;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px rgba(230, 214, 190, .9);
}

.btn--ghost:hover { background: #f3e7d5; color: var(--ink); }

/* ===== Панель управления ===== */
.card__controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 4px;
  position: relative;
  z-index: 1;
  transition: opacity .25s;
}

.card__controls.is-locked { opacity: .72; }

.field { display: flex; flex-direction: column; gap: 10px; }

.field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.field__value {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--amber-deep);
  text-align: right;
}

/* пресеты */
.presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.preset {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  padding: 11px 13px 12px;
  border-radius: 15px;
  background: #fffdf9;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s, background .18s, transform .18s var(--ease), box-shadow .18s;
}

.preset:hover { border-color: #e2c9a5; transform: translateY(-1px); }

.preset strong {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}

.preset span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.preset.is-active {
  border-color: var(--amber);
  background: linear-gradient(180deg, #fff6e8, #fdefdc);
  box-shadow: 0 10px 18px -14px rgba(200, 120, 20, .9), inset 0 0 0 1px rgba(224, 138, 46, .35);
}

.preset.is-active span { color: var(--amber-deep); }

.preset:disabled { cursor: default; }

/* сегменты */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 15px;
  background: #f7ede0;
  align-self: flex-start;
  max-width: 100%;
}

.seg button {
  border: 0;
  cursor: pointer;
  background: transparent;
  border-radius: 11px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background .18s, color .18s, box-shadow .18s;
  white-space: nowrap;
}

.seg button:hover { color: var(--ink); }

.seg button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 8px -3px rgba(130, 90, 40, .35), inset 0 0 0 1px rgba(255, 255, 255, .9);
}

.seg button:disabled { cursor: default; }

/* ползунок */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-light) var(--fill, 30%), #f1e4d2 var(--fill, 30%), #f1e4d2 100%);
  outline: none;
  cursor: pointer;
  margin: 4px 0 2px;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--amber);
  box-shadow: 0 4px 10px -3px rgba(160, 100, 25, .6);
  transition: transform .15s var(--ease);
}

.range::-webkit-slider-thumb:hover { transform: scale(1.08); }

.range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--amber);
  box-shadow: 0 4px 10px -3px rgba(160, 100, 25, .6);
}

.range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #f1e4d2;
}

.range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--amber-light));
}

.range:disabled { cursor: default; opacity: .6; }

/* примечания */
.note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: -6px;
}

.tip-inline {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fdf4e6;
  border: 1px dashed #ecd9bb;
  font-size: 12.5px;
  line-height: 1.45;
  color: #8a6f4d;
  font-weight: 600;
}

/* ===== Шаги ===== */
.steps, .tips {
  background: rgba(255, 253, 248, .66);
  border-radius: 24px;
  padding: 26px 30px 30px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8);
  backdrop-filter: blur(6px);
}

.steps__title, .tips__title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 18px;
}

.steps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.steps__list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.steps__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #fff;
  color: var(--amber-deep);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 12px -8px rgba(150, 100, 40, .9), inset 0 0 0 1px #f4e6d2;
}

.steps__list h3 {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 4px;
  line-height: 1.35;
}

.steps__list p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* ===== Советы ===== */
.tips__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tip {
  background: #fffdf9;
  border-radius: 18px;
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(240, 228, 210, .9);
}

.tip__icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: #fdf3e3;
  font-size: 19px;
  margin-bottom: 12px;
}

.tip h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 6px;
}

.tip p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ===== Подвал ===== */
.footer {
  max-width: 1040px;
  margin: 30px auto 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #b3a494;
}

/* ===== Адаптив ===== */
@media (max-width: 900px) {
  .card {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 30px 24px 32px;
  }

  .card__head { margin-bottom: 0; }

  .card__controls { padding-top: 0; }

  .steps__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tips__grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { padding: 0 12px 30px; }

  .top { padding: 18px 6px; }
  .top__note { display: none; }

  .card { padding: 24px 16px 26px; border-radius: 24px; }

  .title { font-size: 21px; }

  .dial { width: 286px; height: 286px; }
  .pot { transform: scale(.92); }
  .dial__time { font-size: 36px; }

  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .seg { width: 100%; }
  .seg button { flex: 1; padding: 9px 8px; font-size: 12px; }

  .steps, .tips { padding: 20px 18px 22px; border-radius: 20px; }
  .steps__list { grid-template-columns: 1fr; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
