:root {
  color-scheme: dark;
  --bg: #0d100f;
  --panel: rgba(25, 31, 28, 0.9);
  --panel-soft: #202722;
  --line: rgba(238, 243, 237, 0.1);
  --text: #f3f5f2;
  --muted: #9ca79f;
  --lime: #c9ff73;
  --lime-strong: #b9f55d;
  --coral: #ff735e;
  --coral-soft: rgba(255, 115, 94, 0.14);
  --radius-xl: 34px;
  --radius-lg: 22px;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(87, 116, 83, 0.2), transparent 34rem),
    linear-gradient(145deg, #111513 0%, var(--bg) 58%);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
}

.ambient-one {
  width: 24rem;
  height: 24rem;
  top: 16%;
  right: -10rem;
  background: var(--lime);
}

.ambient-two {
  width: 18rem;
  height: 18rem;
  bottom: 6%;
  left: -8rem;
  background: var(--coral);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
  padding: 64px 0 30px;
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
  max-width: 760px;
  margin: 0 auto 38px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 58px;
  height: 58px;
  margin-top: 6px;
  border: 1px solid rgba(201, 255, 115, 0.28);
  border-radius: 18px;
  background: rgba(201, 255, 115, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brand-mark span {
  width: 3px;
  border-radius: 4px;
  background: var(--lime);
}

.brand-mark span:nth-child(1),
.brand-mark span:nth-child(5) {
  height: 10px;
}

.brand-mark span:nth-child(2),
.brand-mark span:nth-child(4) {
  height: 22px;
}

.brand-mark span:nth-child(3) {
  height: 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--lime);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.65rem, 7vw, 5rem);
  font-weight: 720;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.hero-copy {
  max-width: 540px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.control-panel {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 230px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 26px;
  background:
    radial-gradient(circle, rgba(201, 255, 115, 0.08), transparent 62%),
    rgba(9, 12, 10, 0.56);
}

.timer {
  --progress: 0deg;
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 164px;
  height: 164px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #161b18 66%, transparent 67%),
    conic-gradient(var(--lime) var(--progress), rgba(255, 255, 255, 0.08) 0);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: background 180ms ease;
}

.timer::after {
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(201, 255, 115, 0.11);
  border-radius: inherit;
  content: "";
}

.timer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.timer-icon {
  color: var(--lime);
  font-size: 0.8rem;
}

.timer strong {
  font-variant-numeric: tabular-nums;
  font-size: 2.5rem;
  letter-spacing: -0.055em;
}

.timer-inner > span:last-child {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.wave {
  position: absolute;
  inset: auto 24px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.2vw, 8px);
  height: 42px;
  opacity: 0.28;
}

.wave span {
  width: 3px;
  height: 8px;
  border-radius: 10px;
  background: var(--lime);
  transform-origin: center;
}

.wave span:nth-child(3n + 1) {
  height: 18px;
}

.wave span:nth-child(4n + 2) {
  height: 28px;
}

.wave span:nth-child(5n) {
  height: 38px;
}

.stage.is-active .wave {
  opacity: 0.72;
}

.stage.is-active .wave span {
  animation: pulse-wave 900ms ease-in-out infinite alternate;
}

.stage.is-active .wave span:nth-child(2n) {
  animation-delay: -320ms;
}

.stage.is-active .wave span:nth-child(3n) {
  animation-delay: -620ms;
}

.stage.is-recording .timer {
  background:
    radial-gradient(circle at center, #1d1817 66%, transparent 67%),
    conic-gradient(var(--coral) var(--progress), rgba(255, 255, 255, 0.08) 0);
}

.stage.is-recording .timer::after {
  border-color: rgba(255, 115, 94, 0.24);
  animation: recording-ring 1.4s ease-out infinite;
}

.stage.is-recording .timer-icon,
.stage.is-recording .wave span {
  color: var(--coral);
  background: var(--coral);
}

@keyframes pulse-wave {
  from {
    transform: scaleY(0.35);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes recording-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.94);
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

.status-block {
  min-height: 68px;
  padding: 20px 4px 10px;
  text-align: center;
}

.status {
  margin: 0;
  font-weight: 650;
}

.status.is-error {
  color: #ff9a89;
}

.saved-meta {
  min-height: 20px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.record-actions {
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  gap: 12px;
}

.button {
  min-height: 56px;
  border: 0;
  border-radius: 17px;
  font-weight: 760;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:focus-visible,
.stepper-button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(201, 255, 115, 0.38);
  outline-offset: 3px;
}

.button:disabled,
.stepper-button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button-record {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text);
  background: var(--coral-soft);
  border: 1px solid rgba(255, 115, 94, 0.22);
}

.button-record.is-recording {
  color: #22100d;
  background: var(--coral);
}

.record-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 115, 94, 0.12);
}

.button-record.is-recording .record-dot {
  border-radius: 2px;
  background: #24120f;
  box-shadow: none;
}

.button-quiet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.divider {
  height: 1px;
  margin: 32px 0;
  background: var(--line);
}

.interval-section {
  display: grid;
  gap: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-heading .eyebrow {
  margin-bottom: 6px;
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
}

.interval-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--lime);
  background: rgba(201, 255, 115, 0.08);
  font-size: 0.82rem;
  font-weight: 760;
}

.stepper {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  gap: 10px;
}

.stepper-button {
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-size: 1.6rem;
  cursor: pointer;
}

.stepper-button:hover:not(:disabled) {
  border-color: rgba(201, 255, 115, 0.35);
  background: rgba(201, 255, 115, 0.07);
}

.interval-input-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 9px;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #121714;
}

.interval-input-wrap input {
  width: 5ch;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 1.55rem;
  font-weight: 760;
  text-align: right;
  appearance: textfield;
}

.interval-input-wrap input::-webkit-outer-spin-button,
.interval-input-wrap input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.interval-input-wrap span {
  color: var(--muted);
  font-size: 0.9rem;
}

.button-loop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 26px;
  color: #18200f;
  background: var(--lime);
  box-shadow: 0 12px 32px rgba(201, 255, 115, 0.1);
}

.button-loop:hover:not(:disabled) {
  background: var(--lime-strong);
}

.button-loop.is-running {
  color: var(--text);
  border: 1px solid rgba(255, 115, 94, 0.24);
  background: var(--coral-soft);
  box-shadow: none;
}

.loop-symbol {
  font-size: 1.35rem;
}

.button-loop.is-running .loop-symbol {
  animation: slow-spin 2s linear infinite;
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.privacy-note span {
  color: var(--lime);
}

footer {
  padding: 24px 16px 0;
  color: #78817b;
  font-size: 0.76rem;
  text-align: center;
}

.noscript-message {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 10;
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  color: #fff;
  background: #842f24;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 24px, 760px);
    padding-top: 34px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 28px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4.5rem);
  }

  .hero-copy {
    margin-top: 16px;
    font-size: 0.96rem;
  }

  .control-panel {
    padding: 18px;
    border-radius: 26px;
  }

  .stage {
    min-height: 220px;
    border-radius: 21px;
  }

  .record-actions {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: center;
  }

  .section-note {
    max-width: 220px;
  }
}

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