:root {
  --bg-a: #f2f7f2;
  --bg-b: #f8f1e1;
  --bg-c: #e6f2ee;
  --ink: #17242a;
  --muted: #41585f;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-border: rgba(23, 36, 42, 0.08);
  --focus: #1f7a7b;
  --focus-deep: #0f4f53;
  --focus-soft: rgba(31, 122, 123, 0.14);
  --accent: #d5852f;
  --accent-soft: #f0be80;
  --danger: #8f3b3b;
  --break-soft: rgba(213, 133, 47, 0.16);
  --control-bg: rgba(255, 255, 255, 0.85);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Sora", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(70rem 40rem at 8% 6%, rgba(16, 122, 125, 0.12), transparent 55%),
    radial-gradient(48rem 30rem at 90% 84%, rgba(213, 133, 47, 0.14), transparent 60%),
    linear-gradient(145deg, var(--bg-a), var(--bg-b) 54%, var(--bg-c));
  overflow-x: hidden;
}

.ambient-shape {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.65;
}

.ambient-shape-a {
  width: 38vw;
  height: 38vw;
  max-width: 18rem;
  max-height: 18rem;
  left: -5rem;
  top: -5rem;
  background: linear-gradient(135deg, rgba(31, 122, 123, 0.34), rgba(31, 122, 123, 0.05));
  animation: driftA 14s ease-in-out infinite;
}

.ambient-shape-b {
  width: 44vw;
  height: 44vw;
  max-width: 22rem;
  max-height: 22rem;
  right: -7rem;
  bottom: -7rem;
  background: linear-gradient(135deg, rgba(213, 133, 47, 0.3), rgba(240, 190, 128, 0.06));
  animation: driftB 18s ease-in-out infinite;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(64rem, 100%);
  margin: 0 auto;
  padding: 1rem 0.9rem 2rem;
  display: grid;
  gap: 0.9rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 30px rgba(14, 32, 39, 0.08);
  animation: panelIn 500ms ease both;
}

.hero,
.controls,
.timer,
.actions,
.profile {
  padding: 1rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--focus-deep);
}

h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  line-height: 1.08;
}

.hero-subtitle {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.controls {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.field-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--focus-deep);
  font-weight: 600;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(23, 36, 42, 0.12);
  border-radius: 0.75rem;
  padding: 0.78rem 0.85rem;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--control-bg);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder {
  color: rgba(65, 88, 95, 0.62);
}

input:focus,
select:focus {
  border-color: rgba(31, 122, 123, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 122, 123, 0.16);
}

.timer {
  text-align: center;
  padding: 1.2rem 1rem 1.3rem;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.7rem 0 0;
}

.cycle-label,
.rhythm-label {
  margin: 0;
  border: 1px solid rgba(23, 36, 42, 0.08);
  border-radius: 999px;
  padding: 0.34rem 0.68rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.62);
}

.cycle-label {
  color: var(--focus-deep);
}

.rhythm-label {
  color: #7a4b14;
  background: rgba(240, 190, 128, 0.18);
}

.cycle-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.85rem 0 0;
}

.cycle-dot {
  width: 2.7rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(23, 36, 42, 0.1);
  transition: transform 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

.cycle-dot.is-complete {
  background: linear-gradient(130deg, var(--focus) 10%, #47a2a5 92%);
}

.cycle-dot.is-active {
  background: linear-gradient(130deg, var(--accent) 10%, var(--accent-soft) 92%);
  transform: scaleY(1.15);
}

.phase-label {
  margin: 0;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--focus-deep);
  font-weight: 600;
}

.timer-display {
  margin: 0.3rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.8rem, 19vw, 5.2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
}

.status-text {
  margin: 0.75rem auto 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.coach-prompt {
  margin: 0.85rem auto 0;
  max-width: 30rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.5)),
    linear-gradient(135deg, rgba(31, 122, 123, 0.07), rgba(213, 133, 47, 0.07));
  border: 1px solid rgba(23, 36, 42, 0.08);
  color: #223c42;
  font-size: 0.9rem;
  line-height: 1.45;
}

.intention-preview {
  margin: 0.65rem 0 0;
  font-size: 0.86rem;
  color: #234147;
  line-height: 1.35;
  word-break: break-word;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: inherit;
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease, background-color 170ms ease, color 170ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.btn-primary {
  color: #f6fbfb;
  background: linear-gradient(130deg, var(--focus) 6%, #2f9799 62%, #3b8082);
  box-shadow: 0 8px 18px rgba(15, 79, 83, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 10px 22px rgba(15, 79, 83, 0.34);
}

.btn-ghost {
  color: #29474d;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(23, 36, 42, 0.14);
}

.btn-small {
  margin-top: 0.8rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.78rem;
}

.profile-title {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--focus-deep);
  font-weight: 600;
}

.profile-hz {
  margin: 0.5rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.2;
}

.profile-description {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.mixer {
  padding: 0.95rem 1rem 1rem;
}

.mixer details {
  display: grid;
  gap: 0.95rem;
}

.mixer summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--focus-deep);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mixer summary::-webkit-details-marker {
  display: none;
}

.mixer summary::after {
  content: " +";
  font-weight: 500;
}

.mixer details[open] summary::after {
  content: " -";
}

.mixer-grid {
  display: grid;
  gap: 0.78rem;
}

.slider-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
}

.slider-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--focus-deep);
  min-width: 6.8rem;
}

.slider-field input[type="range"] {
  padding: 0;
  margin: 0;
  accent-color: var(--focus);
  width: 100%;
  height: 0.9rem;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.slider-field input[type="range"]:focus {
  box-shadow: none;
}

.slider-value {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 2.6rem;
  text-align: right;
}

.advanced-note {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.05em;
  opacity: 0.78;
}

body[data-phase="focus"] .timer {
  box-shadow: 0 20px 32px rgba(18, 99, 102, 0.24);
}

body[data-phase="focus"] .coach-prompt {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.48)),
    linear-gradient(135deg, rgba(31, 122, 123, 0.12), rgba(31, 122, 123, 0.03));
}

body[data-phase="focus_done"] .timer {
  box-shadow: 0 20px 32px rgba(145, 59, 59, 0.25);
}

body[data-phase="focus_done"] .rhythm-label {
  background: rgba(240, 190, 128, 0.24);
}

body[data-phase="break"] .timer {
  box-shadow: 0 20px 32px rgba(213, 133, 47, 0.24);
}

body[data-phase="break"] .coach-prompt,
body[data-phase="break_done"] .coach-prompt {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.48)),
    linear-gradient(135deg, rgba(240, 190, 128, 0.16), rgba(213, 133, 47, 0.05));
}

body[data-phase="break_done"] .timer {
  box-shadow: 0 20px 32px rgba(47, 127, 95, 0.21);
}

@media (min-width: 46rem) {
  .app-shell {
    padding: 1.5rem 1.4rem 2.4rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
  }

  .hero {
    grid-column: 1 / -1;
    padding: 1.25rem 1.3rem;
  }

  .controls {
    grid-column: 1 / 8;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 0.85rem;
    padding: 1.05rem 1rem;
  }

  .timer {
    grid-column: 8 / -1;
    padding: 1.15rem 1rem 1.3rem;
  }

  .actions {
    grid-column: 1 / 8;
    justify-content: flex-start;
    align-items: center;
  }

  .profile {
    grid-column: 8 / -1;
  }

  .mixer {
    grid-column: 1 / -1;
  }

  .app-footer {
    grid-column: 1 / -1;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes driftA {
  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(0.7rem, 1rem);
  }
}

@keyframes driftB {
  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(-1rem, -0.6rem);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-a: #0f191e;
    --bg-b: #182126;
    --bg-c: #0f1d1c;
    --ink: #dce8ec;
    --muted: #9eb2b8;
    --panel: rgba(14, 24, 29, 0.74);
    --panel-border: rgba(210, 232, 238, 0.12);
    --focus: #5ab5b7;
    --focus-deep: #95d8d9;
    --focus-soft: rgba(90, 181, 183, 0.18);
    --accent: #ecac63;
    --accent-soft: #ebc091;
    --danger: #dc8a8a;
    --break-soft: rgba(236, 172, 99, 0.18);
    --control-bg: rgba(12, 21, 25, 0.82);
  }

  body {
    background:
      radial-gradient(70rem 40rem at 8% 6%, rgba(58, 170, 173, 0.22), transparent 55%),
      radial-gradient(48rem 30rem at 90% 84%, rgba(227, 146, 68, 0.2), transparent 60%),
      linear-gradient(145deg, var(--bg-a), var(--bg-b) 54%, var(--bg-c));
  }

  input,
  select {
    border-color: rgba(214, 235, 240, 0.18);
  }

  .btn-ghost {
    color: #d2e3e7;
    background: rgba(16, 28, 34, 0.72);
    border-color: rgba(205, 231, 237, 0.2);
  }

  .cycle-label,
  .rhythm-label {
    border-color: rgba(214, 235, 240, 0.12);
    background: rgba(13, 24, 29, 0.72);
  }

  .rhythm-label {
    color: #f0c891;
    background: rgba(70, 45, 18, 0.42);
  }

  .coach-prompt {
    color: #d3e3e7;
    background:
      linear-gradient(135deg, rgba(13, 24, 29, 0.92), rgba(13, 24, 29, 0.72)),
      linear-gradient(135deg, rgba(90, 181, 183, 0.12), rgba(236, 172, 99, 0.07));
    border-color: rgba(210, 232, 238, 0.1);
  }

  .intention-preview {
    color: #bfd8df;
  }

  .panel {
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.34);
  }
}
